// added toolbar in cart_rules form.tpl
This commit is contained in:
@@ -1,3 +1,19 @@
|
|||||||
|
{if $show_toolbar}
|
||||||
|
<div class="toolbar-placeholder">
|
||||||
|
<div class="toolbarBox {if $toolbar_fix}toolbarHead{/if}">
|
||||||
|
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn}
|
||||||
|
<div class="pageTitle">
|
||||||
|
<h3>
|
||||||
|
{block name=pageTitle}
|
||||||
|
<span id="current_obj" style="font-weight: normal;">{$title|default:' '}</span>
|
||||||
|
{/block}
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="leadin">{block name="leadin"}{/block}</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<div class="productTabs">
|
<div class="productTabs">
|
||||||
<ul class="tab">
|
<ul class="tab">
|
||||||
@@ -33,8 +49,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="separation"></div>
|
<div class="separation"></div>
|
||||||
<div style="text-align:center">
|
<div style="text-align:center">
|
||||||
<input type="submit" value="{l s='Save'}" class="button" name="submitAddcart_rule" />
|
<input type="submit" value="{l s='Save'}" class="button" name="submitAddcart_rule" id="{$table}_form_submit_btn" />
|
||||||
<input type="submit" value="{l s='Save and stay'}" class="button" name="submitAddcart_ruleAndStay" />
|
<!--<input type="submit" value="{l s='Save and stay'}" class="button" name="submitAddcart_ruleAndStay" id="" />-->
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|||||||
@@ -78,24 +78,24 @@
|
|||||||
|
|
||||||
//submit the form
|
//submit the form
|
||||||
{block name=formSubmit}
|
{block name=formSubmit}
|
||||||
btn_save.click(function() {
|
btn_save.click(function() {
|
||||||
//add hidden input to emulate submit button click when posting the form -> field name posted
|
|
||||||
btn_submit.before('<input type="hidden" name="'+btn_submit.attr("name")+'" value="1" />');
|
|
||||||
|
|
||||||
$('#{$table}_form').submit();
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (btn_save_and_stay)
|
|
||||||
{
|
|
||||||
btn_save_and_stay.click(function() {
|
|
||||||
//add hidden input to emulate submit button click when posting the form -> field name posted
|
//add hidden input to emulate submit button click when posting the form -> field name posted
|
||||||
btn_submit.before('<input type="hidden" name="'+btn_submit.attr("name")+'AndStay" value="1" />');
|
btn_submit.before('<input type="hidden" name="'+btn_submit.attr("name")+'" value="1" />');
|
||||||
|
|
||||||
$('#{$table}_form').submit();
|
$('#{$table}_form').submit();
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
if (btn_save_and_stay)
|
||||||
|
{
|
||||||
|
btn_save_and_stay.click(function() {
|
||||||
|
//add hidden input to emulate submit button click when posting the form -> field name posted
|
||||||
|
btn_submit.before('<input type="hidden" name="'+btn_submit.attr("name")+'AndStay" value="1" />');
|
||||||
|
|
||||||
|
$('#{$table}_form').submit();
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
{/block}
|
{/block}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -242,7 +242,8 @@ class CategoryCore extends ObjectModel
|
|||||||
$id_lang = _USER_ID_LANG_;
|
$id_lang = _USER_ID_LANG_;
|
||||||
|
|
||||||
$children = array();
|
$children = array();
|
||||||
if (($max_depth == 0 || $current_depth < $max_depth) && $subcats = $this->getSubCategories($id_lang, true) && count($subcats))
|
$subcats = $this->getSubCategories($id_lang, true);
|
||||||
|
if (($max_depth == 0 || $current_depth < $max_depth) && $subcats && count($subcats))
|
||||||
foreach ($subcats as &$subcat)
|
foreach ($subcats as &$subcat)
|
||||||
{
|
{
|
||||||
if (!$subcat['id_category'])
|
if (!$subcat['id_category'])
|
||||||
|
|||||||
@@ -274,9 +274,9 @@ class AdminCartRulesControllerCore extends AdminController
|
|||||||
if (empty($back))
|
if (empty($back))
|
||||||
$back = self::$currentIndex.'&token='.$this->token;
|
$back = self::$currentIndex.'&token='.$this->token;
|
||||||
|
|
||||||
$this->toolbar_btn['cancel'] = array(
|
$this->toolbar_btn['save-and-stay'] = array(
|
||||||
'href' => $back,
|
'href' => '#',
|
||||||
'desc' => $this->l('Cancel')
|
'desc' => $this->l('Save and Stay')
|
||||||
);
|
);
|
||||||
|
|
||||||
// Todo: change for "Media" version
|
// Todo: change for "Media" version
|
||||||
@@ -312,6 +312,7 @@ class AdminCartRulesControllerCore extends AdminController
|
|||||||
array(
|
array(
|
||||||
'show_toolbar' => true,
|
'show_toolbar' => true,
|
||||||
'toolbar_btn' => $this->toolbar_btn,
|
'toolbar_btn' => $this->toolbar_btn,
|
||||||
|
'toolbar_fix' => $this->toolbar_fix,
|
||||||
'title' => $this->l('Payment : Cart Rules '),
|
'title' => $this->l('Payment : Cart Rules '),
|
||||||
'languages' => Language::getLanguages(),
|
'languages' => Language::getLanguages(),
|
||||||
'defaultDateFrom' => date('Y-m-d H:00:00'),
|
'defaultDateFrom' => date('Y-m-d H:00:00'),
|
||||||
|
|||||||
Reference in New Issue
Block a user