當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Hook::get方法代碼示例

本文整理匯總了PHP中Hook::get方法的典型用法代碼示例。如果您正苦於以下問題:PHP Hook::get方法的具體用法?PHP Hook::get怎麽用?PHP Hook::get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Hook的用法示例。


在下文中一共展示了Hook::get方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: install

 public function install()
 {
     if (!parent::install() or !$this->registerHook('header') or !$this->registerHook('productFooter') or !$this->registerHook('footer') or !$this->installDB() or !$this->fixCSS() or !$this->updatePosition(Hook::get('header'), 0, 1)) {
         return false;
     }
     return true;
 }
開發者ID:nicolasjeol,項目名稱:hec-ecommerce,代碼行數:7,代碼來源:magiczoomplus.php

示例2: loadAddons

 private function loadAddons()
 {
     $data = S('hooks');
     if (!$data) {
         $hooks = M('hooks')->getField('name,addons', true);
         foreach ($hooks as $key => $value) {
             if ($value) {
                 $map['status'] = 1;
                 $names = explode(',', $value);
                 $map['name'] = array('IN', $names);
                 $data = M('Addons')->where($map)->getField('id,name');
                 if ($data) {
                     $addons = array_intersect($names, $data);
                     Hook::add($key, $addons);
                 }
             }
         }
         S('hooks', Hook::get());
         //插件標簽
         $tpl_tags = array();
         $data = M('addons')->getField('id,name');
         if ($data) {
             foreach ($data as $addon) {
                 if (is_file("HDCMS/Addons/{$addon}/Tag/{$addon}Tag.class.php")) {
                     $tpl_tags[] = "@.Addons.{$addon}.Tag.{$addon}Tag";
                 }
             }
         }
         S('HookTag', array_unique($tpl_tags));
     } else {
         Hook::import($data, false);
         C('TPL_TAGS', array_unique(array_merge(C('TPL_TAGS'), S('HookTag'))));
     }
 }
開發者ID:lililishuang,項目名稱:hdcms,代碼行數:34,代碼來源:AppInitHook.class.php

示例3: _checkValues

 private function _checkValues()
 {
     $errors = array();
     if (isset($_POST['submitPaypalSettings'])) {
         if (!isset($_POST['sandbox'])) {
             $_POST['sandbox'] = 1;
         }
         if (!isset($_POST['expressCheckout'])) {
             $_POST['expressCheckout'] = 0;
         }
         if (!$this->_expressCheckout and intval($_POST['expressCheckout'])) {
             if (!$this->registerHook('shoppingCartExtra')) {
                 $errors[] = $this->l('Cannot register module to validCart hook, ExpressCheckout not enabled');
                 $_POST['expressCheckout'] = 0;
             }
         }
         if ($this->_expressCheckout and !intval($_POST['expressCheckout'])) {
             if (!$this->unregisterHook(Hook::get('shoppingCartExtra'))) {
                 $errors[] = $this->l('Cannot unregister module to validCart hook, ExpressCheckout not disabled');
                 $_POST['expressCheckout'] = 1;
             }
         }
     } elseif (isset($_POST['submitPaypalAPI'])) {
         if (!isset($_POST['apiUser']) or !$_POST['apiUser']) {
             $errors[] = $this->l('You need to configure your PayPal API username');
         }
         if (!isset($_POST['apiPassword']) or !$_POST['apiPassword']) {
             $errors[] = $this->l('You need to configure your PayPal API password');
         }
         if (!isset($_POST['apiSignature']) or !$_POST['apiSignature']) {
             $errors[] = $this->l('You need to configure your PayPal API signature');
         }
     }
     return $errors;
 }
開發者ID:Bruno-2M,項目名稱:prestashop,代碼行數:35,代碼來源:PaypalAdmin.php

示例4: install

 public function install()
 {
     self::$obj_ts_common->install();
     $return = parent::install() && $this->registerHook('displayBackOfficeHeader') && $this->registerHook('orderConfirmation') && $this->registerHook('newOrder') && $this->registerHook('actionOrderStatusPostUpdate') && $this->registerHook('Footer') && $this->registerHook('paymentTop') && $this->registerHook('orderConfirmation');
     $id_hook = _PS_VERSION_ < '1.5' ? Hook::get('payment') : Hook::getIdByName('payment');
     $this->updatePosition($id_hook, 0, 1);
     return $return;
 }
開發者ID:alexsimple,項目名稱:trustedshops,代碼行數:8,代碼來源:trustedshops.php

示例5: install

 public function install()
 {
     $homeHookID = $this->isPrestaShop15x ? $this->isPrestaShop16x ? Hook::getIdByName('displayTopColumn') : Hook::getIdByName('displayHome') : Hook::get('home');
     $headerHookID = $this->isPrestaShop15x ? Hook::getIdByName('displayHeader') : Hook::get('header');
     if (!parent::install() or !$this->registerHook($this->isPrestaShop15x ? 'displayHeader' : 'header') or !$this->registerHook($this->isPrestaShop15x ? 'displayFooterProduct' : 'productFooter') or !$this->registerHook($this->isPrestaShop15x ? 'displayFooter' : 'footer') or !$this->installDB() or !$this->fixCSS() or !$this->registerHook($this->isPrestaShop15x ? $this->isPrestaShop16x ? 'displayTopColumn' : 'displayHome' : 'home') or !$this->updatePosition($homeHookID, 0, 1) or !$this->createImageFolder('magicscroll') or !$this->updatePosition($headerHookID, 0, 1)) {
         return false;
     }
     $this->sendStat('install');
     return true;
 }
開發者ID:Eximagen,項目名稱:3m,代碼行數:10,代碼來源:magicscroll.php

示例6: install

 public function install()
 {
     $return = true;
     foreach (self::$objects_list as $object) {
         $return = $object->install();
         if (!$return) {
             break;
         }
     }
     $return = $return ? parent::install() and $this->registerHook('orderConfirmation') and $this->registerHook('newOrder') and $this->registerHook('rightColumn') and $this->registerHook('paymentTop') and $this->registerHook('orderConfirmation') : $return;
     $id_hook = Hook::get('payment');
     $this->updatePosition($id_hook, 0, 1);
     return $return;
 }
開發者ID:hecbuma,項目名稱:quali-fisioterapia,代碼行數:14,代碼來源:trustedshops.php

示例7: install

 function install()
 {
     if (Hook::get('orderPages') == false) {
         $hook = new Hook();
         $hook->name = 'orderPages';
         $hook->title = 'Order process pages';
         $hook->description = 'Adds new pages in the order process';
         $hook->add();
     }
     if (parent::install() == false or $this->registerHook('orderPages') == false) {
         return false;
     }
     return true;
 }
開發者ID:redb,項目名稱:prestashop,代碼行數:14,代碼來源:OrderPage.php

示例8: install

 function install()
 {
     if (Hook::get('orderPriceAdjustment') == false) {
         $hook = new Hook();
         $hook->name = 'orderPriceAdjustment';
         $hook->title = 'Order price adjustment';
         $hook->description = 'Allows modules to adjust prices in an order after the user has logged in and registered an address, e.g. allows prices based on group memberships and the like.';
         $hook->add();
     }
     if (parent::install() == false) {
         return false;
     }
     return true;
 }
開發者ID:redb,項目名稱:prestashop,代碼行數:14,代碼來源:orderpriceadjustment.php

示例9: install

 function install()
 {
     if (Hook::get('extraCarrierDetails') == false) {
         $hook = new Hook();
         $hook->name = 'extraCarrierDetails';
         $hook->title = 'Extra carrier dietails';
         $hook->description = 'Extra carrier dietails display part';
         $hook->add();
     }
     if (Hook::get('extraCarrierDetailsProcess') == false) {
         $hook = new Hook();
         $hook->name = 'extraCarrierDetailsProcess';
         $hook->title = 'Extra carrier dietails';
         $hook->description = 'Extra carrier dietails processing part';
         $hook->add();
     }
     return parent::install();
 }
開發者ID:redb,項目名稱:prestashop,代碼行數:18,代碼來源:ordercarrier.php

示例10: moveRightColumn

 public function moveRightColumn($position)
 {
     if (_PS_VERSION_ < '1.5') {
         $hookRight = (int) Hook::get('rightColumn');
     } else {
         $hookRight = (int) Hook::getIdByName('rightColumn');
     }
     $moduleInstance = Module::getInstanceByName($this->name);
     if (_PS_VERSION_ < '1.5') {
         $moduleInfo = Hook::getModuleFromHook($hookRight, $moduleInstance->id);
     } else {
         $moduleInfo = Hook::getModulesFromHook($hookRight, $moduleInstance->id);
     }
     if (isset($moduleInfo['position']) && (int) $moduleInfo['position'] > (int) $position || isset($moduleInfo['m.position']) && (int) $moduleInfo['m.position'] > (int) $position) {
         return $moduleInstance->updatePosition($hookRight, 0, (int) $position);
     }
     return $moduleInstance->updatePosition($hookRight, 1, (int) $position);
 }
開發者ID:Evil1991,項目名稱:PrestaShop-1.4,代碼行數:18,代碼來源:paypal_tools.php

示例11: run

 public function run(&$content)
 {
     $data = S('hooks');
     if (!$data) {
         $hooks = M('Hooks')->getField('name,plugins');
         foreach ($hooks as $key => $value) {
             if ($value) {
                 $map['status'] = 1;
                 $names = explode(',', $value);
                 $map['name'] = array('IN', $names);
                 $data = M('Plugins')->where($map)->getField('id,name');
                 if ($data) {
                     $plugins = array_intersect($names, $data);
                     Hook::add($key, $plugins);
                 }
             }
         }
         S('hooks', Hook::get());
     } else {
         Hook::import($data, false);
     }
 }
開發者ID:it114,項目名稱:public,代碼行數:22,代碼來源:InitHookBehavior.class.php

示例12: loadAddons

 /**
  * 加載係統插件
  */
 private function loadAddons()
 {
     $data = S('hooks');
     if (!$data || DEBUG) {
         $hooks = M('hooks')->where("status=1")->getField('name,addons', true);
         if ($hooks) {
             foreach ($hooks as $key => $value) {
                 if ($value) {
                     $map['status'] = 1;
                     $names = explode(',', $value);
                     $map['name'] = array('IN', $names);
                     $data = M('addons')->where($map)->getField('id,name');
                     if ($data) {
                         $addons = array_intersect($names, $data);
                         Hook::add($key, $addons);
                     }
                 }
             }
         }
         S('hooks', Hook::get());
     } else {
         Hook::import($data, false);
     }
 }
開發者ID:suhanyujie,項目名稱:spider,代碼行數:27,代碼來源:AppInitHook.class.php

示例13: installHook

    public function installHook()
    {
        return Db::getInstance()->Execute('INSERT INTO `' . _DB_PREFIX_ . 'hook` (`name`, `title`, `description`)
		VALUE (\'displayMobileHeader\', \'' . pSQL($this->l('Header of mobile pages')) . '\', \'' . pSQL($this->l('A hook which allow you to do things in the header of each pages of the Mobile version')) . '\')') && Configuration::updateValue('PS_MOBILE_HOOK_HEADER_ID', Hook::get('displayMobileHeader'));
    }
開發者ID:rtajmahal,項目名稱:PrestaShop-modules,代碼行數:5,代碼來源:mobile_theme.php

示例14: array

<?php

/**
 * Arxmin Config Option Can be Overrided
 *
 */
return Hook::get('arxmin::config', array('prefix' => 'arxmin', 'theme' => 'arx/arxmin/dist', 'namespace' => 'Arxmin\\', 'database' => array('default' => Config::get('database.default')), 'paths' => array('packages' => app_path('packages'), 'workbench' => base_path('workbench'), 'modules' => base_path('modules'), 'theme' => public_path('packages/arx/arxmin/dist')), 'auth' => array('filter' => 'arxmin-auth', 'controller' => 'Arxmin\\AuthController', 'model' => 'Arxmin\\UserModel')));
開發者ID:php-arx,項目名稱:arxmin,代碼行數:7,代碼來源:arxmin.php

示例15: _displayForm4

    private function _displayForm4()
    {
        $xml = simplexml_load_file(_IMPORT_FOLDER_ . XMLFILENAME);
        $this->xml = $xml;
        self::getModules();
        $hook = array();
        $hookedModule = array();
        $position = array();
        $msg = '';
        foreach ($this->xml->modules->hooks->hook as $row) {
            $hookedModule[] = strval($row['module']);
            $hook[] = strval($row['hook']);
            $position[] = strval($row['position']);
            $exceptions[] = isset($row['exceptions']) ? explode(',', strval($row['exceptions'])) : array();
        }
        if (file_exists(_IMPORT_FOLDER_ . 'doc') and sizeof($xml->docs->doc) != 0) {
            self::_loadDocForm();
        }
        // install selected modules
        $flag = 0;
        if (isset($this->to_export) and $this->to_export) {
            foreach ($this->to_export as $row) {
                if (in_array($row, $this->native_modules)) {
                    continue;
                }
                if ($flag++ == 0) {
                    $msg .= '<b>' . $this->l('The following modules have been installed') . ' :</b><br />';
                }
                self::recurseCopy(_IMPORT_FOLDER_ . 'modules/' . $row, _PS_ROOT_DIR_ . '/modules/' . $row);
                $obj = Module::getInstanceByName($row);
                if (Validate::isLoadedObject($obj)) {
                    Db::getInstance()->Execute('
						UPDATE `' . _DB_PREFIX_ . 'module`
						SET `active`= 1
						WHERE `name` = \'' . pSQL($row) . '\'');
                } elseif (!$obj or !$obj->install()) {
                    continue;
                }
                $msg .= '<i>- ' . pSQL($row) . '</i><br />';
                Db::getInstance()->Execute('
					DELETE FROM `' . _DB_PREFIX_ . 'hook_module` 
					WHERE `id_module` = ' . pSQL($obj->id));
                $count = -1;
                while (isset($hookedModule[++$count])) {
                    if ($hookedModule[$count] == $row) {
                        Db::getInstance()->Execute('
							INSERT INTO `' . _DB_PREFIX_ . 'hook_module` (`id_module`, `id_hook`, `position`)
							VALUES (' . (int) $obj->id . ', ' . (int) Hook::get($hook[$count]) . ', ' . (int) $position[$count] . ')');
                        if ($exceptions[$count]) {
                            foreach ($exceptions[$count] as $file_name) {
                                Db::getInstance()->Execute('
									INSERT INTO `' . _DB_PREFIX_ . 'hook_module_exceptions` (`id_module`, `id_hook`, `file_name`)
									VALUES (' . (int) $obj->id . ', ' . (int) Hook::get($hook[$count]) . ', "' . pSQL($file_name) . '")');
                            }
                        }
                    }
                }
            }
        }
        if (($val = (int) Tools::getValue('nativeModules')) != 1) {
            $flag = 0;
            // Disable native modules
            if ($val == 2 and $this->to_disable and count($this->to_disable)) {
                foreach ($this->to_disable as $row) {
                    $obj = Module::getInstanceByName($row);
                    if (Validate::isLoadedObject($obj)) {
                        if ($flag++ == 0) {
                            $msg .= '<b>' . $this->l('The following modules have been disabled') . ' :</b><br />';
                        }
                        $msg .= '<i>- ' . pSQL($row) . '</i><br />';
                        Db::getInstance()->Execute('
						UPDATE `' . _DB_PREFIX_ . 'module`
						SET `active`= 0
						WHERE `name` = \'' . pSQL($row) . '\'');
                    }
                }
            }
            $flag = 0;
            if ($this->to_enable and count($this->to_enable)) {
                foreach ($this->to_enable as $row) {
                    $obj = Module::getInstanceByName($row);
                    if (Validate::isLoadedObject($obj)) {
                        Db::getInstance()->Execute('
							UPDATE `' . _DB_PREFIX_ . 'module`
							SET `active`= 1
							WHERE `name` = \'' . pSQL($row) . '\'');
                    } elseif (!is_object($obj) or !$obj->install()) {
                        continue;
                    }
                    if ($flag++ == 0) {
                        $msg .= '<b>' . $this->l('The following modules have been enabled') . ' :</b><br />';
                    }
                    $msg .= '<i>- ' . pSQL($row) . '</i><br />';
                    Db::getInstance()->Execute('
						DELETE FROM `' . _DB_PREFIX_ . 'hook_module` 
						WHERE `id_module` = ' . pSQL($obj->id));
                    $count = -1;
                    while (isset($hookedModule[++$count])) {
                        if ($hookedModule[$count] == $row) {
                            Db::getInstance()->Execute('
//.........這裏部分代碼省略.........
開發者ID:greench,項目名稱:prestashop,代碼行數:101,代碼來源:themeinstallator.php


注:本文中的Hook::get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。