当前位置: 首页>>代码示例>>PHP>>正文


PHP Tab::getNewLastPosition方法代码示例

本文整理汇总了PHP中Tab::getNewLastPosition方法的典型用法代码示例。如果您正苦于以下问题:PHP Tab::getNewLastPosition方法的具体用法?PHP Tab::getNewLastPosition怎么用?PHP Tab::getNewLastPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tab的用法示例。


在下文中一共展示了Tab::getNewLastPosition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addAdminTab

 /**
  * Add admin tabs in the menu
  * @param Array $tabs
  *                Array[
  *                Array[
  *                id_parent => 0 || void
  *                className => Controller to link to
  *                module => modulename to easily delete when uninstalling
  *                name => name to display
  *                position => position
  *                ]
  *                ]
  */
 public static function addAdminTab($data)
 {
     // Get ID Parent
     $id_parent = isset($data['id_parent']) ? (int) $data['id_parent'] : (int) Tab::getIdFromClassName($data['classNameParent']);
     // Tab
     $tab = Tab::getInstanceFromClassName($data['className']);
     $tab->id_parent = (int) $id_parent;
     $tab->class_name = $data['className'];
     $tab->module = $data['module'];
     $tab->position = Tab::getNewLastPosition((int) $id_parent);
     $tab->active = 1;
     $languages = Language::getLanguages(false);
     foreach ($languages as $lang) {
         $tab->name[(int) $lang['id_lang']] = $data['name'];
     }
     if (!$tab->save()) {
         return false;
     }
     return $tab->id;
 }
开发者ID:ebaudet,项目名称:ps_my_module,代码行数:33,代码来源:TotAdminTabHelper.php

示例2: update

 /**
  * Overrides update to set position to last when changing parent tab
  *
  * @see ObjectModel::update
  * @param bool $null_values
  * @return bool
  */
 public function update($null_values = false)
 {
     $current_tab = new Tab($this->id);
     if ($current_tab->id_parent != $this->id_parent) {
         $this->position = Tab::getNewLastPosition($this->id_parent);
     }
     self::$_cache_tabs = array();
     return parent::update($null_values);
 }
开发者ID:jicheng17,项目名称:pengwine,代码行数:16,代码来源:Tab.php

示例3: install

 public function install()
 {
     CertissimLogger::insertLog(__METHOD__ . " : " . __LINE__, "Génération du fichier log");
     /** database tables creation * */
     $sqlfile = dirname(__FILE__) . '/install.sql';
     if (!file_exists($sqlfile) || !($sql = file_get_contents($sqlfile))) {
         return false;
     }
     $sql = str_replace('PREFIX_', _DB_PREFIX_, $sql);
     $queries = preg_split("/;\\s*[\r\n]+/", $sql);
     foreach ($queries as $query) {
         if (!Db::getInstance()->Execute(trim($query))) {
             CertissimLogger::insertLog(__METHOD__ . " : " . __LINE__, "Install impossible, génération base échouée : " . Db::getInstance()->getMsgError());
             return false;
         }
     }
     //Certissim order stats insertion
     foreach ($this->_certissim_states as $id => $label) {
         $sql = "INSERT INTO `" . _DB_PREFIX_ . self::CERTISSIM_STATE_TABLE_NAME . "` (`id_certissim_state`,`label`) VALUES ('" . (int) $id . "','" . (string) $label . "')";
         $insert = Db::getInstance()->execute($sql);
         if (!$insert) {
             CertissimLogger::insertLog(__METHOD__ . " : " . __LINE__, "Insertion state {$id}.{$label} échouée : " . Db::getInstance()->getMsgError());
         }
     }
     $tab_admin_order_id = Tab::getIdFromClassName('AdminOrders');
     //AdminCertissimController registration
     $tab_controller_main = new Tab();
     $tab_controller_main->active = 1;
     $tab_controller_main->class_name = "AdminCertissim";
     foreach (Language::getLanguages() as $language) {
         $tab_controller_main->name[$language['id_lang']] = "Certissim";
     }
     $tab_controller_main->id_parent = $tab_admin_order_id;
     $tab_controller_main->module = $this->name;
     $tab_controller_main->add();
     $tab_controller_main->move(Tab::getNewLastPosition(0));
     return parent::install() && $this->registerHook('newOrder') && $this->registerHook('paymentConfirm') && $this->registerHook('adminOrder') && $this->registerHook('backOfficeHeader');
 }
开发者ID:Evil1991,项目名称:PrestaShop-1.4,代码行数:38,代码来源:fianetfraud.php


注:本文中的Tab::getNewLastPosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。