update(get_class($this), 'allowed_actions', array( 'SetCaseStudy', 'SurveyDetails', )); Config::inst()->update(get_class($this->owner), 'allowed_actions', array( 'SetCaseStudy', 'SurveyDetails', )); } function SetCaseStudy() { if(isset($_GET['ID']) && is_numeric($_GET['ID'])) { $UserStory = $_GET['ID']; }else{ die(); } $setCaseStudy = ($_GET['Set'] == 1)? 1 : 0; $story = SiteTree::get_by_id("UserStory",$UserStory); $story->ShowCaseStudy = $setCaseStudy; $story->write(); $story->publish("Live","Stage"); $this->owner->setMessage('Success', 'Case Study updated for ' . $story->Title . ''); Controller::curr()->redirectBack(); } function SurveyDetails(){ $params = $this->owner->request->allParams(); $survey_id = intval(Convert::raw2sql($params["ID"]));; $survey = DeploymentSurvey::get()->byID($survey_id); if($survey) return $this->owner->Customise($survey)->renderWith(array('SangriaPage_SurveyDetails','SangriaPage','SangriaPage')); return $this->owner->httpError(404, 'Sorry that Deployment Survey could not be found!.'); } }