Exemplo n.º 1
0
 /**
  *
  */
 public function indexAction()
 {
     require_once $this->_pm->getPathinfo()->getRootLib() . 'IfwPsn/Wp/Plugin/Menu/Help.php';
     IfwPsn_Wp_Proxy_Script::loadAdmin('ace', $this->_pm->getEnv()->getUrlAdminJs() . 'lib/ace/ace.js', array(), $this->_pm->getEnv()->getVersion());
     IfwPsn_Wp_Proxy_Script::loadAdmin('psn_options', $this->_pm->getEnv()->getUrlAdminJs() . 'options.js', array(), $this->_pm->getEnv()->getVersion());
     // set up contextual help
     $help = new IfwPsn_Wp_Plugin_Menu_Help($this->_pm);
     $help->setTitle(__('Options', 'psn'))->setHelp($this->_getHelpText())->setSidebar($this->_getHelpSidebar())->load();
     $this->view->options = IfwPsn_Wp_Options::getInstance($this->_pm);
 }
Exemplo n.º 2
0
 /**
  * @param IfwPsn_Wp_Options $options
  * @param null $pageId
  */
 public function render(IfwPsn_Wp_Options $options, $pageId = null)
 {
     if ($options->getAddedFields() === 0) {
         echo '<p>' . __('No options available.', 'ifw') . '</p>';
     } else {
         if ($pageId == null) {
             $pageId = $options->getPageId();
         }
         ?>
         <form method="post" action="options.php">
             <?php 
         settings_fields($pageId);
         ?>
             <?php 
         do_settings_sections($pageId);
         ?>
             <?php 
         submit_button();
         ?>
         </form>
     <?php 
     }
 }
Exemplo n.º 3
0
 protected function _preBootstrap()
 {
     require_once $this->_pm->getPathinfo()->getRootLib() . '/IfwPsn/Wp/Options.php';
     $this->_resource = IfwPsn_Wp_Options::getInstance($this->_pm);
     $this->_resource->init();
 }