Changeset 1865 for trunk/admin


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/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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  }
Note: See TracChangeset for help on using the changeset viewer.