コード例 #1
0
 public function reorder($album_id = NULL)
 {
     $album = new Album_Model($album_id);
     if (!$album->id) {
         Event::run('system.404');
     }
     javascript::add(array('jquery-ui', 'photo_admin_effects'));
     stylesheet::add(array('photo_gallery'));
     $this->template->title = $album->album_name;
     $this->template->heading = $album->album_name;
     $this->template->content = new View('admin/album/reorder');
     $this->template->content->photos = $album->find_related('photos', array(), array('photo_order' => 'ASC'));
     $this->template->content->album = $album;
 }
コード例 #2
0
 public function view($album_name = NULL)
 {
     javascript::add(array('jquery.colorbox', 'photo_effects'));
     stylesheet::add(array('colorbox', 'colorbox-custom', 'photo_gallery'));
     $page_num = $this->input->get('page', 1);
     $album = new Album_Model($album_name);
     if (!$album->id) {
         Event::run('system.404');
     }
     $this->template->title = $album->album_name;
     $this->template->heading = $album->album_name;
     $this->template->content = new View('album/view');
     $this->template->content->photos = $album->find_photos($page_num);
     $this->template->content->album = $album;
     $this->template->content->num_pages = ceil(count($album->find_related('photos')) / Kohana::config('photo_gallery.photos_per_page'));
 }