From 30e259904cc38172b2b730455009455675f0d8f5 Mon Sep 17 00:00:00 2001 From: rvelices Date: Wed, 28 Feb 2007 00:16:53 +0000 Subject: 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 --- admin.php | 1 - admin/cat_options.php | 41 --------------------- admin/configuration.php | 39 ++++++++++++++++++++ language/en_UK.iso-8859-1/help/configuration.html | 44 ++++++++++++++-------- language/fr_FR.iso-8859-1/help/configuration.html | 45 ++++++++++++++--------- template/yoga/admin.tpl | 3 +- template/yoga/admin/configuration.tpl | 32 ++++++++++++++++ 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 @@ -56,16 +56,6 @@ 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; @@ -104,16 +94,6 @@ 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; @@ -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.

This screen is divided in several sections, regrouping configuration parameters by theme.

+

General

-

User comments

- - -

Default display

Here you can change display options used by default, when guest is not @@ -108,3 +93,30 @@ users.

previous setting. + + +

User comments

+ + 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' -

Commentaires utilisateur

- - -

Affichage par défaut

Modifier les options d'affichage par défaut: pour les visiteurs non @@ -114,3 +97,31 @@ vos images stock largeur. + + +

Commentaires utilisateur

+ + 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 @@
@@ -29,7 +29,6 @@
  • {lang:manage}
  • {lang:Move}
  • {lang:upload}
  • -
  • {lang:comments}
  • {lang:lock}
  • {lang:cat_security}
  • 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 @@

    + + + +
    +
    + {lang:cat_comments_title} + + + + + + +
    +

    {lang:authorized}

    + +

    +
    +

    {lang:forbidden}

    + +

    +
    +
    +
    + -- cgit v1.2.3