Beispiel #1
0
 /**
  * Stores all categories
  */
 public function store_action()
 {
     $request = Request::getInstance();
     $categories = $request['categories'];
     foreach ($categories as $id => $data) {
         if (empty($data['name'])) {
             $this->reportError(_('Kategorien ohne Namen können nicht gespeichert werden!'));
             continue;
         }
         $category = Kategorie::find($id);
         $category->name = $data['name'];
         $category->content = $data['content'];
         if ($category->store()) {
             $this->reportSuccess(_('Kategorien geändert!'));
             Visibility::renamePrivacySetting('kat_' . $category->id, $category->name);
         }
     }
     $this->redirect('settings/categories');
 }