示例#1
0
 public function actionPageForTopic($title, $shablon)
 {
     $title = urldecode($title);
     if (Topic::findByTitle($title)) {
         $this->data->items = Topic::findByTitle($title)->stories;
         //  $this->data->shablon=$shablon.'.html';
     }
     $this->data->shablon = $shablon . '.html';
 }
示例#2
0
 public function actionTopicMoveAfter($id, $to)
 {
     try {
         $item = Topic::findByPK($id);
         if (empty($item)) {
             throw new Exception('Source element does not exist');
         }
         $destination = Topic::findByPK($to);
         if (empty($destination)) {
             throw new Exception('Destination element does not exist');
         }
         $item->insertAfter($destination);
         $this->data->result = true;
     } catch (Exception $e) {
         $this->data->result = false;
         $this->data->error = $e->getMessage();
     }
 }
示例#3
0
 public function actionNewsForTopic($title)
 {
     $this->data->items = Topic::findByTitle($title)->stories;
     if (empty($this->data->items)) {
         throw new E404Exception('Рубрика не найдена');
     }
 }