activity = $activity; $this->activity_activity_area = $activity_activity_area; $this->activity_area = $activity_area; $this->activity_college = $activity_college; $this->activity_community = $activity_community; $this->activity_manager = $activity_manager; $this->activity_metum = $activity_metum; $this->activity_programme = $activity_programme; $this->activity_project = $activity_project; $this->activity_school = $activity_school; $this->activity_social_partner = $activity_social_partner; $this->activity_log = $activity_log; } /** * Returns count of act. * * @param array $filter * * @return int */ public function count() { return 0; } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.activity.gadget', $count = 10) { if (User::hasRole('user')) { $this->activity->pushCriteria(new \Litepie\Annie\Repositories\Criteria\ActivityUserCriteria()); } $activity = $this->activity->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('act::' . $view, compact('activity'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.activity_activity_area.gadget', $count = 10) { if (User::hasRole('user')) { $this->activity_activity_area->pushCriteria(new \Litepie\Annie\Repositories\Criteria\ActivityActivityAreaUserCriteria()); } $activity_activity_area = $this->activity_activity_area->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('act::' . $view, compact('activity_activity_area'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.activity_area.gadget', $count = 10) { if (User::hasRole('user')) { $this->activity_area->pushCriteria(new \Litepie\Annie\Repositories\Criteria\ActivityAreaUserCriteria()); } $activity_area = $this->activity_area->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('act::' . $view, compact('activity_area'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.activity_college.gadget', $count = 10) { if (User::hasRole('user')) { $this->activity_college->pushCriteria(new \Litepie\Annie\Repositories\Criteria\ActivityCollegeUserCriteria()); } $activity_college = $this->activity_college->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('act::' . $view, compact('activity_college'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.activity_community.gadget', $count = 10) { if (User::hasRole('user')) { $this->activity_community->pushCriteria(new \Litepie\Annie\Repositories\Criteria\ActivityCommunityUserCriteria()); } $activity_community = $this->activity_community->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('act::' . $view, compact('activity_community'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.activity_manager.gadget', $count = 10) { if (User::hasRole('user')) { $this->activity_manager->pushCriteria(new \Litepie\Annie\Repositories\Criteria\ActivityManagerUserCriteria()); } $activity_manager = $this->activity_manager->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('act::' . $view, compact('activity_manager'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.activity_metum.gadget', $count = 10) { if (User::hasRole('user')) { $this->activity_metum->pushCriteria(new \Litepie\Annie\Repositories\Criteria\ActivityMetumUserCriteria()); } $activity_metum = $this->activity_metum->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('act::' . $view, compact('activity_metum'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.activity_programme.gadget', $count = 10) { if (User::hasRole('user')) { $this->activity_programme->pushCriteria(new \Litepie\Annie\Repositories\Criteria\ActivityProgrammeUserCriteria()); } $activity_programme = $this->activity_programme->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('act::' . $view, compact('activity_programme'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.activity_project.gadget', $count = 10) { if (User::hasRole('user')) { $this->activity_project->pushCriteria(new \Litepie\Annie\Repositories\Criteria\ActivityProjectUserCriteria()); } $activity_project = $this->activity_project->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('act::' . $view, compact('activity_project'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.activity_school.gadget', $count = 10) { if (User::hasRole('user')) { $this->activity_school->pushCriteria(new \Litepie\Annie\Repositories\Criteria\ActivitySchoolUserCriteria()); } $activity_school = $this->activity_school->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('act::' . $view, compact('activity_school'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.activity_social_partner.gadget', $count = 10) { if (User::hasRole('user')) { $this->activity_social_partner->pushCriteria(new \Litepie\Annie\Repositories\Criteria\ActivitySocialPartnerUserCriteria()); } $activity_social_partner = $this->activity_social_partner->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('act::' . $view, compact('activity_social_partner'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.activity_log.gadget', $count = 10) { if (User::hasRole('user')) { $this->activity_log->pushCriteria(new \Litepie\Annie\Repositories\Criteria\ActivityLogUserCriteria()); } $activity_log = $this->activity_log->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('act::' . $view, compact('activity_log'))->render(); } }