- index.tpl, menubar.tpl, mainpage_categories.tpl and month_calendar.tpl go smarty

- better template debugging tweak (the smarty console is shown only once at the end)

git-svn-id: http://piwigo.org/svn/trunk@2231 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
rvelices 2008-03-01 13:12:07 +00:00
parent b2b00ba7be
commit 35076ee1b9
14 changed files with 572 additions and 636 deletions

View file

@ -1,7 +1,7 @@
<?php
// +-----------------------------------------------------------------------+
// | PhpWebGallery - a PHP based picture gallery |
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
// | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net |
// +-----------------------------------------------------------------------+
// | file : $Id$
// | last update : $Date$
@ -35,8 +35,6 @@ class CalendarBase
//
var $calendar_levels;
var $has_nav_bar;
/**
* Initialize the calendar
* @param string inner_sql used for queries (INNER JOIN or normal)
@ -53,7 +51,6 @@ class CalendarBase
$this->date_field = 'date_creation';
}
$this->inner_sql = $inner_sql;
$this->has_nav_bar = false;
}
function get_display_name()
@ -262,13 +259,12 @@ SELECT DISTINCT('.$this->calendar_levels[$level]['sql']
isset($labels) ? $labels : $this->calendar_levels[$level]['labels']
);
$template->assign_block_vars(
'calendar.navbar',
$template->append(
'chronology_navigation_bars',
array(
'BAR' => $nav_bar,
'CONTENT' => $nav_bar,
)
);
$this->has_nav_bar = true;
}
/**
@ -311,40 +307,47 @@ GROUP BY period';
}
$current_rank = $upper_items_rank[$current];
if (!$this->has_nav_bar and
($current_rank>0 or $current_rank < count($upper_items)-1 ) )
{
$template->assign_block_vars( 'calendar.navbar', array() );
}
$tpl_var = array();
if ( $current_rank>0 )
{ // has previous
$prev = $upper_items[$current_rank-1];
$chronology_date = explode('-', $prev);
$template->assign_block_vars(
'calendar.navbar.prev',
$tpl_var['previous'] =
array(
'LABEL' => $this->get_date_nice_name($prev),
'URL' => duplicate_index_url(
array('chronology_date'=>$chronology_date), array('start')
)
)
);
}
if ( $current_rank < count($upper_items)-1 )
{ // has next
$next = $upper_items[$current_rank+1];
$chronology_date = explode('-', $next);
$template->assign_block_vars(
'calendar.navbar.next',
$tpl_var['next'] =
array(
'LABEL' => $this->get_date_nice_name($next),
'URL' => duplicate_index_url(
array('chronology_date'=>$chronology_date), array('start')
)
)
);
}
if ( !empty($tpl_var) )
{
$existing = & $template->get_template_vars('chronology_navigation_bars');
if ( !empty($existing) )
{
$existing[ sizeof($existing)-1 ] =
array_merge( $existing[ sizeof($existing)-1 ], $tpl_var);
}
else
{
$template->append( 'chronology_navigation_bars', $tpl_var );
}
}
}
}
?>

View file

@ -71,16 +71,22 @@ function generate_category_content()
$view_type = $page['chronology_view'];
if ($view_type==CAL_VIEW_CALENDAR)
{
global $template;
$tpl_var = array();
if ( count($page['chronology_date'])==0 )
{//case A: no year given - display all years+months
if ($this->build_global_calendar())
if ($this->build_global_calendar($tpl_var))
{
$template->assign('chronology_calendar', $tpl_var);
return true;
}
}
if ( count($page['chronology_date'])==1 )
{//case B: year given - display all days in given year
if ($this->build_year_calendar())
if ($this->build_year_calendar($tpl_var))
{
$template->assign('chronology_calendar', $tpl_var);
$this->build_nav_bar(CYEAR); // years
return true;
}
@ -88,9 +94,10 @@ function generate_category_content()
if ( count($page['chronology_date'])==2 )
{//case C: year+month given - display a nice month calendar
$this->build_month_calendar();
//$this->build_nav_bar(CYEAR); // years
//$this->build_nav_bar(CMONTH); // month
if ( $this->build_month_calendar($tpl_var) )
{
$template->assign('chronology_calendar', $tpl_var);
}
$this->build_next_prev();
return true;
}
@ -98,7 +105,6 @@ function generate_category_content()
if ($view_type==CAL_VIEW_LIST or count($page['chronology_date'])==3)
{
$has_nav_bar = false;
if ( count($page['chronology_date'])==0 )
{
$this->build_nav_bar(CYEAR); // years
@ -213,7 +219,7 @@ function get_all_days_in_month($year, $month)
return $nb_days;
}
function build_global_calendar()
function build_global_calendar(&$tpl_var)
{
global $page;
assert( count($page['chronology_date']) == 0 );
@ -246,27 +252,27 @@ function build_global_calendar()
return false;
}
global $lang, $template;
global $lang;
foreach ( $items as $year=>$year_data)
{
$chronology_date = array( $year );
$url = duplicate_index_url( array('chronology_date'=>$chronology_date) );
$nav_bar = '<span class="calCalHead"><a href="'.$url.'">'.$year.'</a>';
$nav_bar .= ' ('.$year_data['nb_images'].')';
$nav_bar .= '</span><br>';
$nav_bar .= $this->get_nav_bar_from_items( $chronology_date,
$nav_bar = $this->get_nav_bar_from_items( $chronology_date,
$year_data['children'], 'calCal', false, false, $lang['month'] );
$template->assign_block_vars( 'calendar.calbar',
array( 'BAR' => $nav_bar)
);
$tpl_var['calendar_bars'][] =
array(
'U_HEAD' => $url,
'NB_IMAGES' => $year_data['nb_images'],
'HEAD_LABEL' => $year,
'NAV_BAR' => $nav_bar,
);
}
return true;
}
function build_year_calendar()
function build_year_calendar(&$tpl_var)
{
global $page;
assert( count($page['chronology_date']) == 1 );
@ -296,29 +302,28 @@ function build_year_calendar()
$page['chronology_date'][CMONTH] = $m;
return false;
}
global $lang, $template;
global $lang;
foreach ( $items as $month=>$month_data)
{
$chronology_date = array( $page['chronology_date'][CYEAR], $month );
$url = duplicate_index_url( array('chronology_date'=>$chronology_date) );
$nav_bar = '<span class="calCalHead"><a href="'.$url.'">';
$nav_bar .= $lang['month'][$month].'</a>';
$nav_bar .= ' ('.$month_data['nb_images'].')';
$nav_bar .= '</span><br>';
$nav_bar .= $this->get_nav_bar_from_items( $chronology_date,
$nav_bar = $this->get_nav_bar_from_items( $chronology_date,
$month_data['children'], 'calCal', false );
$template->assign_block_vars( 'calendar.calbar',
array( 'BAR' => $nav_bar)
);
$tpl_var['calendar_bars'][] =
array(
'U_HEAD' => $url,
'NB_IMAGES' => $month_data['nb_images'],
'HEAD_LABEL' => $lang['month'][$month],
'NAV_BAR' => $nav_bar,
);
}
return true;
}
function build_month_calendar()
function build_month_calendar(&$tpl_var)
{
global $page;
$query='SELECT DISTINCT(DAYOFMONTH('.$this->date_field.')) as period,
@ -358,7 +363,7 @@ SELECT id, file,tn_ext,path, width, height, DAYOFWEEK('.$this->date_field.')-1 a
$items[$day]['dow'] = $row['dow'];
}
global $lang, $template, $conf;
global $lang, $conf;
if ( !empty($items)
and $conf['calendar_month_cell_width']>0
@ -389,36 +394,15 @@ SELECT id, file,tn_ext,path, width, height, DAYOFWEEK('.$this->date_field.')-1 a
$cell_width = $conf['calendar_month_cell_width'];
$cell_height = $conf['calendar_month_cell_height'];
$template->set_filenames(
array(
'month_calendar'=>'month_calendar.tpl',
)
);
$template->assign_block_vars('calendar.thumbnails',
array(
'WIDTH'=>$cell_width,
'HEIGHT'=>$cell_height,
)
);
//fill the heading with day names
$template->assign_block_vars('calendar.thumbnails.head', array());
foreach( $wday_labels as $d => $label)
{
$template->assign_block_vars('calendar.thumbnails.head.col',
array('LABEL'=>$label)
);
}
$template->assign_block_vars('calendar.thumbnails.row', array());
$tpl_weeks = array();
$tpl_crt_week = array();
//fill the empty days in the week before first day of this month
for ($i=0; $i<$first_day_dow; $i++)
{
$template->assign_block_vars('calendar.thumbnails.row.col', array());
$template->assign_block_vars('calendar.thumbnails.row.col.blank', array());
$tpl_crt_week[] = array();
}
for ( $day = 1;
$day <= $this->get_all_days_in_month(
$page['chronology_date'][CYEAR], $page['chronology_date'][CMONTH]
@ -428,28 +412,22 @@ SELECT id, file,tn_ext,path, width, height, DAYOFWEEK('.$this->date_field.')-1 a
$dow = ($first_day_dow + $day-1)%7;
if ($dow==0 and $day!=1)
{
$template->assign_block_vars('calendar.thumbnails.row', array());
$tpl_weeks[] = $tpl_crt_week; // add finished week to week list
$tpl_crt_week = array(); // start new week
}
$template->assign_block_vars('calendar.thumbnails.row.col', array());
if ( !isset($items[$day]) )
{
$template->assign_block_vars('calendar.thumbnails.row.col.empty',
array('LABEL'=>$day));
{// empty day
$tpl_crt_week[] =
array(
'DAY' => $day
);
}
else
{
/* // first try to guess thumbnail size
if ( !empty($items[$day]['width']) )
{
$tn_size = get_picture_size(
$items[$day]['width'], $items[$day]['height'],
$conf['tn_width'], $conf['tn_height'] );
}
else*/
{// item not an image (tn is either mime type or an image)
$thumb = get_thumbnail_path($items[$day]);
$tn_size = @getimagesize($thumb);
}
$thumb = get_thumbnail_path($items[$day]);
$tn_size = @getimagesize($thumb);
$tn_width = $tn_size[0];
$tn_height = $tn_size[1];
@ -459,21 +437,21 @@ SELECT id, file,tn_ext,path, width, height, DAYOFWEEK('.$this->date_field.')-1 a
$ratio_w = $tn_width/$cell_width;
$ratio_h = $tn_height/$cell_height;
$pos_top=$pos_left=0;
$img_width=$img_height='';
$css_style = '';
if ( $ratio_w>1 and $ratio_h>1)
{// cell completely smaller than the thumbnail so we will let the browser
// resize the thumbnail
if ($ratio_w > $ratio_h )
{// thumbnail ratio compared to cell -> wide format
$img_height = 'height="'.$cell_height.'"';
$css_style = 'height:'.$cell_height.'px;';
$browser_img_width = $cell_height*$tn_width/$tn_height;
$pos_left = ($browser_img_width-$cell_width)/2;
}
else
{
$img_width = 'width="'.$cell_width.'"';
$css_style = 'width:'.$cell_width.'px;';
$browser_img_height = $cell_width*$tn_height/$tn_width;
$pos_top = ($browser_img_height-$cell_height)/2;
}
@ -484,7 +462,6 @@ SELECT id, file,tn_ext,path, width, height, DAYOFWEEK('.$this->date_field.')-1 a
$pos_top = ($tn_height-$cell_height)/2;
}
$css_style = '';
if ( round($pos_left)!=0)
{
$css_style.='left:'.round(-$pos_left).'px;';
@ -505,64 +482,32 @@ SELECT id, file,tn_ext,path, width, height, DAYOFWEEK('.$this->date_field.')-1 a
);
$alt = $wday_labels[$dow] . ' ' . $day.
' ('.sprintf("%d ".l10n('pictures'), $items[$day]['nb_images']).')';
$template->assign_block_vars('calendar.thumbnails.row.col.full',
array(
'LABEL' => $day,
'IMAGE' => $items[$day]['tn_url'],
'U_IMG_LINK'=> $url,
'STYLE' => $css_style,
'IMG_WIDTH' => $img_width,
'IMG_HEIGHT'=> $img_height,
'IMAGE_ALT' => $alt,
)
$tpl_crt_week[] =
array(
'DAY' => $day,
'IMAGE' => $items[$day]['tn_url'],
'U_IMG_LINK'=> $url,
'IMAGE_STYLE' => $css_style,
'IMAGE_ALT' => $alt,
);
}
}
//fill the empty days in the week after the last day of this month
while ( $dow<6 )
{
$template->assign_block_vars('calendar.thumbnails.row.col', array());
$template->assign_block_vars('calendar.thumbnails.row.col.blank', array());
$tpl_crt_week[] = array();
$dow++;
}
$template->assign_var_from_handle('MONTH_CALENDAR', 'month_calendar');
}
else
{
$template->assign_block_vars('thumbnails', array());
$template->assign_block_vars('thumbnails.line', array());
foreach ( $items as $day=>$data)
{
$url = duplicate_index_url(
array(
'chronology_date' =>
array(
$page['chronology_date'][CYEAR],
$page['chronology_date'][CMONTH],
$day
)
)
);
$tpl_weeks[] = $tpl_crt_week;
$thumbnail_title = $lang['day'][$data['dow']] . ' ' . $day;
$name = $thumbnail_title .' ('.$data['nb_images'].')';
$template->assign_block_vars(
'thumbnails.line.thumbnail',
array(
'IMAGE'=>$data['tn_url'],
'IMAGE_ALT'=>$data['file'],
'IMAGE_TITLE'=>$thumbnail_title,
'U_IMG_LINK'=>$url
)
$tpl_var['month_view'] =
array(
'CELL_WIDTH' => $cell_width,
'CELL_HEIGHT' => $cell_height,
'wday_labels' => $wday_labels,
'weeks' => $tpl_weeks,
);
$template->assign_block_vars(
'thumbnails.line.thumbnail.category_name',
array(
'NAME' => $name
)
);
}
}
return true;

View file

@ -2,7 +2,7 @@
// +-----------------------------------------------------------------------+
// | PhpWebGallery - a PHP based picture gallery |
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
// | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net |
// +-----------------------------------------------------------------------+
// | file : $Id$
// | last update : $Date$
@ -233,12 +233,11 @@ if (count($categories) > 0)
$icon_ts = get_icon($category['max_date_last'], $category['is_child_date_last']);
$template->assign_block_vars(
'categories.category',
$tpl_var =
array(
'SRC' => $thumbnail_src_of[$category['representative_picture_id']],
'ID' => $category['id'],
'TN_SRC' => $thumbnail_src_of[$category['representative_picture_id']],
'ALT' => $category['name'],
'TITLE' => l10n('hint_category'),
'ICON' => $icon_ts,
'URL' => make_index_url(
@ -260,8 +259,7 @@ if (count($categories) > 0)
@$category['comment'],
'subcatify_category_description')),
'NAME' => $name,
)
);
);
if ($conf['display_fromto'])
{
@ -286,16 +284,13 @@ if (count($categories) > 0)
format_date($to)
);
}
$template->assign_block_vars(
'categories.category.dates',
array(
'INFO' => $info,
)
);
$tpl_var['INFO_DATES'] = $info;
}
}
}
}//fromto
$template->append( 'category_thumbnails', $tpl_var);
//plugins need to add/modify sth in this loop ?
trigger_action('loc_index_category_thumbnail',

View file

@ -200,6 +200,9 @@ WHERE id IN (' . implode(',',$page['items']) .')';
$page['items'] = array();
$must_show_list = false;
}
$page['comment'] = '';
$template->assign('FILE_CHRONOLOGY_VIEW', 'month_calendar.tpl');
foreach ($styles as $style => $style_data)
{
@ -207,7 +210,7 @@ WHERE id IN (' . implode(',',$page['items']) .')';
{
if ( $style_data['view_calendar'] or $view != CAL_VIEW_CALENDAR)
{
$selected = '';
$selected = false;
if ($style!=$cal_style)
{
@ -231,11 +234,11 @@ WHERE id IN (' . implode(',',$page['items']) .')';
if ($style==$cal_style and $view==$page['chronology_view'] )
{
$selected = 'SELECTED';
$selected = true;
}
$template->assign_block_vars(
'calendar.views.view',
$template->append(
'chronology_views',
array(
'VALUE' => $url,
'CONTENT' => l10n('chronology_'.$style.'_'.$view),
@ -251,7 +254,7 @@ WHERE id IN (' . implode(',',$page['items']) .')';
$calendar_title = '<a href="'.$url.'">'
.$fields[$page['chronology_field']]['label'].'</a>';
$calendar_title.= $calendar->get_display_name();
$template->merge_block_vars('calendar',
$template->assign('chronology',
array(
'TITLE' => $calendar_title
)

View file

@ -2,7 +2,7 @@
// +-----------------------------------------------------------------------+
// | PhpWebGallery - a PHP based picture gallery |
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
// | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net |
// +-----------------------------------------------------------------------+
// | file : $Id$
// | last update : $Date$
@ -36,18 +36,12 @@ $template->set_filenames(
trigger_action('loc_begin_menubar');
$template->assign_vars(
$template->assign(
array(
'NB_PICTURE' => $user['nb_total_images'],
'USERNAME' => $user['username'],
'MENU_CATEGORIES_CONTENT' => get_categories_menu(),
'F_IDENTIFY' => get_root_url().'identification.php',
'U_CATEGORIES' => make_index_url(array('section' => 'categories')),
'U_REGISTER' => get_root_url().'register.php',
'U_LOST_PASSWORD' => get_root_url().'password.php',
'U_LOGOUT' => get_root_url().'?act=logout',
'U_ADMIN'=> get_root_url().'admin.php',
'U_PROFILE'=> get_root_url().'profile.php',
)
);
@ -59,30 +53,27 @@ foreach ($conf['links'] as $url => $url_data)
$url_data = array('label' => $url_data);
}
if
if
(
(!isset($url_data['eval_visible']))
or
(eval($url_data['eval_visible']))
)
{
$template->assign_block_vars(
'links.link',
array(
$tpl_var = array(
'URL' => $url,
'LABEL' => $url_data['label']
)
);
if (!isset($url_data['new_window']) or $url_data['new_window'])
{
$template->assign_block_vars(
'links.link.new_window',
$tpl_var['new_window'] =
array(
'name' => (isset($url_data['nw_name']) ? $url_data['nw_name'] : ''),
'features' => (isset($url_data['nw_features']) ? $url_data['nw_features'] : '')
)
'NAME' => (isset($url_data['nw_name']) ? $url_data['nw_name'] : ''),
'FEATURES' => (isset($url_data['nw_features']) ? $url_data['nw_features'] : '')
);
}
$template->append('links', $tpl_var);
}
}
@ -91,26 +82,22 @@ if (!empty($conf['filter_pages']) and get_filter_page_value('used'))
{
if ($filter['enabled'])
{
$template->assign_block_vars(
'stop_filter',
array(
'URL' => add_url_params(make_index_url(array()), array('filter' => 'stop'))
)
$template->assign(
'U_STOP_FILTER',
add_url_params(make_index_url(array()), array('filter' => 'stop'))
);
}
else
{
$template->assign_block_vars(
'start_filter',
array(
'URL' => add_url_params(make_index_url(array()), array('filter' => 'start-recent-'.$user['recent_period']))
)
$template->assign(
'U_START_FILTER',
add_url_params(make_index_url(array()), array('filter' => 'start-recent-'.$user['recent_period']))
);
}
}
//------------------------------------------------------------------------ tags
if ('tags' == $page['section'])
if ('tags' == @$page['section'])
{
// display tags associated to currently tagged items, less current tags
$tags = array();
@ -124,10 +111,10 @@ if ('tags' == $page['section'])
foreach ($tags as $tag)
{
$template->assign_block_vars(
'tags.tag',
$template->append(
'related_tags',
array(
'URL' => make_index_url(
'U_TAG' => make_index_url(
array(
'tags' => array($tag)
)
@ -135,40 +122,30 @@ if ('tags' == $page['section'])
'NAME' => $tag['name'],
'TITLE' => l10n('See pictures linked to this tag only'),
'CLASS' => 'tagLevel'.$tag['level'],
'CLASS' => 'tagLevel'.$tag['level']
)
);
'add' => array(
$template->assign_block_vars(
'tags.tag.add',
array(
'URL' => make_index_url(
array(
'tags' => array_merge(
$page['tags'],
array($tag)
)
'URL' => make_index_url(
array(
'tags' => array_merge(
$page['tags'],
array($tag)
)
)
),
'COUNTER' => $tag['counter'],
)
),
'TITLE' => l10n_dec(
'%d picture are also linked to current tags',
'%d pictures are also linked to current tags',
$tag['counter']),
)
);
}
}
//---------------------------------------------------------- special categories
// favorites categories
if ( !is_a_guest() )
{
$template->assign_block_vars('username', array());
$template->assign_block_vars(
'special_cat',
$template->append(
'special_categories',
array(
'URL' => make_index_url(array('section' => 'favorites')),
'TITLE' => l10n('favorite_cat_hint'),
@ -176,8 +153,8 @@ if ( !is_a_guest() )
));
}
// most visited
$template->assign_block_vars(
'special_cat',
$template->append(
'special_categories',
array(
'URL' => make_index_url(array('section' => 'most_visited')),
'TITLE' => l10n('most_visited_cat_hint'),
@ -186,8 +163,8 @@ $template->assign_block_vars(
// best rated
if ($conf['rate'])
{
$template->assign_block_vars(
'special_cat',
$template->append(
'special_categories',
array(
'URL' => make_index_url(array('section' => 'best_rated')),
'TITLE' => l10n('best_rated_cat_hint'),
@ -196,8 +173,8 @@ if ($conf['rate'])
);
}
// random
$template->assign_block_vars(
'special_cat',
$template->append(
'special_categories',
array(
'URL' => get_root_url().'random.php',
'TITLE' => l10n('random_cat_hint'),
@ -206,16 +183,16 @@ $template->assign_block_vars(
));
// recent pics
$template->assign_block_vars(
'special_cat',
$template->append(
'special_categories',
array(
'URL' => make_index_url(array('section' => 'recent_pics')),
'TITLE' => l10n('recent_pics_cat_hint'),
'NAME' => l10n('recent_pics_cat'),
));
// recent cats
$template->assign_block_vars(
'special_cat',
$template->append(
'special_categories',
array(
'URL' => make_index_url(array('section' => 'recent_cats')),
'TITLE' => l10n('recent_cats_cat_hint'),
@ -223,8 +200,8 @@ $template->assign_block_vars(
));
// calendar
$template->assign_block_vars(
'special_cat',
$template->append(
'special_categories',
array(
'URL' =>
make_index_url(
@ -244,44 +221,43 @@ $template->assign_block_vars(
if (is_a_guest())
{
$template->assign_block_vars('login', array());
$template->assign(
array(
'U_IDENTIFY' => get_root_url().'identification.php',
'AUTHORIZE_REMEMBERING' => $conf['authorize_remembering']
)
);
$template->assign_block_vars('quickconnect', array());
if ($conf['authorize_remembering'])
{
$template->assign_block_vars('quickconnect.remember_me', array());
}
if ($conf['allow_user_registration'])
{
$template->assign_block_vars('register', array());
$template->assign_block_vars('quickconnect.register', array());
$template->assign( 'U_REGISTER', get_root_url().'register.php');
}
}
else
{
$template->assign_block_vars('hello', array());
$template->assign('USERNAME', $user['username']);
if (is_autorize_status(ACCESS_CLASSIC))
{
$template->assign_block_vars('profile', array());
$template->assign('U_PROFILE', get_root_url().'profile.php');
}
// the logout link has no meaning with Apache authentication : it is not
// possible to logout with this kind of authentication.
if (!$conf['apache_authentication'])
{
$template->assign_block_vars('logout', array());
$template->assign('U_LOGOUT', get_root_url().'?act=logout');
}
if (is_admin())
{
$template->assign_block_vars('admin', array());
$template->assign('U_ADMIN', get_root_url().'admin.php');
}
}
// tags link
$template->assign_block_vars(
'summary',
$template->append(
'summaries',
array(
'TITLE' => l10n('See available tags'),
'NAME' => l10n('Tags'),
@ -290,8 +266,8 @@ $template->assign_block_vars(
);
// search link
$template->assign_block_vars(
'summary',
$template->append(
'summaries',
array(
'TITLE'=>l10n('hint_search'),
'NAME'=>l10n('search'),
@ -299,11 +275,10 @@ $template->assign_block_vars(
'REL'=> 'rel="search"'
)
);
$template->assign_block_vars( 'summary.quick_search', array() );
// comments link
$template->assign_block_vars(
'summary',
$template->append(
'summaries',
array(
'TITLE'=>l10n('hint_comments'),
'NAME'=>l10n('comments'),
@ -312,8 +287,8 @@ $template->assign_block_vars(
);
// about link
$template->assign_block_vars(
'summary',
$template->append(
'summaries',
array(
'TITLE' => l10n('about_page_title'),
'NAME' => l10n('About'),
@ -322,8 +297,8 @@ $template->assign_block_vars(
);
// notification
$template->assign_block_vars(
'summary',
$template->append(
'summaries',
array(
'TITLE'=>l10n('RSS feed'),
'NAME'=>l10n('Notification'),
@ -335,12 +310,7 @@ $template->assign_block_vars(
if (isset($page['category']) and $page['category']['uploadable'] )
{ // upload a picture in the category
$url = get_root_url().'upload.php?cat='.$page['category']['id'];
$template->assign_block_vars(
'upload',
array(
'U_UPLOAD'=> $url
)
);
$template->assign('U_UPLOAD', $url);
}
trigger_action('loc_end_menubar');

View file

@ -44,15 +44,20 @@ if (!is_a_guest())
//------------------------------------------------------------- generation time
$debug_vars = array();
if ($conf['show_queries'])
{
$debug_vars = array_merge($debug_vars, array('QUERIES_LIST' => $debug) );
}
if ($conf['show_gt'])
{
$time = get_elapsed_time($t2, get_moment());
if (!isset($page['count_queries']))
{
$page['count_queries'] = 0;
$page['queries_time'] = 0;
}
$time = get_elapsed_time($t2, get_moment());
$debug_vars = array_merge($debug_vars,
array('TIME' => $time,
@ -61,16 +66,12 @@ if ($conf['show_gt'])
);
}
if ($conf['show_queries'])
{
$debug_vars = array_merge($debug_vars, array('QUERIES_LIST' => $debug) );
}
$template->assign('debug', $debug_vars );
trigger_action('loc_end_page_tail');
//
// Generate the page
//
$template->pparse('tail');
?>
$template->parse('tail');
$template->p();
?>

View file

@ -1057,7 +1057,7 @@ class Smarty
} else {
// var non-existant, return valid reference
$_tmp = null;
return $_tmp;
return $_tmp;
}
}
@ -1116,7 +1116,7 @@ class Smarty
function fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)
{
static $_cache_info = array();
$_smarty_old_error_level = $this->debugging ? error_reporting() : error_reporting(isset($this->error_reporting)
? $this->error_reporting : error_reporting() & ~E_NOTICE);
@ -1292,11 +1292,19 @@ class Smarty
if ($display) {
if (isset($_smarty_results)) { echo $_smarty_results; }
}
if ($this->debugging) {
// capture time for debugging info
$_params = array();
require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
$this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = (smarty_core_get_microtime($_params, $this) - $_debug_start_time);
}
if ($display) {
if ($this->debugging) {
// capture time for debugging info
$_params = array();
require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
$this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = (smarty_core_get_microtime($_params, $this) - $_debug_start_time);
require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');
echo smarty_core_display_debug_console($_params, $this);
}
@ -1932,10 +1940,10 @@ class Smarty
{
return eval($code);
}
/**
* Extracts the filter name from the given callback
*
*
* @param callback $function
* @return string
*/
@ -1950,7 +1958,7 @@ class Smarty
return $function;
}
}
/**#@-*/
}

View file

@ -222,21 +222,6 @@ class Template {
* is true.
*/
function parse($handle, $return=false)
{
return $this->_pparse_or_parse($handle, $return, false);
}
/**
* Load the file for the handle, eventually compile the file and run the compiled
* code. This will print out the results of executing the template.
*/
function pparse($handle)
{
$this->_pparse_or_parse($handle, false, true);
}
/*private*/ function _pparse_or_parse($handle, $return, $immediate_display)
{
if ( !isset($this->files[$handle]) )
{
@ -253,31 +238,54 @@ class Template {
if ($is_new)
{
$this->smarty->assign( 'pwg_root', get_root_url() ); //deprecated
$this->smarty->assign( 'ROOT_URL', get_root_url() );
if ($immediate_display)
$this->p();
$v = $this->smarty->fetch($this->files[$handle], null, null, $immediate_display ? true : false);
if ($immediate_display)
return;
$v = $this->smarty->fetch($this->files[$handle], null, null, false);
}
else
{
$this->_old->set_filename( $handle, $this->files[$handle] );
$v = $this->_old->parse($handle, true);
}
if ($return==false)
if ($return)
{
$this->output .= $v;
return $v;
}
return $v;
$this->output .= $v;
}
/** flushes current output */
function p()
/**
* Load the file for the handle, eventually compile the file and run the compiled
* code. This will print out the results of executing the template.
*/
function pparse($handle)
{
$this->parse($handle, false);
echo $this->output;
$this->output='';
}
/** flushes the output */
function p()
{
$start = get_moment();
echo $this->output;
$this->output='';
if ($this->smarty->debugging)
{
global $t2;
$this->smarty->assign(
array(
'AAAA_DEBUG_OUTPUT_TIME__' => get_elapsed_time($start, get_moment()),
'AAAA_DEBUG_TOTAL_TIME__' => get_elapsed_time($t2, get_moment())
)
);
require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');
echo smarty_core_display_debug_console(null, $this->smarty);
}
}
/**
@ -315,6 +323,12 @@ class Template {
$this->smarty->append( $tpl_var, $value, $merge );
}
/** see smarty get_template_vars http://www.smarty.net/manual/en/api.get_template_vars.php */
function &get_template_vars($name=null)
{
return $this->smarty->get_template_vars( $name );
}
/** see smarty append http://www.smarty.net/manual/en/api.clear_assign.php */
function clear_assign($tpl_var)
{

110
index.php
View file

@ -103,25 +103,21 @@ if (count($page['items']) > 0)
{
$template_title.= ' ['.count($page['items']).']';
}
$template->assign_var('TITLE', $template_title);
$template->assign('TITLE', $template_title);
if (isset($page['flat']) or isset($page['chronology_field']))
{
$template->assign_block_vars(
'mode_normal',
array(
'URL' => duplicate_index_url( array(), array('chronology_field', 'start', 'flat') )
)
$template->assign(
'U_MODE_NORMAL',
duplicate_index_url( array(), array('chronology_field', 'start', 'flat') )
);
}
if (!isset($page['flat']) and 'categories' == $page['section'])
{
$template->assign_block_vars(
'flat',
array(
'URL' => duplicate_index_url(array('flat' => ''), array('start', 'chronology_field'))
)
$template->assign(
'U_MODE_FLAT',
duplicate_index_url(array('flat' => ''), array('start', 'chronology_field'))
);
}
@ -133,19 +129,15 @@ if (!isset($page['chronology_field']))
'chronology_style' => 'monthly',
'chronology_view' => 'list',
);
$template->assign_block_vars(
'mode_created',
array(
'URL' => duplicate_index_url( $chronology_params, array('start', 'flat') )
)
$template->assign(
'U_MODE_CREATED',
duplicate_index_url( $chronology_params, array('start', 'flat') )
);
$chronology_params['chronology_field'] = 'posted';
$template->assign_block_vars(
'mode_posted',
array(
'URL' => duplicate_index_url( $chronology_params, array('start', 'flat') )
)
$template->assign(
'U_MODE_POSTED',
duplicate_index_url( $chronology_params, array('start', 'flat') )
);
}
else
@ -162,9 +154,9 @@ else
array('chronology_field'=>$chronology_field ),
array('chronology_date', 'start', 'flat')
);
$template->assign_block_vars(
'mode_'.$chronology_field,
array('URL' => $url )
$template->assign(
'U_MODE_'.strtoupper($chronology_field),
$url
);
}
// include menubar
@ -172,41 +164,33 @@ include(PHPWG_ROOT_PATH.'include/menubar.inc.php');
if ('search' == $page['section'])
{
$template->assign_block_vars(
'search_rules',
array(
'URL' => get_root_url().'search_rules.php?search_id='.$page['search'],
)
$template->assign(
'U_SEARCH_RULES',
get_root_url().'search_rules.php?search_id='.$page['search']
);
}
if (isset($page['category']) and is_admin())
{
$template->assign_block_vars(
'edit',
array(
'URL' =>
get_root_url().'admin.php?page=cat_modify'
$template->assign(
'U_EDIT',
get_root_url().'admin.php?page=cat_modify'
.'&amp;cat_id='.$page['category']['id']
)
);
}
if (is_admin() and !empty($page['items']))
{
$template->assign_block_vars(
'caddie',
array(
'URL' =>
add_url_params(duplicate_index_url(), array('caddie'=>1) )
)
$template->assign(
'U_CADDIE',
add_url_params(duplicate_index_url(), array('caddie'=>1) )
);
}
if ( $page['section']=='search' and $page['start']==0 and
!isset($page['chronology_field']) and isset($page['qsearch_details']) )
{
$template->assign_var('QUERY_SEARCH',
$template->assign('QUERY_SEARCH',
htmlspecialchars($page['qsearch_details']['q']) );
$cats = array_merge(
@ -220,11 +204,7 @@ if ( $page['section']=='search' and $page['start']==0 and
{
$hints[] = get_cat_display_name( array($cat) );
}
$template->assign_block_vars( 'category_search_results',
array(
'CONTENT' => implode(' &mdash; ', $hints)
)
);
$template->assign( 'category_search_results', $hints);
}
$tags = (array)@$page['qsearch_details']['matching_tags'];
@ -239,11 +219,7 @@ if ( $page['section']=='search' and $page['start']==0 and
.$tag['name']
.'</a>';
}
$template->assign_block_vars( 'tag_search_results',
array(
'CONTENT' => implode(' &mdash; ', $hints)
)
);
$template->assign( 'tag_search_results', $hints);
}
}
@ -272,29 +248,18 @@ if (!empty($page['cat_slideshow_url']))
}
else
{
$template->assign_block_vars(
'slideshow', array('URL' => $page['cat_slideshow_url']));
$template->assign('U_SLIDESHOW', $page['cat_slideshow_url']);
}
}
// navigation bar
if ($page['navigation_bar'] != '')
{
$template->assign_block_vars(
'cat_infos.navigation',
array(
'NAV_BAR' => $page['navigation_bar'],
)
);
}
$template->assign( 'NAV_BAR', $page['navigation_bar'] );
if ( count($page['items']) > 0
and $page['section'] != 'most_visited'
and $page['section'] != 'best_rated')
{
// image order
$template->assign_block_vars( 'preferred_image_order', array() );
$order_idx = pwg_get_session_var( 'image_order', 0 );
$orders = get_category_preferred_image_orders();
@ -302,12 +267,12 @@ if ( count($page['items']) > 0
{
if ($orders[$i][2])
{
$template->assign_block_vars(
'preferred_image_order.order',
$template->append(
'image_orders',
array(
'DISPLAY' => $orders[$i][0],
'URL' => add_url_params( duplicate_index_url(), array('image_order'=>$i) ),
'SELECTED_OPTION' => ($order_idx==$i ? 'SELECTED' : ''),
'SELECTED' => ($order_idx==$i ? true:false),
)
);
}
@ -317,18 +282,13 @@ if ( count($page['items']) > 0
// category comment
if (isset($page['comment']) and $page['comment'] != '')
{
$template->assign_block_vars(
'cat_infos.comment',
array(
'COMMENTS' => $page['comment']
)
);
$template->assign('CONTENT_DESCRIPTION', $page['comment'] );
}
//------------------------------------------------------------ log informations
pwg_log();
include(PHPWG_ROOT_PATH.'include/page_header.php');
trigger_action('loc_end_index');
$template->parse('index');
$template->pparse('index');
include(PHPWG_ROOT_PATH.'include/page_tail.php');
?>

View file

@ -29,4 +29,4 @@
{if isset($debug.QUERIES_LIST)}{$debug.QUERIES_LIST}{/if}
</body>
</html>
</html>

View file

@ -1,116 +1,117 @@
<!-- DEV TAG: not smarty migrated -->
<!-- $Id$ -->
{MENUBAR}
{* $Id$ *}
{$MENUBAR}
<div id="content">
<div class="titrePage">
<ul class="categoryActions">
<li>&nbsp;</li>
<!-- BEGIN preferred_image_order -->
{if !empty($image_orders) }
<li>
{lang:Sort order}:
{'Sort order'|@translate}:
<select onchange="document.location = this.options[this.selectedIndex].value;">
<!-- BEGIN order -->
<option value="{preferred_image_order.order.URL}" {preferred_image_order.order.SELECTED_OPTION}>{preferred_image_order.order.DISPLAY}</option>
<!-- END 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>
</li>
<!-- END preferred_image_order -->
{/if}
<!-- BEGIN caddie -->
<li><a href="{caddie.URL}" title="{lang:add to caddie}"><img src="{pwg_root}{themeconf:icon_dir}/caddie_add.png" class="button" alt="{lang:caddie}"/></a></li>
<!-- END caddie -->
{if isset($U_CADDIE) }
<li><a href="{$U_CADDIE}" title="{'add to caddie'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/caddie_add.png" class="button" alt="{'caddie'|@translate}"/></a></li>
{/if}
<!-- BEGIN edit -->
<li><a href="{edit.URL}" title="{lang:edit category informations}"><img src="{pwg_root}{themeconf:icon_dir}/category_edit.png" class="button" alt="{lang:edit}"/></a></li>
<!-- END edit -->
{if isset($U_EDIT) }
<li><a href="{$U_EDIT}" title="{'edit category informations'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/category_edit.png" class="button" alt="{'edit'|@translate}"/></a></li>
{/if}
<!-- BEGIN search_rules -->
<li><a href="{search_rules.URL}" style="border:none;" onclick="popuphelp(this.href); return false;" title="{lang:Search rules}" rel="nofollow"><img src="{pwg_root}{themeconf:icon_dir}/search_rules.png" class="button" alt="(?)"></a></li>
<!-- END search_rules -->
{if isset($U_SEARCH_RULES) }
<li><a href="{$U_SEARCH_RULES}" style="border:none;" onclick="popuphelp(this.href); return false;" title="{'Search rules'|@translate}" rel="nofollow"><img src="{$ROOT_URL}{$themeconf.icon_dir}/search_rules.png" class="button" alt="(?)"></a></li>
{/if}
<!-- BEGIN slideshow -->
<li><a href="{slideshow.URL}" title="{lang:slideshow}"><img src="{pwg_root}{themeconf:icon_dir}/slideshow.png" class="button" alt="{lang:slideshow}"/></a></li>
<!-- END slideshow -->
{if isset($U_SLIDESHOW) }
<li><a href="{$U_SLIDESHOW}" title="{'slideshow'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/slideshow.png" class="button" alt="{'slideshow'|@translate}"/></a></li>
{/if}
<!-- BEGIN mode_normal -->
<li><a href="{mode_normal.URL}" title="{lang:mode_normal_hint}"><img src="{pwg_root}{themeconf:icon_dir}/normal_mode.png" class="button" alt="{lang:mode_normal_hint}"></a></li>
<!-- END mode_normal -->
{if isset($U_MODE_FLAT) }
<li><a href="{$U_MODE_FLAT}" title="{'mode_flat_hint'|@translate}" rel="nofollow"><img src="{$ROOT_URL}{$themeconf.icon_dir}/flat.png" class="button" alt="{'mode_flat_hint'|@translate}"></a></li>
{/if}
<!-- BEGIN flat -->
<li><a href="{flat.URL}" title="{lang:mode_flat_hint}" rel="nofollow"><img src="{pwg_root}{themeconf:icon_dir}/flat.png" class="button" alt="{lang:mode_flat_hint}"></a></li>
<!-- END flat -->
{if isset($U_MODE_NORMAL) }
<li><a href="{$U_MODE_NORMAL}" title="{'mode_normal_hint'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/normal_mode.png" class="button" alt="{'mode_normal_hint'|@translate}"></a></li>
{/if}
<!-- BEGIN mode_posted -->
<li><a href="{mode_posted.URL}" title="{lang:mode_posted_hint}" rel="nofollow"><img src="{pwg_root}{themeconf:icon_dir}/calendar.png" class="button" alt="{lang:mode_posted_hint}"></a></li>
<!-- END mode_posted -->
<!-- BEGIN mode_created -->
<li><a href="{mode_created.URL}" title="{lang:mode_created_hint}" rel="nofollow"><img src="{pwg_root}{themeconf:icon_dir}/calendar_created.png" class="button" alt="{lang:mode_created_hint}"></a></li>
<!-- END mode_created -->
{PLUGIN_INDEX_ACTIONS}
{if isset($U_MODE_POSTED) }
<li><a href="{$U_MODE_POSTED}" title="{'mode_posted_hint'|@translate}" rel="nofollow"><img src="{$ROOT_URL}{$themeconf.icon_dir}/calendar.png" class="button" alt="{'mode_posted_hint'|@translate}"></a></li>
{/if}
{if isset($U_MODE_CREATED) }
<li><a href="{$U_MODE_CREATED}" title="{'mode_created_hint'|@translate}" rel="nofollow"><img src="{$ROOT_URL}{$themeconf.icon_dir}/calendar_created.png" class="button" alt="{'mode_created_hint'|@translate}"></a></li>
{/if}
{if !empty($PLUGIN_INDEX_ACTIONS)}{$PLUGIN_INDEX_ACTIONS}{/if}
</ul>
<h2>{TITLE}</h2>
<!-- BEGIN calendar -->
<!-- BEGIN views -->
<div class="calendarViews">{lang:calendar_view}:
<h2>{$TITLE}</h2>
{if isset($chronology_views) }
<div class="calendarViews">{'calendar_view'|@translate}:
<select onchange="document.location = this.options[this.selectedIndex].value;">
<!-- BEGIN view -->
<option value="{calendar.views.view.VALUE}" {calendar.views.view.SELECTED}>{calendar.views.view.CONTENT}</option>
<!-- END view -->
{foreach from=$chronology_views item=view}
<option value="{$view.VALUE}"{if $view.SELECTED} selected="selected"{/if}}>{$view.CONTENT}</option>
{/foreach}
</select>
</div>
<!-- END views -->
<!-- END calendar -->
{/if}
<!-- BEGIN calendar -->
<h2>{calendar.TITLE}</h2>
<!-- END calendar -->
{if isset($chronology.TITLE) }
<h2>{$chronology.TITLE}</h2>
{/if}
</div> <!-- titrePage -->
{PLUGIN_INDEX_CONTENT_BEGIN}
{if !empty($PLUGIN_INDEX_CONTENT_END)}{$PLUGIN_INDEX_CONTENT_BEGIN}{/if}
<!-- BEGIN category_search_results -->
<div style="font-size:16px;text-align:left;margin:10px">{lang:Category results for} <strong>{QUERY_SEARCH}</strong> : <em><strong>{category_search_results.CONTENT}</strong></em></div>
<!-- END category_search_results -->
<!-- BEGIN tag_search_results -->
<div style="font-size:16px;text-align:left;margin:10px">{lang:Tag results for} <strong>{QUERY_SEARCH}</strong> : <em><strong>{tag_search_results.CONTENT}</strong></em></div>
<!-- END tag_search_results -->
<!-- BEGIN calendar -->
<!-- BEGIN navbar -->
<div class="calendarBar">
<!-- BEGIN prev -->
<div style="float:left">&laquo; <a href="{calendar.navbar.prev.URL}">{calendar.navbar.prev.LABEL}</a></div>
<!-- END prev -->
<!-- BEGIN next -->
<div style="float:right"><a href="{calendar.navbar.next.URL}">{calendar.navbar.next.LABEL}</a> &raquo;</div>
<!-- END next -->
{calendar.navbar.BAR}&nbsp;
{if !empty($category_search_results) }
<div style="font-size:16px;text-align:left;margin:10px">{'Category 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>
</div>
<!-- END navbar -->
{/if}
<!-- BEGIN calbar -->
<div class="calendarCalBar">{calendar.calbar.BAR}</div>
<!-- END calbar -->
<!-- END calendar -->
{if !empty($tag_search_results) }
<div style="font-size:16px;text-align:left;margin:10px">{'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>
</div>
{/if}
{MONTH_CALENDAR}
{CATEGORIES}
{THUMBNAILS}
{if isset($FILE_CHRONOLOGY_VIEW) }
{include file=$FILE_CHRONOLOGY_VIEW}
{/if}
<!-- BEGIN cat_infos -->
<!-- BEGIN navigation -->
{if !empty($CATEGORIES) }{$CATEGORIES}{/if}
{if !empty($THUMBNAILS) }{$THUMBNAILS}{/if}
{if !empty($NAV_BAR) }
<div class="navigationBar">
{cat_infos.navigation.NAV_BAR}
{$NAV_BAR}
</div>
<!-- END navigation -->
<!-- BEGIN comment -->
<div class="additional_info">{cat_infos.comment.COMMENTS}</div>
<!-- END comment -->
<!-- END cat_infos -->
{/if}
{if !empty($CONTENT_DESCRIPTION) }
<div class="additional_info">
{$CONTENT_DESCRIPTION}
</div>
{/if}
{PLUGIN_INDEX_CONTENT_END}
{if !empty($PLUGIN_INDEX_CONTENT_END) }{$PLUGIN_INDEX_CONTENT_END}{/if}
</div> <!-- content -->

View file

@ -1,28 +1,27 @@
<!-- DEV TAG: not smarty migrated -->
<!-- BEGIN categories -->
<!-- $Id$ -->
{* $Id$ *}
<ul class="thumbnailCategories">
<!-- BEGIN category -->
{foreach from=$category_thumbnails item=cat}
<li>
<div class="thumbnailCategory">
<div class="illustration">
<a href="{categories.category.URL}">
<img src="{categories.category.SRC}" alt="{categories.category.ALT}" title="{categories.category.TITLE}">
<a href="{$cat.URL}">
<img src="{$cat.TN_SRC}" alt="{$cat.ALT}" title="{'hint_category'|@translate}">
</a>
</div>
<div class="description">
<h3>
<a href="{categories.category.URL}">{categories.category.NAME}</a>
{categories.category.ICON}
<a href="{$cat.URL}">{$cat.NAME}</a>
{$cat.ICON}
</h3>
<!-- BEGIN dates -->
<p>{categories.category.dates.INFO}</p>
<!-- END dates -->
<p>{categories.category.CAPTION_NB_IMAGES}&nbsp;</p>
<p>{categories.category.DESCRIPTION}&nbsp;</p>
{if isset($cat.INFO_DATES) }
<p>{$cat.INFO_DATES}</p>
{/if}
<p>{$cat.CAPTION_NB_IMAGES}</p>
<p>{$cat.DESCRIPTION}</p>
</div>
</div>
</li>
<!-- END category -->
{/foreach}
</ul>
<!-- END categories -->

View file

@ -1,155 +1,164 @@
<!-- DEV TAG: not smarty migrated -->
<!-- $Id$ -->
{* $Id$ *}
<div id="menubar">
<!-- BEGIN links -->
{if not empty($links)}
<dl id="mbLinks">
<dt>{lang:Links}</dt>
<dd>
<ul>
<!-- BEGIN link -->
<li>
<a href="{links.link.URL}"
<!-- BEGIN new_window -->
onclick="window.open(this.href,
'{links.link.new_window.name}',
'{links.link.new_window.features}'
); return false;"
<!-- END new_window -->
>{links.link.LABEL}
</a>
</li>
<!-- END link -->
</ul>
</dd>
<dt>{'Links'|@translate}</dt>
<dd>
<ul>
{foreach from=$links item=link}
<li>
<a href="{$link.URL}"
{if isset($link.new_window) }onclick="window.open(this.href, '{$link.new_window.NAME|@escape:'javascript'}','{$link.new_window.FEATURES|@escape:'javascript'}'); return false;"{/if}
>
{$link.LABEL}
</a>
</li>
{/foreach}{*links*}
</ul>
</dd>
</dl>
<!-- END links -->
<!-- BEGIN start_filter -->
<a href="{start_filter.URL}" title="{lang:start_filter_hint}" rel="nofollow"><img src="{pwg_root}{themeconf:icon_dir}/start_filter.png" class="button" alt="{lang:start_filter_hint}"></a>
<!-- END start_filter -->
<!-- BEGIN stop_filter -->
<a href="{stop_filter.URL}" title="{lang:stop_filter_hint}"><img src="{pwg_root}{themeconf:icon_dir}/stop_filter.png" class="button" alt="{lang:stop_filter_hint}"></a>
<!-- END stop_filter -->
{/if}{*links*}
{if isset($U_START_FILTER)}
<a href="{$U_START_FILTER}" title="{'start_filter_hint'|@translate}" rel="nofollow"><img src="{$ROOT_URL}{$themeconf.icon_dir}/start_filter.png" class="button" alt="{'start_filter_hint'|@translate}"></a>
{/if}
{if isset($U_STOP_FILTER)}
<a href="{$U_STOP_FILTER}" title="{'stop_filter_hint'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/stop_filter.png" class="button" alt="{'stop_filter_hint'|@translate}"></a>
{/if}
<dl id="mbCategories">
<dt><a href="{U_CATEGORIES}">{lang:Categories}</a></dt>
<dd>
{MENU_CATEGORIES_CONTENT}
<!-- BEGIN upload -->
<dt><a href="{$U_CATEGORIES}">{'Categories'|@translate}</a></dt>
<dd>
{$MENU_CATEGORIES_CONTENT}
{if isset($U_UPLOAD)}
<ul><li>
<a href="{upload.U_UPLOAD}">{lang:upload_picture}</a>
<a href="{$U_UPLOAD}">{'upload_picture'|@translate}</a>
</li></ul>
<!-- END upload -->
<p class="totalImages">{NB_PICTURE} {lang:total}</p>
{/if}
<p class="totalImages">{$NB_PICTURE} {'total'|@translate}</p>
</dd>
</dl>
<!-- BEGIN tags -->
{if not empty($related_tags)}
<dl id="mbTags">
<dt>{lang:Related tags}</dt>
<dd>
<ul id="menuTagCloud">
<!-- BEGIN tag -->
<li>
<!-- BEGIN add -->
<a href="{tags.tag.add.URL}" title="{tags.tag.add.TITLE}" rel="nofollow"><img src="{pwg_root}{themeconf:icon_dir}/add_tag.png" alt="+"></a>
<!-- END add -->
<a href="{tags.tag.URL}" class="{tags.tag.CLASS}" title="{tags.tag.TITLE}">{tags.tag.NAME}</a>
</li>
<!-- END tag -->
</ul>
</dd>
<dt>{'Related tags'|@translate}</dt>
<dd>
<ul id="menuTagCloud">
{foreach from=$related_tags item=tag}
<li>
{if !empty($tag.add) }
<a href="{$tag.add.URL}"
title="{$pwg->l10n_dec('%d picture are also linked to current tags', '%d pictures are also linked to current tags', $tag.add.COUNTER)}"
rel="nofollow">
<img src="{$ROOT_URL}{$themeconf.icon_dir}/add_tag.png" alt="+" />
</a>
{/if}
<a href="{$tag.U_TAG}" class="{$tag.CLASS}" title="{'See pictures linked to this tag only'|@translate}">{$tag.NAME}</a>
</li>
{/foreach}
</ul>
</dd>
</dl>
<!-- END tags -->
{/if}
<dl id="mbSpecial">
<dt>{lang:special_categories}</dt>
<dd>
<ul>
<!-- BEGIN special_cat -->
<li><a href="{special_cat.URL}" title="{special_cat.TITLE}" {special_cat.REL}>{special_cat.NAME}</a></li>
<!-- END special_cat -->
</ul>
</dd>
<dt>{'special_categories'|@translate}</dt>
<dd>
<ul>
{foreach from=$special_categories item=cat}
<li><a href="{$cat.URL}" title="{$cat.TITLE}" {if isset($cat.REL)}{$cat.REL}{/if}>{$cat.NAME}</a></li>
{/foreach}
</ul>
</dd>
</dl>
<dl id="mbMenu">
<dt>{lang:title_menu}</dt>
<dd>
<!-- BEGIN summary -->
<!-- BEGIN quick_search -->
<form action="{pwg_root}qsearch.php" method="get" id="quicksearch">
<p>
<input type="text" name="q" id="qsearchInput" onfocus="if (value==qsearch_prompt) value='';" onblur="if (value=='') value=qsearch_prompt;" />
</p>
</form>
<script type="text/javascript">var qsearch_prompt="{lang:qsearch}"; document.getElementById('qsearchInput').value=qsearch_prompt;</script>
<!-- END quick_search -->
<!-- END summary -->
<ul>
<!-- BEGIN summary -->
<li><a href="{summary.U_SUMMARY}" title="{summary.TITLE}" {summary.REL}>{summary.NAME}</a></li>
<!-- END summary -->
<dt>{'title_menu'|@translate}</dt>
<dd>
<form action="{$ROOT_URL}qsearch.php" method="get" id="quicksearch">
<p>
<input type="text" name="q" id="qsearchInput" onfocus="if (value==qsearch_prompt) value='';" onblur="if (value=='') value=qsearch_prompt;" />
</p>
</form>
<script type="text/javascript">var qsearch_prompt="{'qsearch'|@translate|@escape:'javascript'}"; document.getElementById('qsearchInput').value=qsearch_prompt;</script>
</ul>
</dd>
<ul>
{foreach from=$summaries item=sum}
<li><a href="{$sum.U_SUMMARY}" title="{$sum.TITLE}" {if isset($sum.REL)}{$sum.REL}{/if}>{$sum.NAME}</a></li>
{/foreach}
</ul>
</dd>
</dl>
<dl id="mbIdentification">
<dt>{lang:identification}</dt>
<dd>
<!-- BEGIN hello -->
<p>{lang:hello}&nbsp;{USERNAME}&nbsp;!</p>
<!-- END hello -->
<ul>
<!-- BEGIN register -->
<li><a href="{U_REGISTER}" title="{lang:Create a new account}" rel="nofollow">{lang:Register}</a></li>
<!-- END register -->
<!-- BEGIN login -->
<li><a href="{F_IDENTIFY}" rel="nofollow">{lang:Connection}</a></li>
<!-- END login -->
<!-- BEGIN logout -->
<li><a href="{U_LOGOUT}">{lang:logout}</a></li>
<!-- END logout -->
<!-- BEGIN profile -->
<li><a href="{U_PROFILE}" title="{lang:hint_customize}">{lang:customize}</a></li>
<!-- END profile -->
<!-- BEGIN admin -->
<li><a href="{U_ADMIN}" title="{lang:hint_admin}">{lang:admin}</a></li>
<!-- END admin -->
</ul>
<!-- BEGIN quickconnect -->
<form method="post" action="{F_IDENTIFY}" class="filter" id="quickconnect">
<fieldset>
<legend>{lang:Quick connect}</legend>
<dt>{'identification'|@translate}</dt>
<dd>
{if isset($USERNAME)}
<p>{'hello'|@translate}&nbsp;{$USERNAME}&nbsp;!</p>
{/if}
<ul>
{if isset($U_REGISTER)}
<li><a href="{$U_REGISTER}" title="{'Create a new account'|@translate}" rel="nofollow">{'Register'|@translate}</a></li>
{/if}
<label>
{lang:Username}
<input type="text" name="username" size="15" value="">
</label>
{if isset($U_IDENTIFY)}
<li><a href="{$U_IDENTIFY}" rel="nofollow">{'Connection'|@translate}</a></li>
{/if}
<label>
{lang:Password}
<input type="password" name="password" size="15">
</label>
{if isset($U_LOGOUT)}
<li><a href="{$U_LOGOUT}">{'logout'|@translate}</a></li>
{/if}
<!-- BEGIN remember_me -->
<label>
{lang:remember_me}
<input type="checkbox" name="remember_me" value="1">
</label>
<!-- END remember_me -->
{if isset($U_PROFILE)}
<li><a href="{$U_PROFILE}" title="{'hint_customize'|@translate}">{'customize'|@translate}</a></li>
{/if}
<p>
<input class="submit" type="submit" name="login" value="{lang:submit}">
</p>
<ul class="actions">
<li><a href="{U_LOST_PASSWORD}" title="{lang:Forgot your password?}" rel="nofollow"><img src="{pwg_root}{themeconf:icon_dir}/lost_password.png" class="button" alt="{lang:Forgot your password?}"></a></li>
<!-- BEGIN register -->
<li><a href="{U_REGISTER}" title="{lang:Create a new account}" rel="nofollow"><img src="{pwg_root}{themeconf:icon_dir}/register.png" class="button" alt="{lang:register}"/></a></li>
<!-- END register -->
</ul>
{if isset($U_ADMIN)}
<li><a href="{$U_ADMIN}" title="{'hint_admin'|@translate}">{'admin'|@translate}</a></li>
{/if}
</ul>
{if isset($U_IDENTIFY)}
<form method="post" action="{$U_IDENTIFY}" class="filter" id="quickconnect">
<fieldset>
<legend>{'Quick connect'|@translate}</legend>
</fieldset>
</form>
<!-- END quickconnect -->
<label>
{'Username'|@translate}
<input type="text" name="username" size="15" value="">
</label>
<label>
{'Password'|@translate}
<input type="password" name="password" size="15">
</label>
{if $AUTHORIZE_REMEMBERING}
<label>
{'remember_me'|@translate}
<input type="checkbox" name="remember_me" value="1">
</label>
{/if}
<p>
<input class="submit" type="submit" name="login" value="{'submit'|@translate}">
</p>
<ul class="actions">
<li><a href="{$U_LOST_PASSWORD}" title="{'Forgot your password?'|@translate}" rel="nofollow"><img src="{$ROOT_URL}{$themeconf.icon_dir}/lost_password.png" class="button" alt="{'Forgot your password?'|@translate}"></a></li>
{if isset($U_REGISTER)}
<li><a href="{$U_REGISTER}" title="{'Create a new account'|@translate}" rel="nofollow"><img src="{$ROOT_URL}{$themeconf.icon_dir}/register.png" class="button" alt="{'register'|@translate}"/></a></li>
{/if}
</ul>
</fieldset>
</form>
{/if}
</dd>
</dl>

View file

@ -1,36 +1,64 @@
<!-- DEV TAG: not smarty migrated -->
<!-- BEGIN calendar -->
<!-- $Id$ -->
<!-- BEGIN thumbnails -->
{* $Id$ *}
{if !empty($chronology_navigation_bars) }
{foreach from=$chronology_navigation_bars item=bar}
<div class="calendarBar">
{if isset($bar.previous)}
<div style="float:left">&laquo; <a href="{$bar.previous.URL}">{$bar.previous.LABEL}</a></div>
{/if}
{if isset($bar.next)}
<div style="float:right"><a href="{$bar.next.URL}">{$bar.next.LABEL}</a> &raquo;</div>
{/if}
{if isset($bar.CONTENT)}
{$bar.CONTENT}
{else}
&nbsp;
{/if}
</div>
{/foreach}
{/if}
{if !empty($chronology_calendar.calendar_bars) }
{foreach from=$chronology_calendar.calendar_bars item=bar}
<div class="calendarCalBar">
<span class="calCalHead"><a href="{$bar.U_HEAD}">{$bar.HEAD_LABEL}</a> ({$bar.NB_IMAGES})</span><br/>
{$bar.NAV_BAR}
</div>
{/foreach}
{/if}
{if isset($chronology_calendar.month_view) }
<table class="calMonth">
<!-- BEGIN head -->
<thead><tr>
<!-- BEGIN col -->
<td class="calDayHead">{calendar.thumbnails.head.col.LABEL}</td>
<!-- END col -->
</tr></thead>
<!-- END head -->
<!-- BEGIN row -->
<thead>
<tr>
<!-- BEGIN col -->
<!-- BEGIN blank -->
<td class="calDayCellBlank" style="width:{calendar.thumbnails.WIDTH}px;height:{calendar.thumbnails.HEIGHT}px;">
<!-- END blank -->
<!-- BEGIN empty -->
<td class="calDayCellEmpty" style="width:{calendar.thumbnails.WIDTH}px;height:{calendar.thumbnails.HEIGHT}px;">{calendar.thumbnails.row.col.empty.LABEL}
<!-- END empty -->
<!-- BEGIN full -->
<td class="calDayCellFull"><div class="calBackDate">{calendar.thumbnails.row.col.full.LABEL}</div><div class="calForeDate">{calendar.thumbnails.row.col.full.LABEL}</div>
<div class="calImg" style="width:{calendar.thumbnails.WIDTH}px;height:{calendar.thumbnails.HEIGHT}px;"><a href="{calendar.thumbnails.row.col.full.U_IMG_LINK}">
<img style="{calendar.thumbnails.row.col.full.STYLE}" {calendar.thumbnails.row.col.full.IMG_WIDTH} {calendar.thumbnails.row.col.full.IMG_HEIGHT}
src="{calendar.thumbnails.row.col.full.IMAGE}" alt="{calendar.thumbnails.row.col.full.IMAGE_ALT}"
title="{calendar.thumbnails.row.col.full.IMAGE_ALT}">
</a></div>
<!-- END full -->
</td>
<!-- END col -->
{foreach from=$chronology_calendar.month_view.wday_labels item=wday}
<td class="calDayHead">{$wday}</td>
{/foreach}
</tr>
<!-- END row -->
</thead>
{foreach from=$chronology_calendar.month_view.weeks item=week}
<tr>
{foreach from=$week item=day}
{if !empty($day)}
{if isset($day.IMAGE)}
<td class="calDayCellFull">
<div class="calBackDate">{$day.DAY}</div><div class="calForeDate">{$day.DAY}</div>
<div class="calImg" style="width:{$chronology_calendar.month_view.CELL_WIDTH}px;height:{$chronology_calendar.month_view.CELL_HEIGHT}px;">
<a href="{$day.U_IMG_LINK}">
<img style="{$day.IMAGE_STYLE}" src="{$day.IMAGE}" alt="{$day.IMAGE_ALT}" title="{$day.IMAGE_ALT}" />
</a>
</div>
{else}
<td class="calDayCellEmpty" style="width:{$chronology_calendar.month_view.CELL_WIDTH}px;height:{$chronology_calendar.month_view.CELL_HEIGHT}px;">{$day.DAY}
{/if}
{else}
<td class="calDayCellBlank" style="width:{$chronology_calendar.month_view.CELL_WIDTH}px;height:{$chronology_calendar.month_view.CELL_HEIGHT}px;">
{/if}
</td>
{/foreach} {*day in week*}
</tr>
{/foreach} {*week in month*}
</table>
<!-- END thumbnails -->
<!-- END calendar -->
{/if}