2004-02-12 00:20:38 +01:00
|
|
|
<?php
|
|
|
|
// +-----------------------------------------------------------------------+
|
2011-01-18 01:02:52 +01:00
|
|
|
// | Piwigo - a PHP based photo gallery |
|
2008-04-05 00:57:23 +02:00
|
|
|
// +-----------------------------------------------------------------------+
|
2011-01-18 01:02:52 +01:00
|
|
|
// | Copyright(C) 2008-2011 Piwigo Team http://piwigo.org |
|
2008-04-05 00:57:23 +02:00
|
|
|
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
|
|
|
|
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
|
|
|
|
// +-----------------------------------------------------------------------+
|
2004-02-12 00:20:38 +01:00
|
|
|
// | This program is free software; you can redistribute it and/or modify |
|
|
|
|
// | it under the terms of the GNU General Public License as published by |
|
|
|
|
// | the Free Software Foundation |
|
|
|
|
// | |
|
|
|
|
// | This program is distributed in the hope that it will be useful, but |
|
|
|
|
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
|
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
|
|
|
// | General Public License for more details. |
|
|
|
|
// | |
|
|
|
|
// | You should have received a copy of the GNU General Public License |
|
|
|
|
// | along with this program; if not, write to the Free Software |
|
|
|
|
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
|
|
|
|
// | USA. |
|
|
|
|
// +-----------------------------------------------------------------------+
|
2003-07-01 11:27:20 +02:00
|
|
|
|
2004-09-20 00:26:41 +02:00
|
|
|
if( !defined("PHPWG_ROOT_PATH") )
|
2004-03-20 01:52:37 +01:00
|
|
|
{
|
2006-03-09 23:46:28 +01:00
|
|
|
die ("Hacking attempt!");
|
2004-03-20 01:52:37 +01:00
|
|
|
}
|
2004-09-20 00:26:41 +02:00
|
|
|
|
2006-03-09 23:46:28 +01:00
|
|
|
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
|
2008-02-29 00:41:47 +01:00
|
|
|
include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
|
2006-03-09 23:46:28 +01:00
|
|
|
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
// | Check Access and exit when user status is not ok |
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
check_status(ACCESS_ADMINISTRATOR);
|
|
|
|
|
- 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
2004-09-03 17:01:05 +02:00
|
|
|
//-------------------------------------------------------- sections definitions
|
|
|
|
if (!isset($_GET['section']))
|
|
|
|
{
|
2007-03-12 00:02:13 +01:00
|
|
|
$page['section'] = 'main';
|
- 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
2004-09-03 17:01:05 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$page['section'] = $_GET['section'];
|
|
|
|
}
|
2006-11-22 05:41:25 +01:00
|
|
|
|
2007-03-12 00:02:13 +01:00
|
|
|
$main_checkboxes = array(
|
2008-03-05 02:50:08 +01:00
|
|
|
'gallery_locked',
|
2007-06-11 00:01:18 +02:00
|
|
|
'allow_user_registration',
|
|
|
|
'obligatory_user_mail_address',
|
2007-03-26 21:15:52 +02:00
|
|
|
'rate',
|
|
|
|
'rate_anonymous',
|
2006-12-13 02:05:38 +01:00
|
|
|
'email_admin_on_new_user',
|
2010-03-25 00:24:01 +01:00
|
|
|
'allow_user_customization',
|
2006-11-22 05:41:25 +01:00
|
|
|
);
|
|
|
|
|
2007-03-09 23:52:22 +01:00
|
|
|
$history_checkboxes = array(
|
|
|
|
'log',
|
|
|
|
'history_admin',
|
|
|
|
'history_guest'
|
|
|
|
);
|
|
|
|
|
2006-11-22 05:41:25 +01:00
|
|
|
$comments_checkboxes = array(
|
|
|
|
'comments_forall',
|
|
|
|
'comments_validation',
|
|
|
|
'email_admin_on_comment',
|
|
|
|
'email_admin_on_comment_validation',
|
2009-06-23 15:44:58 +02:00
|
|
|
'user_can_delete_comment',
|
|
|
|
'user_can_edit_comment',
|
|
|
|
'email_admin_on_comment_edition',
|
|
|
|
'email_admin_on_comment_deletion'
|
2006-11-22 05:41:25 +01:00
|
|
|
);
|
|
|
|
|
2010-03-23 22:19:55 +01:00
|
|
|
$display_checkboxes = array(
|
|
|
|
'menubar_filter_icon',
|
|
|
|
'index_sort_order_input',
|
|
|
|
'index_flat_icon',
|
|
|
|
'index_posted_date_icon',
|
|
|
|
'index_created_date_icon',
|
|
|
|
'index_slideshow_icon',
|
|
|
|
'picture_metadata_icon',
|
|
|
|
'picture_slideshow_icon',
|
|
|
|
'picture_favorite_icon',
|
2010-04-03 23:49:41 +02:00
|
|
|
'picture_download_icon',
|
2010-03-23 22:19:55 +01:00
|
|
|
'picture_navigation_icons',
|
|
|
|
'picture_navigation_thumb',
|
2011-05-07 17:55:10 +02:00
|
|
|
'picture_menu',
|
2010-03-23 22:19:55 +01:00
|
|
|
);
|
|
|
|
|
2010-03-24 01:39:34 +01:00
|
|
|
$display_info_checkboxes = array(
|
|
|
|
'author',
|
|
|
|
'created_on',
|
|
|
|
'posted_on',
|
|
|
|
'dimensions',
|
|
|
|
'file',
|
|
|
|
'filesize',
|
|
|
|
'tags',
|
|
|
|
'categories',
|
|
|
|
'visits',
|
|
|
|
'average_rate',
|
2010-04-08 22:21:17 +02:00
|
|
|
'privacy_level',
|
2010-03-24 01:39:34 +01:00
|
|
|
);
|
|
|
|
|
2003-05-09 14:42:42 +02:00
|
|
|
//------------------------------ verification and registration of modifications
|
2010-12-14 14:47:24 +01:00
|
|
|
if (isset($_POST['submit']))
|
2003-05-09 14:42:42 +02:00
|
|
|
{
|
2003-07-01 11:27:20 +02:00
|
|
|
$int_pattern = '/^\d+$/';
|
2007-03-28 21:57:00 +02:00
|
|
|
|
- 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
2004-09-03 17:01:05 +02:00
|
|
|
switch ($page['section'])
|
2003-05-09 14:42:42 +02:00
|
|
|
{
|
2007-03-12 00:02:13 +01:00
|
|
|
case 'main' :
|
2003-09-17 22:40:15 +02:00
|
|
|
{
|
2011-03-05 17:14:41 +01:00
|
|
|
if (empty($_POST['gallery_locked']) and $conf['gallery_locked'])
|
|
|
|
{
|
|
|
|
$tpl_var = & $template->get_template_vars('header_msgs');
|
|
|
|
$msg_key = array_search(l10n('The gallery is locked for maintenance. Please, come back later.'), $tpl_var);
|
|
|
|
unset($tpl_var[$msg_key]);
|
|
|
|
}
|
|
|
|
elseif (!empty($_POST['gallery_locked']) and !$conf['gallery_locked'])
|
|
|
|
{
|
|
|
|
$template->append('header_msgs', l10n('The gallery is locked for maintenance. Please, come back later.'));
|
|
|
|
}
|
2007-03-12 00:02:13 +01:00
|
|
|
foreach( $main_checkboxes as $checkbox)
|
2006-11-22 05:41:25 +01:00
|
|
|
{
|
|
|
|
$_POST[$checkbox] = empty($_POST[$checkbox])?'false':'true';
|
|
|
|
}
|
- 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
2004-09-03 17:01:05 +02:00
|
|
|
break;
|
|
|
|
}
|
2007-03-09 23:52:22 +01:00
|
|
|
case 'history' :
|
|
|
|
{
|
|
|
|
foreach( $history_checkboxes as $checkbox)
|
|
|
|
{
|
|
|
|
$_POST[$checkbox] = empty($_POST[$checkbox])?'false':'true';
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
- 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
2004-09-03 17:01:05 +02:00
|
|
|
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)
|
|
|
|
{
|
2010-03-02 15:54:22 +01:00
|
|
|
array_push($page['errors'], l10n('The number of comments a page must be between 5 and 50 included.'));
|
- 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
2004-09-03 17:01:05 +02:00
|
|
|
}
|
2006-11-22 05:41:25 +01:00
|
|
|
foreach( $comments_checkboxes as $checkbox)
|
|
|
|
{
|
|
|
|
$_POST[$checkbox] = empty($_POST[$checkbox])?'false':'true';
|
|
|
|
}
|
- 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
2004-09-03 17:01:05 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 'default' :
|
|
|
|
{
|
2007-03-28 21:57:00 +02:00
|
|
|
// Never go here
|
- 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
2004-09-03 17:01:05 +02:00
|
|
|
break;
|
|
|
|
}
|
2010-03-23 22:19:55 +01:00
|
|
|
case 'display' :
|
|
|
|
{
|
|
|
|
foreach( $display_checkboxes as $checkbox)
|
|
|
|
{
|
|
|
|
$_POST[$checkbox] = empty($_POST[$checkbox])?'false':'true';
|
|
|
|
}
|
2010-03-24 01:39:34 +01:00
|
|
|
foreach( $display_info_checkboxes as $checkbox)
|
|
|
|
{
|
|
|
|
$_POST['picture_informations'][$checkbox] =
|
|
|
|
empty($_POST['picture_informations'][$checkbox])? false : true;
|
|
|
|
}
|
|
|
|
$_POST['picture_informations'] = addslashes(serialize($_POST['picture_informations']));
|
2010-03-23 22:19:55 +01:00
|
|
|
break;
|
|
|
|
}
|
2003-05-09 14:42:42 +02:00
|
|
|
}
|
2006-03-09 02:57:13 +01:00
|
|
|
|
2004-09-20 22:08:15 +02:00
|
|
|
// updating configuration if no error found
|
2005-06-11 16:10:04 +02:00
|
|
|
if (count($page['errors']) == 0)
|
2003-05-09 14:42:42 +02:00
|
|
|
{
|
2006-10-19 02:41:07 +02:00
|
|
|
//echo '<pre>'; print_r($_POST); echo '</pre>';
|
2007-01-23 23:03:06 +01:00
|
|
|
$result = pwg_query('SELECT param FROM '.CONFIG_TABLE);
|
2009-11-20 15:17:04 +01:00
|
|
|
while ($row = pwg_db_fetch_assoc($result))
|
- 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
2004-09-03 17:01:05 +02:00
|
|
|
{
|
|
|
|
if (isset($_POST[$row['param']]))
|
|
|
|
{
|
2005-10-08 01:25:42 +02:00
|
|
|
$value = $_POST[$row['param']];
|
2006-03-09 02:57:13 +01:00
|
|
|
|
|
|
|
if ('gallery_title' == $row['param'])
|
2005-10-08 01:25:42 +02:00
|
|
|
{
|
|
|
|
if (!$conf['allow_html_descriptions'])
|
|
|
|
{
|
|
|
|
$value = strip_tags($value);
|
|
|
|
}
|
|
|
|
}
|
2006-03-09 02:57:13 +01:00
|
|
|
|
2004-09-20 22:08:15 +02:00
|
|
|
$query = '
|
|
|
|
UPDATE '.CONFIG_TABLE.'
|
2007-03-28 21:57:00 +02:00
|
|
|
SET value = \''. str_replace("\'", "''", $value).'\'
|
|
|
|
WHERE param = \''.$row['param'].'\'
|
2004-09-20 22:08:15 +02:00
|
|
|
;';
|
2004-10-30 17:42:29 +02:00
|
|
|
pwg_query($query);
|
- 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
2004-09-03 17:01:05 +02:00
|
|
|
}
|
|
|
|
}
|
2010-03-02 15:54:22 +01:00
|
|
|
array_push($page['infos'], l10n('Information data registered in database'));
|
2003-05-09 14:42:42 +02:00
|
|
|
}
|
- 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
2004-09-03 17:01:05 +02:00
|
|
|
|
2007-01-23 23:03:06 +01:00
|
|
|
//------------------------------------------------------ $conf reinitialization
|
|
|
|
load_conf_from_db();
|
2006-10-19 02:41:07 +02:00
|
|
|
}
|
|
|
|
|
2004-09-20 00:26:41 +02:00
|
|
|
//----------------------------------------------------- template initialization
|
2008-09-14 09:16:15 +02:00
|
|
|
$template->set_filename('config', 'configuration.tpl');
|
2007-03-08 23:14:14 +01:00
|
|
|
|
2008-02-29 00:41:47 +01:00
|
|
|
// TabSheet
|
|
|
|
$tabsheet = new tabsheet();
|
2007-03-08 23:14:14 +01:00
|
|
|
// TabSheet initialization
|
2010-03-02 15:54:22 +01:00
|
|
|
$tabsheet->add('main', l10n('Main'), $conf_link.'main');
|
2010-03-23 22:19:55 +01:00
|
|
|
$tabsheet->add('display', l10n('Display'), $conf_link.'display');
|
2010-03-02 15:54:22 +01:00
|
|
|
$tabsheet->add('history', l10n('History'), $conf_link.'history');
|
|
|
|
$tabsheet->add('comments', l10n('Comments'), $conf_link.'comments');
|
2010-03-23 22:19:55 +01:00
|
|
|
$tabsheet->add('default', l10n('Guest Settings'), $conf_link.'default');
|
2008-02-29 00:41:47 +01:00
|
|
|
// TabSheet selection
|
|
|
|
$tabsheet->select($page['section']);
|
2007-03-08 23:14:14 +01:00
|
|
|
// Assign tabsheet to template
|
2008-02-29 00:41:47 +01:00
|
|
|
$tabsheet->assign();
|
- 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
2004-09-03 17:01:05 +02:00
|
|
|
|
2008-03-05 02:50:08 +01:00
|
|
|
$action = get_root_url().'admin.php?page=configuration';
|
2004-09-20 22:08:15 +02:00
|
|
|
$action.= '&section='.$page['section'];
|
|
|
|
|
2008-03-21 02:01:25 +01:00
|
|
|
$template->assign(
|
2004-09-20 22:08:15 +02:00
|
|
|
array(
|
2010-04-18 20:59:37 +02:00
|
|
|
'U_HELP' => get_root_url().'admin/popuphelp.php?page=configuration',
|
2006-01-15 14:45:42 +01:00
|
|
|
'F_ACTION'=>$action
|
2004-09-20 22:08:15 +02:00
|
|
|
));
|
2003-07-01 11:27:20 +02:00
|
|
|
|
2004-09-20 00:26:41 +02:00
|
|
|
switch ($page['section'])
|
2004-09-20 22:08:15 +02:00
|
|
|
{
|
2007-03-12 00:02:13 +01:00
|
|
|
case 'main' :
|
2003-05-09 14:42:42 +02:00
|
|
|
{
|
2008-03-05 02:50:08 +01:00
|
|
|
$template->assign(
|
2007-03-12 00:02:13 +01:00
|
|
|
'main',
|
2004-09-20 22:08:15 +02:00
|
|
|
array(
|
2007-05-19 01:36:55 +02:00
|
|
|
'CONF_GALLERY_TITLE' => htmlspecialchars($conf['gallery_title']),
|
|
|
|
'CONF_PAGE_BANNER' => htmlspecialchars($conf['page_banner']),
|
2006-02-16 01:45:18 +01:00
|
|
|
'CONF_GALLERY_URL' => $conf['gallery_url'],
|
2011-01-12 14:41:55 +01:00
|
|
|
'week_starts_on_options' => array(
|
|
|
|
'sunday' => $lang['day'][0],
|
|
|
|
'monday' => $lang['day'][1],
|
|
|
|
),
|
|
|
|
'week_starts_on_options_selected' => $conf['week_starts_on'],
|
2004-09-20 22:08:15 +02:00
|
|
|
));
|
2006-11-22 05:41:25 +01:00
|
|
|
|
2008-05-02 23:56:21 +02:00
|
|
|
foreach ($main_checkboxes as $checkbox)
|
2006-11-22 05:41:25 +01:00
|
|
|
{
|
2008-03-05 02:50:08 +01:00
|
|
|
$template->append(
|
2007-03-12 00:02:13 +01:00
|
|
|
'main',
|
2006-11-22 05:41:25 +01:00
|
|
|
array(
|
2008-03-05 02:50:08 +01:00
|
|
|
$checkbox => $conf[$checkbox]
|
|
|
|
),
|
|
|
|
true
|
2006-11-22 05:41:25 +01:00
|
|
|
);
|
|
|
|
}
|
2004-09-20 22:08:15 +02:00
|
|
|
break;
|
|
|
|
}
|
2007-03-09 23:52:22 +01:00
|
|
|
case 'history' :
|
|
|
|
{
|
|
|
|
//Necessary for merge_block_vars
|
2008-05-02 23:56:21 +02:00
|
|
|
foreach ($history_checkboxes as $checkbox)
|
2007-03-09 23:52:22 +01:00
|
|
|
{
|
2008-03-05 02:50:08 +01:00
|
|
|
$template->append(
|
2007-03-09 23:52:22 +01:00
|
|
|
'history',
|
|
|
|
array(
|
2008-03-05 02:50:08 +01:00
|
|
|
$checkbox => $conf[$checkbox]
|
|
|
|
),
|
|
|
|
true
|
2007-03-09 23:52:22 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2004-09-20 22:08:15 +02:00
|
|
|
case 'comments' :
|
|
|
|
{
|
2008-03-05 02:50:08 +01:00
|
|
|
$template->assign(
|
2004-09-20 22:08:15 +02:00
|
|
|
'comments',
|
|
|
|
array(
|
|
|
|
'NB_COMMENTS_PAGE'=>$conf['nb_comment_page'],
|
|
|
|
));
|
2006-11-22 05:41:25 +01:00
|
|
|
|
2008-05-02 23:56:21 +02:00
|
|
|
foreach ($comments_checkboxes as $checkbox)
|
2006-11-22 05:41:25 +01:00
|
|
|
{
|
2008-03-05 02:50:08 +01:00
|
|
|
$template->append(
|
2006-11-22 05:41:25 +01:00
|
|
|
'comments',
|
|
|
|
array(
|
2008-03-05 02:50:08 +01:00
|
|
|
$checkbox => $conf[$checkbox]
|
|
|
|
),
|
|
|
|
true
|
2006-11-22 05:41:25 +01:00
|
|
|
);
|
|
|
|
}
|
2004-09-20 22:08:15 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 'default' :
|
|
|
|
{
|
2010-04-29 14:55:46 +02:00
|
|
|
$edit_user = build_user($conf['guest_id'], false);
|
2007-03-28 21:57:00 +02:00
|
|
|
include_once(PHPWG_ROOT_PATH.'profile.php');
|
2006-03-09 02:57:13 +01:00
|
|
|
|
2007-03-28 21:57:00 +02:00
|
|
|
$errors = array();
|
2010-12-14 14:47:24 +01:00
|
|
|
if (save_profile_from_post($edit_user, $errors))
|
2005-09-03 18:36:05 +02:00
|
|
|
{
|
2010-12-14 14:47:24 +01:00
|
|
|
// Reload user
|
|
|
|
$edit_user = build_user($conf['guest_id'], false);
|
|
|
|
array_push($page['infos'], l10n('Information data registered in database'));
|
2005-09-03 18:36:05 +02:00
|
|
|
}
|
2007-03-28 21:57:00 +02:00
|
|
|
$page['errors'] = array_merge($page['errors'], $errors);
|
|
|
|
|
|
|
|
load_profile_in_template(
|
|
|
|
$action,
|
|
|
|
'',
|
|
|
|
$edit_user
|
|
|
|
);
|
2008-03-05 02:50:08 +01:00
|
|
|
$template->assign('default', array());
|
2004-09-20 22:08:15 +02:00
|
|
|
break;
|
|
|
|
}
|
2010-03-23 22:19:55 +01:00
|
|
|
case 'display' :
|
|
|
|
{
|
|
|
|
foreach ($display_checkboxes as $checkbox)
|
|
|
|
{
|
|
|
|
$template->append(
|
|
|
|
'display',
|
|
|
|
array(
|
|
|
|
$checkbox => $conf[$checkbox]
|
|
|
|
),
|
|
|
|
true
|
|
|
|
);
|
|
|
|
}
|
2010-03-24 01:39:34 +01:00
|
|
|
$template->append(
|
|
|
|
'display',
|
|
|
|
array(
|
|
|
|
'picture_informations' => unserialize($conf['picture_informations'])
|
|
|
|
),
|
|
|
|
true
|
|
|
|
);
|
2010-03-23 22:19:55 +01:00
|
|
|
break;
|
|
|
|
}
|
2004-09-20 22:08:15 +02:00
|
|
|
}
|
2007-03-28 21:57:00 +02:00
|
|
|
|
2003-05-09 14:42:42 +02:00
|
|
|
//----------------------------------------------------------- sending html code
|
2004-03-20 01:52:37 +01:00
|
|
|
$template->assign_var_from_handle('ADMIN_CONTENT', 'config');
|
2004-02-12 00:20:38 +01:00
|
|
|
?>
|