public function manageAction($id = false)
 {
     $this->permission('manage');
     if ($id) {
         $model = new \modules\portfolio\models\Portfolio('edit');
     } else {
         $model = new \modules\portfolio\models\Portfolio('add');
     }
     $model->attributes = $this->Input->post();
     $model->language_id = $this->language->getDefaultLanguage();
     if (!$id) {
         $model->created = date("Y-m-d H:i:s");
     }
     if ($id) {
         $model->portfolio_id = $id;
     }
     $blog_category = Form_helper::queryToDropdown('portfolio_categories', 'portfolio_category_id', 'title');
     if ($model->save()) {
         Uri_helper::redirect("management/portfolio_items");
     }
     return $this->render('portfolio_items/manage', ['item' => $id ? $model->get() : null, 'blog_category' => $blog_category]);
 }