Пример #1
0
 /**
  * @param $navigation
  */
 public function addMailTplNav(IfwPsn_Vendor_Zend_Navigation $navigation)
 {
     $page = new IfwPsn_Zend_Navigation_Page_WpMvc(array('label' => __('Mail templates', 'psn'), 'controller' => 'index', 'action' => 'adMailTpl', 'page' => $this->_pm->getPathinfo()->getDirname(), 'route' => 'requestVars'));
     $page->set('exactActiveMatch', true);
     $navigation->addPage($page);
     IfwPsn_Wp_Proxy_Action::doPlugin($this->_pm, 'after_admin_navigation_htmlmails', $navigation);
 }
Пример #2
0
 /**
  * Decides which function to call
  */
 public function _callback()
 {
     if ($this->getCallback() instanceof IfwPsn_Wp_Plugin_Application_PageMapperInterface) {
         $this->getCallback()->handlePage($this);
     } elseif (is_callable($this->getCallback())) {
         call_user_func($this->getCallback());
     } else {
         IfwPsn_Wp_Proxy_Action::doPlugin($this->_pm, 'submenu_page_callback', $this);
     }
 }
Пример #3
0
    /**
     * @see IfwPsn_Wp_Plugin_Admin_Menu_Metabox_Abstract::render()
     */
    public function render()
    {
        require_once IFW_PSN_LIB_ROOT . '/IfwPsn/Vendor/Zend/View.php';
        $testMailForm = new Psn_Admin_Form_TestMail(array('action' => IfwPsn_Wp_Proxy_Admin::getUrl() . IfwPsn_Wp_Proxy_Admin::getMenuUrl($this->_pm, 'service', 'send-test-mail')));
        IfwPsn_Wp_Proxy_Action::doPlugin($this->_pm, 'testmail_form', $testMailForm);
        $testMailForm->setView(new IfwPsn_Vendor_Zend_View());
        ?>

        <p><?php 
        _e('Send a test email to check the general email functionality of your WordPress installation. Settings in the options section will be considered (e.g. SMTP).', 'psn');
        ?>
</p>
        <?php 
        echo $testMailForm;
        ?>
        <?php 
    }
Пример #4
0
 /**
  * @param IfwPsn_Vendor_Zend_Controller_Request_Abstract $request
  * @param IfwPsn_Vendor_Zend_Controller_Response_Abstract $response
  * @throws Exception
  */
 public function initController(IfwPsn_Wp_Plugin_Manager $pm, IfwPsn_Vendor_Zend_Controller_Request_Abstract $request = null, IfwPsn_Vendor_Zend_Controller_Response_Abstract $response = null)
 {
     if (!$this->getParam('noErrorHandler') && !$this->_plugins->hasPlugin('IfwPsn_Vendor_Zend_Controller_Plugin_ErrorHandler')) {
         // Register with stack index of 100
         //require_once 'IfwZend/Controller/Plugin/ErrorHandler.php';
         $this->_plugins->registerPlugin(new IfwPsn_Vendor_Zend_Controller_Plugin_ErrorHandler(), 100);
     }
     if (!$this->getParam('noViewRenderer') && !IfwPsn_Vendor_Zend_Controller_Action_HelperBroker::hasHelper('viewRenderer')) {
         //require_once 'IfwZend/Controller/Action/Helper/ViewRenderer.php';
         IfwPsn_Vendor_Zend_Controller_Action_HelperBroker::getStack()->offsetSet(-80, new IfwPsn_Vendor_Zend_Controller_Action_Helper_ViewRenderer());
     }
     /**
      * Instantiate default request object (HTTP version) if none provided
      */
     if (null !== $request) {
         $this->setRequest($request);
     } elseif (null === $request && null === ($request = $this->getRequest())) {
         //require_once 'IfwZend/Controller/Request/Http.php';
         $request = new IfwPsn_Vendor_Zend_Controller_Request_Http();
         $this->setRequest($request);
     }
     $request->setActionKey($pm->getConfig()->getActionKey());
     /**
      * Set base URL of request object, if available
      */
     if (is_callable(array($this->_request, 'setBaseUrl'))) {
         if (null !== $this->_baseUrl) {
             $this->_request->setBaseUrl($this->_baseUrl);
         }
     }
     /**
      * Instantiate default response object (HTTP version) if none provided
      */
     if (null !== $response) {
         $this->setResponse($response);
     } elseif (null === $this->_response && null === ($this->_response = $this->getResponse())) {
         //require_once 'IfwZend/Controller/Response/Http.php';
         $response = new IfwPsn_Vendor_Zend_Controller_Response_Http();
         $this->setResponse($response);
     }
     //IfwPsn_Wp_Proxy_Action::doPlugin($pm, 'before_controller_init', $this);
     /**
      * Register request and response objects with plugin broker
      */
     $this->_plugins->setRequest($this->_request)->setResponse($this->_response);
     IfwPsn_Wp_Proxy_Action::doPlugin($pm, 'before_controller_init', $this);
     /**
      * Initialize router
      */
     $router = $this->getRouter();
     $router->setParams($this->getParams());
     /**
      * Initialize dispatcher
      */
     $dispatcher = $this->getDispatcher();
     $dispatcher->setParams($this->getParams())->setResponse($this->_response);
     // Begin dispatch
     try {
         /**
          * Route request to controller/action, if a router is provided
          */
         /**
          * Notify plugins of router startup
          */
         $this->_plugins->routeStartup($this->_request);
         try {
             $router->route($this->_request);
         } catch (Exception $e) {
             throw $e;
         }
         /**
          * Needed for custom route RequestVars
          */
         $this->_plugins->routeShutdown($this->_request);
         /**
          * skip plugins dispatchLoopStartup on initController
          */
         //$this->_plugins->dispatchLoopStartup($this->_request);
         /**
          *  Attempt to dispatch the controller/action. If the $this->_request
          *  indicates that it needs to be dispatched, move to the next
          *  action in the request.
          */
         do {
             $this->_request->setDispatched(true);
             /**
              * skip plugins preDispatch on initController
              */
             $this->_plugins->preDispatch($this->_request);
             /**
              * Skip requested action if preDispatch() has reset it
              */
             //if (!$this->_request->isDispatched()) {
             //    continue;
             //}
             /**
              * init controller
              */
             try {
                 // this will add custom WP action to the controller object
                 $dispatcher->initController($this->_request, $this->_response);
             } catch (Exception $e) {
                 throw $e;
             }
             /**
              * skip plugins postDispatch on initController
              */
             //$this->_plugins->postDispatch($this->_request);
         } while (!$this->_request->isDispatched());
     } catch (Exception $e) {
         throw $e;
     }
 }
Пример #5
0
 /**
  * @var IfwPsn_Wp_Plugin_Menu_Page_Sub $subPage
  * @return $this
  */
 public function registerSubPage(IfwPsn_Wp_Plugin_Menu_Page_Sub $subPage)
 {
     array_push($this->_subPages, $subPage);
     IfwPsn_Wp_Proxy_Action::doPlugin($this->_pm, 'after_register_submenu_page', $subPage);
     return $this;
 }
Пример #6
0
 /**
  * Loads the modules after preBootstrap objects are initialized
  */
 private function _moduleBootstrap()
 {
     require_once $this->_pm->getPathinfo()->getRootLib() . 'IfwPsn/Wp/Module/Manager.php';
     $this->_moduleManager = new IfwPsn_Wp_Module_Manager($this->_pm);
     IfwPsn_Wp_Proxy_Action::doPlugin($this->_pm, 'before_modules_load', $this->_moduleManager);
     $pluginConfig = $this->_pm->getConfig()->plugin;
     if (!isset($pluginConfig->simulateLiteVersion) || empty($pluginConfig->simulateLiteVersion)) {
         $this->_moduleManager->load();
     }
     $this->_notifyObservers(self::OBSERVER_POST_MODULES);
     // register module controller path before controller init
     IfwPsn_Wp_Proxy_Action::addPlugin($this->_pm, 'before_controller_init', array($this->_moduleManager, 'registerModules'));
 }