/** * Zikula_View function to get all session variables. * * This function gets all session vars from the Zikula system assigns the names and * values to two array. This is being used in pndebug to show them. * * Example * {debugenvironment} * * @param array $params All attributes passed to this function from the template. * @param Zikula_View $view Reference to the Zikula_View object. * * @return void */ function smarty_function_debugenvironment($params, Zikula_View $view) { $view->assign('_ZSession_keys', array_keys($_SESSION)); $view->assign('_ZSession_vals', array_values($_SESSION)); $view->assign('_smartyversion', $view->_version); $_theme = ModUtil::getInfoFromName('ZikulaThemeModule'); $view->assign('_themeversion', $_theme['version']); $view->assign('_force_compile', ModUtil::getVar('ZikulaThemeModule', 'force_compile') ? __('On') : __('Off')); $view->assign('_compile_check', ModUtil::getVar('ZikulaThemeModule', 'compile_check') ? __('On') : __('Off')); $view->assign('_baseurl', System::getBaseUrl()); $view->assign('_baseuri', System::getBaseUri()); $plugininfo = isset($view->_plugins['function']['zdebug']) ? $view->_plugins['function']['zdebug'] : $view->_plugins['function']['zpopup']; $view->assign('_template', $plugininfo[1]); $view->assign('_path', $view->get_template_path($plugininfo[1])); $view->assign('_line', $plugininfo[2]); }
/** * Get the timestamp of the last change of the $tpl_name file. * * @param string $tpl_name Template name. * @param string &$tpl_timestamp Template timestamp. * @param Zikula_View $view Reference to Smarty instance. * * @return boolean */ public static function z_get_timestamp($tpl_name, &$tpl_timestamp, $view) { // get path, checks also if tpl_name file_exists and is_readable $tpl_path = $view->get_template_path($tpl_name); if ($tpl_path !== false) { $tpl_timestamp = filemtime(DataUtil::formatForOS($tpl_path . '/' . $tpl_name)); return true; } return false; }
/** * This smarty output filter saves all assigned templates variables. * * @param string $output Current HTML output. * @param Zikula_View $view Current Zikula_View instance. * * @return string */ public function smartyViewoutputfilter($output, $view) { // extract template name if (isset($view->_smarty_debug_info[0])) { $template = $view->_smarty_debug_info[0]['filename']; $templatepath = $view->get_template_path($template); // extract module $templateModule = substr($templatepath, strpos($templatepath, '/') + 1); $templateModule = substr($templateModule, 0, strpos($templateModule, '/')); $this->_templates[] = array('module' => $templateModule, 'template' => $template, 'vars' => $this->removeOldModuleVars($this->removeZikulaViewVars($view->get_template_vars()))); $view->_smarty_debug_info = array(); } return $output; }