From bf4012291a878c3f22fa318595e2ca7881c2978a Mon Sep 17 00:00:00 2001 From: rub Date: Wed, 27 Feb 2008 20:25:18 +0000 Subject: Resolved issue 0000807: New slideshow features git-svn-id: http://piwigo.org/svn/trunk@2218 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/category_default.inc.php | 18 +- include/config_default.inc.php | 20 ++- include/functions.inc.php | 4 +- include/functions_picture.inc.php | 108 +++++++++++- index.php | 23 ++- install/db/67-database.php | 51 ++++++ language/en_UK/common.lang.php | 8 +- language/es_ES/common.lang.php | 9 +- language/fr_FR/common.lang.php | 8 +- language/nl_NL/common.lang.php | 9 +- picture.php | 186 ++++++++++++++++----- plugins/c13y_upgrade/initialize.inc.php | 53 +++++- .../c13y_upgrade/language/en_UK/plugin.lang.php | 9 +- .../c13y_upgrade/language/es_ES/plugin.lang.php | 8 +- .../c13y_upgrade/language/fr_FR/plugin.lang.php | 8 +- template/yoga/icon/dec_period.png | Bin 0 -> 1087 bytes template/yoga/icon/dec_period_unactive.png | Bin 0 -> 1169 bytes template/yoga/icon/inc_period.png | Bin 0 -> 1209 bytes template/yoga/icon/inc_period_unactive.png | Bin 0 -> 1255 bytes template/yoga/icon/pause.png | Bin 0 -> 1597 bytes template/yoga/icon/play.png | Bin 0 -> 1568 bytes template/yoga/icon/slideshow.png | Bin 1229 -> 1264 bytes template/yoga/icon/start_repeat.png | Bin 0 -> 1691 bytes template/yoga/icon/stop_repeat.png | Bin 0 -> 1683 bytes template/yoga/icon/stop_slideshow.png | Bin 0 -> 1245 bytes template/yoga/index.tpl | 4 + template/yoga/picture.tpl | 104 +++--------- template/yoga/picture_nav_buttons.tpl | 91 ++++++++++ template/yoga/slideshow.tpl | 11 +- 29 files changed, 574 insertions(+), 158 deletions(-) create mode 100644 install/db/67-database.php create mode 100644 template/yoga/icon/dec_period.png create mode 100644 template/yoga/icon/dec_period_unactive.png create mode 100644 template/yoga/icon/inc_period.png create mode 100644 template/yoga/icon/inc_period_unactive.png create mode 100644 template/yoga/icon/pause.png create mode 100644 template/yoga/icon/play.png create mode 100644 template/yoga/icon/start_repeat.png create mode 100644 template/yoga/icon/stop_repeat.png create mode 100644 template/yoga/icon/stop_slideshow.png create mode 100644 template/yoga/picture_nav_buttons.tpl diff --git a/include/category_default.inc.php b/include/category_default.inc.php index ef029eee6..402df757b 100644 --- a/include/category_default.inc.php +++ b/include/category_default.inc.php @@ -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$ @@ -66,6 +66,22 @@ if (count($pictures) > 0) $template->assign_block_vars('thumbnails.line', array()); // current row displayed $row_number = 0; + + // define category slideshow url + $row = reset($pictures); + $page['cat_slideshow_url'] = + add_url_params( + duplicate_picture_url( + array( + 'image_id' => $row['id'], + 'image_file' => $row['file'] + ), + array('start') + ), + array('slideshow' => + (isset($_GET['slideshow']) ? $_GET['slideshow'] + : '' )) + ); } trigger_action('loc_begin_index_thumbnails', $pictures); diff --git a/include/config_default.inc.php b/include/config_default.inc.php index 6a294236c..67369119e 100644 --- a/include/config_default.inc.php +++ b/include/config_default.inc.php @@ -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$ @@ -66,10 +66,6 @@ // the date_available $conf['order_by'] = ' ORDER BY date_available DESC, file ASC, id ASC'; -// slideshow_period : waiting time in seconds before loading a new page -// during automated slideshow -$conf['slideshow_period'] = 4; - // file_ext : file extensions (case sensitive) authorized $conf['file_ext'] = array('jpg','JPG','jpeg','JPEG', 'png','PNG','gif','GIF','mpg','zip', @@ -692,8 +688,20 @@ $conf['filter_pages'] = array ); // +-----------------------------------------------------------------------+ -// | Light slideshow | +// | Slideshow | // +-----------------------------------------------------------------------+ +// slideshow_period : waiting time in seconds before loading a new page +// during automated slideshow +// slideshow_period_min, slideshow_period_max are bounds of slideshow_period +// slideshow_period_step is the step of navigation between min and max +$conf['slideshow_period_min'] = 1; +$conf['slideshow_period_max'] = 10; +$conf['slideshow_period_step'] = 1; +$conf['slideshow_period'] = 4; + +// slideshow_repeat : slideshow loops on pictures +$conf['slideshow_repeat'] = true; + // $conf['light_slideshow'] indicates to use slideshow.tpl in state of // picture.tpl for slideshow // Take care to have slideshow.tpl in all available templates diff --git a/include/functions.inc.php b/include/functions.inc.php index afc91c9c2..243f2481b 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -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$ @@ -749,6 +749,8 @@ function redirect_http( $url ) { ob_clean(); } + // default url is on html format + $url = html_entity_decode($url); header('Request-URI: '.$url); header('Content-Location: '.$url); header('Location: '.$url); diff --git a/include/functions_picture.inc.php b/include/functions_picture.inc.php index d11574b57..13a09834d 100644 --- a/include/functions_picture.inc.php +++ b/include/functions_picture.inc.php @@ -1,7 +1,7 @@ $conf['slideshow_period'], + 'repeat' => $conf['slideshow_repeat'], + 'play' => true, + ); +} + +/* + * check and correct slideshow params from array + * + * @param array of params + * + * @return slideshow corrected values into array + */ +function correct_slideshow_params($params = array()) +{ + global $conf; + + if ($params['period'] < $conf['slideshow_period_min']) + { + $params['period'] = $conf['slideshow_period_min']; + } + else if ($params['period'] > $conf['slideshow_period_max']) + { + $params['period'] = $conf['slideshow_period_max']; + } + + return $params; +} + +/* + * Decode slideshow string params into array + * + * @param string params like "" + * + * @return slideshow values into array + */ +function decode_slideshow_params($encode_params = null) +{ + global $conf; + + $result = get_default_slideshow_params(); + + if (is_numeric($encode_params)) + { + $result['period'] = $encode_params; + } + else + { + $matches = array(); + if (preg_match_all('/([a-z]+)-(\d+)/', $encode_params, $matches)) + { + $matchcount = count($matches[1]); + for ($i = 0; $i < $matchcount; $i++) + { + $result[$matches[1][$i]] = $matches[2][$i]; + } + } + + if (preg_match_all('/([a-z]+)-(true|false)/', $encode_params, $matches)) + { + $matchcount = count($matches[1]); + for ($i = 0; $i < $matchcount; $i++) + { + $result[$matches[1][$i]] = get_boolean($matches[2][$i]); + } + } + } + + return correct_slideshow_params($result); +} + +/* + * Encode slideshow array params into array + * + * @param array params + * + * @return slideshow values into string + */ +function encode_slideshow_params($decode_params = array()) +{ + global $conf; + + $params = array_diff_assoc(correct_slideshow_params($decode_params), get_default_slideshow_params()); + $result = ''; + + foreach ($params as $name => $value) + { + // boolean_to_string return $value, if it's not a bool + $result .= '+'.$name.'-'.boolean_to_string($value); + } + + return $result; +} + ?> diff --git a/index.php b/index.php index 3a084147e..815b9376c 100644 --- a/index.php +++ b/index.php @@ -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$ @@ -67,7 +67,7 @@ if (isset($page['category'])) check_restrictions($page['category']['id']); } -if ( count($page['items']) > $user['nb_image_page']) +if (count($page['items']) > $user['nb_image_page']) { $page['navigation_bar'] = create_navigation_bar( duplicate_index_url(array(), array('start')), @@ -99,7 +99,7 @@ $page['body_id'] = 'theCategoryPage'; $template->set_filenames( array('index'=>'index.tpl') ); //-------------------------------------------------------------- category title $template_title = $page['title']; -if ( count($page['items']) > 0) +if (count($page['items']) > 0) { $template_title.= ' ['.count($page['items']).']'; } @@ -192,7 +192,7 @@ if (isset($page['category']) and is_admin()) ); } -if (is_admin() and !empty($page['items']) ) +if (is_admin() and !empty($page['items'])) { $template->assign_block_vars( 'caddie', @@ -262,6 +262,21 @@ if ( !empty($page['items']) ) } //------------------------------------------------------- category informations +// slideshow +// execute after init thumbs in order to have all picture informations +if (!empty($page['cat_slideshow_url'])) +{ + if (isset($_GET['slideshow'])) + { + redirect($page['cat_slideshow_url']); + } + else + { + $template->assign_block_vars( + 'slideshow', array('URL' => $page['cat_slideshow_url'])); + } +} + // navigation bar if ($page['navigation_bar'] != '') { diff --git a/install/db/67-database.php b/install/db/67-database.php new file mode 100644 index 000000000..8162f73d8 --- /dev/null +++ b/install/db/67-database.php @@ -0,0 +1,51 @@ + diff --git a/language/en_UK/common.lang.php b/language/en_UK/common.lang.php index dd23da6d5..23a7c8e1c 100644 --- a/language/en_UK/common.lang.php +++ b/language/en_UK/common.lang.php @@ -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$ @@ -382,5 +382,11 @@ $lang['reg_err_mail_address_dbl'] = 'a user use already this mail address'; $lang['Category results for'] = 'Category results for'; $lang['Tag results for'] = 'Tag results for'; $lang['from %s to %s'] = 'from %s to %s'; +$lang['start_play'] = 'Play of slideshow'; +$lang['stop_play'] = 'Pause of slideshow'; +$lang['start_repeat'] = 'Repeat the slideshow'; +$lang['stop_repeat'] = 'Not repeat the slideshow'; +$lang['inc_period'] = 'Increase waiting between pictures'; +$lang['dec_period'] = 'Decrease waiting between pictures'; ?> \ No newline at end of file diff --git a/language/es_ES/common.lang.php b/language/es_ES/common.lang.php index 1e03c9b98..e8e312ca7 100644 --- a/language/es_ES/common.lang.php +++ b/language/es_ES/common.lang.php @@ -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 : $ $ // | last update : $2007-10-12 (ven., 12 oct. 2007)) $ @@ -381,4 +381,11 @@ $lang['reg_err_mail_address_dbl'] = 'Un utilizador ya utiliza esta dirección e- $lang['Category results for'] = 'Los resultados de las categorías para'; $lang['Tag results for'] = 'Los resultados de los tags para'; $lang['from %s to %s'] = 'de %s a %s'; +/* TODO */ $lang['start_play'] = 'Play of slideshow'; +/* TODO */ $lang['stop_play'] = 'Pause of slideshow'; +/* TODO */ $lang['start_repeat'] = 'Repeat the slideshow'; +/* TODO */ $lang['stop_repeat'] = 'Not repeat the slideshow'; +/* TODO */ $lang['inc_period'] = 'Increase waiting between pictures'; +/* TODO */ $lang['dec_period'] = 'Decrease waiting between pictures'; + ?> \ No newline at end of file diff --git a/language/fr_FR/common.lang.php b/language/fr_FR/common.lang.php index 46507322f..8efc46286 100644 --- a/language/fr_FR/common.lang.php +++ b/language/fr_FR/common.lang.php @@ -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$ @@ -381,5 +381,11 @@ $lang['reg_err_mail_address_dbl'] = 'un utilisateur utilise déjà cette adresse $lang['Category results for'] = 'Résultats des catégories pour'; $lang['Tag results for'] = 'Résultats des tags pour'; $lang['from %s to %s'] = 'de %s à %s'; +$lang['start_play'] = 'Lecture du diaporama'; +$lang['stop_play'] = 'Pause du diaporama'; +$lang['start_repeat'] = 'Répeter le diaporama'; +$lang['stop_repeat'] = 'Ne pas répeter le diaporama'; +$lang['inc_period'] = 'Augmenter l\'attente entre les images'; +$lang['dec_period'] = 'Diminuer l\'attente entre les images'; ?> \ No newline at end of file diff --git a/language/nl_NL/common.lang.php b/language/nl_NL/common.lang.php index efe9f27a5..188e26f6f 100644 --- a/language/nl_NL/common.lang.php +++ b/language/nl_NL/common.lang.php @@ -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$ @@ -382,4 +382,11 @@ $lang['reg_err_mail_address_dbl'] = 'Een andere gebruiker maakt al gebruik van d $lang['Category results for'] = 'Categorie resultaten voor'; $lang['Tag results for'] = 'Tag resultaten voor'; $lang['from %s to %s'] = 'van %s tot %s'; +/* TODO */ $lang['start_play'] = 'Play of slideshow'; +/* TODO */ $lang['stop_play'] = 'Pause of slideshow'; +/* TODO */ $lang['start_repeat'] = 'Repeat the slideshow'; +/* TODO */ $lang['stop_repeat'] = 'Not repeat the slideshow'; +/* TODO */ $lang['inc_period'] = 'Increase waiting between pictures'; +/* TODO */ $lang['dec_period'] = 'Decrease waiting between pictures'; + ?> \ No newline at end of file diff --git a/picture.php b/picture.php index ad8f67700..26e461daf 100644 --- a/picture.php +++ b/picture.php @@ -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$ @@ -78,7 +78,7 @@ function default_picture_content($content, $element_info) array('default_content'=>'picture_content.tpl') ); - if ( !isset($page['slideshow']) and isset($element_info['high_url']) ) + if ( !$page['slideshow'] and isset($element_info['high_url']) ) { $uuid = uniqid(rand()); $template->assign_block_vars( @@ -424,38 +424,65 @@ $url_admin = .'&image_id='.$page['image_id'] ; -$url_slide = add_url_params( - $picture['current']['url'], - array( 'slideshow'=>$conf['slideshow_period'] ) - ); - +$slideshow_params = array(); +$slideshow_url_params = array(); -$template->set_filename('picture', 'picture.tpl'); -if ( isset( $_GET['slideshow'] ) ) +if (isset($_GET['slideshow'])) { - $page['meta_robots']=array('noindex'=>1, 'nofollow'=>1); $page['slideshow'] = true; - if ( $conf['light_slideshow'] ) - { // Change template file - // Add local-slideshow.css file if exists - $template->set_filename('picture', 'slideshow.tpl'); - $css = get_root_url() . get_themeconf('template_dir') . '/theme/' - . get_themeconf('theme') . '/local-slideshow.css'; - if (file_exists($css)) + $page['meta_robots'] = array('noindex'=>1, 'nofollow'=>1); + + $slideshow_params = decode_slideshow_params($_GET['slideshow']); + $slideshow_url_params['slideshow'] = encode_slideshow_params($slideshow_params); + + if ($slideshow_params['play']) + { + $id_pict_redirect = ''; + if (isset($page['next_item'])) + { + $id_pict_redirect = 'next'; + } + else { - $template->assign_block_vars('slideshow', array()); + if ($slideshow_params['repeat'] and isset($page['first_item'])) + { + $id_pict_redirect = 'first'; + } + } + + if (!empty($id_pict_redirect)) + { + // $redirect_msg, $refresh, $url_link and $title are required for creating + // an automated refresh page in header.tpl + $refresh = $slideshow_params['period']; + $url_link = add_url_params( + $picture[$id_pict_redirect]['url'], + $slideshow_url_params + ); + $redirect_msg = nl2br(l10n('redirect_msg')); } } - if ( isset($page['next_item']) ) +} +else +{ + $page['slideshow'] = false; +} + +$template->set_filenames( + array( + 'picture' => + (($page['slideshow'] and $conf['light_slideshow']) ? 'slideshow.tpl' : 'picture.tpl'), + 'nav_buttons' => 'picture_nav_buttons.tpl')); + +if ($page['slideshow']) +{ + // Add local-slideshow.css file if exists + // Not only for ligth + $css = get_root_url() . get_themeconf('template_dir') . '/theme/' + . get_themeconf('theme') . '/local-slideshow.css'; + if (file_exists($css)) { - // $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'], - array('slideshow'=>$refresh) - ); - $redirect_msg = nl2br(l10n('redirect_msg')); + $template->assign_block_vars('slideshow', array()); } } @@ -514,7 +541,10 @@ foreach (array('first','previous','next','last') as $which_image) array( 'TITLE_IMG' => $picture[$which_image]['name'], 'IMG' => $picture[$which_image]['thumbnail'], - 'U_IMG' => $picture[$which_image]['url'], + // Params slideshow was transmit to navigation buttons + 'U_IMG' => + add_url_params( + $picture[$which_image]['url'], $slideshow_url_params) ) ); } @@ -527,6 +557,85 @@ foreach (array('first','previous','next','last') as $which_image) } } + +if ($page['slideshow']) +{ + //slideshow end + $template->assign_block_vars( + 'stop_slideshow', + array( + 'U_SLIDESHOW' => $picture['current']['url'], + ) + ); + + foreach (array('repeat', 'play') as $p) + { + $template->assign_block_vars( + ($slideshow_params[$p] ? 'stop' : 'start').'_'.$p, + array( + // Params slideshow was transmit to navigation buttons + 'U_IMG' => + add_url_params( + $picture['current']['url'], + array('slideshow' => + encode_slideshow_params( + array_merge($slideshow_params, + array($p => ! $slideshow_params[$p])) + ) + ) + ) + ) + ); + } + + foreach (array('dec', 'inc') as $op) + { + $new_period = $slideshow_params['period'] + ((($op == 'dec') ? -1 : 1) * $conf['slideshow_period_step']); + $new_slideshow_params = + correct_slideshow_params( + array_merge($slideshow_params, + array('period' => $new_period))); + $block_period = $op.'_period'; + + if ($new_slideshow_params['period'] === $new_period) + { + $template->assign_block_vars( + $block_period, + array( + // Params slideshow was transmit to navigation buttons + 'U_IMG' => + add_url_params( + $picture['current']['url'], + array('slideshow' => encode_slideshow_params($new_slideshow_params) + ) + ) + ) + ); + } + else + { + $template->assign_block_vars( + $block_period.'_unactive', + array() + ); + } + } +} +else +{ + $template->assign_block_vars( + 'start_slideshow', + array( + 'U_SLIDESHOW' => + add_url_params( + $picture['current']['url'], + array( 'slideshow'=>'')) + ) + ); + $template->assign_block_vars( + 'thumbnails',array('U_UP' => $url_up)); +} + $template->assign_vars( array( 'SECTION_TITLE' => $page['title'], @@ -537,10 +646,8 @@ $template->assign_vars( 'LEVEL_SEPARATOR' => $conf['level_separator'], 'U_HOME' => make_index_url(), - 'U_UP' => $url_up, 'U_METADATA' => $url_metadata, 'U_ADMIN' => $url_admin, - 'U_SLIDESHOW'=> $url_slide, 'U_ADD_COMMENT' => $url_self, ) ); @@ -642,7 +749,7 @@ if ( is_admin() ) } //--------------------------------------------------------- picture information -$header_infos = array(); //for html header use +$header_infos = array(); //for html header use // legend if (isset($picture['current']['comment']) and !empty($picture['current']['comment'])) @@ -789,21 +896,8 @@ foreach ($related_categories as $category) ); } -//slideshow end -if (isset($_GET['slideshow'])) -{ - if (!is_numeric($_GET['slideshow'])) - { - $_GET['slideshow'] = $conf['slideshow_period']; - } - - $template->assign_block_vars( - 'stop_slideshow', - array( - 'U_SLIDESHOW' => $picture['current']['url'], - ) - ); -} +// assign tpl picture_nav_buttons +$template->assign_var_from_handle('NAV_BUTTONS', 'nav_buttons'); // maybe someone wants a special display (call it before page_header so that // they can add stylesheets) diff --git a/plugins/c13y_upgrade/initialize.inc.php b/plugins/c13y_upgrade/initialize.inc.php index 7f0accc43..24de4d9cf 100644 --- a/plugins/c13y_upgrade/initialize.inc.php +++ b/plugins/c13y_upgrade/initialize.inc.php @@ -41,10 +41,14 @@ function c13y_upgrade() /* Check user with same e-mail */ $query = ' -select count(*) -from '.USERS_TABLE.' -where '.$conf['user_fields']['email'].' is not null -group by upper('.$conf['user_fields']['email'].') +select + count(*) +from + '.USERS_TABLE.' +where + '.$conf['user_fields']['email'].' is not null +group by + upper('.$conf['user_fields']['email'].') having count(*) > 1 limit 0,1 ;'; @@ -53,12 +57,49 @@ limit 0,1 { $can_be_deactivate = false; add_c13y( - l10n('c13y_exif_dbl_email_user'), + l10n('c13y_dbl_email_user'), null, null, - l10n('c13y_exif_correction_dbl_email_user')); + l10n('c13y_correction_dbl_email_user')); } + /* Check plugin included in Piwigo sources */ + $included_plugins = array('dew'); + $query = ' +select + id +from + '.PLUGINS_TABLE.' +where + id in ('. + implode( + ',', + array_map( + create_function('$s', 'return "\'".$s."\'";'), + $included_plugins + ) + ) + .') +;'; + + $result = pwg_query($query); + while ($row = mysql_fetch_assoc($result)) + { + $can_be_deactivate = false; + + $uninstall_msg_link = + ''. + sprintf(l10n('c13y_correction_obsolete_plugin'), $row['id']).''; + + add_c13y( + l10n('c13y_obsolete_plugin'), + null, + null, + $uninstall_msg_link); + } /* Check if this plugin must deactivate */ if ($can_be_deactivate) diff --git a/plugins/c13y_upgrade/language/en_UK/plugin.lang.php b/plugins/c13y_upgrade/language/en_UK/plugin.lang.php index d8db86284..90a712369 100644 --- a/plugins/c13y_upgrade/language/en_UK/plugin.lang.php +++ b/plugins/c13y_upgrade/language/en_UK/plugin.lang.php @@ -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$ @@ -27,6 +27,9 @@ // --------- Starting below: New or revised $lang ---- from Butterfly (1.8) $lang['c13y_upgrade_no_anomaly'] = 'No anomaly detected after application upgrade'; $lang['c13y_upgrade_deactivate'] = 'You can deactivate "Check upgrades" plugin'; -$lang['c13y_exif_dbl_email_user'] = 'Users with same email address'; -$lang['c13y_exif_correction_dbl_email_user'] = 'Delete duplicate users'; +$lang['c13y_dbl_email_user'] = 'Users with same email address'; +$lang['c13y_correction_dbl_email_user'] = 'Delete duplicate users'; +$lang['c13y_obsolete_plugin'] = 'Obsolete plugin'; +$lang['c13y_correction_obsolete_plugin'] = '"%s" plugin has been included in this application version and you must uninstall it.'; + ?> diff --git a/plugins/c13y_upgrade/language/es_ES/plugin.lang.php b/plugins/c13y_upgrade/language/es_ES/plugin.lang.php index ebe427afe..45e5d5c5e 100644 --- a/plugins/c13y_upgrade/language/es_ES/plugin.lang.php +++ b/plugins/c13y_upgrade/language/es_ES/plugin.lang.php @@ -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$ @@ -27,7 +27,9 @@ // --------- Starting below: New or revised $lang ---- from Butterfly (1.8) $lang['c13y_upgrade_no_anomaly'] = 'Ninguna anomalía detectada después de la puesta al día de la aplicación'; $lang['c13y_upgrade_deactivate'] = 'Usted puede desactivar el plugin Check upgrades'; -$lang['c13y_exif_dbl_email_user'] = 'Utilizadores con la misma dirección e-mail'; -$lang['c13y_exif_correction_dbl_email_user'] = 'Suprima a los utilizadores en duplicado'; +$lang['c13y_dbl_email_user'] = 'Utilizadores con la misma dirección e-mail'; +$lang['c13y_correction_dbl_email_user'] = 'Suprima a los utilizadores en duplicado'; +/* TODO */ $lang['c13y_obsolete_plugin'] = 'Obsolete plugin'; +/* TODO */ $lang['c13y_correction_obsolete_plugin'] = '"%s" plugin has been included in this application version and you must uninstall it.'; ?> diff --git a/plugins/c13y_upgrade/language/fr_FR/plugin.lang.php b/plugins/c13y_upgrade/language/fr_FR/plugin.lang.php index 512b8f5e6..bacf03e71 100644 --- a/plugins/c13y_upgrade/language/fr_FR/plugin.lang.php +++ b/plugins/c13y_upgrade/language/fr_FR/plugin.lang.php @@ -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$ @@ -27,7 +27,9 @@ // --------- Starting below: New or revised $lang ---- from Butterfly (1.8) $lang['c13y_upgrade_no_anomaly'] = 'Pas d\'anomalie détectée après la mise à jour de l\'application'; $lang['c13y_upgrade_deactivate'] = 'Vous pouvez désactiver le plugin "Check upgrades"'; -$lang['c13y_exif_dbl_email_user'] = 'Utilisateurs avec la même adresse email'; -$lang['c13y_exif_correction_dbl_email_user'] = 'Supprimez les utilisateurs en double'; +$lang['c13y_dbl_email_user'] = 'Utilisateurs avec la même adresse email'; +$lang['c13y_correction_dbl_email_user'] = 'Supprimez les utilisateurs en double'; +$lang['c13y_obsolete_plugin'] = 'Plugin obsolète'; +$lang['c13y_correction_obsolete_plugin'] = 'Le plugin "%s" a été inclus dans cette version de l\'application et vous devez le désinstaller.'; ?> diff --git a/template/yoga/icon/dec_period.png b/template/yoga/icon/dec_period.png new file mode 100644 index 000000000..1e2425e78 Binary files /dev/null and b/template/yoga/icon/dec_period.png differ diff --git a/template/yoga/icon/dec_period_unactive.png b/template/yoga/icon/dec_period_unactive.png new file mode 100644 index 000000000..1df2f1bc3 Binary files /dev/null and b/template/yoga/icon/dec_period_unactive.png differ diff --git a/template/yoga/icon/inc_period.png b/template/yoga/icon/inc_period.png new file mode 100644 index 000000000..c750a9dfc Binary files /dev/null and b/template/yoga/icon/inc_period.png differ diff --git a/template/yoga/icon/inc_period_unactive.png b/template/yoga/icon/inc_period_unactive.png new file mode 100644 index 000000000..ac1c7ca03 Binary files /dev/null and b/template/yoga/icon/inc_period_unactive.png differ diff --git a/template/yoga/icon/pause.png b/template/yoga/icon/pause.png new file mode 100644 index 000000000..6a3928c51 Binary files /dev/null and b/template/yoga/icon/pause.png differ diff --git a/template/yoga/icon/play.png b/template/yoga/icon/play.png new file mode 100644 index 000000000..dfde7e96a Binary files /dev/null and b/template/yoga/icon/play.png differ diff --git a/template/yoga/icon/slideshow.png b/template/yoga/icon/slideshow.png index 455d73fdf..0d5c80713 100644 Binary files a/template/yoga/icon/slideshow.png and b/template/yoga/icon/slideshow.png differ diff --git a/template/yoga/icon/start_repeat.png b/template/yoga/icon/start_repeat.png new file mode 100644 index 000000000..74272979e Binary files /dev/null and b/template/yoga/icon/start_repeat.png differ diff --git a/template/yoga/icon/stop_repeat.png b/template/yoga/icon/stop_repeat.png new file mode 100644 index 000000000..f1cc1b564 Binary files /dev/null and b/template/yoga/icon/stop_repeat.png differ diff --git a/template/yoga/icon/stop_slideshow.png b/template/yoga/icon/stop_slideshow.png new file mode 100644 index 000000000..120466a0b Binary files /dev/null and b/template/yoga/icon/stop_slideshow.png differ diff --git a/template/yoga/index.tpl b/template/yoga/index.tpl index 534031493..a388d904b 100644 --- a/template/yoga/index.tpl +++ b/template/yoga/index.tpl @@ -27,6 +27,10 @@
  • (?)
  • + +
  • {lang:slideshow}
  • + +
  • {lang:mode_normal_hint}
  • diff --git a/template/yoga/picture.tpl b/template/yoga/picture.tpl index 7c5f34231..e5e62333e 100644 --- a/template/yoga/picture.tpl +++ b/template/yoga/picture.tpl @@ -30,55 +30,33 @@
    - -
    - {lang:slideshow} - {lang:picture_show_metadata} - - {lang:download} - - {PLUGIN_PICTURE_ACTIONS} - - {favorite.FAVORITE_ALT} - - - {lang:representative} - - - {lang:link_info_image} - - - {lang:caddie} - -
    - - +
    + + {lang:slideshow} + + + {lang:slideshow_stop} + + {lang:picture_show_metadata} + + {lang:download} + + {PLUGIN_PICTURE_ACTIONS} + + {favorite.FAVORITE_ALT} + + + {lang:representative} + + + {lang:link_info_image} + + + {lang:caddie} + +
    + {NAV_BUTTONS} +
    @@ -228,31 +206,3 @@ - \ No newline at end of file diff --git a/template/yoga/picture_nav_buttons.tpl b/template/yoga/picture_nav_buttons.tpl new file mode 100644 index 000000000..a25e2639f --- /dev/null +++ b/template/yoga/picture_nav_buttons.tpl @@ -0,0 +1,91 @@ + + + + diff --git a/template/yoga/slideshow.tpl b/template/yoga/slideshow.tpl index aef05a228..1be2c5a81 100644 --- a/template/yoga/slideshow.tpl +++ b/template/yoga/slideshow.tpl @@ -10,9 +10,14 @@

    {TITLE}

    + +
    + {NAV_BUTTONS} +
    +
    {ELEMENT_CONTENT} - -

    {legend.COMMENT_IMG}

    - + +

    {legend.COMMENT_IMG}

    +
    -- cgit v1.2.3