Ejemplo n.º 1
0
 public static function poll($polls)
 {
     $polls = json_decode($polls);
     $_results = array();
     if (is_array($polls) && count($polls) > 0) {
         foreach ($polls as $i => $_poll) {
             switch ($_poll->type) {
                 case "template":
                     $_results[$_poll->id] = array('type' => 'html', 'args' => Theme::make($_poll->func, array('value' => $_poll->value))->render());
                     break;
                 case "plugin":
                     if ($_poll->func) {
                         $_results[$_poll->id] = call_user_func($_poll->func, $_poll->value);
                     }
                     break;
                 case "check_logs":
                     $list = Dashboard::activity();
                     Session::put('usersonline_lastcheck', time());
                     $_results[$_poll->id] = array('type' => 'function', 'func' => 'fnUpdateGrowler', 'args' => $list);
                     break;
             }
         }
     }
     return $_results;
 }
 public function postPolling()
 {
     $polls = json_decode(Input::get('polls'));
     $_results = array();
     if (is_array($polls) && count($polls) > 0) {
         foreach ($polls as $i => $_poll) {
             switch ($_poll->type) {
                 case "plugin":
                     if ($_poll->func) {
                         $_results[$_poll->id] = call_user_func($_poll->func, $_poll->value);
                     }
                     break;
                 case "check_logs":
                     $list = Activity::whereRaw('UNIX_TIMESTAMP(`activity_log`.`created_at`) > ? AND (activity_log.content_type="notification" OR activity_log.content_type="login")', array(Session::get('usersonline_lastcheck', time())))->select(array('description', 'details', 'users.displayname', 'content_type'))->groupBy(DB::raw('description, details, users.displayname, content_type'))->orderBy('activity_log.id', 'DESC')->leftJoin('users', 'users.id', '=', 'activity_log.user_id')->get()->toArray();
                     Session::put('usersonline_lastcheck', time());
                     $_results[$_poll->id] = array('type' => 'function', 'func' => 'fnUpdateGrowler', 'args' => $list);
                     break;
                 case "users_online":
                     $_results[$_poll->id] = array('type' => 'html', 'args' => Theme::make('admin/helpers/users-online')->render());
                     break;
             }
         }
     }
     return Response::json($_results);
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param $post
  * @return Response
  */
 public function getEdit($autoreply)
 {
     $roles = Support::getRoles();
     $deps = Support::getDeps();
     $actions = Support::getActions();
     $title = Lang::get('l4cp-support::core.autoreply_update');
     return Theme::make('l4cp-support::autoreplys/create_edit', compact('autoreply', 'title', 'deps', 'actions', 'roles'));
 }
Ejemplo n.º 4
0
 public function getEdit($role)
 {
     if (!empty($role)) {
         $permissions = $this->permission->preparePermissionsForDisplay($role->perms()->get());
     } else {
         return Api::to(array('error', Lang::get('admin/roles/messages.does_not_exist'))) ?: Redirect::to('admin/roles')->with('error', Lang::get('admin/roles/messages.does_not_exist'));
     }
     return Theme::make('admin/roles/create_edit', compact('role', 'permissions'));
 }
Ejemplo n.º 5
0
 public function index()
 {
     list($user, $redirect) = $this->user->checkAuthAndRedirect('user');
     if ($redirect) {
         return $redirect;
     }
     $profiles = $user->profiles;
     return Theme::make('site/user/index', compact('user', 'profiles'));
 }
Ejemplo n.º 6
0
 public function index()
 {
     $minigraph_data = array();
     $minigraph_data['account_created'] = Dashboard::graph('account_created');
     $minigraph_data['login'] = Dashboard::graph('login');
     $minigraph_data['activity'] = Dashboard::graph('activity');
     $minigraph_data['activity_unique'] = Dashboard::graph('activity', '5', true);
     View::share('minigraph_data', $minigraph_data);
     View::share('minigraph_json', json_encode($minigraph_data));
     $widgets = Dashboard::widgets();
     View::share('widgets', $widgets);
     $results = Dashboard::online();
     View::share('whosonline', $results);
     Dashboard::googleGraph($minigraph_data);
     return Theme::make('admin/dashboard/index');
 }
Ejemplo n.º 7
0
 public function emailmass()
 {
     $ids = explode(',', rtrim(Input::get('ids'), ','));
     $multi = array();
     $selected = array();
     if (is_array($ids) && count($ids) > 0) {
         foreach ($ids as $id) {
             $user = $this->user->find($id);
             if (!empty($user)) {
                 $multi[$id] = $user->email;
                 $selected = $id;
             }
         }
     }
     $title = Lang::get('core.email');
     $mode = 'edit';
     $templates = LCP::emailTemplates();
     return Theme::make('admin/users/send_email', compact('title', 'mode', 'multi', 'selected', 'templates'));
 }
Ejemplo n.º 8
0
 public function get()
 {
     $ids = explode(',', rtrim(Input::get('ids'), ','));
     $mergefrom = '';
     $mergelist = array();
     if (is_array($ids) && count($ids) > 0) {
         foreach ($ids as $id) {
             $user = $this->user->find($id);
             if (!empty($user)) {
                 if ($mergefrom) {
                     $mergelist[$id] = $user->email;
                 } else {
                     $mergefrom = $user->email;
                 }
             }
         }
     }
     return Theme::make('admin/users/confirm_merge', compact('mergelist', 'mergefrom'));
 }
Ejemplo n.º 9
0
 public function getEdit($post)
 {
     $templates = $this->post->templates();
     $parents = $this->post->parents();
     return Theme::make('admin/blogs/create_edit', compact('post', 'templates', 'parents'));
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param $post
  * @return Response
  */
 public function getEdit($department)
 {
     $admins = Support::getAdmins();
     $title = Lang::get('l4cp-support::core.department_update');
     return Theme::make('l4cp-support::departments/create_edit', compact('department', 'title', 'admins'));
 }
Ejemplo n.º 11
0
 /**
  * Setup the layout used by the controller.
  *
  * @return void
  */
 protected function setupLayout()
 {
     if (!is_null($this->layout)) {
         $this->layout = Theme::make($this->layout);
     }
 }
 public function getIndex($search)
 {
     $results = Search::Query($search);
     return Theme::make('admin/search', compact('results'));
 }
Ejemplo n.º 13
0
 public function getEdit($comment)
 {
     return Theme::make('admin/comments/edit', compact('comment'));
 }
Ejemplo n.º 14
0
 public function getContactUs()
 {
     return Theme::make('site/contact-us');
 }
Ejemplo n.º 15
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param $map
  * @return Response
  */
 public function getEdit($map)
 {
     if (!empty($map)) {
         $permissions = $this->permission->preparePermissionsForDisplay($map->perms()->get());
     } else {
         return Api::to(array('error', Lang::get('admin/maps/messages.does_not_exist'))) ?: Redirect::to('admin/maps')->with('error', Lang::get('admin/maps/messages.does_not_exist'));
     }
     $title = Lang::get('admin/maps/title.role_update');
     return Theme::make('admin/maps/edit', compact('map', 'permissions', 'title'));
 }
Ejemplo n.º 16
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param $post
  * @return Response
  */
 public function getEdit($tickets)
 {
     $title = Lang::get('l4cp-support::core.tickets_update');
     return Theme::make('l4cp-support::tickets/create_edit', compact('tickets', 'title'));
 }
Ejemplo n.º 17
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param $post
  * @return Response
  */
 public function getEdit($post)
 {
     $title = Lang::get('admin/blogs/title.blog_update');
     $templates = $this->getPostTemplates();
     $parents = $this->getPostParents();
     return Theme::make('admin/blogs/create_edit', compact('post', 'title', 'templates', 'parents'));
 }
Ejemplo n.º 18
0
 public function index()
 {
     $settings = Setting::all();
     return Theme::make('admin/settings/index', compact('comments', 'settings'));
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param $post
  * @return Response
  */
 public function getEdit($statuses)
 {
     $title = Lang::get('l4cp-support::core.statuses_update');
     return Theme::make('l4cp-support::statuses/create_edit', compact('statuses', 'title'));
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param $post
  * @return Response
  */
 public function getEdit($escalations)
 {
     $title = Lang::get('l4cp-support::core.escalations_update');
     return Theme::make('l4cp-support::escalations/create_edit', compact('escalations', 'title'));
 }
Ejemplo n.º 21
0
 public function getSettings()
 {
     list($user, $redirect) = User::checkAuthAndRedirect('user/settings');
     if ($redirect) {
         return $redirect;
     }
     return Theme::make('site/user/profile', compact('user'));
 }
Ejemplo n.º 22
0
 /**
  * get edit
  *
  * @return Response
  */
 public function getEdit($todo)
 {
     $title = Lang::get('admin/todos/title.update');
     return Theme::make('admin/todos/create_edit', compact('todo', 'title'));
 }
Ejemplo n.º 23
0
 /**
  * Display the specified resource.
  * GET /map/{name}
  *
  * @param  varchar  $name
  * @return Response
  */
 public function show($name)
 {
     $m = new Map();
     $map = $m->getKmlByName($name);
     return Theme::make('site/map/index', compact('map'));
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param $comment
  * @return Response
  */
 public function getEdit($comment)
 {
     $title = Lang::get('admin/comments/title.comment_update');
     return Theme::make('admin/comments/edit', compact('comment', 'title'));
 }
Ejemplo n.º 25
0
 public function getEdit($todo)
 {
     $due = preg_replace('/0000-00-00 00:00:00/i', '', Input::old('due_at', isset($todo) ? $todo->due_at : null));
     return Theme::make('admin/todos/create_edit', compact('due', 'todo'));
 }
 /**
  * Show a list of all the comment posts.
  *
  * @return View
  */
 public function getIndex()
 {
     $settings = Setting::all();
     $title = Lang::get('admin/settings/title.title');
     return Theme::make('admin/settings/index', compact('comments', 'title', 'settings'));
 }
Ejemplo n.º 27
0
 /**
  * get mass mail
  *
  * @return Response
  */
 public function getEmailMass($a = false)
 {
     $ids = explode(',', rtrim(Input::get('ids'), ','));
     $multi = array();
     if (is_array($ids) && count($ids) > 0) {
         foreach ($ids as $id) {
             $user = User::find($id);
             if (!empty($user)) {
                 $multi[$id] = $user->email;
             }
         }
     }
     $title = Lang::get('core.mass_email');
     $mode = 'edit';
     $templates = $this->emailTemplates();
     return Theme::make('admin/users/send_email', compact('title', 'mode', 'multi', 'templates'));
 }
Ejemplo n.º 28
0
 public function getEdit($user)
 {
     if ($user->id) {
         $roles = $this->role->lists('name', 'id');
         $profiles = $user->profiles;
         $last_login = $user->lastlogin();
         $permissions = $this->permission->all();
         $mode = 'edit';
         return Theme::make('admin/users/create_edit', compact('user', 'roles', 'permissions', 'mode', 'profiles', 'last_login'));
     } else {
         return Api::to(array('error', Lang::get('admin/users/messages.does_not_exist'))) ?: Redirect::to('admin/users')->with('error', Lang::get('admin/users/messages.does_not_exist'));
     }
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param $post
  * @return Response
  */
 public function getEdit($spam)
 {
     $title = Lang::get('l4cp-support::core.spam_update');
     return Theme::make('l4cp-support::spam/create_edit', compact('spam', 'title'));
 }