Example #1
0
 public function get_index()
 {
     $manager = new StoryManager();
     $resData['SideStory'] = $manager->get_side_list();
     $resData['Highlight'] = $manager->get_highlight_list();
     $resData['Slider'] = $manager->get_slider_list();
     $resData['Events'] = array();
     $resData['LecturerNews'] = array();
     $resData['ListStory'] = $manager->get_list(0);
     $this->template->__yield__ = View::forge('home', $this->formatData($resData));
 }
Example #2
0
 public function get_index()
 {
     $reqObj = Input::get();
     $id = $reqObj['id'];
     $managerObj = new StoryManager();
     $storyObj = $managerObj->getStoryBaseID($id);
     $a = $managerObj->getSectionInfoBaseID($storyObj->Type);
     $storyObj->updateView();
     //		$retData['Data']['MainSection'] = 'Thông báo';
     //		$retData['Data']['SubSection'][0] = 'Thông Báo & Sự Kiện';
     //		$retData['Data']['SubSection'][1] = 'Thông Báo';
     $retData['Data'] = $a;
     $retData['Data']['Next'] = array();
     $retData['Data']['Popular'] = array();
     $retData['Data']['Event'] = array();
     $retData['Data']['Post'] = $storyObj->getFull();
     $this->template->__yield__ = View::forge('section/details', $retData);
 }
Example #3
0
 public function get_index()
 {
     $reqObj = Input::get();
     $val = Validation::forge();
     $val->add('id', 'section code')->add_rule('valid_string', array('numeric'))->add_rule('required');
     if (!$val->run(Input::get())) {
         // Forge 404 with query error
     }
     $name = $reqObj['id'];
     $sectionID = $val->validated('id');
     $manageObj = new StoryManager();
     $listStory = $manageObj->buildSectionPageData($sectionID, 1);
     $randomStory = array_rand($listStory, 1);
     if ($randomStory !== null) {
         $retData['Data']['Highlight'] = $listStory[$randomStory];
     }
     $sectionInfo = $manageObj->getSectionInfoBaseID($this->section_code);
     $this->side_data['Data'] = array();
     $retData['Data']['MainSection'] = $sectionInfo['MainSection'];
     $retData['Data']['SubSection'][0] = $sectionInfo['MainSection'];
     $retData['Data']['SubSection'][1] = $sectionInfo['SubSection'];
     $retData['Data']['News'] = $listStory;
     $this->template->__yield__ = View::forge('section/overview', $retData);
 }