aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2007-02-07 21:23:33 +0000
committerplegall <plg@piwigo.org>2007-02-07 21:23:33 +0000
commit3c8775b25255a2be4f561b1c0ede275cbae3f73b (patch)
tree16d21c0034081f1d730ddf3d60ad2eca1ca43cc1
parent15b3774482b086f4f34f440763d11d00f7e2b04e (diff)
Feature 638 added: "Fixed navigation bar" extension integration.
git-svn-id: http://piwigo.org/svn/trunk@1787 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--picture.php90
-rw-r--r--template/yoga/icon/first_unactive.pngbin0 -> 1573 bytes
-rw-r--r--template/yoga/icon/last_unactive.pngbin0 -> 1556 bytes
-rw-r--r--template/yoga/icon/left_unactive.pngbin0 -> 1574 bytes
-rw-r--r--template/yoga/icon/right_unactive.pngbin0 -> 1556 bytes
-rw-r--r--template/yoga/picture.tpl18
6 files changed, 74 insertions, 34 deletions
diff --git a/picture.php b/picture.php
index a177b9b47..1200e4c33 100644
--- a/picture.php
+++ b/picture.php
@@ -43,13 +43,19 @@ if (isset($page['category']))
// displayed, and execution is stopped
if (!in_array($page['image_id'], $page['items']))
{
- page_not_found('The requested image does not belong to this image set',
- duplicate_index_url() );
+ page_not_found(
+ 'The requested image does not belong to this image set',
+ duplicate_index_url()
+ );
}
// add default event handler for rendering element content
-add_event_handler('render_element_content', 'default_picture_content',
- EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
+add_event_handler(
+ 'render_element_content',
+ 'default_picture_content',
+ EVENT_HANDLER_PRIORITY_NEUTRAL,
+ 2
+ );
trigger_action('loc_begin_picture');
// this is the default handler that generates the display for the element
@@ -63,10 +69,16 @@ function default_picture_content($content, $element_info)
{ // nothing to do
return $content;
}
+
global $user;
- $my_template = new Template(PHPWG_ROOT_PATH.'template/'.$user['template'],
- $user['theme'] );
- $my_template->set_filenames( array('default_content'=>'picture_content.tpl') );
+
+ $my_template = new Template(
+ PHPWG_ROOT_PATH.'template/'.$user['template'],
+ $user['theme']
+ );
+ $my_template->set_filenames(
+ array('default_content'=>'picture_content.tpl')
+ );
if (isset($element_info['high_url']))
{
@@ -89,8 +101,6 @@ function default_picture_content($content, $element_info)
return $my_template->parse( 'default_content', true);
}
-
-
// +-----------------------------------------------------------------------+
// | initialization |
// +-----------------------------------------------------------------------+
@@ -211,8 +221,10 @@ UPDATE '.CATEGORIES_TABLE.'
case 'rate' :
{
include_once(PHPWG_ROOT_PATH.'include/functions_rate.inc.php');
- rate_picture($page['image_id'],
- isset($_POST['rate']) ? $_POST['rate'] : $_GET['rate'] );
+ rate_picture(
+ $page['image_id'],
+ isset($_POST['rate']) ? $_POST['rate'] : $_GET['rate']
+ );
redirect($url_self);
}
case 'delete_comment' :
@@ -395,8 +407,10 @@ if (empty($picture['current']['width']))
if (!empty($picture['current']['width']))
{
- list($picture['current']['scaled_width'],$picture['current']['scaled_height']) =
- get_picture_size(
+ list(
+ $picture['current']['scaled_width'],
+ $picture['current']['scaled_height']
+ ) = get_picture_size(
$picture['current']['width'],
$picture['current']['height'],
@$user['maxwidth'],
@@ -419,8 +433,8 @@ $title = $picture['current']['name'];
$refresh = 0;
if ( isset( $_GET['slideshow'] ) and isset($page['next_item']) )
{
- // $redirect_msg, $refresh, $url_link and $title are required for creating an automated
- // refresh page in header.tpl
+ // $redirect_msg, $refresh, $url_link and $title are required for creating
+ // an automated refresh page in header.tpl
$refresh= $_GET['slideshow'];
$url_link = add_url_params(
$picture['next']['url'],
@@ -436,12 +450,15 @@ $title_nb = ($page['current_rank'] + 1).'/'.$page['cat_nb_images'];
$url_metadata = duplicate_picture_url();
// do we have a plugin that can show metadata for something else than images?
-$metadata_showable = trigger_event('get_element_metadata_available',
- (
- ($conf['show_exif'] or $conf['show_iptc'])
- and isset($picture['current']['image_path'])
+$metadata_showable = trigger_event(
+ 'get_element_metadata_available',
+ (
+ ($conf['show_exif'] or $conf['show_iptc'])
+ and isset($picture['current']['image_path'])
),
- $picture['current']['path'] );
+ $picture['current']['path']
+ );
+
if ($metadata_showable)
{
if ( !isset($_GET['metadata']) )
@@ -471,26 +488,30 @@ else {
$page['display_tpl'] = 'picture.tpl';
$page['slideshow'] = false;
}
-// maybe someone wants a special display (call it before page_header so that they
-// can add stylesheets)
-$element_content = trigger_event('render_element_content',
- '', $picture['current'] );
-if ( isset($picture['next']['image_url'])
- and isset($picture['next']['is_picture']) )
+// maybe someone wants a special display (call it before page_header so that
+// they can add stylesheets)
+$element_content = trigger_event(
+ 'render_element_content',
+ '',
+ $picture['current']
+ );
+
+if (isset($picture['next']['image_url'])
+ and isset($picture['next']['is_picture']))
{
- $template->assign_block_vars( 'prefetch',
+ $template->assign_block_vars(
+ 'prefetch',
array (
'URL' => $picture['next']['image_url']
- )
- );
+ )
+ );
}
$template->set_filenames(array( 'picture' => $page['display_tpl'] ));
-
//------------------------------------------------------- navigation management
-foreach ( array('first','previous','next','last') as $which_image )
+foreach (array('first','previous','next','last') as $which_image)
{
if (isset($picture[$which_image]))
{
@@ -503,6 +524,13 @@ foreach ( array('first','previous','next','last') as $which_image )
)
);
}
+ else
+ {
+ $template->assign_block_vars(
+ $which_image.'_unactive',
+ array()
+ );
+ }
}
$template->assign_vars(
diff --git a/template/yoga/icon/first_unactive.png b/template/yoga/icon/first_unactive.png
new file mode 100644
index 000000000..f0c0364f2
--- /dev/null
+++ b/template/yoga/icon/first_unactive.png
Binary files differ
diff --git a/template/yoga/icon/last_unactive.png b/template/yoga/icon/last_unactive.png
new file mode 100644
index 000000000..90469d5c4
--- /dev/null
+++ b/template/yoga/icon/last_unactive.png
Binary files differ
diff --git a/template/yoga/icon/left_unactive.png b/template/yoga/icon/left_unactive.png
new file mode 100644
index 000000000..0aefc64e4
--- /dev/null
+++ b/template/yoga/icon/left_unactive.png
Binary files differ
diff --git a/template/yoga/icon/right_unactive.png b/template/yoga/icon/right_unactive.png
new file mode 100644
index 000000000..cf2f9614c
--- /dev/null
+++ b/template/yoga/icon/right_unactive.png
Binary files differ
diff --git a/template/yoga/picture.tpl b/template/yoga/picture.tpl
index 99056b8ad..c90271b07 100644
--- a/template/yoga/picture.tpl
+++ b/template/yoga/picture.tpl
@@ -40,16 +40,28 @@
<!-- BEGIN last -->
<a class="navButton prev" href="{last.U_IMG}" title="{lang:last_page} : {last.TITLE_IMG}" rel="last"><img src="{pwg_root}{themeconf:icon_dir}/last.png" class="button" alt="{lang:last_page}"></a>
<!-- END last -->
+<!-- BEGIN last_unactive -->
+ <a class="navButton prev"><img src="{pwg_root}{themeconf:icon_dir}/last_unactive.png" class="button" alt="{lang:last_page}"></a>
+<!-- END last_unactive -->
<!-- BEGIN next -->
- <a class="navButton next" href="{next.U_IMG}" title="{lang:next_page} : {next.TITLE_IMG}" rel="next"><img src="{pwg_root}{themeconf:icon_dir}/right.png" class="button" alt="{lang:next_page}"></a>
+ <a class="navButton next" href="{next.U_IMG}" title="{L_NEXT_IMG}{next.TITLE_IMG}" rel="next"><img src="{pwg_root}{themeconf:icon_dir}/right.png" class="button" alt="{lang:next_page}"></a>
<!-- END next -->
- <a class="navButton up" href="{U_UP}" title="{lang:thumbnails}" rel="up"><img src="{pwg_root}{themeconf:icon_dir}/up.png" class="button" alt="{lang:home}"></a>
+<!-- BEGIN next_unactive -->
+ <a class="navButton next"><img src="{pwg_root}{themeconf:icon_dir}/right_unactive.png" class="button" alt="{lang:next_page}"></a>
+<!-- END next_unactive -->
+ <a class="navButton up" href="{U_UP}" title="{lang:thumbnails}" rel="up"><img src="{pwg_root}{themeconf:icon_dir}/up.png" class="button" alt="{L_UP_ALT}"></a>
<!-- BEGIN previous -->
- <a class="navButton prev" href="{previous.U_IMG}" title="{lang:previous_page} : {previous.TITLE_IMG}" rel="prev"><img src="{pwg_root}{themeconf:icon_dir}/left.png" class="button" alt="{lang:previous_page}"></a>
+ <a class="navButton prev" href="{previous.U_IMG}" title="{L_PREV_IMG}{previous.TITLE_IMG}" rel="prev"><img src="{pwg_root}{themeconf:icon_dir}/left.png" class="button" alt="{lang:previous_page}"></a>
<!-- END previous -->
+<!-- BEGIN previous_unactive -->
+ <a class="navButton prev"><img src="{pwg_root}{themeconf:icon_dir}/left_unactive.png" class="button" alt="{lang:previous_page}"></a>
+<!-- END previous_unactive -->
<!-- BEGIN first -->
<a class="navButton prev" href="{first.U_IMG}" title="{lang:first_page} : {first.TITLE_IMG}" rel="first"><img src="{pwg_root}{themeconf:icon_dir}/first.png" class="button" alt="{lang:first_page}"></a>
<!-- END first -->
+<!-- BEGIN first_unactive -->
+ <a class="navButton prev"><img src="{pwg_root}{themeconf:icon_dir}/first_unactive.png" class="button" alt="{lang:first_page}"></a>
+<!-- END first_unactive -->
</div>
</div> <!-- imageToolBar -->