Exemplo n.º 1
0
 public function actionPageForRubric($title, $shablon)
 {
     $title = urldecode($title);
     if (Rubric::findByTitle($title)) {
         $this->data->items = Rubric::findByTitle($title)->page;
         //  $this->data->shablon=$shablon.'.html';
     }
     $this->data->shablon = $shablon . '.html';
 }
Exemplo n.º 2
0
 public function actionRubricMoveAfter($id, $to)
 {
     try {
         $item = Rubric::findByPK($id);
         if (empty($item)) {
             throw new Exception('Source element does not exist');
         }
         $destination = Rubric::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();
     }
 }