コード例 #1
0
 /**
  * Fetch the template for action enable
  *
  * @param string $token
  * @param int $id
  * @param int $value state enabled or not
  * @param string $active status
  * @param int $id_category
  * @param int $id_product
  */
 public function displayEnableLink($token, $id, $value, $active, $id_category = null, $id_product = null)
 {
     if ($value && TaxRule::isTaxInUse($id)) {
         $confirm = $this->l('This tax is currently in use as a tax rule. If you continue, this tax will be removed from the tax rule. Are you sure you\'d like to continue?', null, true, false);
     }
     $tpl_enable = $this->context->smarty->createTemplate('helpers/list/list_action_enable.tpl');
     $tpl_enable->assign(array('enabled' => (bool) $value, 'url_enable' => self::$currentIndex . '&' . $this->identifier . '=' . (int) $id . '&' . $active . $this->table . ((int) $id_category && (int) $id_product ? '&id_category=' . (int) $id_category : '') . '&token=' . ($token != null ? $token : $this->token), 'confirm' => isset($confirm) ? $confirm : null));
     return $tpl_enable->fetch();
 }
コード例 #2
0
    protected function _displayEnableLink($token, $id, $value, $active, $id_category = NULL, $id_product = NULL)
    {
        global $currentIndex;
        $confirm = $value && TaxRule::isTaxInUse($id) ? 'onclick="return confirm(\'' . $this->l('This tax is currently in use in a tax rule. If you continue this tax will be removed from the tax rule, are you sure you want to continue?') . '\')"' : '';
        echo '<a href="' . $currentIndex . '&' . $this->identifier . '=' . $id . '&' . $active . ((int) $id_category && (int) $id_product ? '&id_category=' . (int) $id_category : '') . '&token=' . ($token != null ? $token : $this->token) . '" ' . $confirm . '>
	        <img src="../img/admin/' . ($value ? 'enabled.gif' : 'disabled.gif') . '"
	        alt="' . ($value ? $this->l('Enabled') : $this->l('Disabled')) . '" title="' . ($value ? $this->l('Enabled') : $this->l('Disabled')) . '" /></a>';
    }