Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code style (endif endforeach endfor and more) #1035

Merged
merged 13 commits into from
Apr 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions app/code/core/Mage/Sales/Block/Order/Creditmemo/Totals.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,19 @@ protected function _initTotals()
<td colspan="6" class="a-right"><strong><?php echo $this->__('Total Paid') ?></strong></td>
<td class="last a-right"><strong><?php echo $_order->formatPrice($_creditmemo->getTotalPaid()) ?></strong></td>
</tr>
<?php endif; ?>
<?php endif ?>
<?php if ($this->getCanDisplayTotalRefunded()): ?>
<tr>
<td colspan="6" class="a-right"><strong><?php echo $this->__('Total Refunded') ?></strong></td>
<td class="last a-right"><strong><?php echo $_order->formatPrice($_creditmemo->getTotalRefunded()) ?></strong></td>
</tr>
<?php endif; ?>
<?php endif ?>
<?php if ($this->getCanDisplayTotalDue()): ?>
<tr>
<td colspan="6" class="a-right"><strong><?php echo $this->__('Total Due') ?></strong></td>
<td class="last a-right"><strong><?php echo $_order->formatPrice($_creditmemo->getTotalDue()) ?></strong></td>
</tr>
<?php endif; ?>
<?php endif ?>
*/
return $this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@
</p>
<?php else: ?>
<p><?php echo $this->helper('adminhtml')->__('Access denied.') ?></p>
<?php endif?>
<?php endif ?>
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@
<?php echo $myBlock->getJsObjectName() ?>.checkCheckboxes = myhandler;
<?php echo $myBlock->getJsObjectName() ?>.rows.each(function(row){roleUsersRowInit(<?php echo $myBlock->getJsObjectName() ?>, row)});
$('in_role_user_old').value = $('in_role_user').value;
<?php endif; ?>
<?php endif ?>
//-->
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<script type="text/javascript">
<?php if($this->getEverythingAllowed()): ?>
$('resources_container').hide();
<?php endif; ?>
<?php endif ?>
Ext.EventManager.onDocumentReady(function() {
var tree = new Ext.tree.TreePanel('resource-tree', {
animate:false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@
<?php echo $myBlock->getJsObjectName() ?>.initRowCallback = rolesRowInit;
<?php echo $myBlock->getJsObjectName() ?>.checkboxCheckCallback = registerUserRole;
<?php echo $myBlock->getJsObjectName() ?>.rows.each(function(row){rolesRowInit(<?php echo $myBlock->getJsObjectName() ?>, row)});
<?php endif; ?>
<?php endif ?>
//-->
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<?php echo $this->__("Edit User '%s'", $_userName) ?>
<?php else: ?>
<?php echo $this->__('Add New User') ?>
<?php endif; ?>
<?php endif ?>
</h3>
</td>
<td class="form-buttons">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@
}
?>
<input type="checkbox" value="<?php echo $role->getRoleId(); ?>" <?php echo ($checked ? "checked" : ""); ?> name="roles[]" id="_<?php echo $role->getRoleId(); ?>" /> <label for="_<?php echo $role->getRoleId(); ?>" class="normal"><?php echo $role->getRoleName(); ?></label><br />
<?php endforeach; ?>
<?php endforeach ?>
</fieldset>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<?php if ($this->hasEntityOnlyAttributes()): ?>
<div class="clear"></div>
<span>* This attribute data will be returned for a single resource only.</span>
<?php endif; ?>
<?php endif ?>
</span>

</fieldset>
Expand All @@ -66,7 +66,7 @@
//<![CDATA[
<?php if($this->getEverythingAllowed()): ?>
$('resources_container').hide();
<?php endif; ?>
<?php endif ?>
Ext.EventManager.onDocumentReady(function() {
var tree = new Ext.tree.TreePanel('resource-tree', {
animate:false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,6 @@
<?php echo $name ?>.checkCheckboxes = myhandler;
<?php echo $name ?>.rows.each(function(row){roleUsersRowInit(<?php echo $name ?>, row)});
$('in_role_users_old').value = $('in_role_users').value;
<?php endif; ?>
<?php endif ?>
//]]>
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ $_helper = $this->helper('authorizenet/admin');
//<![CDATA[
<?php if (isset($_params['redirect'])): ?>
window.location="<?php echo $this->escapeUrl($_params['redirect']) ?>";
<?php endif; ?>
<?php endif ?>
<?php if (isset($_params['redirect_parent'])): ?>
window.top.location="<?php echo $this->escapeUrl($_params['redirect_parent']) ?>";
<?php endif; ?>
<?php endif ?>
<?php if (isset($_params['error_msg'])): ?>
window.top.directPostModel.showError(<?php echo $this->helper('core')->jsonEncode($_params['error_msg']) ?>);
<?php if (isset($_params['x_invoice_num'])): ?>
window.top.directPostModel.successUrl="<?php echo $_helper->getSuccessOrderUrl($_params) ?>";
<?php endif; ?>
<?php endif; ?>
<?php endif ?>
<?php endif ?>
//]]>
</script>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ $_orderUrl = $this->helper('authorizenet')->getPlaceOrderAdminUrl();
<input type="text" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('payment')->__('Card Verification Number')) ?>" class="required-entry input-text validate-cc-cvn" id="<?php echo $_code ?>_cc_cid" name="payment[cc_cid]" style="width:3em;" value="<?php echo $this->getInfoData('cc_cid')?>" />
</div>
</li>
<?php endif; ?>
<?php endif ?>
</ul>
<script type="text/javascript">
//<![CDATA[
Expand Down Expand Up @@ -142,7 +142,7 @@ AdminOrder.prototype.getPaymentData = function(currentMethod) {
};
<?php if (!$this->isAjaxRequest()): ?>
document.observe('dom:loaded', function(){
<?php endif; ?>
<?php endif ?>
directPostModel = new directPost(
'<?php echo $_code ?>',
'directpost-iframe',
Expand All @@ -152,6 +152,6 @@ directPostModel = new directPost(
'<?php echo $this->getUrl('*/*/save', array('_secure' => $this->getRequest()->isSecure())) ?>');
<?php if (!$this->isAjaxRequest()): ?>
});
<?php endif; ?>
<?php endif ?>
//]]>
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
<?php foreach ($options as $option) : ?>
<?php if ($option->getSelections()) : ?>
<?php echo $this->getOptionHtml($option); ?>
<?php endif; ?>
<?php endforeach; ?>
<?php endif ?>
<?php endforeach ?>
</dl>
</div>
</div>
Expand Down Expand Up @@ -92,4 +92,4 @@ BundleControl.prototype = {
ProductConfigure.bundleControl = new BundleControl(<?php echo $this->getJsonConfig() ?>);
</script>

<?php endif; ?>
<?php endif ?>
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@
<?php if (count($_selections) == 1 && $_option->getRequired()): ?>
<?php echo $this->getSelectionQtyTitlePrice($_selections[0]) ?>
<input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>" price="<?php echo $this->getSelectionPrice($_selections[0]) ?>"'/>
<?php else:?>
<?php else: ?>
<ul class="options-list">
<?php foreach($_selections as $_selection): ?>
<li><input class="change-container-classname checkbox bundle-option-<?php echo $_option->getId() ?> <?php if ($_option->getRequired()) echo 'validate-one-required-by-name' ?>" id="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>" type="checkbox" name="bundle_option[<?php echo $_option->getId() ?>][]"<?php if ($this->_isSelected($_selection)) echo ' checked="checked"' ?><?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) echo ' disabled="disabled"' ?> value="<?php echo $_selection->getSelectionId() ?>" onclick="ProductConfigure.bundleControl.changeSelection(this)" price="<?php echo $this->getSelectionPrice($_selection) ?>"/>
<span class="label"><label for="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>"><?php echo $this->getSelectionQtyTitlePrice($_selection) ?></label></span>
<?php if($_option->getRequired()): ?>
<?php echo $this->setValidationContainer('bundle-option-'.$_option->getId().'-'.$_selection->getSelectionId(), 'bundle-option-'.$_option->getId().'-container') ?>
<?php endif; ?>
<?php endif ?>
</li>
<?php endforeach; ?>
<?php endforeach ?>
</ul>
<div id="bundle-option-<?php echo $_option->getId() ?>-container"></div>
<?php endif; ?>
<?php endif ?>
</div>
</dd>
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
<select multiple="multiple" size="5" id="bundle-option-<?php echo $_option->getId() ?>" name="bundle_option[<?php echo $_option->getId() ?>][]" class="bundle-option-<?php echo $_option->getId() ?><?php if ($_option->getRequired()) echo ' required-entry' ?> bundle-option-select multiselect change-container-classname" onchange="ProductConfigure.bundleControl.changeSelection(this)">
<?php if(!$_option->getRequired()): ?>
<option value=""><?php echo $this->__('None') ?></option>
<?php endif; ?>
<?php endif ?>
<?php foreach ($_selections as $_selection): ?>
<option value="<?php echo $_selection->getSelectionId() ?>"<?php if ($this->_isSelected($_selection)) echo ' selected="selected"' ?><?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) echo ' disabled="disabled"' ?> price="<?php echo $this->getSelectionPrice($_selection) ?>"><?php echo $this->getSelectionQtyTitlePrice($_selection, false) ?></option>
<?php endforeach; ?>
<?php endforeach ?>
</select>
<?php endif; ?>
<?php endif ?>
</div>
</dd>
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,23 @@
<?php if ($this->_showSingle()): ?>
<?php echo $this->getSelectionTitlePrice($_selections[0]) ?>
<input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>" price="<?php echo $this->getSelectionPrice($_selections[0]) ?>" />
<?php else:?>
<?php else: ?>
<ul class="options-list">
<?php if (!$_option->getRequired()): ?>
<li><input type="radio" class="radio" id="bundle-option-<?php echo $_option->getId() ?>" name="bundle_option[<?php echo $_option->getId() ?>]"<?php echo ($_default && $_default->isSalable())?'':' checked="checked" ' ?> value="" onclick="ProductConfigure.bundleControl.changeSelection(this)"/>
<span class="label"><label for="bundle-option-<?php echo $_option->getId() ?>"><?php echo $this->__('None') ?></label></span>
</li>
<?php endif; ?>
<?php endif ?>
<?php foreach ($_selections as $_selection): ?>
<li><input type="radio" class="radio<?php echo $_option->getRequired()?' validate-one-required-by-name':'' ?> change-container-classname" id="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>" name="bundle_option[<?php echo $_option->getId() ?>]"<?php if ($this->_isSelected($_selection)) echo ' checked="checked"' ?><?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) echo ' disabled="disabled"' ?>value="<?php echo $_selection->getSelectionId() ?>" onclick="ProductConfigure.bundleControl.changeSelection(this)" price="<?php echo $this->getSelectionPrice($_selection) ?>" qtyId="bundle-option-<?php echo $_option->getId() ?>-qty-input"/>
<span class="label"><label for="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>"><?php echo $this->getSelectionTitlePrice($_selection) ?></label></span>
<?php if ($_option->getRequired()): ?>
<?php echo $this->setValidationContainer('bundle-option-'.$_option->getId().'-'.$_selection->getSelectionId(), 'bundle-option-'.$_option->getId().'-container') ?>
<?php endif; ?>
<?php endif ?>
</li>
<?php endforeach; ?>
<?php endforeach ?>
</ul>
<div id="bundle-option-<?php echo $_option->getId() ?>-container"></div>
<?php endif; ?>
<?php endif ?>
</div>
</dd>
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
<?php if ($this->_showSingle()): ?>
<?php echo $this->getSelectionTitlePrice($_selections[0]) ?>
<input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>" price="<?php echo $this->getSelectionPrice($_selections[0]) ?>"/>
<?php else:?>
<?php else: ?>
<select id="bundle-option-<?php echo $_option->getId() ?>" name="bundle_option[<?php echo $_option->getId() ?>]" class="bundle-option-<?php echo $_option->getId() ?><?php if ($_option->getRequired()) echo ' required-entry' ?> bundle-option-select change-container-classname" onchange="ProductConfigure.bundleControl.changeSelection(this)">
<option value=""><?php echo $this->__('Choose a selection...') ?></option>
<?php foreach ($_selections as $_selection): ?>
<option value="<?php echo $_selection->getSelectionId() ?>"<?php if ($this->_isSelected($_selection)) echo ' selected="selected"' ?><?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) echo ' disabled="disabled"' ?> price="<?php echo $this->getSelectionPrice($_selection) ?>" qtyId="bundle-option-<?php echo $_option->getId() ?>-qty-input"><?php echo $this->getSelectionTitlePrice($_selection, false) ?></option>
<?php endforeach; ?>
<?php endforeach ?>
</select>
<?php endif; ?>
<?php endif ?>
</div>
</dd>
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ if(typeof Bundle=='undefined') {
<table cellspacing="0" class="form-list">
<tr>
<td class="label"><label for="shipment_type"><?php echo Mage::helper('bundle')->__('Ship Bundle Items') ?></label></td>
<td class="value"><select <?php if ($this->isReadonly()): ?>disabled="disabled" <?php endif;?>id="shipment_type" name="<?php echo $this->getFieldSuffix() ?>[shipment_type]" class="select">
<td class="value"><select <?php if ($this->isReadonly()): ?>disabled="disabled" <?php endif ?>id="shipment_type" name="<?php echo $this->getFieldSuffix() ?>[shipment_type]" class="select">
<option value="1"><?php echo Mage::helper('bundle')->__('Separately') ?></option>
<option value="0"<?php if ($this->getProduct()->getShipmentType() == 0): ?> selected="selected"<?php endif; ?>><?php echo Mage::helper('bundle')->__('Together') ?></option>
<option value="0"<?php if ($this->getProduct()->getShipmentType() == 0): ?> selected="selected"<?php endif ?>><?php echo Mage::helper('bundle')->__('Together') ?></option>
</select>
</td>
</tr>
Expand Down Expand Up @@ -70,7 +70,7 @@ $('product_bundle_container').select('input', 'select', 'textarea', 'button').ea
input.addClassName('disabled');
}
});
<?php endif; ?>
<?php endif ?>
Validation.add('validate-greater-zero-based-on-option', '<?php echo Mage::helper('core')->jsQuoteEscape($this->__('Please enter a number greater 0 in this field.')) ?>', function(v, el) {
var optionType = $(el).up('div.grid').previous('table.option-header').select('select.select-product-option-type')[0],
v = Number(v) || 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ optionTemplate = '<div id="<?php echo $this->getFieldId() ?>_{{index}}" class="
'<input class="input-text required-entry" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][title]" id="id_<?php echo $this->getFieldName() ?>_{{index}}_title" value="{{title}}">' +
<?php else: ?>
'<input class="input-text required-entry" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][default_title]" id="id_<?php echo $this->getFieldName() ?>_{{index}}_default_title" value="{{default_title}}">' +
<?php endif; ?>
<?php endif ?>
'<?php echo $this->jsQuoteEscape($this->getOptionDeleteButtonHtml()) ?>' +
'</div>' +
'<table class="option-header" cellpadding="0" cellspacing="0">' +
'<thead>' +
'<tr>' +
<?php if (!$this->isDefaultStore()): ?>
'<th class="opt-title"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Store View Title')) ?> <span class="required">*</span></th>' +
<?php endif; ?>
<?php endif ?>
'<th class="opt-type"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Input Type')) ?></th>' +
'<th class="opt-req"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Is Required')) ?></th>' +
'<th class="opt-order"><?php echo $this->jsQuoteEscape(Mage::helper('bundle')->__('Position')) ?></th>' +
Expand All @@ -53,7 +53,7 @@ optionTemplate = '<div id="<?php echo $this->getFieldId() ?>_{{index}}" class="
'<input type="hidden" name="<?php echo $this->getFieldName() ?>[{{index}}][delete]" value="" class="delete">' +
<?php if (!$this->isDefaultStore()): ?>
'<td><input class="input-text required-entry" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][title]" id="id_<?php echo $this->getFieldName() ?>_{{index}}_title_store" value="{{title}}"></td>' +
<?php endif; ?>
<?php endif ?>
'<td><?php echo $this->getTypeSelectHtml() ?></td>' +
'<td><?php echo $this->getRequireSelectHtml() ?></td>' +
'<td><input class="input-text validate-zero-or-greater" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][position]" value="{{position}}"></td>' +
Expand Down Expand Up @@ -217,9 +217,9 @@ bOption = new Bundle.Option(optionTemplate);
<?php $_selection->setName($this->escapeHtml($_selection->getName())); ?>
<?php $_selection->setSku($this->escapeHtml($_selection->getSku())); ?>
bSelection.addRow(optionIndex, <?php echo $_selection->toJson() ?>);
<?php endforeach; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php endforeach ?>
<?php endif ?>
<?php endforeach ?>
/**
* Adding event on price type select box of product to hide or show prices for selections
*/
Expand Down
Loading