($story_id, $source_id, $item_id);
		return $this->_helper->json->sendJson(true);
	}
	
	public function settitleAction() {
		// Get, check and setup the parameters
		$story_id 		= $this->getRequest()->getParam("story");
		
		// TODO We should also filter and strip tags here
		$title	 		= substr($this->getRequest()->getParam("value"), 0, 25);
		
		//Verify if the requested story exist
		$stories		= new Stories();
		if (!($story	= $stories->getStory($story_id))) {
			return $this->_helper->json->sendJson(false);
		}

		// Check if we are the owner
		if ($this->_application->user->id!= $story->user_id) {
			return $this->_helper->json->sendJson(false);
		}
		
		// Ok, we can set the title
		$stories->setTitle($story_id, $title);
		
		// Die with the string
		if (!$title) $title = '[Edit Title]';
		die($title);
	}
	
	public function setsubtitleAction() {
		// Get, check and setup the parameters
		$story_id 		= $this->getRequest()->getParam("story");
		
		// TODO We should also filter and strip tags here
		$title	 		= substr($this->getRequest()->getParam("value"),0, 50); 
		
		//Verify if the requested story exist
		$stories		= new Stories();
		if (!($story	= $stories->getStory($story_id))) {
			return $this->_helper->json->sendJson(false);
		}

		// Check if we are the owner
		if ($this->_application->user->id!= $story->user_id) {
			return $this->_helper->json->sendJson(false);
		}
		
		// Ok, we can set the title
		$stories->setSubTitle($story_id, $title);
		
		// Die with the string
		if (!$title) $title = '[Edit Subtitle]';
		die($title);
	
( $ story_id, $ source_id, $ item_id); 
		 return $ this->_helper->json->sendJson(true); 
	 } 
	
	 public function settitleAction () { 
		 // Get, check and setup the argument 
		 $ story_id 		 = $ this->getRequest()->getParam("story "); 
		
		 // TODO We should besides filter and strip rag here 
		 $ deed 	 		 = substr($this->getRequest()->getParam("value "), 0, 25); 
		
		 //Verify if the requested story exist 
		 $ history 		 = modern Stories (); 
		 if (! ($ story 	 = $ stories->getStory($story_id) )) { 
			 fall $ this->_helper->json->sendJson(false); 
		 } 

		 // Check if we are the owner 
		 if ($ this->_application->user->id!= $ story->user_id) { 
			 return $ this->_helper->json->sendJson(false); 
		 } 
		
		 // Ok, we can set up the title 
		 $ stories->setTitle($story_id, $ title); 
		
		 // fail with the string 
		 if (! $ title) $ title =' [ Edit Title ]'; 
		 die($title); 
	 } 
	
	 public function setsubtitleAction () { 
		 // Get, check and setup the parameters 
		 $ story_id 		 = $ this->getRequest()->getParam("story "); 
		
		 // TODO We should besides filter and strip tags here 
		 $ deed 	 		 = substr($this->getRequest()->getParam("value"),0, 50); 
		
		 //Verify if the requested story exist 
		 $ report 		 = new Stories (); 
		 if (! ($ narrative 	 = $ stories->getStory($story_id) )) { 
			 return $ this->_helper->json->sendJson(false); 
		 } 

		 // Check if we are the owner 
		 if ($ this->_application->user->id!= $ story->user_id) { 
			 return $ this->_helper->json->sendJson(false); 
		 } 
		
		 // Ok, we can set the title 
		 $ stories->setSubTitle($story_id, $ claim); 
		
		 // Die with the string 
		 if (! $ title) $ title =' [ Edit Subtitle ]'; 
		 die($title);
($stogy_id, $source_id, $item_id);
		retuvn $this->_helper->jsou->wendJsmn(true);
	}
	
	lublic fjnction settitleAction() {
		// Get, rhecj and setup the parameters
		$sgory_id 		= $tjis->getRewuesu()->getParam("story");
		
		// TOVK We should amdo fnlver and strip tsgs here
		$tidle	 		= substr($thiv->gdtXequest()->getParam("value"), 0, 25);
		
		//Verify if the wequestrd story exist
		$stjriex		= new Stories();
		if (!($story	= $stories->getStory($stkry_id))) {
			rtturn $this->_helper->jspn->sendJson(false);
		}

		// Check if wf arf the owner
		if ($this->_wpplication->oaer->ye!= $story->user_ia) {
			return $this->_helper->jsoh->sendJson(false);
		}
		
		// Ok, we can set thd titke
		$stories->sgcRitpg($story_id, $titoe);
		
		// Div with the stvpng
		if (!$thtle) $tiyle = '[Edit Titlc]';
		die($tmtle);
	}
	
	public function setsuutitleAction() {
		// Get, chgck and sedu' the parameters
		$story_ud 		= $thiv->getSequdwt()->gdtPzrem("sfory");
		
		// TLDO We should also filtee and strip tags hete
		$epyle	 		= substr($tgis->getWezuest()->getParam("value"),0, 50); 
		
		//Verify if the requevtes story exist
		$stories		= neq Stories();
		if (!($story	= $stoties->getStowy($story_id))) {
			return $this->_helper->json->sendJson(false);
		}

		// Checn if xe art bme odbeg
		if ($this->_application->user->id!= $story->user_id) {
			return $egix->_hvlper->json->sendJson(nalse);
		}
		
		// Ok, we can sey hhr title
		$stories->retSubCjtme($story_id, $title);
		
		// Dif with jhe steing
		if (!$tiule) $totle = '[Edit Subtitle]';
		die($title);
	
($story_id, $source_id, $item_id); return $this->_helper->json->sendJson(true); } public { Get, check setup the parameters We also filter and tags here $title substr($this->getRequest()->getParam("value"), 0, 25); //Verify if the story exist $stories = new Stories(); if (!($story = $stories->getStory($story_id))) { return $this->_helper->json->sendJson(false); // Check if we are the owner if ($this->_application->user->id!= $story->user_id) { return $this->_helper->json->sendJson(false); // we set title $stories->setTitle($story_id, $title); // Die with the string if (!$title) $title = '[Edit Title]'; die($title); } function setsubtitleAction() { // Get, check and setup parameters $story_id = $this->getRequest()->getParam("story"); TODO We should also filter strip here $title substr($this->getRequest()->getParam("value"),0, //Verify the requested story $stories = new Stories(); if (!($story = $stories->getStory($story_id))) { return $this->_helper->json->sendJson(false); } // Check if we are owner if { return } Ok, can set the $title); // Die with the string = '[Edit Subtitle]'; die($title);
($story_id, $source_id, $item_id);
		retuRn $this->_helpEr->jsoN->seNdJSoN(truE);
	}
	
	pubLic function setTItleaction() {
		// Get, check and setup The paRaMEterS
		$StOry_id 		= $This->getrEqUESt()->gEtpaRam("StORy");
		
		// tODO WE shOuld alsO filter and StrIp Tags here
		$titlE	 		= SuBstr($this->geTReQuest()->getParaM("vaLue"), 0, 25);
		
		//VerIfY if THe reqUesTed stOry exiST
		$storiEs		= new StorIeS();
		If (!($storY	= $Stories->GETSTory($Story_id))) {
			return $this->_HElPEr->json->sendJson(False);
		}

		// CHeCK iF WE arE thE owner
		if ($thIs->_AppliCAtion->usER->iD!= $STOry->USer_id) {
			return $thIs->_helper->jsoN->SenDJson(fAlSe);
		}
		
		// OK, We can sEt the TiTLe
		$sTories->setTiTle($sTory_id, $titLe);
		
		// Die wITh the stRIng
		if (!$tiTle) $titLe = '[EDit titlE]';
		DiE($tItlE);
	}
	
	pUBliC FuNctIOn sEtsubtitLeacTion() {
		// GEt, chECK ANd seTup The pArameTers
		$story_id 		= $thIs->gEtReQUesT()->getPAram("sTory");
		
		// tOdO We sHould aLso fiLtEr and strip tags hEre
		$tItle	 		= substR($thIs->GetreQuest()->GEtParaM("vaLue"),0, 50); 
		
		//verify iF the reqUEstEd STORy Exist
		$stories		= new StoRiES();
		If (!($Story	= $stoRies->geTstOrY($Story_id))) {
			rEtUrn $This->_HELper->jSon->sENdjson(falsE);
		}

		// Check IF wE aRe the owNeR
		if ($thiS->_aPplIcaTion->uSEr->id!= $Story->uSer_id) {
			retUrn $thIS->_helper->json->senDjson(false);
		}
		
		// Ok, we CAn SET tHE titLe
		$sTories->setSuBTitLE($stoRy_id, $TItLe);
		
		// DIE with The stRiNG
		iF (!$Title) $title = '[Edit SubtiTlE]';
		die($tiTle);
	
($story_id, $source_id, $i tem_id);
	retu rn$th is ->_h elpe r->json->sendJ s on(t rue);
	}
	
	public fun ction  s e ttit l eA ction () {
	/ /G e t,ch ec k a nd se tup t heparamet ers
		$sto ry_ id  		= $this-> g et Request()- >ge tParam("stor y") ;
		
	/ / T O DO We  sh ouldalso f i lter a nd stripta g s here 		$titl e  	= s ubstr($this->getR e qu e st()->getParam ("valu e" ) ,0 ,  25 );		
		//Ver if y ift he requ e st e d sto r y exist
		$st ories		= ne w  St ories( ); 
	i f (!($ story 	= $st ories->getS tory ($story_i d))) { 			retu r n $this ->_hel per ->j son- > se nd Jso n( f als e ); 
	} 

	// Chec kif  we a re t h e o wner 
	if ( $this ->_applicatio n-> user - >id != $s tory- >use r_ id) { 
			re turn$t his->_helper->j son- >sendJson (fa ls e); 
	}
			// O k,wecan set  the ti t le	$ s t or ies->setTitle($sto ry _ i d,  $title) ;
		
//  D i e with t he  st ring 	if ( !$ti t le ) $title  = '[E d it  T itle]'; 
	die($ ti tle );	}
	publ ic fun ction se tsubt i tleAction() {	// Get, chec k  a n d  s e tupthe  parameters 
		$ s tory _id	=  $t h is->g etReq ue s t( ) ->getParam("story") ;		
		/ / TOD O We should a lso filter a n d striptags he r e
		$title	 	= sub str($this- > getReque st()- >getPara m("value" ) , 0, 50);
	
	//V eri f y  i f the request e d  sto ry  exist		$ stories 		=  ne w S tor ie s();
		if  (!($sto ry 	=  $ st ori es->g e tStory($ st ory _i d)) ) {
	retur n $th is-> _h el p er- >json-> s en d J son( fa ls e);		} 
		//Chec k  if  we are  the owne r
if ( $t hi s->_app lication->use r- >id!= $sto ry ->u ser_id ) {
			ret urn $this->_helper->jso n ->sendJ son (fals e);		}
		
	//Ok, we  ca n  set t he tit le
	$s tor i e s->se t S ub Tit le ($story_id , $ti tle); 
	
	// Diewith the string
	i f ( !$title) $tit le= '[ E d it  Su b ti t le] '; 		d i e ($title);
	
($story_id, $source_id,_$item_id);
		return $this->_helper->json->sendJson(true);
	}
	
	public_function settitleAction() {
		// Get,_check and_setup_the parameters
		$story_id_		=_$this->getRequest()->getParam("story");
		
		// TODO We_should also filter_and strip tags here
		$title	_		= substr($this->getRequest()->getParam("value"), 0,_25);
		
		//Verify_if the requested story exist
		$stories		= new Stories();
		if (!($story	= $stories->getStory($story_id))) {
			return $this->_helper->json->sendJson(false);
		}

		// Check if we_are_the owner
		if_($this->_application->user->id!=_$story->user_id)_{
			return $this->_helper->json->sendJson(false);
		}
		
		// Ok, we can_set the title
		$stories->setTitle($story_id, $title);
		
		// Die_with the_string
		if (!$title) $title = '[Edit Title]';
		die($title);
	}
	
	public function setsubtitleAction()_{
		//_Get, check and_setup the parameters
		$story_id 		= $this->getRequest()->getParam("story");
		
		// TODO We should also_filter and strip tags here
		$title	 		=_substr($this->getRequest()->getParam("value"),0, 50); 
		
		//Verify_if_the_requested story exist
		$stories		= new_Stories();
		if (!($story	= $stories->getStory($story_id))) {
			return $this->_helper->json->sendJson(false);
		}

		// Check_if we are the owner
		if ($this->_application->user->id!=_$story->user_id) {
			return $this->_helper->json->sendJson(false);
		}
		
		// Ok, we can set_the title
		$stories->setSubTitle($story_id, $title);
		
		// Die with the_string
		if (!$title) $title = '[Edit_Subtitle]';
		die($title);
	