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


PHP EEH_Template::help_tour_stops_generator方法代码示例

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


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

示例1: _add_help_tour

 /**
  * This basically checks loaded $_page_config property to see if there are any help_tours defined.  "help_tours" is an array with properties for setting up usage of the joyride plugin
  *
  * @link http://zurb.com/playground/jquery-joyride-feature-tour-plugin
  * @see instructions regarding the format and construction of the "help_tour" array element is found in the _set_page_config() comments
  * @access protected
  * @return void
  */
 protected function _add_help_tour()
 {
     $tours = array();
     $this->_help_tour = array();
     //exit early if help tours are turned off globally
     if (!EE_Registry::instance()->CFG->admin->help_tour_activation || defined('EE_DISABLE_HELP_TOURS') && EE_DISABLE_HELP_TOURS) {
         return;
     }
     //loop through _page_config to find any help_tour defined
     foreach ($this->_page_config as $route => $config) {
         //we're only going to set things up for this route
         if ($route !== $this->_req_action) {
             continue;
         }
         if (isset($config['help_tour'])) {
             foreach ($config['help_tour'] as $tour) {
                 $file_path = $this->_get_dir() . '/help_tours/' . $tour . '.class.php';
                 //let's see if we can get that file... if not its possible this is a decaf route not set in caffienated so lets try and get the caffeinated equivalent
                 $file_path = !is_readable($file_path) ? EE_ADMIN_PAGES . basename($this->_get_dir()) . '/help_tours/' . $tour . '.class.php' : $file_path;
                 //if file is STILL not readable then let's do a EE_Error so its more graceful than a fatal error.
                 if (!is_readable($file_path)) {
                     EE_Error::add_error(sprintf(__('The file path given for the help tour (%s) is not a valid path.  Please check that the string you set for the help tour on this route (%s) is the correct spelling', 'event_espresso'), $file_path, $tour), __FILE__, __FUNCTION__, __LINE__);
                     return;
                 }
                 require_once $file_path;
                 if (!class_exists($tour)) {
                     $error_msg[] = sprintf(__('Something went wrong with loading the %s Help Tour Class.', 'event_espresso'), $tour);
                     $error_msg[] = $error_msg[0] . "\r\n" . sprintf(__('There is no class in place for the %s help tour.%s Make sure you have <strong>%s</strong> defined in the "help_tour" array for the %s route of the % admin page.', 'event_espresso'), $tour, '<br />', $tour, $this->_req_action, get_class($this));
                     throw new EE_Error(implode('||', $error_msg));
                 }
                 $a = new ReflectionClass($tour);
                 $tour_obj = $a->newInstance($this->_is_caf);
                 $tours[] = $tour_obj;
                 $this->_help_tour[$route][] = EEH_Template::help_tour_stops_generator($tour_obj);
             }
             //let's inject the end tour stop element common to all pages... this will only get seen once per machine.
             $end_stop_tour = new EE_Help_Tour_final_stop($this->_is_caf);
             $tours[] = $end_stop_tour;
             $this->_help_tour[$route][] = EEH_Template::help_tour_stops_generator($end_stop_tour);
         }
     }
     if (!empty($tours)) {
         $this->_help_tour['tours'] = $tours;
     }
     //thats it!  Now that the $_help_tours property is set (or not) the scripts and html should be taken care of automatically.
 }
开发者ID:robert-osborne,项目名称:event-espresso-core-1,代码行数:54,代码来源:EE_Admin_Page.core.php


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