From bacf165624681b6457a196a055e41e179e072ea4 Mon Sep 17 00:00:00 2001
From: rub
Date: Wed, 7 Mar 2007 22:21:35 +0000
Subject: [PATCH] Undo revision 1865 in order to add tabsheet for categories.
(Not really undo help)
git-svn-id: http://piwigo.org/svn/trunk@1877 68402e56-0260-453c-a942-63ccdbb3a9ee
---
admin.php | 1 +
admin/cat_options.php | 41 +++++++++++++++++++
admin/configuration.php | 39 ------------------
.../en_UK.iso-8859-1/help/cat_options.html | 6 +--
.../en_UK.iso-8859-1/help/configuration.html | 3 --
.../fr_FR.iso-8859-1/help/cat_options.html | 5 +--
.../fr_FR.iso-8859-1/help/configuration.html | 3 --
template/yoga/admin.tpl | 3 +-
template/yoga/admin/configuration.tpl | 32 ---------------
9 files changed, 49 insertions(+), 84 deletions(-)
diff --git a/admin.php b/admin.php
index 9282f3430..90a6d63b2 100644
--- a/admin.php
+++ b/admin.php
@@ -94,6 +94,7 @@ $template->assign_vars(
'U_CATEGORIES'=> $link_start.'cat_list',
'U_MOVE'=> $link_start.'cat_move',
'U_CAT_UPLOAD'=> $opt_link.'upload',
+ 'U_CAT_COMMENTS'=> $opt_link.'comments',
'U_CAT_VISIBLE'=> $opt_link.'visible',
'U_CAT_STATUS'=> $opt_link.'status',
'U_CAT_OPTIONS'=> $link_start.'cat_options',
diff --git a/admin/cat_options.php b/admin/cat_options.php
index 305c764c1..8aaf4ad14 100644
--- a/admin/cat_options.php
+++ b/admin/cat_options.php
@@ -56,6 +56,16 @@ if (isset($_POST['falsify'])
UPDATE '.CATEGORIES_TABLE.'
SET uploadable = \'false\'
WHERE id IN ('.implode(',', $_POST['cat_true']).')
+;';
+ pwg_query($query);
+ break;
+ }
+ case 'comments' :
+ {
+ $query = '
+UPDATE '.CATEGORIES_TABLE.'
+ SET commentable = \'false\'
+ WHERE id IN ('.implode(',', $_POST['cat_true']).')
;';
pwg_query($query);
break;
@@ -94,6 +104,16 @@ else if (isset($_POST['trueify'])
UPDATE '.CATEGORIES_TABLE.'
SET uploadable = \'true\'
WHERE id IN ('.implode(',', $_POST['cat_false']).')
+;';
+ pwg_query($query);
+ break;
+ }
+ case 'comments' :
+ {
+ $query = '
+UPDATE '.CATEGORIES_TABLE.'
+ SET commentable = \'true\'
+ WHERE id IN ('.implode(',', $_POST['cat_false']).')
;';
pwg_query($query);
break;
@@ -185,6 +205,27 @@ SELECT id,name,uppercats,global_rank
);
break;
}
+ case 'comments' :
+ {
+ $query_true = '
+SELECT id,name,uppercats,global_rank
+ FROM '.CATEGORIES_TABLE.'
+ WHERE commentable = \'true\'
+;';
+ $query_false = '
+SELECT id,name,uppercats,global_rank
+ FROM '.CATEGORIES_TABLE.'
+ WHERE commentable = \'false\'
+;';
+ $template->assign_vars(
+ array(
+ 'L_SECTION' => $lang['cat_comments_title'],
+ 'L_CAT_OPTIONS_TRUE' => $lang['authorized'],
+ 'L_CAT_OPTIONS_FALSE' => $lang['forbidden'],
+ )
+ );
+ break;
+ }
case 'visible' :
{
$query_true = '
diff --git a/admin/configuration.php b/admin/configuration.php
index c45fddc85..12235cce6 100644
--- a/admin/configuration.php
+++ b/admin/configuration.php
@@ -158,32 +158,6 @@ UPDATE '.CONFIG_TABLE.'
load_conf_from_db();
}
-if ( $page['section']=='comments' and !is_adviser() )
-{
- if (isset($_POST['falsify'])
- and isset($_POST['cat_true'])
- and count($_POST['cat_true']) > 0)
- {
- $query = '
-UPDATE '.CATEGORIES_TABLE.'
- SET commentable = \'false\'
- WHERE id IN ('.implode(',', $_POST['cat_true']).')
-;';
- pwg_query($query);
- }
- if (isset($_POST['trueify'])
- and isset($_POST['cat_false'])
- and count($_POST['cat_false']) > 0)
- {
- $query = '
-UPDATE '.CATEGORIES_TABLE.'
- SET commentable = \'true\'
- WHERE id IN ('.implode(',', $_POST['cat_false']).')
-;';
- pwg_query($query);
- }
-}
-
//----------------------------------------------------- template initialization
$template->set_filenames( array('config'=>'admin/configuration.tpl') );
@@ -252,19 +226,6 @@ switch ($page['section'])
)
);
}
-
- $query_true = '
-SELECT id,name,uppercats,global_rank
- FROM '.CATEGORIES_TABLE.'
- WHERE commentable = \'true\'
-;';
- $query_false = '
-SELECT id,name,uppercats,global_rank
- FROM '.CATEGORIES_TABLE.'
- WHERE commentable = \'false\'
-;';
- display_select_cat_wrapper($query_true,array(),'comments.category_option_true');
- display_select_cat_wrapper($query_false,array(),'comments.category_option_false');
break;
}
case 'default' :
diff --git a/language/en_UK.iso-8859-1/help/cat_options.html b/language/en_UK.iso-8859-1/help/cat_options.html
index 2db75ed0a..c79d3aac3 100644
--- a/language/en_UK.iso-8859-1/help/cat_options.html
+++ b/language/en_UK.iso-8859-1/help/cat_options.html
@@ -10,9 +10,9 @@ categories at once.
non remote categories are shown.
Comments
-
Authorize users to add comments on selected categories. By
- inheritance, an element is commentable if it belongs at least to one
- commentable category.
+
Authorize users to add comments on selected categories.
+Selects the categories which are commentable.
+An image is commentable if it belongs to at least one category that is commentable.
Lock
Selected categories will temporary been disabled for maintenance. If
diff --git a/language/en_UK.iso-8859-1/help/configuration.html b/language/en_UK.iso-8859-1/help/configuration.html
index be92d9a9c..14da93362 100644
--- a/language/en_UK.iso-8859-1/help/configuration.html
+++ b/language/en_UK.iso-8859-1/help/configuration.html
@@ -116,7 +116,4 @@ Sends an email to the administrators when a user enters a comment and this comme
Sends an email to the administrators when a user enters a comment that requires validation by the admin.
User comments validation takes place in the screen Administration, Pictures, Comments.
-
Authorize users to add comments on selected categories:
- Selects the categories which are commentable. An image is commentable if it belongs to at least one category that is commentable.
Autoriser les utilisateurs à commenter les images des catégories
-sélectionnées. Par héritage, une image est commentable si elle appartient à
-au moins une catégorie commentable.
+
Autoriser les utilisateurs à ajouter des commentaires dans les catégories sélectionnée.
+Par héritage, une image est commentable si elle appartient à au moins une catégorie commentable.
Verrouiller
diff --git a/language/fr_FR.iso-8859-1/help/configuration.html b/language/fr_FR.iso-8859-1/help/configuration.html
index 32cf50352..1ed295524 100644
--- a/language/fr_FR.iso-8859-1/help/configuration.html
+++ b/language/fr_FR.iso-8859-1/help/configuration.html
@@ -121,7 +121,4 @@ Envoi un courriel aux administrateurrs lorsqu'un utilisateur enregistre un comme
Envoi un courriel aux administrateurrs lorsqu'un utilisateur enregistre un commentaire qui demande une validation de la part des administrateurs.
La validation des commentaires utilisateurs a lieu dans l'écran Administration, Images, Commentaires.
-
Autoriser les utilisateurs à ajouter des commentaires dans les catégories sélectionnées:
-Une image est commentable si elle appartient à au moins une catégorie commentable.