From 06df3920059f3ea861655d7d844d734adac7d649 Mon Sep 17 00:00:00 2001 From: rvelices Date: Sat, 16 Aug 2008 01:32:37 +0000 Subject: - optim dont include a php file if not required - eng lang small change - remove link to unexisting admin css git-svn-id: http://piwigo.org/svn/trunk@2476 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/common.inc.php | 5 ++--- include/filter.inc.php | 1 + include/template.class.php | 31 ++++++++++++++----------------- 3 files changed, 17 insertions(+), 20 deletions(-) (limited to 'include') diff --git a/include/common.inc.php b/include/common.inc.php index 285d1bdb3..d87b8728a 100644 --- a/include/common.inc.php +++ b/include/common.inc.php @@ -189,14 +189,14 @@ if (is_a_guest()) // template instance if ( - defined('IN_ADMIN') and IN_ADMIN + defined('IN_ADMIN') and IN_ADMIN ) { // Admin template //$template = new Template(PHPWG_ROOT_PATH.'template/'.$user['admin_template'], $user['admin_theme'] ); list($user['admin_template'], $user['admin_theme']) = explode ('/', $conf['admin_layout']); - $template = new Template(PHPWG_ROOT_PATH.'admin/template/' + $template = new Template(PHPWG_ROOT_PATH.'admin/template/' . $user['admin_template'], $user['admin_theme'] ); } else @@ -263,7 +263,6 @@ if (count($header_msgs) > 0) if (!empty($conf['filter_pages']) and get_filter_page_value('used')) { - include(PHPWG_ROOT_PATH.'include/functions_filter.inc.php'); include(PHPWG_ROOT_PATH.'include/filter.inc.php'); } else diff --git a/include/filter.inc.php b/include/filter.inc.php index d63515265..511b9e0a2 100644 --- a/include/filter.inc.php +++ b/include/filter.inc.php @@ -126,6 +126,7 @@ WHERE '; { $header_notes[] = l10n_dec('note_filter_day', 'note_filter_days', $filter['recent_period']); } + include_once(PHPWG_ROOT_PATH.'include/functions_filter.inc.php'); } else { diff --git a/include/template.class.php b/include/template.class.php index 43bed8ae0..b51624929 100644 --- a/include/template.class.php +++ b/include/template.class.php @@ -145,7 +145,7 @@ class Template { */ function set_filenames($filename_array) { - global $conf; + global $conf; if (!is_array($filename_array)) { return false; @@ -159,16 +159,16 @@ class Template { unset( $this->files[$handle] ); else { - if (!isset($this->files[$handle])) $this->files[$handle] = $filename; + $this->files[$handle] = $filename; foreach ($tpl_extension as $file => $conditions) { $localtpl = './template-extension/' . $file; - if ($handle == $conditions[0] and - (stripos(implode('/',array_flip($_GET)),$conditions[1])>0 + if ($handle == $conditions[0] and + (stripos(implode('/',array_flip($_GET)),$conditions[1])>0 or $conditions[1] == 'N/A') and file_exists($localtpl)) { /* examples: Are best_rated, created-monthly-calendar, list, ... set? */ - $this->files[$handle] = '../.' . $localtpl; + $this->files[$handle] = '../.' . $localtpl; /* assign their tpl-extension */ } } @@ -176,10 +176,7 @@ class Template { } return true; } - function on_extension($key, $tlpname) - { - return $tplname; - } + /** see smarty assign http://www.smarty.net/manual/en/api.assign.php */ function assign($tpl_var, $value = null) { @@ -256,14 +253,14 @@ class Template { $save_compile_id = $this->smarty->compile_id; $this->smarty->compile_id .= '.'.$lang_info['code']; } - + $v = $this->smarty->fetch($this->files[$handle], null, null, false); - + if (isset ($save_compile_id) ) { $this->smarty->compile_id = $save_compile_id; } - + if ($return) { return $v; @@ -335,12 +332,12 @@ class Template { { return explode($delimiter, $text); } - + /** * This smarty "html_head" block allows to add content just before * element in the output after the head has been parsed. This is * handy in order to respect strict standards when