aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2010-12-30 19:47:17 +0000
committerrvelices <rv-github@modusoptimus.com>2010-12-30 19:47:17 +0000
commitff36bf3b70b58a117b7ccfe72d0f3faf58d97f34 (patch)
tree5ee59ce55e533f17b3791885538b10fa9ed9c7ce
parent2ca0da39fbf476dd144dba440f94f1ffb045f117 (diff)
index.tpl and thumbnails change: category description above thumbs and enclosing ul moved to index.tpl
fix some combine_xxx git-svn-id: http://piwigo.org/svn/trunk@8401 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--include/template.class.php21
-rw-r--r--index.php32
-rw-r--r--themes/default/template/index.tpl59
-rw-r--r--themes/default/template/thumbnails.tpl4
4 files changed, 57 insertions, 59 deletions
diff --git a/include/template.class.php b/include/template.class.php
index b5842199a..1fdb028fb 100644
--- a/include/template.class.php
+++ b/include/template.class.php
@@ -428,7 +428,7 @@ class Template {
foreach ($this->css_by_priority as $files)
$css = array_merge($css, $files);
}
-
+
$content = array();
foreach( $css as $file_ver )
{
@@ -597,7 +597,7 @@ class Template {
}
if (count($this->scriptLoader->inline_scripts))
{
- $content[]= '<script type="text/javascript">//<![CDATA[
+ $content[]= '<script type="text/javascript">//<![CDATA[
';
$content = array_merge($content, $this->scriptLoader->inline_scripts);
$content[]= '//]]></script>';
@@ -978,6 +978,7 @@ class ScriptLoader
$todo[$id] = $script;
}
}
+
foreach( array_keys($todo) as $id )
{
$this->compute_script_topological_order($id);
@@ -1019,7 +1020,7 @@ class ScriptLoader
}
return $results;
}
-
+
// checks that if B depends on A, then B->load_mode >= A->load_mode in order to respect execution order
private static function check_load_dep($scripts)
{
@@ -1041,7 +1042,7 @@ class ScriptLoader
$scripts[$precedent]->load_mode = $load;
$changed = true;
}
- if ($load==2 && $scripts[$precedent]->load_mode==2 && ($script->is_remote() or !$conf['template_combine_files']) )
+ if ($load==2 && $scripts[$precedent]->load_mode==2 && ($scripts[$precedent]->is_remote() or !$conf['template_combine_files']) )
{// we are async -> a predecessor cannot be async unlesss it can be merged; otherwise script execution order is not guaranteed
$scripts[$precedent]->load_mode = 1;
$changed = true;
@@ -1158,7 +1159,7 @@ final class FileCombiner
$is_css = $this->type == "css";
global $conf;
$key = array();
- if ($is_css)
+ if ($is_css)
$key[] = get_absolute_root_url(false);//because we modify bg url
for ($i=0; $i<count($this->files); $i++)
{
@@ -1170,7 +1171,7 @@ final class FileCombiner
$file = base_convert(crc32($key),10,36);
$file = self::OUT_SUB_DIR . $file . '.' . $this->type;
-
+
$exists = file_exists( PHPWG_ROOT_PATH . $file );
if ($exists)
{
@@ -1220,16 +1221,16 @@ final class FileCombiner
}
return $js;
}
-
+
private static function process_css($file)
{
$css = self::process_css_rec($file);
require_once(PHPWG_ROOT_PATH.'include/cssmin.class.php');
$css = CssMin::minify($css, array('emulate-css3-variables'=>false));
- $css = trigger_event('combined_css_postfilter', $css);
+ $css = trigger_event('combined_css_postfilter', $css);
return $css;
}
-
+
private static function process_css_rec($file)
{
static $PATTERN = "#url\(\s*['|\"]{0,1}(.*?)['|\"]{0,1}\s*\)#";
@@ -1243,7 +1244,7 @@ final class FileCombiner
{
$relative = dirname($file) . "/$match[1]";
$search[] = $match[0];
- $replace[] = 'url('.embellish_url(get_absolute_root_url(false)).$relative.')';
+ $replace[] = 'url('.embellish_url(get_absolute_root_url(false).$relative).')';
}
}
$css = str_replace($search, $replace, $css);
diff --git a/index.php b/index.php
index f31abe978..f4b4ebb02 100644
--- a/index.php
+++ b/index.php
@@ -26,13 +26,22 @@ define('PHPWG_ROOT_PATH','./');
include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
include(PHPWG_ROOT_PATH.'include/section_init.inc.php');
-trigger_action('loc_begin_index');
-
-// +-----------------------------------------------------------------------+
-// | Check Access and exit when user status is not ok |
-// +-----------------------------------------------------------------------+
+// Check Access and exit when user status is not ok
check_status(ACCESS_GUEST);
+if (!isset($page['start']))
+{
+ $page['start'] = 0;
+}
+
+// access authorization check
+if (isset($page['category']))
+{
+ check_restrictions($page['category']['id']);
+}
+
+trigger_action('loc_begin_index');
+
//---------------------------------------------- change of image display order
if (isset($_GET['image_order']))
{
@@ -52,17 +61,6 @@ if (isset($_GET['image_order']))
);
}
//-------------------------------------------------------------- initialization
-// detection of the start picture to display
-if (!isset($page['start']))
-{
- $page['start'] = 0;
-}
-
-// access authorization check
-if (isset($page['category']))
-{
- check_restrictions($page['category']['id']);
-}
$page['navigation_bar'] = array();
if (count($page['items']) > $user['nb_image_page'])
@@ -255,7 +253,7 @@ if ( $conf['index_sort_order_input']
}
// category comment
-if (isset($page['comment']) and $page['comment'] != '')
+if ($page['start']==0 and !isset($page['chronology_field']) and !empty($page['comment']) )
{
$template->assign('CONTENT_DESCRIPTION', $page['comment'] );
}
diff --git a/themes/default/template/index.tpl b/themes/default/template/index.tpl
index 8c68cfd8b..14d63ab18 100644
--- a/themes/default/template/index.tpl
+++ b/themes/default/template/index.tpl
@@ -3,11 +3,11 @@
<div id="content" class="content">
<div class="titrePage">
<ul class="categoryActions">
- {if !empty($image_orders) }
+ {if !empty($image_orders)}
<li>
{'Sort order'|@translate}:
<select onchange="document.location = this.options[this.selectedIndex].value;">
- {foreach from=$image_orders item=image_order }
+ {foreach from=$image_orders item=image_order}
<option value="{$image_order.URL}"{if $image_order.SELECTED} selected="selected"{/if}>{$image_order.DISPLAY}</option>
{/foreach}
</select>
@@ -75,52 +75,55 @@
</div>
{/if}
-{if isset($chronology.TITLE) }
+{if isset($chronology.TITLE)}
<h2>{$chronology.TITLE}</h2>
{/if}
-</div> <!-- titrePage -->
+</div><!-- titrePage -->
{if !empty($PLUGIN_INDEX_CONTENT_BEGIN)}{$PLUGIN_INDEX_CONTENT_BEGIN}{/if}
-{if !empty($category_search_results) }
+{if !empty($category_search_results)}
<div style="font-size:16px;margin:10px 16px">{'Album results for'|@translate} <strong>{$QUERY_SEARCH}</strong> :
- <em><strong>
- {foreach from=$category_search_results item=res name=res_loop}
- {if !$smarty.foreach.res_loop.first} &mdash; {/if}
- {$res}
- {/foreach}
- </strong></em>
+ <em><strong>
+ {foreach from=$category_search_results item=res name=res_loop}
+ {if !$smarty.foreach.res_loop.first} &mdash; {/if}
+ {$res}
+ {/foreach}
+ </strong></em>
</div>
{/if}
-{if !empty($tag_search_results) }
+{if !empty($tag_search_results)}
<div style="font-size:16px;margin:10px 16px">{'Tag results for'|@translate} <strong>{$QUERY_SEARCH}</strong> :
- <em><strong>
- {foreach from=$tag_search_results item=res name=res_loop}
- {if !$smarty.foreach.res_loop.first} &mdash; {/if}
- {$res}
- {/foreach}
- </strong></em>
+ <em><strong>
+ {foreach from=$tag_search_results item=res name=res_loop}
+ {if !$smarty.foreach.res_loop.first} &mdash; {/if}
+ {$res}
+ {/foreach}
+ </strong></em>
</div>
{/if}
-{if isset($FILE_CHRONOLOGY_VIEW) }
+{if isset($FILE_CHRONOLOGY_VIEW)}
{include file=$FILE_CHRONOLOGY_VIEW}
{/if}
-{if !empty($CATEGORIES) }{$CATEGORIES}{/if}
-{if !empty($THUMBNAILS) }{$THUMBNAILS}{/if}
-
-{if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
-
-{if !empty($CONTENT_DESCRIPTION) }
+{if !empty($CONTENT_DESCRIPTION)}
<div class="additional_info">
- {$CONTENT_DESCRIPTION}
+ {$CONTENT_DESCRIPTION}
</div>
{/if}
-{if !empty($PLUGIN_INDEX_CONTENT_END) }{$PLUGIN_INDEX_CONTENT_END}{/if}
-</div> <!-- content -->
+{if !empty($CATEGORIES)}{$CATEGORIES}{/if}
+{if !empty($THUMBNAILS)}
+<ul class="thumbnails" id="thumbnails">
+{$THUMBNAILS}
+</ul>
+{/if}
+
+{if !empty($navbar)}{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
+{if !empty($PLUGIN_INDEX_CONTENT_END)}{$PLUGIN_INDEX_CONTENT_END}{/if}
+</div><!-- content -->
{if !empty($PLUGIN_INDEX_CONTENT_AFTER)}{$PLUGIN_INDEX_CONTENT_AFTER}{/if}
diff --git a/themes/default/template/thumbnails.tpl b/themes/default/template/thumbnails.tpl
index cb00e915b..fab6f23c3 100644
--- a/themes/default/template/thumbnails.tpl
+++ b/themes/default/template/thumbnails.tpl
@@ -1,6 +1,5 @@
{if !empty($thumbnails)}
-<ul class="thumbnails">
{foreach from=$thumbnails item=thumbnail}
<li>
<span class="wrap1">
@@ -31,7 +30,4 @@
</span>
</li>
{/foreach}
-</ul>
{/if}
-
-