Exemplo n.º 1
0
 /**
  * Display form to edit a category.
  * @param $args array optional, first parameter is the ID of the category to edit
  */
 function editCategory($args, &$request)
 {
     $categoryId = (int) array_shift($args);
     if (!$categoryId) {
         $categoryId = null;
     }
     $this->validate($categoryId);
     $this->setupTemplate($request, $this->category, true);
     import('classes.journal.categories.CategoryForm');
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('pageTitle', $this->category === null ? 'admin.categories.createTitle' : 'admin.categories.editTitle');
     $categoryForm = new CategoryForm($this->category);
     if ($categoryForm->isLocaleResubmit()) {
         $categoryForm->readInputData();
     } else {
         $categoryForm->initData();
     }
     $categoryForm->display();
 }