Beispiel #1
0
 public function action_index()
 {
     // Cookies to help determine the search options to display
     Cookie::set(Swiftriver::COOKIE_SEARCH_SCOPE, 'bucket');
     Cookie::set(Swiftriver::COOKIE_SEARCH_ITEM_ID, $this->bucket->id);
     $this->template->header->title = $this->page_title;
     $this->template->content = View::factory('pages/bucket/main')->bind('droplets_view', $droplets_view)->bind('settings_url', $settings_url)->bind('discussion_url', $discussion_url)->bind('owner', $this->owner);
     $this->template->content->collaborators = $this->bucket->get_collaborators(TRUE);
     $this->template->content->is_collaborator = $this->collaborator;
     $this->template->content->anonymous = $this->anonymous;
     $this->template->content->bucket = $this->bucket;
     $this->template->content->user = $this->user;
     // The maximum droplet id for pagination and polling
     $max_droplet_id = Model_Bucket::get_max_droplet_id($this->bucket->id);
     //Get Droplets
     $droplets_array = Model_Bucket::get_droplets($this->user->id, $this->bucket->id, 0, 1, $max_droplet_id, $this->photos);
     // Bootstrap the droplet list
     $this->template->header->js .= Html::script("themes/default/media/js/drops.js");
     $droplet_js = View::factory('pages/drop/js/drops');
     $droplet_js->fetch_base_url = $this->bucket_base_url;
     $droplet_js->default_view = $this->bucket->default_layout;
     $droplet_js->photos = $this->photos ? 1 : 0;
     $droplet_js->filters = NULL;
     $droplet_js->droplet_list = json_encode($droplets_array['droplets']);
     $droplet_js->max_droplet_id = $max_droplet_id;
     $droplet_js->channels = json_encode(array());
     // Generate the List HTML
     $droplets_view = View::factory('pages/drop/drops')->bind('droplet_js', $droplet_js)->bind('user', $this->user)->bind('owner', $this->owner)->bind('anonymous', $this->anonymous);
     // Suppress expiry notices
     $droplets_view->expiry_notice = "";
     if (!$this->owner) {
         $bucket_item = json_encode(array('id' => $this->bucket->id, 'type' => 'river', 'subscribed' => $this->bucket->is_subscriber($this->user->id)));
         // Action URL - To handle the follow/unfollow actions on the river
         $action_url = URL::site() . $this->visited_account->account_path . '/user/bucket/manage';
         $this->template->content->bucket_name = $this->page_title;
         $this->template->content->bucket_item = $bucket_item;
         $this->template->content->action_url = $action_url;
     }
     // Nothing to display message
     $droplets_view->nothing_to_display = View::factory('pages/bucket/nothing_to_display')->bind('message', $nothing_to_display_message);
     $nothing_to_display_message = __('There are no drops in this bucket yet.');
     if ($this->owner) {
         $nothing_to_display_message .= __(' Add some from your :rivers', array(':rivers' => HTML::anchor($this->dashboard_url . '/rivers', __('rivers'))));
     }
     // Links to bucket menu items
     $settings_url = $this->bucket_base_url . '/settings';
     $discussion_url = $this->bucket_base_url . '/discussion';
 }