aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2007-09-20 23:45:23 +0000
committerrvelices <rv-github@modusoptimus.com>2007-09-20 23:45:23 +0000
commit179106efaff17b4fa25667381244ebc46789885e (patch)
tree4028ff34f051574b8afc93d922bcca4b2473d38f /include
parentc5970aba221881d9788197115fd17ab863d72269 (diff)
- removed unused code from the calendar
- removed some unused css rules, simplified css a bit and made some rule grouping (nothing important) git-svn-id: http://piwigo.org/svn/trunk@2101 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include')
-rw-r--r--include/calendar_base.class.php38
-rw-r--r--include/calendar_monthly.class.php4
-rw-r--r--include/picture_comment.inc.php11
3 files changed, 19 insertions, 34 deletions
diff --git a/include/calendar_base.class.php b/include/calendar_base.class.php
index bc8c6a7be..67282190c 100644
--- a/include/calendar_base.class.php
+++ b/include/calendar_base.class.php
@@ -3,8 +3,7 @@
// | PhpWebGallery - a PHP based picture gallery |
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
// +-----------------------------------------------------------------------+
-// | branch : BSF (Best So Far)
-// | file : $RCSfile$
+// | file : $Id$
// | last update : $Date$
// | last modifier : $Author$
// | revision : $Revision$
@@ -133,14 +132,13 @@ class CalendarBase
*
* @param array date_components
* @param array items - hash of items to put in the bar (e.g. 2005,2006)
- * @param array selected_item - item currently selected (e.g. 2005)
* @param string class_prefix - html class attribute prefix for span elements
* @param bool show_any - adds any link to the end of the bar
* @param bool show_empty - shows all labels even those without items
* @param array labels - optional labels for items (e.g. Jan,Feb,...)
* @return string the navigation bar
*/
- function get_nav_bar_from_items($date_components, $items, $selected_item,
+ function get_nav_bar_from_items($date_components, $items,
$class_prefix, $show_any,
$show_empty=false, $labels=null)
{
@@ -167,12 +165,7 @@ class CalendarBase
{
$label = $labels[$item];
}
- if (isset($selected_item) and $item == $selected_item)
- {
- $nav_bar .= '<span class="'.$class_prefix.'Sel">';
- $nav_bar .= $label;
- }
- elseif ($nb_images==-1)
+ if ($nb_images==-1)
{
$nav_bar .= '<span class="'.$class_prefix.'Empty">';
$nav_bar .= $label;
@@ -199,22 +192,14 @@ class CalendarBase
count($date_components)<count($this->calendar_levels)-1 )
{
$label = l10n('calendar_any');
- if (isset($selected_item) and 'any' === $selected_item)
- {
- $nav_bar .= '<span class="'.$class_prefix.'Sel">';
- $nav_bar .= $label;
- }
- else
- {
- $nav_bar .= '<span class="'.$class_prefix.'">';
- $url = duplicate_index_url(
- array('chronology_date'=>array_merge($date_components,array('any'))),
- array( 'start' )
- );
- $nav_bar .= '<a href="'.$url.'">';
- $nav_bar .= $label;
- $nav_bar .= '</a>';
- }
+ $nav_bar .= '<span class="'.$class_prefix.'">';
+ $url = duplicate_index_url(
+ array('chronology_date'=>array_merge($date_components,array('any'))),
+ array( 'start' )
+ );
+ $nav_bar .= '<a href="'.$url.'">';
+ $nav_bar .= $label;
+ $nav_bar .= '</a>';
$nav_bar.= '</span>';
}
return $nav_bar;
@@ -271,7 +256,6 @@ SELECT DISTINCT('.$this->calendar_levels[$level]['sql']
$nav_bar = $this->get_nav_bar_from_items(
$dates,
$level_items,
- null,
'calItem',
true,
true,
diff --git a/include/calendar_monthly.class.php b/include/calendar_monthly.class.php
index c7822394b..7200dff09 100644
--- a/include/calendar_monthly.class.php
+++ b/include/calendar_monthly.class.php
@@ -257,7 +257,7 @@ function build_global_calendar()
$nav_bar .= '</span><br>';
$nav_bar .= $this->get_nav_bar_from_items( $chronology_date,
- $year_data['children'], null, 'calCal', false, false, $lang['month'] );
+ $year_data['children'], 'calCal', false, false, $lang['month'] );
$template->assign_block_vars( 'calendar.calbar',
array( 'BAR' => $nav_bar)
@@ -308,7 +308,7 @@ function build_year_calendar()
$nav_bar .= '</span><br>';
$nav_bar .= $this->get_nav_bar_from_items( $chronology_date,
- $month_data['children'], null, 'calCal', false );
+ $month_data['children'], 'calCal', false );
$template->assign_block_vars( 'calendar.calbar',
array( 'BAR' => $nav_bar)
diff --git a/include/picture_comment.inc.php b/include/picture_comment.inc.php
index 6370544a7..971336fba 100644
--- a/include/picture_comment.inc.php
+++ b/include/picture_comment.inc.php
@@ -55,7 +55,7 @@ if ( $page['show_comments'] and isset( $_POST['content'] ) )
);
include_once(PHPWG_ROOT_PATH.'include/functions_comment.inc.php');
-
+
$comment_action = insert_user_comment($comm, @$_POST['key'], $infos );
switch ($comment_action)
@@ -65,7 +65,7 @@ if ( $page['show_comments'] and isset( $_POST['content'] ) )
case 'validate':
array_push( $infos, l10n('comment_added'));
break;
- case 'reject':
+ case 'reject':
set_status_header(403);
array_push($infos, l10n('comment_not_added') );
break;
@@ -73,11 +73,12 @@ if ( $page['show_comments'] and isset( $_POST['content'] ) )
trigger_error('Invalid comment action '.$comment_action, E_USER_WARNING);
}
+ $block_var = ($comment_action=='reject') ? 'errors.error' : 'infos.info';
foreach ($infos as $info)
{
$template->assign_block_vars(
- 'information',
- array( 'INFORMATION'=>$info )
+ $block_var,
+ array( 'TEXT'=>$info )
);
}
@@ -136,7 +137,7 @@ SELECT id,author,date,image_id,content
$template->assign_block_vars(
'comments.comment',
array(
- 'COMMENT_AUTHOR' => trigger_event('render_comment_author',
+ 'COMMENT_AUTHOR' => trigger_event('render_comment_author',
empty($row['author'])
? l10n('guest')
: $row['author']),