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


PHP IPSLib::getDataHookLocations方法代码示例

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


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

示例1: _getDataLocationsForAdd

 /**
  * Get data hook locations
  *
  * @return	@e void		[Outputs to screen]
  */
 protected function _getDataLocationsForAdd()
 {
     $i = intval($this->request['i']);
     $_locations = IPSLib::getDataHookLocations();
     $output = $this->registry->output->formDropdown("dataLocation[{$i}]", $_locations);
     $this->returnHtml($output);
 }
开发者ID:ConnorChristie,项目名称:GrabViews,代码行数:12,代码来源:hooks.php

示例2: _hookForm

 /**
  * Hook add/edit form
  * This dynamic form allows users to associate multiple files with a single hook.
  *
  * @param	string		[add|edit]
  * @return	@e void		[Outputs to screen]
  */
 protected function _hookForm($type = 'add')
 {
     /* Init vars */
     $form = array();
     $files = array();
     $hookData = array();
     $requirements = array();
     $entryPoints = array('foreach' => array(array('outer.pre', $this->lang->words['h_outerpre']), array('inner.pre', $this->lang->words['h_innerpre']), array('inner.post', $this->lang->words['h_innerpost']), array('outer.post', $this->lang->words['h_outerpost'])), 'if' => array(array('pre.startif', $this->lang->words['h_prestartif']), array('post.startif', $this->lang->words['h_poststartif']), array('pre.else', $this->lang->words['h_preelse']), array('post.else', $this->lang->words['h_postelse']), array('pre.endif', $this->lang->words['h_preendif']), array('post.endif', $this->lang->words['h_postendif'])));
     /* Edit time? */
     if ($type == 'edit') {
         $id = intval($this->request['id']);
         if (!$id) {
             $this->registry->output->showError($this->lang->words['h_noedit'], 1116);
         }
         $hookData = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $id));
         if (!$hookData['hook_id']) {
             $this->registry->output->showError($this->lang->words['h_noedit'], 1117);
         }
         /* Sort out extra stuff and requirements */
         $hookData['hook_extra_data'] = unserialize($hookData['hook_extra_data']);
         $hookData['hook_requirements'] = unserialize($hookData['hook_requirements']);
         /* Old data? - @todo: we should remove that around 3.3(4?) */
         if (!isset($hookData['hook_requirements']['required_applications']['core']) && isset($hookData['hook_requirements']['hook_ipb_version_min']) && ($hookData['hook_requirements']['hook_ipb_version_min'] > 0 || $hookData['hook_requirements']['hook_ipb_version_max'] > 0)) {
             $requirements['core'] = array('min_version' => intval($hookData['hook_requirements']['hook_ipb_version_min']), 'max_version' => intval($hookData['hook_requirements']['hook_ipb_version_max']));
         }
         if (is_array($hookData['hook_requirements']['required_applications']) && count($hookData['hook_requirements']['required_applications'])) {
             /* Get the setup class */
             require_once IPS_ROOT_PATH . 'setup/sources/base/setup.php';
             /*noLibHook*/
             foreach ($hookData['hook_requirements']['required_applications'] as $appKey => $versionData) {
                 /* Fetch and check versions */
                 if (!isset($this->cachedVersions[$appKey])) {
                     $this->cachedVersions[$appKey] = IPSSetUp::fetchXmlAppVersions($appKey);
                 }
                 $_versions = $this->cachedVersions[$appKey];
                 krsort($_versions);
                 /* Setup our default 'no version' value */
                 $versions = array(array(0, $this->lang->words['h_any_version']));
                 foreach ($_versions as $long => $human) {
                     if ($long < 30000 && in_array($appKey, array('core', 'forums', 'members'))) {
                         continue;
                     }
                     $versions[] = array($long, $human);
                 }
                 $versionData['_versions'] = $versions;
                 $requirements[$appKey] = $versionData;
             }
         }
         /* Sort out hook files */
         $index = 1;
         $skinGroups = $this->hooksFunctions->getSkinGroups();
         $this->DB->build(array('select' => '*', 'from' => 'core_hooks_files', 'where' => 'hook_hook_id=' . $id));
         $outer = $this->DB->execute();
         /* Get them outside the while cycle to prevent warnings */
         $_dataHooks = IPSLib::getDataHookLocations();
         while ($r = $this->DB->fetch($outer)) {
             $r['hook_data'] = unserialize($r['hook_data']);
             if ($r['hook_type'] == 'templateHooks') {
                 $templates = $this->hooksFunctions->getSkinMethods($r['hook_data']['skinGroup']);
                 $hookIds = $this->hooksFunctions->getHookIds($r['hook_data']['skinFunction'], $r['hook_data']['type']);
                 $r['_skinDropdown'] = $this->registry->output->formDropdown("skinGroup[{$index}]", $skinGroups, $r['hook_data']['skinGroup'], "skinGroup[{$index}]", "onchange='getTemplatesForAdd({$index});'");
                 $r['_templateDropdown'] = $this->registry->output->formDropdown("skinFunction[{$index}]", $templates, $r['hook_data']['skinFunction'], "skinFunction[{$index}]", "onchange='getTypeOfHook({$index});'");
                 $r['_hookTypeDropdown'] = $this->registry->output->formDropdown("type[{$index}]", array(array(0, $this->lang->words['a_selectone']), array('foreach', $this->lang->words['hook_foreach_loop']), array('if', $this->lang->words['hook_if_statement'])), $r['hook_data']['type'], "type[{$index}]", "onchange='getHookIds({$index});'");
                 $r['_hookIdsDropdown'] = $this->registry->output->formDropdown("id[{$index}]", $hookIds, $r['hook_data']['id'], "id[{$index}]", "onchange='getHookEntryPoints({$index});'");
                 $r['_hookEPDropdown'] = $this->registry->output->formDropdown("position[{$index}]", $r['hook_data']['type'] == 'foreach' ? $entryPoints['foreach'] : $entryPoints['if'], $r['hook_data']['position']);
             }
             if ($r['hook_type'] == 'dataHooks') {
                 $r['_dataLocationDropdown'] = $this->registry->output->formDropdown("dataLocation[{$index}]", $_dataHooks, $r['hook_data']['dataLocation']);
             }
             $files[$index] = $r;
             $index++;
         }
         $action = 'do_edit_hook';
     } else {
         $action = 'do_create_hook';
     }
     /* Info */
     foreach (array('hook_name', 'hook_desc', 'hook_key', 'hook_version_human', 'hook_version_long', 'hook_author', 'hook_email', 'hook_website', 'hook_update_check') as $_hook_key) {
         $form[$_hook_key] = $this->registry->output->formSimpleInput($_hook_key, isset($this->request[$_hook_key]) ? $this->request[$_hook_key] : $hookData[$_hook_key], 60);
     }
     /* Requirements */
     foreach (array('hook_php_version_min', 'hook_php_version_max') as $_version_key) {
         $form[$_version_key] = $this->registry->output->formSimpleInput($_version_key, isset($this->request[$_version_key]) ? $this->request[$_version_key] : $hookData['hook_requirements'][$_version_key], 20);
     }
     /* Setup the global caches DD */
     $_caches = array();
     $this->DB->build(array('select' => 'cs_key', 'from' => 'cache_store', 'order' => 'cs_key ASC'));
     $this->DB->execute();
     while ($gc = $this->DB->fetch()) {
         $_caches[] = array($gc['cs_key'], $gc['cs_key']);
     }
     sort($_caches);
     $form['hook_global_caches'] = $this->registry->output->formMultiDropdown('hook_global_caches[]', $_caches, isset($_POST['hook_global_caches']) ? $_POST['hook_global_caches'] : explode(',', $hookData['hook_global_caches']), 15);
//.........这里部分代码省略.........
开发者ID:ConnorChristie,项目名称:GrabViews,代码行数:101,代码来源:hooks.php


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