public function performHandlerTasks()
 {
     $comment = new Comment();
     $comment->clauseSafe('author_id', Logbook::current()->authorId());
     $comment->clauseSafe('entry_id', Application::param('entry_id'));
     $comment->clauseSafe('comment_id', Application::param('comment_id'));
     $comment->delete();
     Application::setParam('author_id', Logbook::current()->authorId());
     $this->redirectOnSave();
 }
        protected function editAboutMe()
        {
            $form = Form::load('logbook.views.EditBlogAuthorDetails');

            if($form->validate())
            {
                $item = new Author();
                $item->clause('user_id',Application::current()->user()->id());
                $item->parse();
                $item->synch();
                Application::setParam('author_id',$item->id());
                $this->redirectOnSave();
            }
        }
        private function savePart()
        {
            $form = 'frost.views.cms.part.text.TextAdd';
            $part = Part::addMediaToPart($form,'Text');
            
            // Add the 'preview' to the part 
            $part = new Part();
            $part->clauseSafe('part_id',Application::param('part_id')); 
            $part->parse(); 
            $part->save();

            //Part::setParttagsAndSave($part,Application::param('current_tags'));
    
            Application::setParam('module_id',Application::param('module_id'));
            Application::redirect('ModuleDetail');
        }
        public function save()
	{
	    $form = Form::load('logbook.views.AddBlogComment');
            $capval = Captcha::validate();

	    if($form->validate()&&$capval)
	    {
	        Application::alterParam('comment_content',strip_tags(Application::param('comment_content')));
	        $item = new Comment();
		$item->parse();
                $item->set('comment_date',date('Y-m-d H:M:S'));
                $item->setSafe('author_id',Logbook::current()->authorId());
		$item->save();

                Application::setParam('author_id',Application::param('author_id'));
		Application::setParam('entry_id',Application::param('entry_id'));
		$this->redirectOnSave();
	    }
	}
        protected function doEdit()
	{
	    $form = $this->editForm();

	    if($form->validate())
	    {
            $item = $this->entryToEdit();
            $test = $item->restrict();

	        if(LogbookAccess::currentUserCanEdit($test))
	        {
                $item = $this->entryToEdit();
    		    $item->parse();
    		    $item->synch();
    		    Entry::setTagsAndSave($item,Application::param('entry_tags'));
                Application::setParam('author_id',Application::param('author_id'));
                Application::setParam('entry_id',Application::param('entry_id'));
	        }
                
            LogbookAccess::publishLookupTables();
    		$this->redirectOnSave();
	    }
	}
 /**
  * Change a parameter that is in the $_POST, $_GET or user parameters array
  *
  * This method first checks post, then get, the user params to see if the value is present.
  * If it was present in any of these, then it changes the value to the new one passed. 
  * If the value could not be found, then it is set using the {@link Application::setParam()}
  * method
  * @param name - the name of the value to change
  * @param new_value - the new value 
  * @access public
  * @static
  */
 function alterParam($name, $new_value)
 {
     $ret = true;
     if (!($param = Application::postVarsParam($name))) {
         if (!($param = Application::getVarsParam($name))) {
             Application::setParam($name, $new_value);
         } else {
             $_GET[$name] = $new_value;
         }
     } else {
         $_POST[$name] = $new_value;
     }
     return $ret;
 }
 public function redirectOnAccessDenied()
 {
     Application::setParam('author_id', Logbook::current()->authorId());
     Application::setParam('entry_id', Application::param('entry_id'));
     Application::redirect(Application::defaultHandler());
 }