public function action_index() { if ($this->owner) { $this->template->header->title = __('Dashboard'); $this->template->header->js = View::factory('pages/user/js/main'); $this->active = 'dashboard-navigation-link'; $this->sub_content = View::factory('pages/user/main')->bind('owner', $this->owner)->bind('account', $this->visited_account); $gravatar_view = TRUE; } else { $this->template->header->title = __(':name\'s Profile', array(':name' => Text::limit_chars($this->visited_account->user->name))); $this->template->header->js = View::factory('pages/user/js/profile'); $this->template->header->js->visited_account = $this->visited_account; $this->template->header->js->bucket_list = json_encode($this->visited_account->user->get_buckets_array($this->user)); $this->template->header->js->river_list = json_encode($this->visited_account->user->get_rivers_array($this->user)); $this->sub_content = View::factory('pages/user/profile'); $this->sub_content->account = $this->visited_account; $this->sub_content->anonymous = $this->anonymous; $gravatar_view = FALSE; $this->template->content->view_type = "user"; } // Activity stream $this->sub_content->activity_stream = View::factory('template/activities')->bind('activities', $activities)->bind('fetch_url', $fetch_url)->bind('owner', $this->owner)->bind('gravatar_view', $gravatar_view); $fetch_url = URL::site() . $this->visited_account->account_path . '/user/action/actions'; $activity_list = Model_User_Action::get_activity_stream($this->visited_account->user->id, $this->user->id, !$this->owner); $this->sub_content->has_activity = count($activity_list) > 0; $activities = json_encode($activity_list); }