本文整理汇总了PHP中AdminController::initToolbar方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminController::initToolbar方法的具体用法?PHP AdminController::initToolbar怎么用?PHP AdminController::initToolbar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminController
的用法示例。
在下文中一共展示了AdminController::initToolbar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initToolbar
public function initToolbar()
{
switch ($this->display) {
default:
parent::initToolbar();
}
}
示例2: initToolbar
public function initToolbar()
{
parent::initToolbar();
if (in_array($this->display, array('add', 'edit'))) {
$this->toolbar_btn = array_merge(array('save-and-stay' => array('short' => 'SaveAndStay', 'href' => '#', 'desc' => $this->l('Save and stay'))), $this->toolbar_btn);
}
}
示例3: initToolbar
public function initToolbar()
{
if ($this->display == 'add' || $this->display == 'edit') {
$this->toolbar_btn['save-and-stay'] = array('short' => 'SaveAndStay', 'href' => '#', 'desc' => $this->l('Save, then add a category reduction.'), 'force_desc' => true);
}
parent::initToolbar();
}
示例4: initToolbar
public function initToolbar()
{
parent::initToolbar();
if (isset($this->toolbar_btn['new'])) {
$this->toolbar_btn['new']['href'] = $this->context->link->getAdminLink('AdminCarrierWizard');
}
}
示例5: initToolbar
public function initToolbar()
{
if (!$this->id_shop_group && $this->object && $this->object->id_shop_group) {
$this->id_shop_group = $this->object->id_shop_group;
}
if (!$this->display && $this->id_shop_group) {
$this->toolbar_btn['edit'] = array('desc' => $this->l('Edit this shop group'), 'href' => $this->context->link->getAdminLink('AdminShopGroup') . '&updateshop_group&id_shop_group=' . $this->id_shop_group);
}
if ($this->display == 'edit' || $this->display == 'add') {
if ($shop = $this->loadObject(true)) {
if ((bool) $shop->id) {
// adding button for delete this shop
if ($this->tabAccess['delete'] && $this->display != 'add' && !Shop::hasDependency($shop->id)) {
$this->toolbar_btn['delete'] = array('short' => 'Delete', 'href' => $this->context->link->getAdminLink('AdminShop') . '&id_shop=' . $shop->id . '&deleteshop', 'desc' => $this->l('Delete this shop'), 'confirm' => 1);
}
$this->toolbar_btn['new-url'] = array('href' => $this->context->link->getAdminLink('AdminShopUrl') . '&id_shop=' . $shop->id . '&addshop_url', 'desc' => $this->l('Add URL'), 'class' => 'addShopUrl');
}
if ($this->tabAccess['edit']) {
$this->toolbar_btn['save'] = array('short' => 'Save', 'href' => '#todo' . $this->context->link->getAdminLink('AdminShops') . '&id_shop=' . $shop->id, 'desc' => $this->l('Save'));
$this->toolbar_btn['save-and-stay'] = array('short' => 'SaveAndStay', 'href' => '#todo' . $this->context->link->getAdminLink('AdminShops') . '&id_shop=' . $shop->id, 'desc' => $this->l('Save and stay'));
}
}
}
parent::initToolbar();
$this->context->smarty->assign('toolbar_scroll', 1);
$this->show_toolbar = false;
if (isset($this->toolbar_btn['new'])) {
$this->toolbar_btn['new'] = array('desc' => $this->l('Add new shop'), 'href' => $this->context->link->getAdminLink('AdminShop') . '&add' . $this->table . '&id_shop_group=' . $this->id_shop_group);
}
if (isset($this->toolbar_btn['back'])) {
$this->toolbar_btn['back']['href'] .= '&id_shop_group=' . $this->id_shop_group;
}
}
示例6: initToolbar
public function initToolbar()
{
parent::initToolbar();
if (!$this->display) {
$this->toolbar_btn['import'] = array('href' => $this->context->link->getAdminLink('AdminImport', true) . '&import_type=addresses', 'desc' => $this->l('Import'));
}
}
示例7: initToolbar
public function initToolbar()
{
parent::initToolbar();
if (isset($this->toolbar_btn['new']) && $this->display != 'view') {
$this->toolbar_btn['new']['href'] = $this->context->link->getAdminLink('AdminCarriers') . '&onboarding_carrier';
}
}
示例8: initToolbar
public function initToolbar()
{
parent::initToolbar();
if ($this->display != 'add' && $this->display != 'edit') {
$this->toolbar_btn['new'] = array('desc' => $this->l('Add a new shop group'), 'href' => self::$currentIndex . '&add' . $this->table . '&token=' . $this->token);
}
}
示例9: initToolbar
public function initToolbar()
{
parent::initToolbar();
if ($this->display == 'options') {
unset($this->toolbar_btn['new']);
} elseif ($this->display != 'add' && $this->display != 'edit') {
unset($this->toolbar_btn['save']);
}
}
示例10: initToolbar
public function initToolbar()
{
parent::initToolbar();
if (!$this->can_add_confirmpayment) {
unset($this->toolbar_btn['new']);
} elseif (!$this->display && $this->can_import) {
$this->toolbar_btn['import'] = array('href' => $this->context->link->getAdminLink('AdminImport', true) . '&import_type=confirmpayment', 'desc' => $this->l('Import'));
}
}
示例11: initToolbar
public function initToolbar()
{
// If display list, we don't want the "add" button
if (!$this->display || $this->display == 'list') {
return;
} elseif ($this->display != 'options') {
$this->toolbar_btn['save-and-stay'] = array('short' => 'SaveAndStay', 'href' => '#', 'desc' => $this->l('Save and stay'), 'force_desc' => true);
}
parent::initToolbar();
}
示例12: initToolbar
public function initToolbar()
{
if ($this->display == 'view' && ($id_request = Tools::getValue('id_request_sql'))) {
$this->toolbar_btn['edit'] = array('href' => self::$currentIndex . '&updaterequest_sql&token=' . $this->token . '&id_request_sql=' . (int) $id_request, 'desc' => $this->l('Edit this SQL query'));
}
parent::initToolbar();
if ($this->display == 'options') {
unset($this->toolbar_btn['new']);
}
}
示例13: initToolbar
public function initToolbar()
{
parent::initToolbar();
if ($this->display != 'edit' && $this->display != 'add') {
if ($this->id_object) {
$this->loadObject();
}
if (!$this->id_shop_group && $this->object && $this->object->id_shop_group) {
$this->id_shop_group = $this->object->id_shop_group;
}
$this->toolbar_btn['new'] = array('desc' => $this->l('Add new shop'), 'href' => $this->context->link->getAdminLink('AdminShop') . '&add' . $this->table . '&id_shop_group=' . $this->id_shop_group);
}
}
示例14: initContent
public function initContent()
{
parent::initToolbar();
parent::initTabModuleList();
parent::initPageHeaderToolbar();
$this->addHeaderToolbarBtn();
parent::initContent();
$this->show_page_header_toolbar = (bool) $this->showContentHeader;
if ($this->title) {
$this->context->smarty->assign(array('title' => $this->title));
}
$vars = array('maintenance_mode' => !(bool) Configuration::get('PS_SHOP_ENABLE'), 'headerTabContent' => $this->headerTabContent, 'content' => '{$content}', 'enableSidebar' => $this->enableSidebar);
if (!empty($this->helpLink)) {
$vars['help_link'] = $this->helpLink;
}
$this->context->smarty->assign($vars);
}
示例15: initToolbar
public function initToolbar()
{
if (empty($this->display)) {
if (Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE')) {
$this->toolbar_btn['new-url'] = array('href' => self::$currentIndex . '&add' . $this->table . 'root&token=' . $this->token, 'desc' => $this->l('Add new root category'));
}
$this->toolbar_btn['new'] = array('href' => self::$currentIndex . '&add' . $this->table . '&token=' . $this->token, 'desc' => $this->l('Add new'));
$this->toolbar_btn['import'] = array('href' => $this->context->link->getAdminLink('AdminImport', true) . '&import_type=' . $this->table, 'desc' => $this->l('Import'));
}
// be able to edit the Home category
if (count(Category::getCategoriesWithoutParent()) == 1 && !Tools::isSubmit('id_category') && ($this->display == 'view' || empty($this->display))) {
$this->toolbar_btn['edit'] = array('href' => self::$currentIndex . '&update' . $this->table . '&id_category=' . (int) $this->_category->id . '&token=' . $this->token, 'desc' => $this->l('Edit'));
}
if (Tools::getValue('id_category') && !Tools::isSubmit('updatecategory')) {
$this->toolbar_btn['edit'] = array('href' => self::$currentIndex . '&update' . $this->table . '&id_category=' . (int) Tools::getValue('id_category') . '&token=' . $this->token, 'desc' => $this->l('Edit'));
}
if ($this->display == 'view') {
$this->toolbar_btn['new'] = array('href' => self::$currentIndex . '&add' . $this->table . '&id_parent=' . (int) Tools::getValue('id_category') . '&token=' . $this->token, 'desc' => $this->l('Add new'));
}
parent::initToolbar();
if ($this->_category->id == Category::getTopCategory()->id && isset($this->toolbar_btn['new'])) {
unset($this->toolbar_btn['new']);
}
// after adding a category
if (empty($this->display)) {
$id_category = Tools::isSubmit('id_category') ? '&id_parent=' . (int) Tools::getValue('id_category') : '';
$this->toolbar_btn['new'] = array('href' => self::$currentIndex . '&add' . $this->table . '&token=' . $this->token . $id_category, 'desc' => $this->l('Add new'));
if (Tools::isSubmit('id_category')) {
$back = Tools::safeOutput(Tools::getValue('back', ''));
if (empty($back)) {
$back = self::$currentIndex . '&token=' . $this->token;
}
$this->toolbar_btn['back'] = array('href' => $back, 'desc' => $this->l('Back to list'));
}
}
}