Пример #1
0
 public function actionOne($id, $album_id)
 {
     $album = $this->data->album = Album::findByColumn('__id', $album_id);
     if ($album->__prt) {
         $this->data->albumParent = Album::findByColumn('__id', $album->__prt);
     }
     $this->data->item = Photo::findByColumn('__id', $id);
 }
Пример #2
0
 public function actionSlaiderNews($title)
 {
     $title = urldecode($title);
     $this->data->items = Album::findBytitle($title)->photos;
 }
Пример #3
0
 public function actionAlbumMoveAfter($id, $to)
 {
     try {
         $item = Album::findByPK($id);
         if (empty($item)) {
             throw new Exception('Source element does not exist');
         }
         $destination = Album::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();
     }
 }