diff options
author | z0rglub <z0rglub@piwigo.org> | 2004-09-03 15:01:05 +0000 |
---|---|---|
committer | z0rglub <z0rglub@piwigo.org> | 2004-09-03 15:01:05 +0000 |
commit | 1f71a31084add9a8fbf2947eff85ee50c5913f5b (patch) | |
tree | d591861cbd3bdffffed5748fee6bdd8c41ab788f | |
parent | fb5b21cbde40a80d5f36c6dad51dc76bbbe88069 (diff) |
- in admin/configuration, add new step with "sections" (general, comments,
default, upload, metadata, sessions)
- admin/configuration.php and its template have been higly simplificated by
making things more generic : for example, for each configuration
parameter, its name must correspond to the name we find in the config
table and belongs to a section, in the lang array we find :
- $lang['conf_<section>_<param>']
- $lang['conf_<section>_<param>_info']
- $lang['conf_<section>_<param>_error'] optionnaly
- more described message when connection to database server is impossible
- redefinitions of get_languages and get_templates functions
- deletion of configuration parameters : webmaster, session_keyword
- rename of configuration parameters :
- default_lang => default_language
- default_style => default_template
git-svn-id: http://piwigo.org/svn/trunk@512 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/configuration.php | 565 | ||||
-rw-r--r-- | include/common.inc.php | 2 | ||||
-rw-r--r-- | include/functions.inc.php | 51 | ||||
-rw-r--r-- | include/functions_html.inc.php | 34 | ||||
-rw-r--r-- | include/page_tail.php | 2 | ||||
-rw-r--r-- | install/config.sql | 6 | ||||
-rw-r--r-- | language/en_UK.iso-8859-1/admin.lang.php | 184 | ||||
-rw-r--r-- | language/en_UK.iso-8859-1/common.lang.php | 3 | ||||
-rw-r--r-- | template/default/admin/configuration.tpl | 279 | ||||
-rw-r--r-- | template/default/default.css | 53 | ||||
-rw-r--r-- | template/default/footer.tpl | 2 |
11 files changed, 512 insertions, 669 deletions
diff --git a/admin/configuration.php b/admin/configuration.php index 369e0cdda..c14f54f12 100644 --- a/admin/configuration.php +++ b/admin/configuration.php @@ -25,344 +25,313 @@ // | USA. | // +-----------------------------------------------------------------------+ -if( !defined("PHPWG_ROOT_PATH") ) +if (!defined('PHPWG_ROOT_PATH')) { - die ("Hacking attempt!"); + die ("Hacking attempt!"); } +include_once(PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php'); +//-------------------------------------------------------- sections definitions +if (!isset($_GET['section'])) +{ + $page['section'] = 'general'; +} +else +{ + $page['section'] = $_GET['section']; +} + +// templates for fields definitions +$true_false = array('type' => 'radio', + 'options' => array('true' => $lang['yes'], + 'false' => $lang['no'])); +$textfield = array('type' => 'textfield'); + +$sections = array( + 'general' => array( + 'mail_webmaster' => $textfield, + 'prefix_thumbnail' => $textfield, + 'access' => array('type' => 'radio', + 'options' => array( + 'free' => $lang['conf_general_access_1'], + 'restricted' => $lang['conf_general_access_2'])), + 'log' => $true_false, + 'mail_notification' => $true_false, + ), + 'comments' => array( + 'show_comments' => $true_false, + 'comments_forall' => $true_false, + 'nb_comment_page' => $textfield, + 'comments_validation' => $true_false + ), + 'default' => array( + 'default_language' => array('type' => 'select', + 'options' => get_languages()), + 'nb_image_line' => $textfield, + 'nb_line_page' => $textfield, + 'default_template' => array('type' => 'select', + 'options' => get_templates()), + 'recent_period' => $textfield, + 'auto_expand' => $true_false, + 'show_nb_comments' => $true_false + ), + 'upload' => array( + 'upload_available' => $true_false, + 'upload_maxfilesize' => $textfield, + 'upload_maxwidth' => $textfield, + 'upload_maxheight' => $textfield, + 'upload_maxwidth_thumbnail' => $textfield, + 'upload_maxheight_thumbnail' => $textfield + ), + 'session' => array( + 'authorize_cookies' => $true_false, + 'session_time' => $textfield, + 'session_id_size' => $textfield + ), + 'metadata' => array( + 'use_exif' => $true_false, + 'use_iptc' => $true_false, + 'show_exif' => $true_false, + 'show_iptc' => $true_false + ) + ); +//------------------------------------------------------ $conf reinitialization +$result = mysql_query('SELECT param,value FROM '.CONFIG_TABLE); +while ($row = mysql_fetch_array($result)) +{ + $conf[$row['param']] = $row['value']; -include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' ); - -$Caracs = array("¥" => "Y", "µ" => "u", "À" => "A", "Á" => "A", - "Â" => "A", "Ã" => "A", "Ä" => "A", "Å" => "A", - "Æ" => "A", "Ç" => "C", "È" => "E", "É" => "E", - "Ê" => "E", "Ë" => "E", "Ì" => "I", "Í" => "I", - "Î" => "I", "Ï" => "I", "Ð" => "D", "Ñ" => "N", - "Ò" => "O", "Ó" => "O", "Ô" => "O", "Õ" => "O", - "Ö" => "O", "Ø" => "O", "Ù" => "U", "Ú" => "U", - "Û" => "U", "Ü" => "U", "Ý" => "Y", "ß" => "s", - "à" => "a", "á" => "a", "â" => "a", "ã" => "a", - "ä" => "a", "å" => "a", "æ" => "a", "ç" => "c", - "è" => "e", "é" => "e", "ê" => "e", "ë" => "e", - "ì" => "i", "í" => "i", "î" => "i", "ï" => "i", - "ð" => "o", "ñ" => "n", "ò" => "o", "ó" => "o", - "ô" => "o", "õ" => "o", "ö" => "o", "ø" => "o", - "ù" => "u", "ú" => "u", "û" => "u", "ü" => "u", - "ý" => "y", "ÿ" => "y"); + if (isset($_POST[$row['param']])) + { + $conf[$row['param']] = $_POST[$row['param']]; + } +} //------------------------------ verification and registration of modifications -$error = array(); -if ( isset( $_POST['submit'] ) ) +$errors = array(); +if (isset($_POST['submit'])) { +// echo '<pre>'; +// print_r($_POST); +// echo '</pre>'; + $int_pattern = '/^\d+$/'; - // deletion of site as asked - $site_deleted = false; - $query = 'SELECT id'; - $query.= ' FROM '.SITES_TABLE; - $query.= " WHERE galleries_url <> './galleries/';"; - $result = mysql_query( $query ); - while ( $row = mysql_fetch_array( $result ) ) + switch ($page['section']) { - $site = 'delete_site_'.$row['id']; - if ( $_POST[$site] == 1 ) + case 'general' : { - delete_site( $row['id'] ); - $site_deleted = true; + // thumbnail prefix must only contain simple ASCII characters + if (!preg_match('/^[\w-]*$/', $_POST['prefix_thumbnail'])) + { + array_push($errors, $lang['conf_general_prefix_thumbnail_error']); + } + // mail must be formatted as follows : name@server.com + $pattern = '/^[\w-]+(\.[\w-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$/'; + if (!preg_match($pattern, $_POST['mail_webmaster'])) + { + array_push($errors, $lang['conf_general_mail_webmaster_error']); + } + break; + } + case 'comments' : + { + // the number of comments per page must be an integer between 5 and 50 + // included + if (!preg_match($int_pattern, $_POST['nb_comment_page']) + or $_POST['nb_comment_page'] < 5 + or $_POST['nb_comment_page'] > 50) + { + array_push($errors, $lang['conf_comments_nb_comment_page_error']); + } + break; + } + case 'default' : + { + // periods must be integer values, they represents number of days + if (!preg_match($int_pattern, $_POST['recent_period']) + or $_POST['recent_period'] <= 0) + { + array_push($errors, $lang['conf_default_recent_period_error']); + } + break; + } + case 'upload' : + { + // the maximum upload filesize must be an integer between 10 and 1000 + if (!preg_match($int_pattern, $_POST['upload_maxfilesize']) + or $_POST['upload_maxfilesize'] < 10 + or $_POST['upload_maxfilesize'] > 1000) + { + array_push($errors, $lang['conf_upload_upload_maxfilesize_error']); + } + + foreach (array('upload_maxwidth', + 'upload_maxheight', + 'upload_maxwidth_thumbnail', + 'upload_maxheight_thumbnail') + as $field) + { + if (!preg_match($int_pattern, $_POST[$field]) + or $_POST[$field] < 10) + { + array_push($errors, $lang['conf_upload_'.$field.'_error']); + } + } + break; + } + case 'session' : + { + // session_id size must be an integer between 4 and 50 + if (!preg_match($int_pattern, $_POST['session_id_size']) + or $_POST['session_id_size'] < 4 + or $_POST['session_id_size'] > 50) + { + array_push($errors, $lang['conf_session_session_id_size_error']); + } + // session_time must be an integer between 5 and 60, in minutes + if (!preg_match($int_pattern, $_POST['session_time']) + or $_POST['session_time'] < 5 + or $_POST['session_time'] > 60) + { + array_push($errors, $lang['conf_session_session_time_error']); + } + break; } } - // if any picture of this site were linked to another categories, we have - // to update the informations of those categories. To make it simple, we - // just update all the categories - if ( $site_deleted ) - { - update_category( 'all' ); - synchronize_all_users(); - } - // thumbnail prefix must not contain accentuated characters - $old_prefix = $_POST['prefix_thumbnail']; - $prefix = strtr( $_POST['prefix_thumbnail'], $Caracs ); - if ( $old_prefix != $prefix ) - { - array_push( $error, $lang['conf_err_prefixe'] ); - } - // mail must be formatted as follows : name@server.com - $pattern = '/^[\w-]+(\.[\w-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$/'; - if ( !preg_match( $pattern, $_POST['mail_webmaster'] ) ) - { - array_push( $error, $lang['conf_err_mail'] ); - } - // periods must be integer values, they represents number of days - if (!preg_match($int_pattern, $_POST['recent_period']) - or $_POST['recent_period'] <= 0) - { - array_push( $error, $lang['err_periods'] ); - } - // session_id size must be an integer between 4 and 50 - if ( !preg_match( $int_pattern, $_POST['session_id_size'] ) - or $_POST['session_id_size'] < 4 - or $_POST['session_id_size'] > 50 ) - { - array_push( $error, $lang['conf_err_sid_size'] ); - } - // session_time must be an integer between 5 and 60, in minutes - if ( !preg_match( $int_pattern, $_POST['session_time'] ) - or $_POST['session_time'] < 5 - or $_POST['session_time'] > 60 ) - { - array_push( $error, $lang['conf_err_sid_time'] ); - } - // the number of comments per page must be an integer between 5 and 50 - // included - if ( !preg_match( $int_pattern, $_POST['nb_comment_page'] ) - or $_POST['nb_comment_page'] < 5 - or $_POST['nb_comment_page'] > 50 ) - { - array_push( $error, $lang['conf_err_comment_number'] ); - } - // the maximum upload filesize must be an integer between 10 and 1000 - if ( !preg_match( $int_pattern, $_POST['upload_maxfilesize'] ) - or $_POST['upload_maxfilesize'] < 10 - or $_POST['upload_maxfilesize'] > 1000 ) - { - array_push( $error, $lang['conf_err_upload_maxfilesize'] ); - } - // the maximum width of uploaded pictures must be an integer superior to - // 10 - if ( !preg_match( $int_pattern, $_POST['upload_maxwidth'] ) - or $_POST['upload_maxwidth'] < 10 ) - { - array_push( $error, $lang['conf_err_upload_maxwidth'] ); - } - // the maximum height of uploaded pictures must be an integer superior to - // 10 - if ( !preg_match( $int_pattern, $_POST['upload_maxheight'] ) - or $_POST['upload_maxheight'] < 10 ) + + // updating configuraiton if no error found + if (count($errors) == 0) { - array_push( $error, $lang['conf_err_upload_maxheight'] ); + $result = mysql_query('SELECT * FROM '.CONFIG_TABLE); + while ($row = mysql_fetch_array($result)) + { + if (isset($_POST[$row['param']])) + { + $query = ' +UPDATE '.CONFIG_TABLE.' + SET value = \''. str_replace("\'", "''", $_POST[$row['param']]).'\' + WHERE param = \''.$row['param'].'\' +;'; + mysql_query($query); + } + } } - // the maximum width of uploaded thumbnails must be an integer superior to - // 10 - if ( !preg_match( $int_pattern, $_POST['upload_maxwidth_thumbnail'] ) - or $_POST['upload_maxwidth_thumbnail'] < 10 ) +} +//----------------------------------------------------- template initialization +$template->set_filenames(array('config'=>'admin/configuration.tpl')); + +$action = PHPWG_ROOT_PATH.'admin.php?page=configuration'; +$action.= '&section='.$page['section']; + +$template->assign_vars( + array( + 'L_CONFIRM'=>$lang['conf_confirmation'], + 'L_SUBMIT'=>$lang['submit'], + 'F_ACTION'=>add_session_id($action) + ) + ); + +$base_url = PHPWG_ROOT_PATH.'admin.php?page=configuration&section='; +foreach (array_keys($sections) as $section) +{ + if (isset($_GET['section']) and $_GET['section'] == $section) { - array_push( $error, $lang['conf_err_upload_maxwidth_thumbnail'] ); + $class = 'opened'; } - // the maximum width of uploaded thumbnails must be an integer superior to - // 10 - if ( !preg_match( $int_pattern, $_POST['upload_maxheight_thumbnail'] ) - or $_POST['upload_maxheight_thumbnail'] < 10 ) + else { - array_push( $error, $lang['conf_err_upload_maxheight_thumbnail'] ); + $class = ''; } + + $template->assign_block_vars( + 'confmenu_item', + array( + 'CLASS' => $class, + 'URL' => add_session_id($base_url.$section), + 'NAME' => $lang['conf_'.$section.'_title'] + )); +} -/* if ( $_POST['maxwidth'] != '' - and ( !preg_match( $int_pattern, $_POST['maxwidth'] ) - or $_POST['maxwidth'] < 50 ) ) +$fields = $sections[$page['section']]; +foreach ($fields as $field_name => $field) +{ + $template->assign_block_vars( + 'line', + array( + 'NAME' => $lang['conf_'.$page['section'].'_'.$field_name], + 'INFO' => $lang['conf_'.$page['section'].'_'.$field_name.'_info'] + )); + if ($field['type'] == 'textfield') { - array_push( $error, $lang['err_maxwidth'] ); + $template->assign_block_vars( + 'line.textfield', + array( + 'NAME' => $field_name, + 'VALUE' => $conf[$field_name] + )); } - if ( $_POST['maxheight'] - and ( !preg_match( $int_pattern, $_POST['maxheight'] ) - or $_POST['maxheight'] < 50 ) ) - { - array_push( $error, $lang['err_maxheight'] ); - }*/ - // updating configuraiton if no error found - if (count($error) == 0) + else if ($field['type'] == 'radio') { - $result = mysql_query('SELECT * FROM '.CONFIG_TABLE); - while ($row = mysql_fetch_array($result)) + foreach ($field['options'] as $option_value => $option) { - $config_name = $row['param']; - if (isset($_POST[$config_name])) + if ($conf[$field_name] == $option_value) { - $conf[$config_name] = $_POST[$config_name]; + $checked = 'checked="checked"'; } else { - $conf[$config_name] = $row['value']; + $checked = ''; } - - if (isset($_POST[$config_name])) + + $template->assign_block_vars( + 'line.radio', + array( + 'NAME' => $field_name, + 'VALUE' => $option_value, + 'CHECKED' => $checked, + 'OPTION' => $option + )); + } + } + else if ($field['type'] == 'select') + { + $template->assign_block_vars( + 'line.select', + array( + 'NAME' => $field_name + )); + foreach ($field['options'] as $option_value => $option) + { + if ($conf[$field_name] == $option_value) { - $query = ' -UPDATE '.CONFIG_TABLE.' - SET value = \''. str_replace("\'", "''", $conf[$config_name]).'\' - WHERE param = \''.$config_name.'\' -;'; - mysql_query($query); + $selected = 'selected="selected"'; + } + else + { + $selected = ''; } + + $template->assign_block_vars( + 'line.select.select_option', + array( + 'VALUE' => $option_value, + 'SELECTED' => $selected, + 'OPTION' => $option + )); } } } - -// echo '<pre>'; -// print_r($conf); -// echo '</pre>'; - -$access = ($conf['access']=='free')?'ACCESS_FREE':'ACCESS_RESTRICTED'; -$log = ($conf['log']=='true')?'HISTORY_YES':'HISTORY_NO'; -$mail_notif = ($conf['mail_notification']=='true')?'MAIL_NOTIFICATION_YES':'MAIL_NOTIFICATION_NO'; -$show_comments = ($conf['show_comments']=='true')?'SHOW_COMMENTS_YES':'SHOW_COMMENTS_NO'; -$comments_all = ($conf['comments_forall']=='true')?'COMMENTS_ALL_YES':'COMMENTS_ALL_NO'; -$comments_validation = ($conf['comments_validation']=='true')?'VALIDATE_COMMENTS_YES':'VALIDATE_COMMENTS_NO'; -$expand = ($conf['auto_expand']=='true')?'EXPAND_TREE_YES':'EXPAND_TREE_NO'; -$nb_comments = ($conf['show_nb_comments']=='true')?'NB_COMMENTS_YES':'NB_COMMENTS_NO'; -$upload = ($conf['upload_available']=='true')?'UPLOAD_YES':'UPLOAD_NO'; -$cookie = ($conf['authorize_cookies']=='true')?'COOKIE_YES':'COOKIE_NO'; -$use_exif = ($conf['use_exif']=='true')?'USE_EXIF_YES':'USE_EXIF_NO'; -$use_iptc = ($conf['use_iptc']=='true')?'USE_IPTC_YES':'USE_IPTC_NO'; -$show_exif = ($conf['show_exif']=='true')?'SHOW_EXIF_YES':'SHOW_EXIF_NO'; -$show_iptc = ($conf['show_iptc']=='true')?'SHOW_IPTC_YES':'SHOW_IPTC_NO'; - -//----------------------------------------------------- template initialization -$template->set_filenames( array('config'=>'admin/configuration.tpl') ); - -$template->assign_vars(array( - 'ADMIN_NAME'=>$conf['webmaster'], - 'ADMIN_MAIL'=>$conf['mail_webmaster'], - 'THUMBNAIL_PREFIX'=>$conf['prefix_thumbnail'], - 'NB_COMMENTS_PAGE'=>$conf['nb_comment_page'], - 'LANG_SELECT'=>language_select($conf['default_lang'], 'default_lang'), - 'NB_IMAGE_LINE'=>$conf['nb_image_line'], - 'NB_ROW_PAGE'=>$conf['nb_line_page'], - 'STYLE_SELECT'=>style_select($conf['default_style'], 'default_style'), - 'RECENT_PERIOD'=>$conf['recent_period'], - 'UPLOAD_MAXSIZE'=>$conf['upload_maxfilesize'], - 'UPLOAD_MAXWIDTH'=>$conf['upload_maxwidth'], - 'UPLOAD_MAXHEIGHT'=>$conf['upload_maxheight'], - 'TN_UPLOAD_MAXWIDTH'=>$conf['upload_maxwidth_thumbnail'], - 'TN_UPLOAD_MAXHEIGHT'=>$conf['upload_maxheight_thumbnail'], - 'SESSION_LENGTH'=>$conf['session_time'], - 'SESSION_ID_SIZE'=>$conf['session_id_size'], - - $access=>'checked="checked"', - $log=>'checked="checked"', - $mail_notif=>'checked="checked"', - $show_comments=>'checked="checked"', - $comments_all=>'checked="checked"', - $comments_validation=>'checked="checked"', - $expand=>'checked="checked"', - $nb_comments=>'checked="checked"', - $upload=>'checked="checked"', - $cookie=>'checked="checked"', - $use_exif=>'checked="checked"', - $use_iptc=>'checked="checked"', - $show_exif=>'checked="checked"', - $show_iptc=>'checked="checked"', - - 'L_CONFIRM'=>$lang['conf_confirmation'], - 'L_CONF_GENERAL'=>$lang['conf_general_title'], - 'L_ADMIN_NAME'=>$lang['conf_general_webmaster'], - 'L_ADMIN_NAME_INFO'=>$lang['conf_general_webmaster_info'], - 'L_ADMIN_MAIL'=>$lang['conf_general_mail'], - 'L_ADMIN_MAIL_INFO'=>$lang['conf_general_mail_info'], - 'L_THUMBNAIL_PREFIX'=>$lang['conf_general_prefix'], - 'L_THUMBNAIL_PREFIX_INFO'=>$lang['conf_general_prefix_info'], - 'L_ACCESS'=>$lang['conf_general_access'], - 'L_ACCESS_INFO'=>$lang['conf_general_access_info'], - 'L_ACCESS_FREE'=>$lang['conf_general_access_1'], - 'L_ACCESS_RESTRICTED'=>$lang['conf_general_access_2'], - 'L_CONF_HISTORY'=>$lang['history'], - 'L_CONF_HISTORY_INFO'=>$lang['conf_general_log_info'], - 'L_MAIL_NOTIFICATION'=>$lang['conf_general_mail_notification'], - 'L_MAIL_NOTIFICATION_INFO'=>$lang['conf_general_mail_notification_info'], - 'L_CONF_COMMENTS'=>$lang['conf_comments_title'], - 'L_SHOW_COMMENTS'=>$lang['conf_comments_show_comments'], - 'L_SHOW_COMMENTS_INFO'=>$lang['conf_comments_show_comments_info'], - 'L_COMMENTS_ALL'=>$lang['conf_comments_forall'], - 'L_COMMENTS_ALL_INFO'=>$lang['conf_comments_forall_info'], - 'L_NB_COMMENTS_PAGE'=>$lang['conf_comments_comments_number'], - 'L_NB_COMMENTS_PAGE_INFO'=>$lang['conf_comments_comments_number_info'], - 'L_VALIDATE_COMMENTS'=>$lang['conf_comments_validation'], - 'L_VALIDATE_COMMENTS_INFO'=>$lang['conf_comments_validation_info'], - 'L_ABILITIES_SETTINGS'=>$lang['conf_default_title'], - 'L_LANG_SELECT'=>$lang['customize_language'], - 'L_LANG_SELECT_INFO'=>$lang['conf_default_language_info'], - 'L_NB_IMAGE_LINE'=>$lang['customize_nb_image_per_row'], - 'L_NB_IMAGE_LINE_INFO'=>$lang['conf_default_nb_image_per_row_info'], - 'L_NB_ROW_PAGE'=>$lang['customize_nb_row_per_page'], - 'L_NB_ROW_PAGE_INFO'=>$lang['conf_default_nb_row_per_page_info'], - 'L_STYLE_SELECT'=>$lang['customize_theme'], - 'L_STYLE_SELECT_INFO'=>$lang['conf_default_theme_info'], - 'L_RECENT_PERIOD'=>$lang['customize_recent_period'], - 'L_RECENT_PERIOD_INFO'=>$lang['conf_default_recent_period_info'], - 'L_EXPAND_TREE'=>$lang['customize_expand'], - 'L_EXPAND_TREE_INFO'=>$lang['conf_default_expand_info'], - 'L_NB_COMMENTS'=>$lang['customize_show_nb_comments'], - 'L_NB_COMMENTS_INFO'=>$lang['conf_default_show_nb_comments_info'], - 'L_AUTH_UPLOAD'=>$lang['conf_upload_available'], - 'L_AUTH_UPLOAD_INFO'=>$lang['conf_upload_available_info'], - 'L_CONF_UPLOAD'=>$lang['conf_upload_title'], - 'L_UPLOAD_MAXSIZE'=>$lang['conf_upload_maxfilesize'], - 'L_UPLOAD_MAXSIZE_INFO'=>$lang['conf_upload_maxfilesize_info'], - 'L_UPLOAD_MAXWIDTH'=>$lang['conf_upload_maxwidth'], - 'L_UPLOAD_MAXWIDTH_INFO'=>$lang['conf_upload_maxwidth_info'], - 'L_UPLOAD_MAXHEIGHT'=>$lang['conf_upload_maxheight'], - 'L_UPLOAD_MAXHEIGHT_INFO'=>$lang['conf_upload_maxheight_info'], - 'L_TN_UPLOAD_MAXWIDTH'=>$lang['conf_upload_maxwidth_thumbnail'], - 'L_TN_UPLOAD_MAXWIDTH_INFO'=>$lang['conf_upload_maxwidth_thumbnail_info'], - 'L_TN_UPLOAD_MAXHEIGHT'=>$lang['conf_upload_maxheight_thumbnail'], - 'L_TN_UPLOAD_MAXHEIGHT_INFO'=>$lang['conf_upload_maxheight_thumbnail'], - 'L_CONF_SESSION'=>$lang['conf_session_title'], - 'L_COOKIE'=>$lang['conf_session_cookie'], - 'L_COOKIE_INFO'=>$lang['conf_session_cookie_info'], - 'L_SESSION_LENGTH'=>$lang['conf_session_time'], - 'L_SESSION_LENGTH_INFO'=>$lang['conf_session_time_info'], - 'L_SESSION_ID_SIZE'=>$lang['conf_session_size'], - 'L_SESSION_ID_SIZE_INFO'=>$lang['conf_session_size_info'], - 'L_YES'=>$lang['yes'], - 'L_NO'=>$lang['no'], - 'L_SUBMIT'=>$lang['submit'], - 'L_CONF_METADATA'=>$lang['conf_metadata_title'], - 'L_USE_EXIF'=>$lang['conf_use_exif'], - 'L_USE_EXIF_INFO'=>$lang['conf_use_exif_info'], - 'L_USE_IPTC'=>$lang['conf_use_iptc'], - 'L_USE_IPTC_INFO'=>$lang['conf_use_iptc_info'], - 'L_SHOW_EXIF'=>$lang['conf_show_exif'], - 'L_SHOW_EXIF_INFO'=>$lang['conf_show_exif_info'], - 'L_SHOW_IPTC'=>$lang['conf_show_iptc'], - 'L_SHOW_IPTC_INFO'=>$lang['conf_show_iptc_info'], - - 'F_ACTION'=>add_session_id(PHPWG_ROOT_PATH.'admin.php?page=configuration') - )); - //-------------------------------------------------------------- errors display -if ( sizeof( $error ) != 0 ) +if (count($errors) != 0) { $template->assign_block_vars('errors',array()); - for ( $i = 0; $i < sizeof( $error ); $i++ ) + foreach ($errors as $error) { - $template->assign_block_vars('errors.error',array('ERROR'=>$error[$i])); + $template->assign_block_vars('errors.error',array('ERROR'=>$error)); } } -elseif ( isset( $_POST['submit'] ) ) +else if (isset($_POST['submit'])) { $template->assign_block_vars('confirmation' ,array()); } -//------------------------------------------------ remote sites administration -$query = 'select id,galleries_url'; -$query.= ' from '.SITES_TABLE; -$query.= " where galleries_url <> './galleries/';"; -$result = mysql_query( $query ); -if ( mysql_num_rows( $result ) > 0 ) -{ - $vtp->addSession( $sub, 'remote_sites' ); - $i = 0; - while ( $row = mysql_fetch_array( $result ) ) - { - $vtp->addSession( $sub, 'site' ); - $vtp->setVar( $sub, 'site.url', $row['galleries_url'] ); - $vtp->setVar( $sub, 'site.id', $row['id'] ); - if ( $i == 0 ) - { - $vtp->addSession( $sub, 'rowspan' ); - $vtp->setVar( $sub, 'rowspan.nb_sites', mysql_num_rows( $result ) ); - $vtp->closeSession( $sub, 'rowspan' ); - } - $vtp->closeSession( $sub, 'site' ); - $i++; - } - $vtp->closeSession( $sub, 'remote_sites' ); -} //----------------------------------------------------------- sending html code $template->assign_var_from_handle('ADMIN_CONTENT', 'config'); ?> diff --git a/include/common.inc.php b/include/common.inc.php index 6a06706ce..6d4b37195 100644 --- a/include/common.inc.php +++ b/include/common.inc.php @@ -130,7 +130,7 @@ include(PHPWG_ROOT_PATH . 'include/template.php'); // mysql_connect( $dbhost, $dbuser, $dbpasswd ) -or die ( "Could not connect to server" ); +or die ( "Could not connect to database server" ); mysql_select_db( $dbname ) or die ( "Could not connect to database" ); diff --git a/include/functions.inc.php b/include/functions.inc.php index df5b39e40..afd4f87b0 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -179,22 +179,25 @@ function get_filename_wo_extension( $filename ) } /** - * returns an array contening sub-directories + * returns an array contening sub-directories, excluding "CVS" * * @param string $dir * @return array */ -function get_dirs( $directory ) +function get_dirs($directory) { $sub_dirs = array(); - if ( $opendir = opendir( $directory ) ) + if ($opendir = opendir($directory)) { - while ( $file = readdir ( $opendir ) ) + while ($file = readdir($opendir)) { - if ( $file != '.' and $file != '..' and is_dir ( $directory.'/'.$file ) ) + if ($file != '.' + and $file != '..' + and is_dir($directory.'/'.$file) + and $file != 'CVS') { - array_push( $sub_dirs, $file ); + array_push($sub_dirs, $file); } } } @@ -258,23 +261,29 @@ function get_picture_size( $original_width, $original_height, } //-------------------------------------------- PhpWebGallery specific functions -// get_languages retourne un tableau contenant tous les languages -// disponibles pour PhpWebGallery -function get_languages( $rep_language ) +/** + * returns an array with a list of {language_code => language_name} + * + * @returns array + */ +function get_languages() { - global $lang; + $dir = opendir(PHPWG_ROOT_PATH.'language'); $languages = array(); - $i = 0; - if ( $opendir = opendir ( $rep_language ) ) + + while ($file = readdir($dir)) { - while ( $file = readdir ( $opendir ) ) + $path = realpath(PHPWG_ROOT_PATH.'language/'.$file); + if (is_dir($path) and !is_link($path) and file_exists($path.'/iso.txt')) { - if ( is_dir ( $rep_language.$file )&& !substr_count($file,'.') && isset($lang['lang'][$file])) - { - $languages[$i++] =$lang['lang'][$file]; - } + list($language_name) = @file($path.'/iso.txt'); + $languages[$file] = $language_name; } } + closedir($dir); + @asort($languages); + @reset($languages); + return $languages; } @@ -539,4 +548,12 @@ function get_query_string_diff($rejects = array()) return $query_string; } + +/** + * returns available templates + */ +function get_templates() +{ + return get_dirs(PHPWG_ROOT_PATH.'template'); +} ?>
\ No newline at end of file diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php index 015eef155..5d91aa7aa 100644 --- a/include/functions_html.inc.php +++ b/include/functions_html.inc.php @@ -113,22 +113,7 @@ function create_navigation_bar( $url, $nb_element, $start, // function language_select($default, $select_name = "language") { - - $dir = opendir(PHPWG_ROOT_PATH . 'language'); - $available_lang= array(); - - while ( $file = readdir($dir) ) - { - $path= realpath(PHPWG_ROOT_PATH . 'language/'.$file); - if (is_dir ($path) && !is_link($path) && file_exists($path . '/iso.txt')) - { - list($displayname) = @file($path . '/iso.txt'); - $available_lang[$displayname] = $file; - } - } - closedir($dir); - @asort($available_lang); - @reset($available_lang); + $available_lang = get_languages(); $lang_select = '<select name="' . $select_name . '" onchange="this.form.submit()">'; foreach ($available_lang as $displayname => $code) @@ -146,19 +131,14 @@ function language_select($default, $select_name = "language") // function style_select($default_style, $select_name = "style") { - $dir = opendir(PHPWG_ROOT_PATH . 'template'); - $style_select = '<select name="' . $select_name . '">'; - while ( $file = readdir($dir) ) + $templates = get_templates(); + + foreach ($templates as $template) { - if (is_dir ( realpath(PHPWG_ROOT_PATH.'template/'.$file) ) - && !is_link(realpath(PHPWG_ROOT_PATH . 'template/' . $file)) - && !strstr($file,'.')) - { - $selected = ( $file == $default_style ) ? ' selected="selected"' : ''; - $style_select .= '<option value="' . $file . '"' . $selected . '>' . $file . '</option>'; - } + $selected = ( $template == $default_style ) ? ' selected="selected"' : ''; + $style_select.= '<option value="'.$template.'"'.$selected.'>'; + $style_select.= $template.'</option>'; } - closedir($dir); return $style_select; } diff --git a/include/page_tail.php b/include/page_tail.php index bf1c1d0e3..f8388f766 100644 --- a/include/page_tail.php +++ b/include/page_tail.php @@ -34,12 +34,12 @@ $template->assign_vars( array( 'TIME' => $time, 'VERSION' => $conf['version'], - 'WEBMASTER'=>$conf['webmaster'], 'MAIL'=>$conf['mail_webmaster'], 'L_GEN_TIME' => $lang['generation_time'], 'L_SEND_MAIL' => $lang['send_mail'], 'L_TITLE_MAIL' => $lang['title_send_mail'], + 'L_WEBMASTER'=>$lang['webmaster'], 'U_SITE' => $conf['site_url'] )); diff --git a/install/config.sql b/install/config.sql index 3ef928a4f..c440f1743 100644 --- a/install/config.sql +++ b/install/config.sql @@ -1,13 +1,11 @@ -- initial configuration for PhpWebGallery INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('prefix_thumbnail','TN-','thumbnails filename prefix'); -INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('webmaster','','webmaster login'); INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('mail_webmaster','','webmaster mail'); -INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('default_lang','en_UK.iso-8859-1','Default gallery language'); -INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('default_style','default','Default gallery style'); +INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('default_language','en_UK.iso-8859-1','Default gallery language'); +INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('default_template','default','Default gallery style'); INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('access','free','access type to your gallery (free|restricted)'); INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('session_id_size','4','length of session identifiers'); -INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('session_keyword','','improves the encoding of the session identifier'); INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('session_time','30','number of minutes for validity of sessions'); INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('show_comments','true','display the users comments'); INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('nb_comment_page','10','number of comments to display on each page'); diff --git a/language/en_UK.iso-8859-1/admin.lang.php b/language/en_UK.iso-8859-1/admin.lang.php index 6a7afb728..b8304ddf5 100644 --- a/language/en_UK.iso-8859-1/admin.lang.php +++ b/language/en_UK.iso-8859-1/admin.lang.php @@ -82,87 +82,131 @@ $lang['title_default'] = 'PhpWebGallery administration'; $lang['title_waiting'] = 'Pictures waiting for validation'; //Error messages -$lang['conf_err_prefixe'] = 'thumbnail\'s prefix mustn\'t contain any accentued character'; -$lang['conf_err_mail'] = 'e-mail address refused, it must be like name@server.com'; -$lang['conf_err_sid_size'] = 'the session identifier size must be an integer value between 4 and 50'; -$lang['conf_err_sid_time'] = 'the session time must be an integer value between 5 and 60'; -$lang['conf_err_max_user_listbox'] = 'the max user listbox number must be an integer value between 0 and 255'; $lang['cat_error_name'] = 'The name of a category mustn\'t be empty'; //Configuration $lang['conf_confirmation'] = 'Information data registered in database'; -$lang['conf_general_title'] = 'Main configuration'; -$lang['conf_general_webmaster'] = 'Webmaster login'; -$lang['conf_general_webmaster_info'] = 'It will be shown to the visitors. It is necessary for website administration'; -$lang['conf_general_mail'] = 'Webmaster mail adress'; -$lang['conf_general_mail_info'] = 'Visitors will be able to contact by this mail'; -$lang['conf_general_prefix'] = 'Thumbnail prefix'; -$lang['conf_general_prefix_info'] = 'Thumbnails use this prefix. Do not fill if your not sure.'; + +// Configuration -> general +$lang['conf_general_title'] = 'Main'; + +$lang['conf_general_mail_webmaster'] = 'Webmaster mail adress'; +$lang['conf_general_mail_webmaster_info'] = 'Visitors will be able to contact site administrator with this mail'; +$lang['conf_general_mail_webmaster_error'] = 'e-mail address refused, it must be like name@server.com'; + +$lang['conf_general_prefix_thumbnail'] = 'Thumbnail prefix'; +$lang['conf_general_prefix_thumbnail_info'] = 'Thumbnails use this prefix. Do not fill if your not sure.'; +$lang['conf_general_prefix_thumbnail_error'] = 'thumbnail\'s prefix must only contain characters among : a to z (case insensitive), "-" or "_"'; + $lang['conf_general_access'] = 'Access type'; +$lang['conf_general_access_info'] = '- free : anyone can enter the site, any visitor can create an account in order to customize the appareance of the website<br />- restricted : the webmaster create accounts. Only registered users can enter the site'; $lang['conf_general_access_1'] = 'Free'; $lang['conf_general_access_2'] = 'Restricted'; -$lang['conf_general_access_info'] = '- free : anyone can enter the site, any visitor can create an account in order to customize the appareance of the website<br />- restricted : the webmaster create accounts. Only registered users can enter the site'; -$lang['conf_comments'] = 'Users comments'; -$lang['conf_comments_title'] = 'Configuration of users comments'; -$lang['conf_comments_show_comments'] = $lang['conf_comments']; -$lang['conf_comments_show_comments_info'] = 'display the users comments under each picture ?'; -$lang['conf_comments_comments_number'] = 'Number of comments per page'; -$lang['conf_comments_comments_number_info'] = 'number of comments to display on each page. This number is unlimited for a picture. Enter a number between 5 and 50.'; -$lang['conf_err_comment_number'] = 'The number of comments a page must be between 5 and 50 included.'; -$lang['conf_remote_site_delete_info'] = 'Deleting a remote server will delete all the image and the categories in relation with this server.'; -$lang['conf_upload_title'] = 'Configuration of the users upload'; -$lang['conf_upload_available'] = 'authorized the upload of pictures'; -$lang['conf_upload_available_info'] = ''; -$lang['conf_upload_maxfilesize'] = 'maximum filesize'; -$lang['conf_upload_maxfilesize_info'] = 'Maximum filesize for the uploaded pictures. Must be a number between 10 and 1000 KB.'; -$lang['conf_err_upload_maxfilesize'] = 'Maximum filesize for the uploaded pictures must be a number between 10 and 1000 KB.'; -$lang['conf_upload_maxwidth'] = 'maximum width'; -$lang['conf_upload_maxwidth_info'] = 'Maximum width authorized for the uploaded images. Must be a number superior to 10 pixels'; -$lang['conf_err_upload_maxwidth'] = 'maximum width authorized for the uploaded images must be a number superior to 10 pixels.'; -$lang['conf_upload_maxheight'] = 'maximum height'; -$lang['conf_upload_maxheight_info'] = 'Maximum height authorized for the uploaded images. Must be a number superior to 10 pixels'; -$lang['conf_err_upload_maxwidth'] = 'maximum height authorized for the uploaded images must be a number superior to 10 pixels.'; -$lang['conf_upload_maxwidth_thumbnail'] = 'thumbnails maximum width'; -$lang['conf_upload_maxwidth_thumbnail_info'] = 'Maximum width authorized for the uploaded thumbnails. Must be a number superior to 10 pixels'; -$lang['conf_err_upload_maxwidth_thumbnail'] = 'Maximum width authorized for the uploaded thumbnails must be a number superior to 10 pixels.'; -$lang['conf_upload_maxheight_thumbnail'] = 'thumbnails maximum height'; -$lang['conf_upload_maxheight_thumbnail_info'] = 'Maximum height authorized for the uploaded thumbnails. Must be a number superior to 10 pixels'; -$lang['conf_err_upload_maxheight_thumbnail'] = 'Maximum height authorized for the uploaded thumbnails must be a number superior to 10 pixels.'; -$lang['conf_default_title'] = 'Default display properties for unregistered visitors and new accounts'; -$lang['conf_default_language_info'] = 'Default language'; -$lang['conf_default_theme_info'] = 'Default theme'; -$lang['conf_session_title'] = 'Sessions configuration'; -$lang['conf_session_size'] = 'identifier size'; -$lang['conf_session_size_info'] = '- the longer your identifier is, the more secure your site is<br />- enter a number between 4 and 50'; -$lang['conf_session_time'] = 'validity period'; -$lang['conf_session_time_info'] = '- the shorter the validity period is, the more secure your site is<br />- enter a number between 5 and 60, in minutes'; -$lang['conf_session_key'] = 'keyword'; -$lang['conf_session_key_info'] = '- the session keyword improve the encoding of the session identifier<br />- enter any sentence shorter than 255 caracters'; + +$lang['conf_general_log'] = $lang['history']; $lang['conf_general_log_info'] = 'Keep an history of visits on your website ? Visits will be shown in the history section of the administration panel'; + $lang['conf_general_mail_notification'] = 'Mail notification'; $lang['conf_general_mail_notification_info'] = 'Automated mail notification for adminsitrators (and only for them) when a user add a comment or upload a picture.'; -$lang['conf_comments_validation'] = 'validation'; -$lang['conf_comments_validation_info'] = 'An administrator validate users posted comments before the becom visible on the site'; -$lang['conf_comments_forall'] = 'for all ?'; -$lang['conf_comments_forall_info'] = 'Even guest not registered can post comments'; -$lang['conf_default_nb_image_per_row_info'] = 'number of pictures for each row by default'; -$lang['conf_default_nb_row_per_page_info'] = 'number of rows by page by default'; -$lang['conf_default_recent_period_info'] = 'By days. Period within a picture is shown as new. The short period must be superior to 1 day.'; -$lang['conf_default_expand_info'] = 'expand all categories by default in the menu ?'; + +// Configuration -> comments +$lang['conf_comments_title'] = 'Users comments'; + +$lang['conf_comments_show_comments'] = 'Show users comments'; +$lang['conf_comments_show_comments_info'] = 'display the users comments under each picture ?'; + +$lang['conf_comments_nb_comment_page'] = 'Number of comments per page'; +$lang['conf_comments_nb_comment_page_info'] = 'number of comments to display on each page. This number is unlimited for a picture. Enter a number between 5 and 50.'; +$lang['conf_comments_nb_comment_page_error'] = 'The number of comments a page must be between 5 and 50 included.'; + +$lang['conf_comments_comments_validation'] = 'validation'; +$lang['conf_comments_comments_validation_info'] = 'An administrator validate users posted comments before the becom visible on the site'; + +$lang['conf_comments_comments_forall'] = 'for all ?'; +$lang['conf_comments_comments_forall_info'] = 'Even guest not registered can post comments'; + +// Configuration -> upload +$lang['conf_upload_title'] = 'Users upload'; + +$lang['conf_upload_upload_available'] = 'authorized the upload of pictures'; +$lang['conf_upload_upload_available_info'] = ''; + +$lang['conf_upload_upload_maxfilesize'] = 'maximum filesize'; +$lang['conf_upload_upload_maxfilesize_info'] = 'Maximum filesize for the uploaded pictures. Must be a number between 10 and 1000 KB.'; +$lang['conf_upload_upload_maxfilesize_error'] = 'Maximum filesize for the uploaded pictures must be a number between 10 and 1000 KB.'; + +$lang['conf_upload_upload_maxwidth'] = 'maximum width'; +$lang['conf_upload_upload_maxwidth_info'] = 'Maximum width authorized for the uploaded images. Must be a number superior to 10 pixels'; +$lang['conf_upload_upload_maxwidth_error'] = 'maximum width authorized for the uploaded images must be a number superior to 10 pixels.'; + +$lang['conf_upload_upload_maxheight'] = 'maximum height'; +$lang['conf_upload_upload_maxheight_info'] = 'Maximum height authorized for the uploaded images. Must be a number superior to 10 pixels'; +$lang['conf_upload_upload_maxheight_error'] = 'maximum height authorized for the uploaded images must be a number superior to 10 pixels.'; + +$lang['conf_upload_upload_maxwidth_thumbnail'] = 'thumbnails maximum width'; +$lang['conf_upload_upload_maxwidth_thumbnail_info'] = 'Maximum width authorized for the uploaded thumbnails. Must be a number superior to 10 pixels'; +$lang['conf_upload_upload_maxwidth_thumbnail_error'] = 'Maximum width authorized for the uploaded thumbnails must be a number superior to 10 pixels.'; + +$lang['conf_upload_upload_maxheight_thumbnail'] = 'thumbnails maximum height'; +$lang['conf_upload_upload_maxheight_thumbnail_info'] = 'Maximum height authorized for the uploaded thumbnails. Must be a number superior to 10 pixels'; +$lang['conf_upload_upload_maxheight_thumbnail_error'] = 'Maximum height authorized for the uploaded thumbnails must be a number superior to 10 pixels.'; + +// Configuration -> default +$lang['conf_default_title'] = 'Default display'; + +$lang['conf_default_default_language'] = $lang['customize_language']; +$lang['conf_default_default_language_info'] = 'Default language'; + +$lang['conf_default_default_template'] = $lang['customize_theme']; +$lang['conf_default_default_template_info'] = 'Default theme'; + +$lang['conf_default_nb_image_line'] = $lang['customize_nb_image_per_row']; +$lang['conf_default_nb_image_line_info'] = 'number of pictures for each row by default'; + +$lang['conf_default_nb_line_page'] = $lang['customize_nb_row_per_page']; +$lang['conf_default_nb_line_page_info'] = 'number of rows by page by default'; + +$lang['conf_default_recent_period'] = $lang['customize_recent_period']; +$lang['conf_default_recent_period_info'] = 'By days. Period within a picture is shown as new. Must be superior to 1 day.'; +$lang['conf_default_recent_period_error'] = 'The recent period must be an integer value, superior to 1.'; + +$lang['conf_default_auto_expand'] = $lang['customize_expand']; +$lang['conf_default_auto_expand_info'] = 'expand all categories by default in the menu ?'; + +$lang['conf_default_show_nb_comments'] = $lang['customize_show_nb_comments']; $lang['conf_default_show_nb_comments_info'] = 'show the number of comments for each picture on the thumbnails page'; -$lang['conf_default_maxwidth_info'] = 'Maximum width for display pictures : picture will have a new width only for display, picture files won\'t be changed. Let empty if you don\'t wish to have a limit.'; -$lang['conf_default_maxheight_info'] = 'Just as the maximum width, but for the height'; -$lang['conf_session_cookie'] = 'Authorize cookies'; -$lang['conf_session_cookie_info'] = 'users won\'t have to log on each visit any more. Less secure.'; -$lang['conf_metadata_title'] = 'Files metadata'; -$lang['conf_use_exif'] = 'Use EXIF'; -$lang['conf_use_exif_info'] = 'Use EXIF data during metadata synchronization into PhpWebGallery database'; -$lang['conf_use_iptc'] = 'Use IPTC'; -$lang['conf_use_iptc_info'] = 'Use IPTC data during metadata synchronization into PhpWebGallery database'; -$lang['conf_show_exif'] = 'Show EXIF'; -$lang['conf_show_exif_info'] = 'Give the possibility to show EXIF metadata on visualisation page. See include/config.inc.php for available EXIF fields'; -$lang['conf_show_iptc'] = 'Show IPTC'; -$lang['conf_show_iptc_info'] = 'Give the possibility to show IPTC metadata on visualisation page. See include/config.inc.php for available IPTC fields'; + +// Configuration -> session +$lang['conf_session_title'] = 'Sessions'; + +$lang['conf_session_session_id_size'] = 'identifier size'; +$lang['conf_session_session_id_size_info'] = '- the longer your identifier is, the more secure your site is<br />- enter a number between 4 and 50'; +$lang['conf_session_session_id_size_error'] = 'the session identifier size must be an integer value between 4 and 50'; + +$lang['conf_session_session_time'] = 'validity period'; +$lang['conf_session_session_time_info'] = '- the shorter the validity period is, the more secure your site is<br />- enter a number between 5 and 60, in minutes'; +$lang['conf_session_session_time_error'] = 'the session time must be an integer value between 5 and 60'; + +$lang['conf_session_authorize_cookies'] = 'Authorize cookies'; +$lang['conf_session_authorize_cookies_info'] = 'users won\'t have to log on each visit any more. Less secure.'; + +// Configuration -> metadata +$lang['conf_metadata_title'] = 'Metadata'; + +$lang['conf_metadata_use_exif'] = 'Use EXIF'; +$lang['conf_metadata_use_exif_info'] = 'Use EXIF data during metadata synchronization into PhpWebGallery database'; + +$lang['conf_metadata_use_iptc'] = 'Use IPTC'; +$lang['conf_metadata_use_iptc_info'] = 'Use IPTC data during metadata synchronization into PhpWebGallery database'; + +$lang['conf_metadata_show_exif'] = 'Show EXIF'; +$lang['conf_metadata_show_exif_info'] = 'Give the possibility to show EXIF metadata on visualisation page. See include/config.inc.php for available EXIF fields'; + +$lang['conf_metadata_show_iptc'] = 'Show IPTC'; +$lang['conf_metadata_show_iptc_info'] = 'Give the possibility to show IPTC metadata on visualisation page. See include/config.inc.php for available IPTC fields'; + +// Configuration -> remote +$lang['conf_remote_site_delete_info'] = 'Deleting a remote server will delete all the image and the categories in relation with this server.'; //FAQ $lang['help_images_title'] = 'Adding pictures'; diff --git a/language/en_UK.iso-8859-1/common.lang.php b/language/en_UK.iso-8859-1/common.lang.php index 25f9a8919..e167ed8ca 100644 --- a/language/en_UK.iso-8859-1/common.lang.php +++ b/language/en_UK.iso-8859-1/common.lang.php @@ -144,7 +144,8 @@ $lang['previous_page'] = 'Previous'; $lang['next_page'] = 'Next'; $lang['recent_image'] = 'Image within the'; $lang['days'] = 'days'; -$lang['send_mail'] = 'Contact the webmaster'; +$lang['send_mail'] = 'Contact'; +$lang['webmaster'] = 'webmaster'; $lang['title_send_mail'] = 'A comment on your site'; $lang['sub-cat'] = 'subcategories'; $lang['images_available'] = 'images in this category'; diff --git a/template/default/admin/configuration.tpl b/template/default/admin/configuration.tpl index d1a528b6d..bcdb4882e 100644 --- a/template/default/admin/configuration.tpl +++ b/template/default/admin/configuration.tpl @@ -10,242 +10,49 @@ <!-- BEGIN confirmation --> <div class="info">{L_CONFIRM}</div> <!-- END confirmation --> + <form method="post" action="{F_ACTION}"> + +<p class="confMenu"> + <!-- BEGIN confmenu_item --> + <a class="{confmenu_item.CLASS}" href="{confmenu_item.URL}">{confmenu_item.NAME}</a> + <!-- END confmenu_item --> +</p> + <table width="100%" align="center"> - <tr class="admin"> - <th colspan="2">{L_CONF_GENERAL}</th> - </tr> - <tr> - <td colspan="2"> </td> - </tr> - <tr> - <td width="50%" ><strong>{L_ADMIN_NAME} :</strong><br /><span class="small">{L_ADMIN_NAME_INFO}</span></td> - <td class="row1"><input type="text" size="25" name="webmaster" value="{ADMIN_NAME}" /></td> - </tr> - <tr> - <td><strong>{L_ADMIN_MAIL} :</strong><br /><span class="small">{L_ADMIN_MAIL_INFO}</span></td> - <td class="row1"><input type="text" size="25" maxlength="100" name="mail_webmaster" value="{ADMIN_MAIL}" /></td> - </tr> - <tr> - <td><strong>{L_THUMBNAIL_PREFIX} :</strong><br /><span class="small">{L_THUMBNAIL_PREFIX_INFO}</span></td> - <td class="row1"><input type="text" size="3" maxlength="4" name="prefix_thumbnail" value="{THUMBNAIL_PREFIX}" /></td> - </tr> - <tr> - <td><strong>{L_ACCESS} :</strong><br /><span class="small">{L_ACCESS_INFO}</span></td> - <td class="row1"><input type="radio" class="radio" name="access" value="free" {ACCESS_FREE} />{L_ACCESS_FREE} - <input type="radio" class="radio" name="access" value="restricted" {ACCESS_RESTRICTED} />{L_ACCESS_RESTRICTED}</td> - </tr> - <tr> - <td><strong>{L_CONF_HISTORY} :</strong><br /><span class="small">{L_CONF_HISTORY_INFO}</span></td> - <td class="row1"><input type="radio" class="radio" name="log" value="true" {HISTORY_YES} />{L_YES} - <input type="radio" class="radio" name="log" value="false" {HISTORY_NO} />{L_NO}</td> - </tr> - <tr> - <td><strong>{L_MAIL_NOTIFICATION} :</strong><br /><span class="small">{L_MAIL_NOTIFICATION_INFO}</span></td> - <td class="row1"><input type="radio" class="radio" name="mail_notification" value="true" {MAIL_NOTIFICATION_YES} />{L_YES} - <input type="radio" class="radio" name="mail_notification" value="false" {MAIL_NOTIFICATION_NO} />{L_NO}</td> - </tr> - <tr> - <td colspan="2"> </td> - </tr> - <tr class="admin"> - <th colspan="2">{L_CONF_COMMENTS}</th> - </tr> - <tr> - <td colspan="2"> </td> - </tr> - <tr> - <td><strong>{L_SHOW_COMMENTS} :</strong><br /><span class="small">{L_SHOW_COMMENTS_INFO}</span></td> - <td class="row1"><input type="radio" class="radio" name="show_comments" value="true" {SHOW_COMMENTS_YES} />{L_YES} - <input type="radio" class="radio" name="show_comments" value="false" {SHOW_COMMENTS_NO} />{L_NO}</td> - </tr> - <tr> - <td><strong>{L_COMMENTS_ALL} :</strong><br /><span class="small">{L_NB_COMMENTS_PAGE_INFO}</span></td> - <td class="row1"><input type="radio" class="radio" name="comments_forall" value="true" {COMMENTS_ALL_YES} />{L_YES} - <input type="radio" class="radio" name="comments_forall" value="false" {COMMENTS_ALL_NO} />{L_NO}</td> - </tr> - <tr> - <td><strong>{L_NB_COMMENTS_PAGE} :</strong><br /><span class="small">{L_NB_COMMENTS_PAGE_INFO}</span></td> - <td class="row1"><input type="text" size="3" maxlength="4" name="nb_comment_page" value="{NB_COMMENTS_PAGE}" /></td> - </tr> - <tr> - <td><strong>{L_VALIDATE_COMMENTS} :</strong><br /><span class="small">{L_VALIDATE_COMMENTS_INFO}</span></td> - <td class="row1"><input type="radio" class="radio" name="comments_validation" value="true" {VALIDATE_COMMENTS_YES} />{L_YES} - <input type="radio" class="radio" name="comments_validation" value="false" {VALIDATE_COMMENTS_NO} />{L_NO}</td> - </tr> - <tr> - <td colspan="2"> </td> - </tr> - <tr class="admin"> - <th colspan="2">{L_ABILITIES_SETTINGS}</th> - </tr> - <tr> - <td colspan="2"> </td> - </tr> - <tr> - <td><strong>{L_LANG_SELECT} :</strong><br /><span class="small">{L_LANG_SELECT_INFO}</span></td> - <td class="row1">{LANG_SELECT}</td> - </tr> - <tr> - <td><strong>{L_NB_IMAGE_LINE} :</strong><br /><span class="small">{L_NB_IMAGE_LINE_INFO}</span></td> - <td class="row1"><input type="text" size="3" maxlength="2" name="nb_image_line" value="{NB_IMAGE_LINE}" /></td> - </tr> - <tr> - <td><strong>{L_NB_ROW_PAGE} :</strong><br /><span class="small">{L_NB_ROW_PAGE_INFO}</span></td> - <td class="row1"><input type="text" size="3" maxlength="2" name="nb_line_page" value="{NB_ROW_PAGE}" /></td> - </tr> - <tr> - <td><strong>{L_STYLE_SELECT} :</strong><br /><span class="small">{L_STYLE_SELECT_INFO}</span></td> - <td class="row1">{STYLE_SELECT}</td> - </tr> - <tr> - <td><strong>{L_RECENT_PERIOD} :</strong><br /><span class="small">{L_RECENT_PERIOD_INFO}</span></td> - <td class="row1"><input type="text" size="3" maxlength="2" name="recent_period" value="{RECENT_PERIOD}" /></td> - </tr> - <tr> - <td><strong>{L_EXPAND_TREE} :</strong><br /><span class="small">{L_EXPAND_TREE_INFO}</span></td> - <td class="row1"><input type="radio" class="radio" name="auto_expand" value="true" {EXPAND_TREE_YES} />{L_YES} - <input type="radio" class="radio" name="auto_expand" value="false" {EXPAND_TREE_NO} />{L_NO}</td> - </tr> - <tr> - <td><strong>{L_NB_COMMENTS} :</strong><br /><span class="small">{L_NB_COMMENTS_INFO}</span></td> - <td class="row1"><input type="radio" class="radio" name="show_nb_comments" value="true" {NB_COMMENTS_YES} />{L_YES} - <input type="radio" class="radio" name="show_nb_comments" value="false" {NB_COMMENTS_NO} />{L_NO}</td> - </tr> - <tr> - <td colspan="2"> </td> - </tr> - <tr class="admin"> - <th colspan="2">{L_CONF_UPLOAD}</th> - </tr> - <tr> - <td colspan="2"> </td> - </tr> - <tr> - <td><strong>{L_AUTH_UPLOAD} :</strong><br /><span class="small">{L_AUTH_UPLOAD_INFO}</span></td> - <td class="row1"><input type="radio" class="radio" name="upload_available" value="true" {UPLOAD_YES} />{L_YES} - <input type="radio" class="radio" name="upload_available" value="false" {UPLOAD_NO} />{L_NO}</td> - </tr> - <tr> - <td><strong>{L_UPLOAD_MAXSIZE} :</strong><br /><span class="small">{L_UPLOAD_MAXSIZE_INFO}</span></td> - <td class="row1"><input type="text" size="4" maxlength="4" name="upload_maxfilesize" value="{UPLOAD_MAXSIZE}" /></td> - </tr> - <tr> - <td><strong>{L_UPLOAD_MAXWIDTH} :</strong><br /><span class="small">{L_UPLOAD_MAXWIDTH_INFO}</span></td> - <td class="row1"><input type="text" size="4" maxlength="4" name="upload_maxwidth" value="{UPLOAD_MAXWIDTH}" /></td> - </tr> - <tr> - <td><strong>{L_UPLOAD_MAXHEIGHT} :</strong><br /><span class="small">{L_UPLOAD_MAXHEIGHT_INFO}</span></td> - <td class="row1"><input type="text" size="4" maxlength="4" name="upload_maxheight" value="{UPLOAD_MAXHEIGHT}" /></td> - </tr> - <tr> - <td><strong>{L_TN_UPLOAD_MAXWIDTH} :</strong><br /><span class="small">{L_TN_UPLOAD_MAXWIDTH_INFO}</span></td> - <td class="row1"><input type="text" size="4" maxlength="4" name="upload_maxwidth_thumbnail" value="{TN_UPLOAD_MAXWIDTH}" /></td> - </tr> - <tr> - <td><strong>{L_TN_UPLOAD_MAXHEIGHT} :</strong><br /><span class="small">{L_TN_UPLOAD_MAXHEIGHT_INFO}</span></td> - <td class="row1"><input type="text" size="4" maxlength="4" name="upload_maxheight_thumbnail" value="{TN_UPLOAD_MAXHEIGHT}" /></td> - </tr> - <tr> - <td colspan="2"> </td> - </tr> - <tr class="admin"> - <th colspan="2">{L_CONF_SESSION}</th> - </tr> - <tr> - <td colspan="2"> </td> - </tr> - <tr> - <td><strong>{L_COOKIE} :</strong><br /><span class="small">{L_COOKIE_INFO}</span></td> - <td class="row1"><input type="radio" class="radio" name="authorize_cookies" value="true" {COOKIE_YES} />{L_YES} - <input type="radio" class="radio" name="authorize_cookies" value="false" {COOKIE_NO} />{L_NO}</td> - </tr> - <tr> - <td><strong>{L_SESSION_LENGTH} :</strong><br /><span class="small">{L_SESSION_LENGTH_INFO}</span></td> - <td class="row1"><input type="text" size="4" maxlength="6" name="session_time" value="{SESSION_LENGTH}" /></td> - </tr> - <tr> - <td><strong>{L_SESSION_ID_SIZE} :</strong><br /><span class="small">{L_SESSION_ID_SIZE_INFO}</span></td> - <td class="row1"><input type="text" size="2" maxlength="3" name="session_id_size" value="{SESSION_ID_SIZE}" /></td> - </tr> - <tr> - <td colspan="2"> </td> - </tr> - <tr class="admin"> - <th colspan="2">{L_CONF_METADATA}</th> - </tr> - <tr> - <td colspan="2"> </td> - </tr> - <tr> - <td> - <strong>{L_USE_EXIF} :</strong> - <br /><span class="small">{L_USE_EXIF_INFO}</span> - </td> - <td class="row1"> - <input type="radio" class="radio" name="use_exif" value="true" {USE_EXIF_YES} />{L_YES} - <input type="radio" class="radio" name="use_exif" value="false" {USE_EXIF_NO} />{L_NO} - </td> - </tr> - <tr> - <td> - <strong>{L_USE_IPTC} :</strong> - <br /><span class="small">{L_USE_IPTC_INFO}</span> - </td> - <td class="row1"> - <input type="radio" class="radio" name="use_iptc" value="true" {USE_IPTC_YES} />{L_YES} - <input type="radio" class="radio" name="use_iptc" value="false" {USE_IPTC_NO} />{L_NO} - </td> - </tr> - <tr> - <td> - <strong>{L_SHOW_EXIF} :</strong> - <br /><span class="small">{L_SHOW_EXIF_INFO}</span> - </td> - <td class="row1"> - <input type="radio" class="radio" name="show_exif" value="true" {SHOW_EXIF_YES} />{L_YES} - <input type="radio" class="radio" name="show_exif" value="false" {SHOW_EXIF_NO} />{L_NO} - </td> - </tr> - <tr> - <td> - <strong>{L_SHOW_IPTC} :</strong> - <br /><span class="small">{L_SHOW_IPTC_INFO}</span> - </td> - <td class="row1"> - <input type="radio" class="radio" name="show_iptc" value="true" {SHOW_IPTC_YES} />{L_YES} - <input type="radio" class="radio" name="show_iptc" value="false" {SHOW_IPTC_NO} />{L_NO} - </td> - </tr> - <!-- BEGIN remote_sites --> - <tr> - <th colspan="2" align="center">{#remote_site}</th> - </tr> - <tr> - <td colspan=3><div style='margin-bottom:0px'> </div></td> - </tr> - <tr> - <td> </td> - <td align="center">{#delete}</td> - <td> </td> - </tr> - <!-- BEGIN site --> - <tr> - <td>{#url}</td> - <td align="center"><input type="checkbox" name="delete_site_{#id}" value="1" /></td> - <!-- BEGIN rowspan --> - <td class="row2" rowspan="{#nb_sites}">{#conf_remote_site_delete_INFO}</span></td> - <!-- END rowspan --> - </tr> - <!-- END site --> - <tr> - <td colspan=3><div style='margin-bottom:0px'> </div></td> - </tr> - <!-- END remote_sites --> - <tr> - <td colspan="2" align="center"> - <input type="submit" name="submit" class="bouton" value="{L_SUBMIT}"> - </td> - </tr> - </table> + <!-- BEGIN line --> + <tr> + <td width="50%"> + <span class="confLineName">{line.NAME} :</span> + <br /> + <span class="confLineInfo">{line.INFO}</span> + </td> + <td class="confLineField"> + + <!-- BEGIN textfield --> + <input type="text" size="{line.textfield.SIZE}" name="{line.textfield.NAME}" value="{line.textfield.VALUE}" /> + <!-- END textfield --> + + <!-- BEGIN radio --> + <input type="radio" class="radio" name="{line.radio.NAME}" value="{line.radio.VALUE}" {line.radio.CHECKED} />{line.radio.OPTION} + <!-- END radio --> + + <!-- BEGIN select --> + <select name="{line.select.NAME}"> + <!-- BEGIN select_option --> + <option value="{line.select.select_option.VALUE}" {line.select.select_option.SELECTED}>{line.select.select_option.OPTION}</option> + <!-- END select_option --> + </select> + <!-- END select --> + + </td> + </tr> + <!-- END line --> + <tr> + <td colspan="2" align="center"> + <input type="submit" name="submit" class="bouton" value="{L_SUBMIT}" /> + </td> + </tr> +</table> + </form> diff --git a/template/default/default.css b/template/default/default.css index 65292944e..81d4bfaca 100644 --- a/template/default/default.css +++ b/template/default/default.css @@ -19,8 +19,6 @@ h2 { line-height: 120%; } -.small{ font-size:80%;} - /* ANCHORS */ a { text-decoration:none; color:#FFFFFF;} @@ -146,16 +144,6 @@ ul.menu { border-collapse:collapse; } -.row1,.row2 { - text-align:left; - padding:5px 0px 5px 0px; - height:20px; -} - -.row1 { - background-color:#505050; -} - .throw { color:#FFFFCC; background-color:#3F3F3F; @@ -257,7 +245,7 @@ background-color:#444444; margin:0px 0px 12px 0px; text-align: center; padding:0px; -color : #FFF48E; +color : #FFF48E; } .adminMain @@ -338,4 +326,43 @@ span.update_error_element, span.update_category_error { .update_summary_del { color:#ffe1e1; +} + +.confMenu { + background-color:#444444; + text-align:center; +} + +.confMenu a { + padding:2px; + border:1px solid gray; + background-color:#505050; + color:#fff48e; + color:lightgray; +} + +.confMenu a:hover { + color:orange; + text-decoration:none; +} + +.confMenu a.opened { + background-color:gray; + color:white; + text-decoration:none; +} + +span.confLineName { + font-weight:bold; +} + +span.confLineInfo { + font-size:80%; +} + +td.confLineField { + text-align:left; + padding:5px 0px 5px 0px; + height:20px; + background-color:#505050; }
\ No newline at end of file diff --git a/template/default/footer.tpl b/template/default/footer.tpl index c0f6aa90a..f1ee02372 100644 --- a/template/default/footer.tpl +++ b/template/default/footer.tpl @@ -12,7 +12,7 @@ {L_SEND_MAIL} <a href="mailto:{MAIL}?subject={L_TITLE_MAIL}"> - <span style="font-weight:bold;">{WEBMASTER}</span> + <span style="font-weight:bold;">{L_WEBMASTER}</span> </a> </div> |