phpMyFAQ PHP Cross Reference Customer Relationship Management

Source: /admin/category.move.php - 78 lines - 2904 bytes - Summary - Text - Print

Description: Select a category to move

   1  <?php
   2  /**
   3   * Select a category to move
   4   *
   5   * PHP Version 5.3
   6   *
   7   * This Source Code Form is subject to the terms of the Mozilla Public License,
   8   * v. 2.0. If a copy of the MPL was not distributed with this file, You can
   9   * obtain one at http://mozilla.org/MPL/2.0/.
  10   *
  11   * @category  phpMyFAQ
  12   * @package   Administration
  13   * @author    Thorsten Rinne <thorsten@phpmyfaq.de>
  14   * @copyright 2004-2014 phpMyFAQ Team
  15   * @license   http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
  16   * @link      http://www.phpmyfaq.de
  17   * @since     2004-04-29
  18   */
  19  
  20  if (!defined('IS_VALID_PHPMYFAQ')) {
  21      $protocol = 'http';
  22      if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON'){
  23          $protocol = 'https';
  24      }
  25      header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
  26      exit();
  27  }
  28  
  29  if ($permission["editcateg"]) {
  30      $id         = PMF_Filter::filterInput(INPUT_GET, 'cat', FILTER_VALIDATE_INT);
  31      $parent_id  = PMF_Filter::filterInput(INPUT_GET, 'parent_id', FILTER_VALIDATE_INT);
  32      $category = new PMF_Category($faqConfig, array(), false);
  33      $category->setUser($currentAdminUser);
  34      $category->setGroups($currentAdminGroups);
  35      $categories = $category->getAllCategories();
  36  
  37      $category->categories = null;
  38      unset($category->categories);
  39      $category->getCategories($parent_id, false);
  40      $category->buildTree($parent_id);
  41      
  42      $header = sprintf('%s: <em>%s</em>',
  43          $PMF_LANG['ad_categ_move'],
  44          $category->categories[$id]['name']
  45      );
  46  ?>
  47          <header>
  48              <h2><i class="icon-list"></i> <?php print $header ?></h2>
  49          </header>
  50          <form class="form-horizontal" action="?action=changecategory" method="post" accept-charset="utf-8">
  51              <input type="hidden" name="cat" value="<?php print $id; ?>" />
  52              <input type="hidden" name="csrf" value="<?php print $user->getCsrfTokenFromSession(); ?>" />
  53              <div class="control-group">
  54                  <label class="control-label"><?php print $PMF_LANG["ad_categ_change"]; ?></label>
  55                  <div class="controls">
  56                     <select name="change" size="1">
  57  <?php
  58                      foreach ($category->categories as $cat) {
  59                         if ($id != $cat["id"]) {
  60                            printf("<option value=\"%s\">%s</option>", $cat['id'], $cat['name']);
  61                         }
  62                     }
  63  ?>
  64                      </select>
  65                      <?php printf('<p class="help-block">%s</p>', $PMF_LANG['ad_categ_remark_move']); ?>
  66                  </div>
  67              </div>
  68  
  69              <div class="form-actions">
  70                  <button class="btn btn-primary" type="submit" name="submit">
  71                      <?php print $PMF_LANG["ad_categ_updatecateg"]; ?>
  72                  </button>
  73              </div>
  74          </form>
  75  <?php
  76  } else {
  77      print $PMF_LANG["err_NotAuth"];
  78  }

title

Description

title

Description

title

Description

title

title

Body