本文整理汇总了PHP中Tab::move方法的典型用法代码示例。如果您正苦于以下问题:PHP Tab::move方法的具体用法?PHP Tab::move怎么用?PHP Tab::move使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tab
的用法示例。
在下文中一共展示了Tab::move方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postProcess
public function postProcess()
{
if ($id_tab = intval(Tools::getValue('id_tab')) and $direction = Tools::getValue('move') and Validate::isLoadedObject($tab = new Tab($id_tab))) {
global $currentIndex;
if ($tab->move($direction)) {
Tools::redirectAdmin($currentIndex . '&token=' . $this->token);
}
} else {
if (!Tools::getValue('position')) {
$_POST['position'] = Tab::getNbTabs(Tools::getValue('id_parent'));
}
parent::postProcess();
}
}
示例2: postProcess
public function postProcess()
{
/* PrestaShop demo mode */
if (_PS_MODE_DEMO_) {
$this->_errors[] = Tools::displayError('This functionnality has been disabled.');
return;
}
/* PrestaShop demo mode*/
if ($id_tab = (int) Tools::getValue('id_tab') and $direction = Tools::getValue('move') and Validate::isLoadedObject($tab = new Tab($id_tab))) {
global $currentIndex;
if ($tab->move($direction)) {
Tools::redirectAdmin($currentIndex . '&token=' . $this->token);
}
} else {
if (!Tools::getValue('position')) {
$_POST['position'] = Tab::getNbTabs(Tools::getValue('id_parent'));
}
parent::postProcess();
}
}
示例3: install
public function install()
{
//create log file
SceauLogger::insertLogSceau(__METHOD__ . " : " . __LINE__, "Création du fichier de log");
/** database tables creation * */
$sqlfile = dirname(__FILE__) . '/install.sql';
if (!file_exists($sqlfile) || !($sql = Tools::file_get_contents($sqlfile))) {
return false;
}
$sql = str_replace('PREFIX_', _DB_PREFIX_, $sql);
$sql = str_replace('SCEAU_ORDER_TABLE_NAME', self::SCEAU_ORDER_TABLE_NAME, $sql);
$sql = str_replace('SCEAU_STATE_TABLE_NAME', self::SCEAU_STATE_TABLE_NAME, $sql);
$queries = preg_split("/;\\s*[\r\n]+/", $sql);
foreach ($queries as $query) {
if (!Db::getInstance()->Execute(trim($query))) {
SceauLogger::insertLogSceau(__METHOD__ . " : " . __LINE__, "Installation failed, database creation failed : " . Db::getInstance()->getMsgError());
return false;
}
}
//Sceau order statuses insertion
foreach ($this->_fianetsceau_order_statuses as $id => $label) {
$sql = "INSERT INTO `" . _DB_PREFIX_ . self::SCEAU_STATE_TABLE_NAME . "` (`id_fianetsceau_state`,`label`) VALUES ('" . (int) $id . "','" . pSQL((string) $label) . "')";
$insert = Db::getInstance()->execute($sql);
if (!$insert) {
SceauLogger::insertLogSceau(__METHOD__ . " : " . __LINE__, "Insertion state {$id}.{$label} échouée : " . Db::getInstance()->getMsgError());
}
}
//tabs creation
$tab_admin_id_order = Tab::getIdFromClassName('AdminOrders');
//AdminSceauController registration
$tab_controller_main = new Tab();
$tab_controller_main->active = 1;
$tab_controller_main->class_name = "AdminSceau";
foreach (Language::getLanguages() as $language) {
$tab_controller_main->name[$language['id_lang']] = "Sceau de Confiance";
}
$tab_controller_main->id_parent = $tab_admin_id_order;
$tab_controller_main->module = $this->name;
$tab_controller_main->add();
$tab_controller_main->move($this->getNewLastPosition(0));
//Hook register
return parent::install() && $this->registerHook('newOrder') && $this->registerHook('paymentConfirm') && $this->registerHook('adminOrder') && $this->registerHook('backOfficeHeader') && $this->registerHook('top') && $this->registerHook('footer') && $this->registerHook('leftColumn') && $this->registerHook('rightColumn');
}
示例4: 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($this->getNewLastPosition(0));
return parent::install() && $this->registerHook('newOrder') && $this->registerHook('paymentConfirm') && $this->registerHook('adminOrder') && $this->registerHook('backOfficeHeader');
}
示例5: postProcess
public function postProcess()
{
/* PrestaShop demo mode */
if (_PS_MODE_DEMO_) {
$this->errors[] = Tools::displayError('This functionality has been disabled.');
return;
}
/* PrestaShop demo mode*/
if (($id_tab = (int) Tools::getValue('id_tab')) && ($direction = Tools::getValue('move')) && Validate::isLoadedObject($tab = new Tab($id_tab))) {
if ($tab->move($direction)) {
Tools::redirectAdmin(self::$currentIndex . '&token=' . $this->token);
}
} elseif (Tools::getValue('position') && !Tools::isSubmit('submitAdd' . $this->table)) {
if ($this->tabAccess['edit'] !== '1') {
$this->errors[] = Tools::displayError('You do not have permission to edit this.');
} elseif (!Validate::isLoadedObject($object = new Tab((int) Tools::getValue($this->identifier)))) {
$this->errors[] = Tools::displayError('An error occurred while updating the status for an object.') . ' <b>' . $this->table . '</b> ' . Tools::displayError('(cannot load object)');
}
if (!$object->updatePosition((int) Tools::getValue('way'), (int) Tools::getValue('position'))) {
$this->errors[] = Tools::displayError('Failed to update the position.');
} else {
Tools::redirectAdmin(self::$currentIndex . '&conf=5&token=' . Tools::getAdminTokenLite('AdminTabs'));
}
} elseif (Tools::isSubmit('submitAdd' . $this->table) && Tools::getValue('id_tab') === Tools::getValue('id_parent')) {
$this->errors[] = Tools::displayError('You can\'t put this menu inside itself. ');
} elseif (Tools::isSubmit('submitAdd' . $this->table) && ($id_parent = (int) Tools::getValue('id_parent'))) {
$this->redirect_after = self::$currentIndex . '&id_' . $this->table . '=' . $id_parent . '&details' . $this->table . '&conf=4&token=' . $this->token;
} elseif (isset($_GET['details' . $this->table]) && is_array($this->bulk_actions)) {
$submit_bulk_actions = array_merge(array('enableSelection' => array('text' => $this->l('Enable selection'), 'icon' => 'icon-power-off text-success'), 'disableSelection' => array('text' => $this->l('Disable selection'), 'icon' => 'icon-power-off text-danger')), $this->bulk_actions);
foreach ($submit_bulk_actions as $bulk_action => $params) {
if (Tools::isSubmit('submitBulk' . $bulk_action . $this->table) || Tools::isSubmit('submitBulk' . $bulk_action)) {
if ($this->tabAccess['edit'] === '1') {
$this->action = 'bulk' . $bulk_action;
$this->boxes = Tools::getValue($this->list_id . 'Box');
} else {
$this->errors[] = Tools::displayError('You do not have permission to edit this.');
}
break;
} elseif (Tools::isSubmit('submitBulk')) {
if ($this->tabAccess['edit'] === '1') {
$this->action = 'bulk' . Tools::getValue('select_submitBulk');
$this->boxes = Tools::getValue($this->list_id . 'Box');
} else {
$this->errors[] = Tools::displayError('You do not have permission to edit this.');
}
break;
}
}
} else {
// Temporary add the position depend of the selection of the parent category
if (!Tools::isSubmit('id_tab')) {
// @todo Review
$_POST['position'] = Tab::getNbTabs(Tools::getValue('id_parent'));
}
}
if (!count($this->errors)) {
parent::postProcess();
}
}
示例6: postProcess
public function postProcess()
{
/* PrestaShop demo mode */
if (_PS_MODE_DEMO_) {
$this->errors[] = Tools::displayError('This functionality has been disabled.');
return;
}
/* PrestaShop demo mode*/
if (($id_tab = (int) Tools::getValue('id_tab')) && ($direction = Tools::getValue('move')) && Validate::isLoadedObject($tab = new Tab($id_tab))) {
if ($tab->move($direction)) {
Tools::redirectAdmin(self::$currentIndex . '&token=' . $this->token);
}
} elseif (Tools::getValue('position') && !Tools::isSubmit('submitAdd' . $this->table)) {
if ($this->tabAccess['edit'] !== '1') {
$this->errors[] = Tools::displayError('You do not have permission to edit here.');
} elseif (!Validate::isLoadedObject($object = new Tab((int) Tools::getValue($this->identifier)))) {
$this->errors[] = Tools::displayError('An error occurred while updating status for object.') . ' <b>' . $this->table . '</b> ' . Tools::displayError('(cannot load object)');
}
if (!$object->updatePosition((int) Tools::getValue('way'), (int) Tools::getValue('position'))) {
$this->errors[] = Tools::displayError('Failed to update the position.');
} else {
Tools::redirectAdmin(self::$currentIndex . '&conf=5&token=' . Tools::getAdminTokenLite('AdminTabs'));
}
} elseif (Tools::isSubmit('submitAddtab') && Tools::getValue('id_tab') === Tools::getValue('id_parent')) {
$this->errors[] = Tools::displayError('You can\'t put this menu in itself');
} else {
// Temporary add the position depend of the selection of the parent category
if (!Tools::isSubmit('id_tab')) {
// @todo Review
$_POST['position'] = Tab::getNbTabs(Tools::getValue('id_parent'));
}
}
if (!count($this->errors)) {
parent::postProcess();
}
}