/**
  * Edit document category page action
  * 
  * @param void
  * @return void
  */
 function edit()
 {
     $this->wireframe->print_button = false;
     if ($this->active_document_category->isNew()) {
         $this->httpError(HTTP_ERR_NOT_FOUND);
     }
     // if
     if (!$this->active_document_category->canEdit($this->logged_user)) {
         $this->httpError(HTTP_ERR_FORBIDDEN);
     }
     // if
     $category_data = $this->request->post('category');
     if (!is_array($category_data)) {
         $category_data = array('name' => $this->active_document_category->getName());
     }
     // if
     $this->smarty->assign('category_data', $category_data);
     if ($this->request->isSubmitted()) {
         db_begin_work();
         $old_name = $this->active_document_category->getName();
         $this->active_document_category->setAttributes($category_data);
         $save = $this->active_document_category->save();
         if ($save && !is_error($save)) {
             db_commit();
             if ($this->request->isAsyncCall()) {
                 $this->renderText($this->active_document_category->getName());
             } else {
                 flash_success('Category ":category_name" has been updated', array('category_name' => $old_name));
                 $this->redirectTo('document_categories');
             }
             // if
         } else {
             db_rollback();
             if ($this->request->isAsyncCall()) {
                 $this->serveData($save);
             } else {
                 $this->smarty->assign('errors', $save);
             }
             // if
         }
         // if
     }
     // if
 }