aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2008-08-16 01:32:37 +0000
committerrvelices <rv-github@modusoptimus.com>2008-08-16 01:32:37 +0000
commit06df3920059f3ea861655d7d844d734adac7d649 (patch)
treececaad845d82780e1264b09c249ddcb269ea0ccf /include
parent9824cbbc5f8f07de9c86892afa86f69c1b2e5db3 (diff)
- 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
Diffstat (limited to '')
-rw-r--r--include/common.inc.php5
-rw-r--r--include/filter.inc.php1
-rw-r--r--include/template.class.php31
3 files changed, 17 insertions, 20 deletions
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
* </head> element in the output after the head has been parsed. This is
* handy in order to respect strict standards when <style> and <link>
- * html elements must appear in the <head> element
+ * html elements must appear in the <head> element
*/
function block_html_head($params, $content, &$smarty, &$repeat)
{
@@ -357,9 +354,9 @@ class Template {
}
}
}
-
+
/**
- * Smarty prefilter to allow caching (whenever possible) language strings
+ * Smarty prefilter to allow caching (whenever possible) language strings
* from templates.
*/
function prefilter_language($source, &$smarty)
@@ -367,7 +364,7 @@ class Template {
global $lang;
$ldq = preg_quote($this->smarty->left_delimiter, '~');
$rdq = preg_quote($this->smarty->right_delimiter, '~');
-
+
$regex = "~$ldq *\'([^'$]+)\'\|@translate *$rdq~";
$source = preg_replace( $regex.'e', 'isset($lang[\'$1\']) ? $lang[\'$1\'] : \'$0\'', $source);