Beispiel #1
0
 /**
  * Initialisation for the renderer, assignment of default values, boot up of the master template
  *
  * @param object $oTpl Templating renderer. Instance of PPI_Interface_Template
  * @param string $p_tplFile The template file to render
  * @param array $p_tplParams Optional user defined parameres
  * @return void
  */
 function setupRenderer(PPI_Interface_Template $oTpl, $p_tplFile, $p_tplParams = array(), $p_oConfig)
 {
     $oSession = PPI_Helper::getSession();
     // Default View Values
     if (!empty($p_tplParams)) {
         foreach ($p_tplParams as $key => $val) {
             $oTpl->assign($key, $val);
         }
     }
     $p_tplFile = PPI_Helper::checkExtension($p_tplFile, $oTpl->getTemplateExtension());
     // Plugin View Detection
     $sPath = defined('PLUGINVIEWPATH') ? PLUGINVIEWPATH : APPFOLDER . 'View/';
     // View Directory Preparation By Theme
     $sViewDir = $sPath . $p_oConfig->layout->view_theme . '/';
     // Get the default view vars that come when you load a view page.
     $defaultViewVars = $this->getDefaultRenderValues(array('viewDir' => $sViewDir, 'actionFile' => $p_tplFile), $p_oConfig);
     foreach ($defaultViewVars as $varName => $viewVar) {
         $oTpl->assign($varName, $viewVar);
     }
     // Flash Messages
     if (!isset($p_oConfig->layout->useMessageFlash) || $p_oConfig->layout->useMessageFlash && $p_oConfig->layout->useMessageFlash == true) {
         $oTpl->assign('ppiFlashMessage', PPI_Input::getFlashMessage());
         PPI_Input::clearFlashMessage();
     }
     // Master template override from config or setTemplateFile()
     if ($this->_templateOverride !== null) {
         $sMasterTemplate = $this->_templateOverride;
     } elseif (isset($p_oConfig->layout->masterFile) && $p_oConfig->layout->masterFile != '') {
         $sMasterTemplate = $p_oConfig->layout->masterFile;
     } else {
         $sMasterTemplate = $oTpl->getDefaultMasterTemplate();
     }
     $oTpl->render($sMasterTemplate);
 }
Beispiel #2
0
 /**
  * Empty the entire HTTP POST
  *
  * @return void
  */
 protected function emptyPost()
 {
     $this->_input->emptyPost();
 }
 /**
  * Clear the flash message from the session
  *
  * @return void
  */
 protected function clearFlashMessage()
 {
     PPI_Input::clearFlashMessage();
 }