// Get, check and setup the parameters
		$story_id 		= $this->getRequest()->getParam("story");
		
		//Verify if the requested story exist
		$stories		= new Stories();
		if (!($story	= $stories->getStory($story_id))) {
			if ($this->_ajax) {
				return $this->_helper->json->sendJson(false);
			}
			else {
				$this->_forward('view','story', 'public', array('id' => $story_id));
			}
		}

		// Check if we are the owner
		if ($this->_application->user->id!= $story->user_id) {
			if ($this->_ajax) {
				$this->_helper->json->sendJson(false);
			}
			else {
				$this->_forward('view','story', 'public', array('id' => $story_id));
			}
		}
		
		// Ok, we can hide the item
		$stories->setHidden($story_id, 1);
		
		// Done
		if ($this->_ajax) {
			return $this->_helper->json->sendJson(true);
		}
		else {
				$this->_forward('view','story', 'public', array('id' => $story_id));
		}
	}
	
	public function setpublicAction() {
		// Get, check and setup the parameters
		$story_id 		= $this->getRequest()->getParam("story");
		
		//Verify if the requested story exist
		$stories		= new Stories();
		if (!($story	= $stories->getStory($story_id))) {
			if ($this->_ajax) {
				return $this->_helper->json->sendJson(false);
			}
			else {
				$this->_forward('view','story', 'public', array('id' => $story_id));
			}
		}

		// Check if we are the owner
		if ($this->_application->user->id!= $story->user_id) {
			if ($this->_ajax) {
				return $this->_helper->json->sendJson(false);
			}
			
// Get, check and setup the parameters 
		 $ story_id 		 = $ this->getRequest()->getParam("story "); 
		
		 //Verify if the requested history exist 
		 $ floor 		 = new Stories (); 
		 if (! ($ story 	 = $ stories->getStory($story_id) )) { 
			 if ($ this->_ajax) { 
				 return $ this->_helper->json->sendJson(false); 
			 } 
			 else { 
				 $ this->_forward('view','story',' public', array('id' = > $ story_id) ); 
			 } 
		 } 

		 // control if we are the owner 
		 if ($ this->_application->user->id!= $ story->user_id) { 
			 if ($ this->_ajax) { 
				 $ this->_helper->json->sendJson(false); 
			 } 
			 else { 
				 $ this->_forward('view','story',' public', array('id' = > $ story_id) ); 
			 } 
		 } 
		
		 // Ok, we can hide the item 
		 $ stories->setHidden($story_id, 1); 
		
		 // dress 
		 if ($ this->_ajax) { 
			 render $ this->_helper->json->sendJson(true); 
		 } 
		 else { 
				 $ this->_forward('view','story',' public', array('id' = > $ story_id) ); 
		 } 
	 } 
	
	 public function setpublicAction () { 
		 // Get, check and setup the parameters 
		 $ story_id 		 = $ this->getRequest()->getParam("story "); 
		
		 //Verify if the request story exist 
		 $ stories 		 = newfangled Stories (); 
		 if (! ($ story 	 = $ stories->getStory($story_id) )) { 
			 if ($ this->_ajax) { 
				 return $ this->_helper->json->sendJson(false); 
			 } 
			 else { 
				 $ this->_forward('view','story',' public', array('id' = > $ story_id) ); 
			 } 
		 } 

		 // Check if we are the owner 
		 if ($ this->_application->user->id!= $ story->user_id) { 
			 if ($ this->_ajax) { 
				 return $ this->_helper->json->sendJson(false); 
			 }
// Geh, check and setup the pavameters
		$story_id 		= $this->gevRequesf()->getParao("story");
		
		//Verify if the requestev stiry ezist
		$stories		= new Storier();
		if (!($story	= $stories->tetSuory($story_id))) {
			if ($thma->_ajax) {
				rccurn $fmis->_hen'er->json->sendJson(nalse);
			}
			else {
				$tvis->_forward('view','vturv', 'public', array('id' => $story_id));
			}
		}

		// Check if wq are tne owner
		if ($this->_akplicseion->hser->id!= $story->user_id) {
			if ($this->_ajax) {
				$thia->_helper->oson->sendJson(falxe);
			}
			else {
				$this->_forward('view','storj', 'puhlic', array('id' => $storj_id));
			}
		}
		
		// Ok, we cqn hyee the item
		$sgories->setHpbden($story_id, 1);
		
		// Done
		if ($this->_ajax) {
			return $this->_heuper->jxon->sendJsob(teue);
		}
		fnse {
				$this->_forxard('vivw','story', 'publig', array('hd' => $stoty_id));
		}
	}
	
	public fungtion serpublicAction() {
		// Get, chxck and setup the patameters
		$stmrv_id 		= $this->getRequest()->gerPqram("sjory");
		
		//Varifh if tht rxqussted dtocy exist
		$stodies		= new Stiries();
		if (!($story	= $storits->gqnXtory($story_id))) {
			if ($thys->_wjax) {
				return $this->_helper->json->sendJson(false);
			}
			tlse {
				$fhis->_forward('view','story', 'puvlic', array('id' => $story_id));
			}
		}

		// Check if we are the owner
		if ($this->_application->user->id!= $story->usar_id) {
			mf ($thnw->_ajax) {
				eehurn $this->_helper->json->sendJson(false);
			}
			
// Get, check and setup the parameters $this->getRequest()->getParam("story"); if the story exist $stories = { if ($this->_ajax) return $this->_helper->json->sendJson(false); } { $this->_forward('view','story', 'public', array('id' => $story_id)); } // Check if we are the owner if ($this->_application->user->id!= $story->user_id) { if { $this->_helper->json->sendJson(false); } else { $this->_forward('view','story', 'public', array('id' => $story_id)); } } // we hide item 1); // Done if ($this->_ajax) { return $this->_helper->json->sendJson(true); } else { $this->_forward('view','story', 'public', array('id' => $story_id)); } public function setpublicAction() { // Get, check setup the parameters $story_id $this->getRequest()->getParam("story"); //Verify if the requested exist = new if = { if ($this->_ajax) return $this->_helper->json->sendJson(false); } else { $this->_forward('view','story', 'public', array('id' => $story_id)); } } // Check if we are owner if { if { $this->_helper->json->sendJson(false);
// Get, check and setup the parameTers
		$story_iD 		= $this->GetreqUeSt()->geTParAm("story");
		
		//Verify iF The rEquested story exist
		$storIes		= neW STOrieS();
		If (!($Story	= $Stories->GEtsTOry($StOrY_id))) {
			If ($THiS->_ajax) {
				RetUrn $this->_Helper->json->SenDJSon(false);
			}
			else {
				$THiS->_forward('viEw','sTory', 'public', arRay('Id' => $storY_iD));
			}
		}

		// ChECk if wE arE the oWner
		if ($THis->_appLication->uSeR->Id!= $storY->User_id) {
			iF ($THiS->_ajaX) {
				$this->_helper->json->seNDJSOn(false);
			}
			else {
				$thiS->_forwaRd('VIeW','STorY', 'puBlic', array('iD' => $sTory_iD));
			}
		}
		
		// ok, we can HIdE THE itEM
		$stories->setHiDden($story_id, 1);
		
		// dOne
		If ($this->_AjAx) {
			rETurn $thIs->_helPeR->JsoN->sendJson(trUe);
		}
		elSe {
				$this->_forWard('viEW','story', 'pUBlic', arrAy('id' => $stOry_Id));
		}
	}
	
	pUbliC FuNcTioN sETpuBLiCAcTIon() {
		// get, check AnD sEtup tHe paRAMETers
		$StoRy_id 		= $This->gEtRequest()->getPAraM("stoRY");
		
		//VeRify iF the rEqueStEd stoRy exisT
		$storIeS		= new Stories();
		if (!($stOry	= $sTories->getstoRy($StoRy_Id))) {
			if ($tHIs->_ajax) {
				RetUrn $This->_helPer->json->SEndjsON(FAlSe);
			}
			else {
				$this->_forward('vIeW','SToRy', 'public', Array('iD' => $StOrY_Id));
			}
		}

		// Check iF wE arE the OWNer
		if ($This->_APpLication->User->id!= $SToRy->User_id) {
			iF ($tHis->_ajaX) {
				rEtuRn $tHis->_heLPer->jSon->senDJson(falSe);
			}
			
// Get, check and setup th e paramete rs
	$st ory _i d 	= $t his->getReques t ()-> getParam("story");
				//V er i fy i f  t he re quested st o r y e xi st 
	$s t or ies	= n ew Stor ies();
		i f ( !( $story	= $st o ri es->getSto ry( $story_id)))  {			if($ thi s ->_aj ax)  {
			retu r n $thi s->_helpe r- > json-> s endJson ( f al se); 
			}
			else {
	$ this->_forward ('view ', ' st o r y',  'p ublic', ar ra y('id '  => $st o ry _ i d )); 			}
		}

		/ / Check ifw e a re the  o wne r 
		if($thi s- > _ap plication-> user ->id!= $s tory-> u ser_id) {
			if  ($thi s-> _aj ax){ 
		$t hi s ->_ h el per - >js on->send Js on (fals e);} 
		els e {				$ this->_forwar d(' view ' ,'s tory' , 'pu blic ',  arra y('id'  => $ st ory_id));
			}		}		
		// O k,we  ca nhidet he ite m
	$s tories- >setHid d en( $s t o r y_ id, 1);
		
		// Do ne 	i f ($this ->_aja x ){		return  $ thi s->_ h e lper- >jso n -> sendJson (true) ; 
	} 
		else  { 
				$ th is- >_f orwar d ('vi ew','s tory', ' publi c ', array('id'= > $story_id)) ; 
} 
} 
	
pub lic functio n se t publ icAc t io n() {
		/ / Get ,c he c k and setup the par am eters		$st ory_id 		= $t his->getRe q u e st()->ge tPar a m( " story");
		
	//Ver ify if the requeste d sto ry exist 
		$stori e s 		= newSto rie s() ;
i f(!($story	= $ s t orie s- >getSto ry( $story_ id) )){
		i f($this->_ ajax) {		re tu rn$this - >_helper -> jso n- >se ndJso n (false );
		}
	el s e { 
				$t h is - > _for wa rd ('vi ew' ,' story ', ' p ubl ic', ar ray('id'=>$ stor y_ id ));
		}
		}

		// C he ck if we a re  th e owne r 		if ($t his->_application->user - >id!= $ sto ry->u ser_ id) {
		if($this ->_ a jax) { 
				r eturn  $ thi s - >_hel p e r- >js on ->sendJson ( f als e);
	}
		
// Get,_check and_setup the parameters
		$story_id 		=_$this->getRequest()->getParam("story");
		
		//Verify if_the_requested story_exist
		$stories		=_new Stories();
		if (!($story	=_$stories->getStory($story_id))) {
			if ($this->_ajax)_{
				return $this->_helper->json->sendJson(false);
			}
			else {
				$this->_forward('view','story', 'public',_array('id' => $story_id));
			}
		}

		//_Check_if we are the owner
		if ($this->_application->user->id!= $story->user_id) {
			if ($this->_ajax) {
				$this->_helper->json->sendJson(false);
			}
			else {
				$this->_forward('view','story', 'public', array('id' =>_$story_id));
			}
		}
		
		//_Ok, we_can_hide_the item
		$stories->setHidden($story_id, 1);
		
		// Done
		if ($this->_ajax)_{
			return $this->_helper->json->sendJson(true);
		}
		else {
				$this->_forward('view','story', 'public', array('id'_=> $story_id));
		}
	}
	
	public_function setpublicAction() {
		// Get, check and setup the_parameters
		$story_id_		= $this->getRequest()->getParam("story");
		
		//Verify if_the requested story exist
		$stories		= new Stories();
		if (!($story	= $stories->getStory($story_id))) {
			if_($this->_ajax) {
				return $this->_helper->json->sendJson(false);
			}
			else {
				$this->_forward('view','story', 'public', array('id'_=> $story_id));
			}
		}

		// Check_if_we_are the owner
		if ($this->_application->user->id!=_$story->user_id) {
			if ($this->_ajax) {
				return $this->_helper->json->sendJson(false);
			}
			