/**
  * Generates plugin page options markup - Calls parent::generateView()
  *
  * @return str view markup
  */
 protected function generateView()
 {
     // if we have some p[lugin option elements defined
     // render them and add to the parent view...
     if (count($this->option_elements) > 0) {
         $this->setValues();
         $view_mgr = new ViewManager();
         $view_mgr->disableCaching();
         // assign data
         $view_mgr->assign('option_elements', $this->option_elements);
         $view_mgr->assign('option_elements_json', json_encode($this->option_elements));
         $view_mgr->assign('option_headers', $this->option_headers);
         $view_mgr->assign('option_not_required', $this->option_not_required);
         $view_mgr->assign('option_not_required_json', json_encode($this->option_not_required));
         $view_mgr->assign('option_required_message', $this->option_required_message);
         $view_mgr->assign('option_required_message_json', json_encode($this->option_required_message));
         $view_mgr->assign('option_select_multiple', $this->option_select_multiple);
         $view_mgr->assign('option_select_visible', $this->option_select_visible);
         $view_mgr->assign('plugin_id', $this->plugin_id);
         $view_mgr->assign('user_is_admin', $this->isAdmin());
         $options_markup = '';
         if ($this->profiler_enabled) {
             $view_start_time = microtime(true);
             $options_markup = $view_mgr->fetch(self::OPTIONS_TEMPLATE);
             $view_end_time = microtime(true);
             $total_time = $view_end_time - $view_start_time;
             $profiler = Profiler::getInstance();
             $profiler->add($total_time, "Rendered view (not cached)", false);
         } else {
             $options_markup = $view_mgr->fetch(self::OPTIONS_TEMPLATE);
         }
         $this->addToView('options_markup', $options_markup);
     }
     return parent::generateView();
 }
예제 #2
0
 /**
  * Turn off caching
  * Provided in case an individual controller wants to override the application-wide setting.
  */
 protected function disableCaching()
 {
     $this->view_mgr->disableCaching();
 }