Changeset 1865


Ignore:
Timestamp:
Feb 28, 2007, 1:16:53 AM (17 years ago)
Author:
rvelices
Message:

admin pages: merge Categories/comments page into Configuration/comments page
(they are related and we reduce the # of links in the menu)

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin.php

    r1760 r1865  
    9696    'U_MOVE'=> $link_start.'cat_move',
    9797    'U_CAT_UPLOAD'=> $opt_link.'upload',
    98     'U_CAT_COMMENTS'=> $opt_link.'comments',
    9998    'U_CAT_VISIBLE'=> $opt_link.'visible',
    10099    'U_CAT_STATUS'=> $opt_link.'status',
  • trunk/admin/cat_options.php

    r1072 r1865  
    6161      break;
    6262    }
    63     case 'comments' :
    64     {
    65       $query = '
    66 UPDATE '.CATEGORIES_TABLE.'
    67   SET commentable = \'false\'
    68   WHERE id IN ('.implode(',', $_POST['cat_true']).')
    69 ;';
    70       pwg_query($query);
    71       break;
    72     }
    7363    case 'visible' :
    7464    {
     
    10494UPDATE '.CATEGORIES_TABLE.'
    10595  SET uploadable = \'true\'
    106   WHERE id IN ('.implode(',', $_POST['cat_false']).')
    107 ;';
    108       pwg_query($query);
    109       break;
    110     }
    111     case 'comments' :
    112     {
    113       $query = '
    114 UPDATE '.CATEGORIES_TABLE.'
    115   SET commentable = \'true\'
    11696  WHERE id IN ('.implode(',', $_POST['cat_false']).')
    11797;';
     
    206186    break;
    207187  }
    208   case 'comments' :
    209   {
    210     $query_true = '
    211 SELECT id,name,uppercats,global_rank
    212   FROM '.CATEGORIES_TABLE.'
    213   WHERE commentable = \'true\'
    214 ;';
    215     $query_false = '
    216 SELECT id,name,uppercats,global_rank
    217   FROM '.CATEGORIES_TABLE.'
    218   WHERE commentable = \'false\'
    219 ;';
    220     $template->assign_vars(
    221       array(
    222         'L_SECTION' => $lang['cat_comments_title'],
    223         'L_CAT_OPTIONS_TRUE' => $lang['authorized'],
    224         'L_CAT_OPTIONS_FALSE' => $lang['forbidden'],
    225         )
    226       );
    227     break;
    228   }
    229188  case 'visible' :
    230189  {
  • trunk/admin/configuration.php

    r1763 r1865  
    159159}
    160160
     161if ( $page['section']=='comments' and !is_adviser() )
     162{
     163  if (isset($_POST['falsify'])
     164      and isset($_POST['cat_true'])
     165      and count($_POST['cat_true']) > 0)
     166  {
     167      $query = '
     168UPDATE '.CATEGORIES_TABLE.'
     169  SET commentable = \'false\'
     170  WHERE id IN ('.implode(',', $_POST['cat_true']).')
     171;';
     172      pwg_query($query);
     173  }
     174  if (isset($_POST['trueify'])
     175         and isset($_POST['cat_false'])
     176         and count($_POST['cat_false']) > 0)
     177  {
     178      $query = '
     179UPDATE '.CATEGORIES_TABLE.'
     180  SET commentable = \'true\'
     181  WHERE id IN ('.implode(',', $_POST['cat_false']).')
     182;';
     183      pwg_query($query);
     184  }
     185}
     186
    161187//----------------------------------------------------- template initialization
    162188$template->set_filenames( array('config'=>'admin/configuration.tpl') );
     
    227253        );
    228254    }
     255   
     256    $query_true = '
     257SELECT id,name,uppercats,global_rank
     258  FROM '.CATEGORIES_TABLE.'
     259  WHERE commentable = \'true\'
     260;';
     261    $query_false = '
     262SELECT id,name,uppercats,global_rank
     263  FROM '.CATEGORIES_TABLE.'
     264  WHERE commentable = \'false\'
     265;';
     266    display_select_cat_wrapper($query_true,array(),'comments.category_option_true');
     267    display_select_cat_wrapper($query_false,array(),'comments.category_option_false');
    229268    break;
    230269  }
  • trunk/language/en_UK.iso-8859-1/help/configuration.html

    r1763 r1865  
    99<p>This screen is divided in several sections, regrouping configuration
    1010parameters by theme.</p>
     11
    1112
    1213<h3>General</h3>
     
    4344</ul>
    4445
    45 
    46 <h3>User comments</h3>
    47 
    48 <ul>
    49 
    50   <li><strong>Comments for all</strong>: Even guest not registered can post
    51   comments.</li>
    52 
    53   <li><strong>Number of comments per page</strong>.</li>
    54 
    55   <li><strong>Validation</strong>: an administrator validate users posted
    56   comments before they become visible on the site. User comments validation
    57   takes place in screen <span class="pwgScreen">Administration, Pictures,
    58   Comments</span>.</li>
    59 
    60 </ul>
    6146
    6247<h3>Default display</h3>
     
    10994
    11095</ul>
     96
     97
     98<h3>User comments</h3>
     99
     100<ul>
     101
     102  <li><strong>Comments for all</strong>: Even guest not registered can post
     103  comments.</li>
     104
     105  <li><strong>Number of comments per page</strong>.</li>
     106
     107  <li><strong>Validation</strong>: an administrator validate users posted
     108  comments before they become visible on the site. User comments validation
     109  takes place in screen <span class="pwgScreen">Administration, Pictures,
     110  Comments</span>.</li>
     111
     112  <li><strong>Email admin when a valid comment is entered</strong>:
     113Sends an email to the administrators when a user enters a comment and this comment is validated.</li>
     114
     115  <li><strong>Email admin when a comment requires validation</strong>:
     116Sends an email to the administrators when a user enters a comment that requires validation by the admin.
     117User comments validation takes place in the screen <span class="pwgScreen">Administration, Pictures, Comments</span>.</li>
     118
     119  <li><strong>Authorize users to add comments on selected categories</strong>:
     120 Selects the categories which are commentable. An image is commentable if it belongs to at least one category that is commentable.</li>
     121 
     122</ul>
  • trunk/language/fr_FR.iso-8859-1/help/configuration.html

    r1763 r1865  
    4444</ul>
    4545
    46 
    47 <h3>Commentaires utilisateur</h3>
    48 
    49 <ul>
    50 
    51   <li><strong>Commentaires utilisateur pour tous</strong>: même les
    52 utilisateurs non enregistrés peuvent enregistrer des commentaires.</li>
    53 
    54   <li><strong>Nombre de commentaires utilisateur par page</strong>.</li>
    55 
    56   <li><strong>Validation</strong>: un administrateur doit valider les
    57 commentaires utilisateurs avant qu'ils puissent devenir visibles dans la
    58 partie publique. La validation des commentaires utilisateurs a lieu dans
    59 l'écran <span class="pwgScreen">Administration, Images,
    60 Commentaires</span>.</li>
    61 
    62 </ul>
    6346
    6447<h3>Affichage par défaut</h3>
     
    11598
    11699</ul>
     100
     101
     102<h3>Commentaires utilisateur</h3>
     103
     104<ul>
     105
     106  <li><strong>Commentaires utilisateur pour tous</strong>: même les
     107utilisateurs non enregistrés peuvent enregistrer des commentaires.</li>
     108
     109  <li><strong>Nombre de commentaires utilisateur par page</strong>.</li>
     110
     111  <li><strong>Validation</strong>: un administrateur doit valider les
     112commentaires utilisateurs avant qu'ils puissent devenir visibles dans la
     113partie publique. La validation des commentaires utilisateurs a lieu dans
     114l'écran <span class="pwgScreen">Administration, Images,
     115Commentaires</span>.</li>
     116
     117  <li><strong>Notifier le webmestre quand un commentaire est enregistré</strong>:
     118Envoi un courriel aux administrateurrs lorsqu'un utilisateur enregistre un commentaire qui est validé.</li>
     119
     120  <li><strong>Notifier le webmestre quand un commentaire requiert sa validation </strong>:
     121Envoi un courriel aux administrateurrs lorsqu'un utilisateur enregistre un commentaire qui demande une validation de la part des administrateurs.
     122La validation des commentaires utilisateurs a lieu dans l'écran <span class="pwgScreen">Administration, Images, Commentaires</span>.</li>
     123
     124<li><strong>Autoriser les utilisateurs à ajouter des commentaires dans les catégories sélectionnées</strong>:
     125Une image est commentable si elle appartient à au moins une catégorie commentable.</li>
     126
     127</ul>
  • trunk/template/yoga/admin.tpl

    r1853 r1865  
    1616      <ul>
    1717        <li><a href="{U_CONFIG_GENERAL}">{lang:general}</a></li>
     18        <li><a href="{U_CONFIG_DISPLAY}">{lang:conf_default}</a></li>
    1819        <li><a href="{U_CONFIG_COMMENTS}">{lang:comments}</a></li>
    19         <li><a href="{U_CONFIG_DISPLAY}">{lang:conf_default}</a></li>
    2020      </ul>
    2121    </dd>
     
    3030        <li><a href="{U_MOVE}">{lang:Move}</a></li>
    3131        <li><a href="{U_CAT_UPLOAD}">{lang:upload}</a></li>
    32         <li><a href="{U_CAT_COMMENTS}">{lang:comments}</a></li>
    3332        <li><a href="{U_CAT_VISIBLE}">{lang:lock}</a></li>
    3433        <li><a href="{U_CAT_STATUS}">{lang:cat_security}</a></li>
  • trunk/template/yoga/admin/configuration.tpl

    r1780 r1865  
    222222  </p>
    223223</form>
     224
     225
     226<!-- BEGIN comments -->
     227<form method="post" action="{F_ACTION}" class="properties">
     228<fieldset>
     229  <legend>{lang:cat_comments_title}</legend>
     230  <table class="doubleSelect">
     231    <tr>
     232      <td>
     233        <h3>{lang:authorized}</h3>
     234        <select class="categoryList" name="cat_true[]" multiple="multiple" size="30">
     235          <!-- BEGIN category_option_true -->
     236          <option {comments.category_option_true.SELECTED} value="{comments.category_option_true.VALUE}">{comments.category_option_true.OPTION}</option>
     237          <!-- END category_option_true -->
     238        </select>
     239        <p><input class="submit" type="submit" value="&raquo;" name="falsify" style="font-size:15px;" {TAG_INPUT_ENABLED}/></p>
     240      </td>
     241
     242      <td>
     243        <h3>{lang:forbidden}</h3>
     244        <select class="categoryList" name="cat_false[]" multiple="multiple" size="30">
     245          <!-- BEGIN category_option_false -->
     246          <option {comments.category_option_false.SELECTED} value="{comments.category_option_false.VALUE}">{comments.category_option_false.OPTION}</option>
     247          <!-- END category_option_false -->
     248        </select>
     249        <p><input class="submit" type="submit" value="&laquo;" name="trueify" style="font-size:15px;" {TAG_INPUT_ENABLED}/></p>
     250      </td>
     251    </tr>
     252  </table>
     253</fieldset>
     254</form>
     255<!-- END comments -->
Note: See TracChangeset for help on using the changeset viewer.