Exemplo n.º 1
0
 protected function AddCategoryPost()
 {
     if ($this->post->name == '') {
         $this->set('message', 'No category name entered!');
         $this->render('core_error.tpl');
         return;
     }
     if (DownloadData::FindCategory($this->post->name)) {
         $this->set('message', 'Category already exists');
         $this->render('core_error.tpl');
         return;
     }
     DownloadData::AddCategory($this->post->name, '', '');
     $this->set('message', 'Category added!');
     $this->render('core_success.tpl');
 }
Exemplo n.º 2
0
 protected function AddCategoryPost()
 {
     $this->checkPermission(EDIT_DOWNLOADS);
     if ($this->post->name == '') {
         $this->set('message', 'No category name entered!');
         $this->render('core_error.php');
         return;
     }
     if (DownloadData::FindCategory($this->post->name)) {
         $this->set('message', 'Category already exists');
         $this->render('core_error.php');
         return;
     }
     DownloadData::AddCategory($this->post->name, '', '');
     $this->set('message', 'Category added!');
     $this->render('core_success.php');
 }