[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/class/action/admin/ -> adminnewarticlecategoryaction.class.php (source)

   1  <?php
   2  
   3      lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
   4      lt_include( PLOG_CLASS_PATH."class/view/admin/admintemplatedview.class.php" );
   5      lt_include( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
   6      lt_include( PLOG_CLASS_PATH."class/dao/articlecategories.class.php" );
   7  
   8      /**
   9       * \ingroup Action
  10       * @private
  11       *
  12       * Action that adds a new category for the articles to the database
  13       */
  14      class AdminNewArticleCategoryAction extends AdminAction 
  15      {
  16  
  17          /**
  18           * Constructor. If nothing else, it also has to call the constructor of the parent
  19           * class, BlogAction with the same parameters
  20           */
  21          function AdminNewArticleCategoryAction( $actionInfo, $request )
  22          {
  23              $this->AdminAction( $actionInfo, $request );
  24  
  25              $this->requirePermission( "add_category" );
  26          }
  27  
  28          /**
  29           * Carries out the specified action
  30           */
  31          function perform()
  32          {
  33              // initialize the view
  34              $this->_view = new AdminTemplatedView( $this->_blogInfo, "newpostcategory" );
  35              $this->setCommonData();
  36  
  37              // fetch the categories
  38              $categories = new ArticleCategories();
  39              $blogSettings = $this->_blogInfo->getSettings();
  40              $categoriesOrder = $blogSettings->getValue( "categories_order" );
  41              $blogCategories = $categories->getBlogCategories( $this->_blogInfo->getId(), false, $categoriesOrder );
  42              $this->_view->setValue( "categories", $blogCategories );
  43              // this field should be true by default
  44              $this->_view->setValue( "categoryInMainPage", true );
  45  
  46              // better to return true if everything fine
  47              return true;
  48          }
  49      }
  50  ?>


Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics