Example #1
0
 public function _initialize()
 {
     parent::_initialize();
     if (strcmp($this->action, "index")) {
         $this->ZaddChapters();
         $this->buildSearch();
     }
 }
 public function _initialize()
 {
     parent::_initialize();
     if (isset($_GET['eid']) && isset($_GET['type'])) {
         $this->eid = I('get.eid', 0, 'intval');
         $problemType = I('get.type', 0, 'intval');
         $widgets = array('eid' => $this->eid, 'type' => $problemType);
         if (!$this->isOwner4ExamByExamId($this->eid)) {
             $this->echoError('You have no privilege of this exam~');
         } else {
             $this->ZaddWidgets($widgets);
         }
         if (!strcmp($this->action, 'add')) {
             $this->buildSearch();
             $this->ZaddChapters();
         }
     } else {
         if (isset($_POST['eid'])) {
             $this->eid = I('post.eid', 0, 'intval');
         } else {
             $this->echoError('No Such Exam!');
         }
     }
 }