aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2007-02-28 00:16:53 +0000
committerrvelices <rv-github@modusoptimus.com>2007-02-28 00:16:53 +0000
commit30e259904cc38172b2b730455009455675f0d8f5 (patch)
treeb454d1d0e8c2ee75eb2bb4e41b0658f833a5a1a2
parentfec44b7f888783afeb99f256a07cfcef185d2110 (diff)
admin pages: merge Categories/comments page into Configuration/comments page
(they are related and we reduce the # of links in the menu) git-svn-id: http://piwigo.org/svn/trunk@1865 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--admin.php1
-rw-r--r--admin/cat_options.php41
-rw-r--r--admin/configuration.php39
-rw-r--r--language/en_UK.iso-8859-1/help/configuration.html44
-rw-r--r--language/fr_FR.iso-8859-1/help/configuration.html45
-rw-r--r--template/yoga/admin.tpl3
-rw-r--r--template/yoga/admin/configuration.tpl32
7 files changed, 128 insertions, 77 deletions
diff --git a/admin.php b/admin.php
index f124980fc..9b2147728 100644
--- a/admin.php
+++ b/admin.php
@@ -95,7 +95,6 @@ $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 8aaf4ad14..305c764c1 100644
--- a/admin/cat_options.php
+++ b/admin/cat_options.php
@@ -60,16 +60,6 @@ UPDATE '.CATEGORIES_TABLE.'
pwg_query($query);
break;
}
- case 'comments' :
- {
- $query = '
-UPDATE '.CATEGORIES_TABLE.'
- SET commentable = \'false\'
- WHERE id IN ('.implode(',', $_POST['cat_true']).')
-;';
- pwg_query($query);
- break;
- }
case 'visible' :
{
set_cat_visible($_POST['cat_true'], 'false');
@@ -108,16 +98,6 @@ UPDATE '.CATEGORIES_TABLE.'
pwg_query($query);
break;
}
- case 'comments' :
- {
- $query = '
-UPDATE '.CATEGORIES_TABLE.'
- SET commentable = \'true\'
- WHERE id IN ('.implode(',', $_POST['cat_false']).')
-;';
- pwg_query($query);
- break;
- }
case 'visible' :
{
set_cat_visible($_POST['cat_false'], 'true');
@@ -205,27 +185,6 @@ 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 12235cce6..c45fddc85 100644
--- a/admin/configuration.php
+++ b/admin/configuration.php
@@ -158,6 +158,32 @@ 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') );
@@ -226,6 +252,19 @@ 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/configuration.html b/language/en_UK.iso-8859-1/help/configuration.html
index 8e6068c6e..be92d9a9c 100644
--- a/language/en_UK.iso-8859-1/help/configuration.html
+++ b/language/en_UK.iso-8859-1/help/configuration.html
@@ -9,6 +9,7 @@ cass="filename">include/config_default.inc.php</span>.</p>
<p>This screen is divided in several sections, regrouping configuration
parameters by theme.</p>
+
<h3>General</h3>
<ul>
@@ -43,22 +44,6 @@ rate images.</li>
</ul>
-<h3>User comments</h3>
-
-<ul>
-
- <li><strong>Comments for all</strong>: Even guest not registered can post
- comments.</li>
-
- <li><strong>Number of comments per page</strong>.</li>
-
- <li><strong>Validation</strong>: an administrator validate users posted
- comments before they become visible on the site. User comments validation
- takes place in screen <span class="pwgScreen">Administration, Pictures,
- Comments</span>.</li>
-
-</ul>
-
<h3>Default display</h3>
<p>Here you can change display options used by default, when guest is not
@@ -108,3 +93,30 @@ users.</p>
previous setting.</li>
</ul>
+
+
+<h3>User comments</h3>
+
+<ul>
+
+ <li><strong>Comments for all</strong>: Even guest not registered can post
+ comments.</li>
+
+ <li><strong>Number of comments per page</strong>.</li>
+
+ <li><strong>Validation</strong>: an administrator validate users posted
+ comments before they become visible on the site. User comments validation
+ takes place in screen <span class="pwgScreen">Administration, Pictures,
+ Comments</span>.</li>
+
+ <li><strong>Email admin when a valid comment is entered</strong>:
+Sends an email to the administrators when a user enters a comment and this comment is validated.</li>
+
+ <li><strong>Email admin when a comment requires validation</strong>:
+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 <span class="pwgScreen">Administration, Pictures, Comments</span>.</li>
+
+ <li><strong>Authorize users to add comments on selected categories</strong>:
+ Selects the categories which are commentable. An image is commentable if it belongs to at least one category that is commentable.</li>
+
+</ul>
diff --git a/language/fr_FR.iso-8859-1/help/configuration.html b/language/fr_FR.iso-8859-1/help/configuration.html
index ab0ae03c3..32cf50352 100644
--- a/language/fr_FR.iso-8859-1/help/configuration.html
+++ b/language/fr_FR.iso-8859-1/help/configuration.html
@@ -44,23 +44,6 @@ dans l'écran <span class="pwgScreen">Administration, Général, Historique</span>.
</ul>
-<h3>Commentaires utilisateur</h3>
-
-<ul>
-
- <li><strong>Commentaires utilisateur pour tous</strong>: même les
-utilisateurs non enregistrés peuvent enregistrer des commentaires.</li>
-
- <li><strong>Nombre de commentaires utilisateur par page</strong>.</li>
-
- <li><strong>Validation</strong>: un administrateur doit valider les
-commentaires utilisateurs avant qu'ils puissent devenir visibles dans la
-partie publique. La validation des commentaires utilisateurs a lieu dans
-l'écran <span class="pwgScreen">Administration, Images,
-Commentaires</span>.</li>
-
-</ul>
-
<h3>Affichage par défaut</h3>
<p>Modifier les options d'affichage par défaut: pour les visiteurs non
@@ -114,3 +97,31 @@ vos images stockées.</li>
largeur.</li>
</ul>
+
+
+<h3>Commentaires utilisateur</h3>
+
+<ul>
+
+ <li><strong>Commentaires utilisateur pour tous</strong>: même les
+utilisateurs non enregistrés peuvent enregistrer des commentaires.</li>
+
+ <li><strong>Nombre de commentaires utilisateur par page</strong>.</li>
+
+ <li><strong>Validation</strong>: un administrateur doit valider les
+commentaires utilisateurs avant qu'ils puissent devenir visibles dans la
+partie publique. La validation des commentaires utilisateurs a lieu dans
+l'écran <span class="pwgScreen">Administration, Images,
+Commentaires</span>.</li>
+
+ <li><strong>Notifier le webmestre quand un commentaire est enregistré</strong>:
+Envoi un courriel aux administrateurrs lorsqu'un utilisateur enregistre un commentaire qui est validé.</li>
+
+ <li><strong>Notifier le webmestre quand un commentaire requiert sa validation </strong>:
+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 <span class="pwgScreen">Administration, Images, Commentaires</span>.</li>
+
+<li><strong>Autoriser les utilisateurs à ajouter des commentaires dans les catégories sélectionnées</strong>:
+Une image est commentable si elle appartient à au moins une catégorie commentable.</li>
+
+</ul>
diff --git a/template/yoga/admin.tpl b/template/yoga/admin.tpl
index 9fc63321b..fdbd50614 100644
--- a/template/yoga/admin.tpl
+++ b/template/yoga/admin.tpl
@@ -15,8 +15,8 @@
<dd>
<ul>
<li><a href="{U_CONFIG_GENERAL}">{lang:general}</a></li>
- <li><a href="{U_CONFIG_COMMENTS}">{lang:comments}</a></li>
<li><a href="{U_CONFIG_DISPLAY}">{lang:conf_default}</a></li>
+ <li><a href="{U_CONFIG_COMMENTS}">{lang:comments}</a></li>
</ul>
</dd>
</dl>
@@ -29,7 +29,6 @@
<li><a href="{U_CATEGORIES}">{lang:manage}</a></li>
<li><a href="{U_MOVE}">{lang:Move}</a></li>
<li><a href="{U_CAT_UPLOAD}">{lang:upload}</a></li>
- <li><a href="{U_CAT_COMMENTS}">{lang:comments}</a></li>
<li><a href="{U_CAT_VISIBLE}">{lang:lock}</a></li>
<li><a href="{U_CAT_STATUS}">{lang:cat_security}</a></li>
<!-- BEGIN representative -->
diff --git a/template/yoga/admin/configuration.tpl b/template/yoga/admin/configuration.tpl
index a6b14e1e5..7622564d4 100644
--- a/template/yoga/admin/configuration.tpl
+++ b/template/yoga/admin/configuration.tpl
@@ -221,3 +221,35 @@
<input class="submit" type="reset" name="reset" value="{lang:Reset}">
</p>
</form>
+
+
+<!-- BEGIN comments -->
+<form method="post" action="{F_ACTION}" class="properties">
+<fieldset>
+ <legend>{lang:cat_comments_title}</legend>
+ <table class="doubleSelect">
+ <tr>
+ <td>
+ <h3>{lang:authorized}</h3>
+ <select class="categoryList" name="cat_true[]" multiple="multiple" size="30">
+ <!-- BEGIN category_option_true -->
+ <option {comments.category_option_true.SELECTED} value="{comments.category_option_true.VALUE}">{comments.category_option_true.OPTION}</option>
+ <!-- END category_option_true -->
+ </select>
+ <p><input class="submit" type="submit" value="&raquo;" name="falsify" style="font-size:15px;" {TAG_INPUT_ENABLED}/></p>
+ </td>
+
+ <td>
+ <h3>{lang:forbidden}</h3>
+ <select class="categoryList" name="cat_false[]" multiple="multiple" size="30">
+ <!-- BEGIN category_option_false -->
+ <option {comments.category_option_false.SELECTED} value="{comments.category_option_false.VALUE}">{comments.category_option_false.OPTION}</option>
+ <!-- END category_option_false -->
+ </select>
+ <p><input class="submit" type="submit" value="&laquo;" name="trueify" style="font-size:15px;" {TAG_INPUT_ENABLED}/></p>
+ </td>
+ </tr>
+ </table>
+</fieldset>
+</form>
+<!-- END comments -->