// #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:
dSevere
2011-11-04 10:21:23 +00:00
parent 04cf1350fc
commit 64e62fa338
5 changed files with 17 additions and 40 deletions
+1 -11
View File
@@ -322,14 +322,4 @@
{/if}
</fieldset>
{block name="other_fieldsets"}{/block}
</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}
</form>
@@ -41,14 +41,4 @@
{*
if (isset($this->_includeTab) AND sizeof($this->_includeTab))
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}
*}
+15
View File
@@ -738,10 +738,25 @@ class AdminControllerCore extends Controller
// @todo defining default buttons
case 'add':
case 'edit':
// Default save button - action dynamically handled in javascript
$this->toolbar_btn['save'] = array(
'href' => '#',
'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;
case 'options':
break;
-8
View File
@@ -50,12 +50,6 @@ class HelperFormCore extends Helper
*/
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 $languages = null;
@@ -93,8 +87,6 @@ class HelperFormCore extends Helper
'defaultFormLanguage' => $this->default_form_language,
'allowEmployeeFormLang' => $this->allow_employee_form_lang,
'form_id' => $this->id,
'back' => Tools::getValue('back'),
'no_back' => $this->no_back,
'fields' => $this->fields_form,
'fields_value' => $this->fields_value,
'required_fields' => $this->getFieldsRequired(),
-10
View File
@@ -134,12 +134,6 @@ class HelperListCore extends Helper
$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
*
@@ -599,8 +593,6 @@ class HelperListCore extends Helper
'name' => isset($name) ? $name : null,
'name_id' => isset($name_id) ? $name_id : null,
'show_toolbar' => $this->show_toolbar,
'back' => Tools::getValue('back'),
'no_back' => $this->no_back
));
return $this->header_tpl->fetch();
@@ -617,8 +609,6 @@ class HelperListCore extends Helper
'current' => $this->currentIndex,
'simple_header' => $this->simple_header,
'bulk_actions' => $this->bulk_actions,
'back' => Tools::getValue('back'),
'no_back' => $this->no_back
));
return $this->footer_tpl->fetch();
}