// #PSFV-94 : replace back link with cancel button in the toolbar on all admin controllers
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9876 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -323,13 +323,3 @@
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
{block name="other_fieldsets"}{/block}
|
{block name="other_fieldsets"}{/block}
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<br /><br />
|
|
||||||
{if $firstCall && !$no_back}
|
|
||||||
{if $back}
|
|
||||||
<a href="{$back}"><img src="../img/admin/arrow2.gif" />{l s='Back'}</a>
|
|
||||||
{else}
|
|
||||||
<a href="{$current}&token={$token}"><img src="../img/admin/arrow2.gif" />{l s='Back to list'}</a>
|
|
||||||
{/if}
|
|
||||||
<br />
|
|
||||||
{/if}
|
|
||||||
|
|||||||
@@ -42,13 +42,3 @@
|
|||||||
if (isset($this->_includeTab) AND sizeof($this->_includeTab))
|
if (isset($this->_includeTab) AND sizeof($this->_includeTab))
|
||||||
echo '<br /><br />';
|
echo '<br /><br />';
|
||||||
*}
|
*}
|
||||||
|
|
||||||
{if !$no_back}
|
|
||||||
<br />
|
|
||||||
{if $back}
|
|
||||||
<a href="{$back}"><img src="../img/admin/arrow2.gif" />{l s='Back'}</a>
|
|
||||||
{else}
|
|
||||||
<a href="{$current}&token={$token}"><img src="../img/admin/arrow2.gif" />{l s='Back to list'}</a>
|
|
||||||
{/if}
|
|
||||||
<br />
|
|
||||||
{/if}
|
|
||||||
@@ -738,10 +738,25 @@ class AdminControllerCore extends Controller
|
|||||||
// @todo defining default buttons
|
// @todo defining default buttons
|
||||||
case 'add':
|
case 'add':
|
||||||
case 'edit':
|
case 'edit':
|
||||||
|
// Default save button - action dynamically handled in javascript
|
||||||
$this->toolbar_btn['save'] = array(
|
$this->toolbar_btn['save'] = array(
|
||||||
'href' => '#',
|
'href' => '#',
|
||||||
'desc' => $this->l('Save')
|
'desc' => $this->l('Save')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
case 'view':
|
||||||
|
// Default cancel button - like old back link
|
||||||
|
if (!isset($this->no_back) || $this->no_back == false)
|
||||||
|
{
|
||||||
|
$back = Tools::safeOutput(Tools::getValue('back', ''));
|
||||||
|
if (empty($back))
|
||||||
|
$back = self::$currentIndex.'&token='.$this->token;
|
||||||
|
|
||||||
|
$this->toolbar_btn['cancel'] = array(
|
||||||
|
'href' => $back,
|
||||||
|
'desc' => $this->l('Cancel')
|
||||||
|
);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'options':
|
case 'options':
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -50,12 +50,6 @@ class HelperFormCore extends Helper
|
|||||||
*/
|
*/
|
||||||
public $submit_action = '';
|
public $submit_action = '';
|
||||||
|
|
||||||
/**
|
|
||||||
* @var bool
|
|
||||||
* Usage : Set the value to true if you want to simply remove the back button
|
|
||||||
*/
|
|
||||||
public $no_back = false;
|
|
||||||
|
|
||||||
public $token;
|
public $token;
|
||||||
|
|
||||||
public $languages = null;
|
public $languages = null;
|
||||||
@@ -93,8 +87,6 @@ class HelperFormCore extends Helper
|
|||||||
'defaultFormLanguage' => $this->default_form_language,
|
'defaultFormLanguage' => $this->default_form_language,
|
||||||
'allowEmployeeFormLang' => $this->allow_employee_form_lang,
|
'allowEmployeeFormLang' => $this->allow_employee_form_lang,
|
||||||
'form_id' => $this->id,
|
'form_id' => $this->id,
|
||||||
'back' => Tools::getValue('back'),
|
|
||||||
'no_back' => $this->no_back,
|
|
||||||
'fields' => $this->fields_form,
|
'fields' => $this->fields_form,
|
||||||
'fields_value' => $this->fields_value,
|
'fields_value' => $this->fields_value,
|
||||||
'required_fields' => $this->getFieldsRequired(),
|
'required_fields' => $this->getFieldsRequired(),
|
||||||
|
|||||||
@@ -134,12 +134,6 @@ class HelperListCore extends Helper
|
|||||||
$this->footer_tpl = $this->context->smarty->createTemplate($this->footer_tpl);
|
$this->footer_tpl = $this->context->smarty->createTemplate($this->footer_tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @var bool
|
|
||||||
* Usage : Set the value to false if you want to simply display the back button
|
|
||||||
*/
|
|
||||||
public $no_back = true;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an html list given the data to fill it up
|
* Return an html list given the data to fill it up
|
||||||
*
|
*
|
||||||
@@ -599,8 +593,6 @@ class HelperListCore extends Helper
|
|||||||
'name' => isset($name) ? $name : null,
|
'name' => isset($name) ? $name : null,
|
||||||
'name_id' => isset($name_id) ? $name_id : null,
|
'name_id' => isset($name_id) ? $name_id : null,
|
||||||
'show_toolbar' => $this->show_toolbar,
|
'show_toolbar' => $this->show_toolbar,
|
||||||
'back' => Tools::getValue('back'),
|
|
||||||
'no_back' => $this->no_back
|
|
||||||
));
|
));
|
||||||
|
|
||||||
return $this->header_tpl->fetch();
|
return $this->header_tpl->fetch();
|
||||||
@@ -617,8 +609,6 @@ class HelperListCore extends Helper
|
|||||||
'current' => $this->currentIndex,
|
'current' => $this->currentIndex,
|
||||||
'simple_header' => $this->simple_header,
|
'simple_header' => $this->simple_header,
|
||||||
'bulk_actions' => $this->bulk_actions,
|
'bulk_actions' => $this->bulk_actions,
|
||||||
'back' => Tools::getValue('back'),
|
|
||||||
'no_back' => $this->no_back
|
|
||||||
));
|
));
|
||||||
return $this->footer_tpl->fetch();
|
return $this->footer_tpl->fetch();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user