Jlog PHP Cross Reference Blogging Systems

Source: /admin/categories.php - 76 lines - 2902 bytes - Summary - Text - Print

   1  <?php
   2   include_once ('.'.DIRECTORY_SEPARATOR.'auth.php');
   3   define("JLOG_ADMIN", true);
   4   require('..'.DIRECTORY_SEPARATOR.'personal'.DIRECTORY_SEPARATOR.'settings.inc.php');
   5   $get = strip($_GET);
   6   $form_input = strip($_POST);
   7  
   8   $c['meta']['title'] = $l['admin']['cat_title'];
   9   $c['main'] = output_admin_menu()."<h2>".$l['admin']['cat_title']."</h2>\n";
  10   
  11      switch ($get['action']) {
  12      
  13          case 'new':
  14              if(isset($form_input['form_submit'])) {
  15                  if(!is_array($errors = $categories->validate($form_input))) {
  16                      $categories->new_cat($form_input);
  17                      $categories->get_categories();
  18                      $c['main'] .= "<p><strong></strong> <a href='?action=new'>".$l['admin']['cat_new']."</a></p>
  19                                       ".$categories->output_whole_list_admin();
  20                  }
  21                  else {
  22                      $c['main'] .= error_output($errors);
  23                      $c['main'] .= $categories->output_form($form_input, $action = 'new', $l['admin']['cat_new']);
  24                  }
  25              }
  26              else $c['main'] .= $categories->output_form('', $action = 'new', $l['admin']['cat_new']);
  27              break;
  28  
  29          case 'change':
  30              if(isset($form_input['form_submit'])) {
  31                  if(!is_array($errors = $categories->validate($form_input))) {
  32                      $categories->change_cat($form_input);
  33                      $categories->get_categories();
  34                      $c['main'] .= "<p>".$l['admin']['cat_new_ok']."</p>".$categories->output_whole_list_admin();
  35                  }
  36                  else {
  37                      $c['main'] .= error_output($errors);
  38                      $c['main'] .= $categories->output_form($form_input, $action = 'new', $l['admin']['cat_new']);
  39                  }
  40              }
  41              else {
  42                  $form_input['name'] = $categories->get($get['id'], 'name');
  43                  $form_input['id'] = $get['id'];
  44                  $form_input['url'] = $categories->get($get['id'], 'url');
  45                  $form_input['description'] = $categories->get($get['id'], 'description');
  46                  
  47                  $c['main'] .= $categories->output_form($form_input, $action = 'change', $l['admin']['cat_change']);
  48              }
  49                break;
  50  
  51          case 'trash':
  52              if($form_input['form_submit'] == $l['admin']['yes']) {
  53                  $categories->trash_cat($form_input['id']);
  54                  $categories->get_categories();
  55                  $c['main'] .= "<p>".$l['admin']['cat_trash_ok']."
  56                                       <a href='categories.php'>".$l['admin']['cat_admincenter']."</a></p>";
  57              }
  58              else {
  59                  $c['main'] .= "<form action='?action=trash' method='POST'>
  60                                  <p>".$l['admin']['cat_really_trash']."</p>
  61                                  <h3>".$categories->link($get['id'])."</h3>
  62                                  <p><input type='submit' name='form_submit' value='".$l['admin']['yes']."' />
  63                                     <input type='hidden' name='id' value='".$get['id']."' />
  64                                     <a href='categories.php'>".$l['admin']['no']."</a></p>
  65                                 </form>";
  66              }
  67              break;
  68          
  69          default:
  70              $c['main'] .= "<p><strong></strong> <a href='?action=new'>".$l['admin']['cat_new']."</a></p>
  71                                ".$categories->output_whole_list_admin();
  72      }
  73  
  74  require (JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'do_template.php');
  75  echo $body;
  76  ?>

title

Description

title

Description

title

Description

title

title

Body