aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
Diffstat (limited to 'admin')
-rw-r--r--admin/configuration.php43
-rw-r--r--admin/include/functions.php16
2 files changed, 55 insertions, 4 deletions
diff --git a/admin/configuration.php b/admin/configuration.php
index 0a89f6e4b..8e69d9c16 100644
--- a/admin/configuration.php
+++ b/admin/configuration.php
@@ -51,7 +51,6 @@ $main_checkboxes = array(
'rate',
'rate_anonymous',
'email_admin_on_new_user',
- 'email_admin_on_picture_uploaded',
);
$history_checkboxes = array(
@@ -60,6 +59,11 @@ $history_checkboxes = array(
'history_guest'
);
+$upload_checkboxes = array(
+ 'upload_link_everytime',
+ 'email_admin_on_picture_uploaded',
+ );
+
$comments_checkboxes = array(
'comments_forall',
'comments_validation',
@@ -110,6 +114,14 @@ if (isset($_POST['submit']) and !is_adviser())
}
break;
}
+ case 'upload' :
+ {
+ foreach( $upload_checkboxes as $checkbox)
+ {
+ $_POST[$checkbox] = empty($_POST[$checkbox])?'false':'true';
+ }
+ break;
+ }
case 'default' :
{
// Never go here
@@ -160,6 +172,7 @@ $tabsheet = new tabsheet();
$tabsheet->add('main', l10n('conf_main_title'), $conf_link.'main');
$tabsheet->add('history', l10n('conf_history_title'), $conf_link.'history');
$tabsheet->add('comments', l10n('conf_comments_title'), $conf_link.'comments');
+$tabsheet->add('upload', l10n('conf_upload_title'), $conf_link.'upload');
$tabsheet->add('default', l10n('conf_display'), $conf_link.'default');
// TabSheet selection
$tabsheet->select($page['section']);
@@ -187,7 +200,7 @@ switch ($page['section'])
'CONF_GALLERY_URL' => $conf['gallery_url'],
));
- foreach( $main_checkboxes as $checkbox)
+ foreach ($main_checkboxes as $checkbox)
{
$template->append(
'main',
@@ -202,7 +215,7 @@ switch ($page['section'])
case 'history' :
{
//Necessary for merge_block_vars
- foreach( $history_checkboxes as $checkbox)
+ foreach ($history_checkboxes as $checkbox)
{
$template->append(
'history',
@@ -222,7 +235,7 @@ switch ($page['section'])
'NB_COMMENTS_PAGE'=>$conf['nb_comment_page'],
));
- foreach( $comments_checkboxes as $checkbox)
+ foreach ($comments_checkboxes as $checkbox)
{
$template->append(
'comments',
@@ -234,6 +247,28 @@ switch ($page['section'])
}
break;
}
+ case 'upload' :
+ {
+ $template->assign(
+ 'upload',
+ array(
+ 'upload_user_access_options'=> get_user_access_level_html_options(ACCESS_GUEST),
+ 'upload_user_access_options_selected' => array($conf['upload_user_access'])
+ )
+ );
+ //Necessary for merge_block_vars
+ foreach ($upload_checkboxes as $checkbox)
+ {
+ $template->append(
+ 'upload',
+ array(
+ $checkbox => $conf[$checkbox]
+ ),
+ true
+ );
+ }
+ break;
+ }
case 'default' :
{
$edit_user = build_user($conf['default_user_id'], false);
diff --git a/admin/include/functions.php b/admin/include/functions.php
index 94ac4c962..5cb81e9cb 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -1837,4 +1837,20 @@ function create_table_add_character_set($query)
}
return $query;
}
+
+/**
+ * Returns array use on template with html_options method
+ * @param Min and Max access to use
+ * @return array of user access level
+ */
+function get_user_access_level_html_options($MinLevelAccess = ACCESS_FREE, $MaxLevelAccess = ACCESS_CLOSED)
+{
+ $tpl_options = array();
+ for ($level = $MinLevelAccess; $level <= $MaxLevelAccess; $level++)
+ {
+ $tpl_options[$level] = l10n(sprintf('ACCESS_%d', $level));
+ }
+ return $tpl_options;
+}
+
?> \ No newline at end of file