public function get() { if (Api::Enabled()) { return Api::make($this->comment->all()->get()->toArray()); } else { return Datatables::of($this->comment->all())->edit_column('content', '<a href="{{{ URL::to(\'admin/comments/\'. $id .\'/edit\') }}}" class="modalfy cboxElement">{{{ Str::limit($content, 40, \'...\') }}}</a>')->edit_column('post_name', '<a href="{{{ URL::to(\'admin/slugs/\'. $postid .\'/edit\') }}}" class="modalfy cboxElement">{{{ Str::limit($post_name, 40, \'...\') }}}</a>')->edit_column('poster_name', '<a href="{{{ URL::to(\'admin/users/\'. $userid .\'/edit\') }}}" class="modalfy cboxElement">{{{ $poster_name }}}</a>')->add_column('actions', '<div class="btn-group"><a href="{{{ URL::to(\'admin/comments/\' . $id . \'/edit\' ) }}}" class="modalfy btn btn-primary btn-sm"><span class="glyphicon glyphicon-pencil"></span></a> <a data-row="{{{ $id }}}" data-method="delete" data-table="comments" href="{{{ URL::to(\'admin/comments/\' . $id . \'\' ) }}}" class="confirm-ajax-update btn btn-sm btn-danger"><span class="glyphicon glyphicon-remove"></span></a></div>')->remove_column('postid')->remove_column('userid')->make(); } }
public function get() { if (Api::Enabled()) { return Api::make($this->role->all()->get()->toArray()); } else { return Datatables::of($this->role->all())->edit_column('users', '{{{ DB::table(\'assigned_roles\')->where(\'role_id\', \'=\', $id)->count() }}}')->add_column('actions', '<div class="btn-group"><a href="{{{ URL::to(\'admin/roles/\' . $id . \'/edit\' ) }}}" class="modalfy btn btn-sm btn-primary"><span class="glyphicon glyphicon-pencil"></span></a> <a data-row="{{{ $id }}}" data-method="delete" data-table="roles" href="{{{ URL::to(\'admin/roles/\' . $id . \'\' ) }}}" class="confirm-ajax-update btn btn-sm btn-danger" @if($name == "admin" || $name == "users")disabled@endif><span class="glyphicon glyphicon-remove"></span></a></div> ')->make(); } }
public function get() { if (Api::Enabled()) { return Api::make($this->post->all()->get()->toArray()); } else { return Datatables::of($this->post->all())->edit_column('comments', '{{ DB::table(\'comments\')->where(\'post_id\', \'=\', $id)->count() }}')->add_column('actions', '<div class="btn-group"><a href="{{{ URL::to(\'admin/slugs/\' . $id . \'/edit\' ) }}}" class="btn btn-primary btn-sm modalfy" ><span class="glyphicon glyphicon-pencil"></span></a> <a data-method="delete" data-row="{{{ $id }}}" data-table="blogs" href="{{{ URL::to(\'admin/slugs/\' . $id . \'\' ) }}}" class="confirm-ajax-update btn btn-sm btn-danger"><span class="glyphicon glyphicon-remove"></span></a></div> ')->make(); } }
/** * Show a list of all the comments formatted for Datatables. * * @return Datatables JSON */ public function getData() { $comments = Comment::leftjoin('posts', 'posts.id', '=', 'comments.post_id')->leftjoin('users', 'users.id', '=', 'comments.user_id')->select(array('comments.id as id', 'posts.id as postid', 'users.id as userid', 'comments.content', 'posts.title as post_name', 'users.displayname as poster_name', 'comments.created_at')); if (Api::Enabled()) { $u = $comments->get(); return Api::make($u->toArray()); } else { return Datatables::of($comments)->edit_column('content', '<a href="{{{ URL::to(\'admin/comments/\'. $id .\'/edit\') }}}" class="modalfy cboxElement">{{{ Str::limit($content, 40, \'...\') }}}</a>')->edit_column('post_name', '<a href="{{{ URL::to(\'admin/slugs/\'. $postid .\'/edit\') }}}" class="modalfy cboxElement">{{{ Str::limit($post_name, 40, \'...\') }}}</a>')->edit_column('poster_name', '<a href="{{{ URL::to(\'admin/users/\'. $userid .\'/edit\') }}}" class="modalfy cboxElement">{{{ $poster_name }}}</a>')->add_column('actions', '<div class="btn-group"><a href="{{{ URL::to(\'admin/comments/\' . $id . \'/edit\' ) }}}" class="modalfy btn btn-primary btn-sm">{{{ Lang::get(\'button.edit\') }}}</a> <a data-row="{{{ $id }}}" data-method="delete" data-table="comments" href="{{{ URL::to(\'admin/comments/\' . $id . \'\' ) }}}" class="ajax-alert-confirm btn btn-sm btn-danger">{{{ Lang::get(\'button.delete\') }}}</a></div> ')->remove_column('postid')->remove_column('userid')->make(); } }
public function emails($user) { if ($user->id) { $list = $user->emails(); if (Api::Enabled()) { $u = $list->get(); return Api::make($u->toArray()); } else { return Datatables::of($list)->edit_column('updated_at', '{{{ Carbon::parse($updated_at)->diffForHumans() }}}')->edit_column('details', '{{{ strip_tags(substr($details,0,100))}}}')->make(); } } }
public function get() { if (Api::Enabled()) { return Api::make($this->todo->all()->get()->toArray()); } else { return Datatables::of($this->todo->all())->edit_column('status', '{{{ Lang::get(\'admin/todos/todos.status_\'.$status) }}}')->edit_column('due_at', '{{{ Carbon::parse($due_at)->diffForHumans() }}}')->edit_column('created_at', '{{{ Carbon::parse($created_at)->diffForHumans() }}}')->edit_column('displayname', '{{{ $displayname ? : "Nobody" }}}')->add_column('actions', '<div class="btn-group" style="width: 200px"> <a href="{{{ URL::to(\'admin/todos/\' . $id . \'/edit\' ) }}}" class="modalfy btn btn-sm btn-primary"><span class="glyphicon glyphicon-pencil"></span></a> <a href="{{{ URL::to(\'admin/todos/\' . $id . \'/assign\' ) }}}" data-row="{{{ $id }}}" data-table="todos" class="confirm-ajax-update btn btn-sm btn-default">{{{ Lang::get(\'button.assign_to_me\') }}}</a> <a data-row="{{{ $id }}}" data-table="todos" data-method="delete" href="{{{ URL::to(\'admin/todos/\' . $id . \'\' ) }}}" class="confirm-ajax-update btn btn-sm btn-danger"><span class="glyphicon glyphicon-remove"></span></a> </div> ')->make(); } }
public function get() { if (Api::Enabled()) { return Api::make($this->comment->all()->get()->toArray()); } else { return Datatables::of($this->comment->all())->edit_column('content', '<a href="{{{ URL::to(\'admin/comments/\'. $id .\'/edit\') }}}" class="modalfy cboxElement">{{{ Str::limit($content, 40, \'...\') }}}</a>')->edit_column('post_name', '<a href="{{{ URL::to(\'admin/slugs/\'. $postid .\'/edit\') }}}" class="modalfy cboxElement">{{{ Str::limit($post_name, 40, \'...\') }}}</a>')->edit_column('poster_name', '<a href="{{{ URL::to(\'admin/users/\'. $userid .\'/edit\') }}}" class="modalfy cboxElement">{{{ $poster_name }}}</a>')->add_column('actions', ' <div class="btn-group btn-hover"> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> <span class="fa fa-lg fa-cog fa-fw"></span> <span class="caret"></span> </button> <ul class="dropdown-menu pull-right" role="menu"> <li><a href="{{{ URL::to(\'admin/comments/\' . $id . \'/edit\' ) }}}" class="modalfy ">{{{ Lang::get(\'button.edit\') }}}</a></li> <li class="divider"></li> <li><a data-row="{{{ $id }}}" data-method="delete" data-table="comments" href="{{{ URL::to(\'admin/comments/\' . $id . \'\' ) }}}" class="confirm-ajax-update ">{{{ Lang::get(\'button.delete\') }}}</a></li> </ul> </div> ')->remove_column('postid')->remove_column('userid')->make(); } }
public function get() { if (Api::Enabled()) { return Api::make($this->post->all()->get()->toArray()); } else { return Datatables::of($this->post->all())->edit_column('title', '<a href="{{{ URL::to(\'admin/slugs/\' . $id . \'/edit\' ) }}}" class="modalfy">{{{$title}}}</a>')->edit_column('comments', '{{ DB::table(\'comments\')->where(\'post_id\', \'=\', $id)->count() }}')->add_column('actions', ' <div class="btn-group btn-hover"> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> <span class="fa fa-lg fa-cog fa-fw"></span> <span class="caret"></span> </button> <ul class="dropdown-menu pull-right" role="menu"> <li><a href="{{{ URL::to(\'admin/slugs/\' . $id . \'/edit\' ) }}}" class="modalfy" >{{{ Lang::get(\'button.edit\') }}}</a></li> <li class="divider"></li> <li><a data-method="delete" data-row="{{{ $id }}}" data-table="blogs" href="{{{ URL::to(\'admin/slugs/\' . $id . \'\' ) }}}" class="confirm-ajax-update ">{{{ Lang::get(\'button.delete\') }}}</a></li> </ul> </div> ')->make(); } }
public function get() { if (Api::Enabled()) { return Api::make($this->todo->all()->get()->toArray()); } else { return Datatables::of($this->todo->all())->edit_column('title', '<a href="{{{ URL::to(\'admin/todos/\' . $id . \'/edit\' ) }}}" class="modalfy">{{{ Str::limit($title, 40, \'...\') }}}</a>')->edit_column('description', '<a href="{{{ URL::to(\'admin/todos/\' . $id . \'/edit\' ) }}}" class="modalfy">{{{ Str::limit($description, 40, \'...\') }}}</a>')->edit_column('status', '<a href="{{{ URL::to(\'admin/todos/\' . $id . \'/edit\' ) }}}" class="modalfy">{{{ Lang::get(\'admin/todos/todos.status_\'.$status) }}}</a>')->edit_column('due_at', '{{{ Carbon::parse($due_at)->diffForHumans() }}}')->edit_column('created_at', '{{{ Carbon::parse($created_at)->diffForHumans() }}}')->edit_column('displayname', '{{{ $displayname ? : "Nobody" }}}')->add_column('actions', ' <div class="btn-group btn-hover"> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> <span class="fa fa-lg fa-cog fa-fw"></span> <span class="caret"></span> </button> <ul class="dropdown-menu pull-right" role="menu"> <li><a href="{{{ URL::to(\'admin/todos/\' . $id . \'/edit\' ) }}}" class="modalfy ">{{{ Lang::get(\'button.edit\') }}}</a></li> <li class="divider"></li> <li><a href="{{{ URL::to(\'admin/todos/\' . $id . \'/assign\' ) }}}" data-row="{{{ $id }}}" data-table="todos" class="confirm-ajax-update ">{{{ Lang::get(\'button.assign_to_me\') }}}</a></li> <li class="divider"></li> <li><a data-row="{{{ $id }}}" data-table="todos" data-method="delete" href="{{{ URL::to(\'admin/todos/\' . $id . \'\' ) }}}" class="confirm-ajax-update">{{{ Lang::get(\'button.delete\') }}}</a></li> </ul> </div> ')->make(); } }
public function get() { if (Api::Enabled()) { return Api::make($this->role->all()->get()->toArray()); } else { return Datatables::of($this->role->all())->edit_column('name', '<a href="{{{ URL::to(\'admin/roles/\' . $id . \'/edit\' ) }}}" class="modalfy">{{{$name}}}</a>')->edit_column('users', '{{{ DB::table(\'assigned_roles\')->where(\'role_id\', \'=\', $id)->count() }}}')->add_column('actions', ' <div class="btn-group btn-hover"> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> <span class="fa fa-lg fa-cog fa-fw"></span> <span class="caret"></span> </button> <ul class="dropdown-menu pull-right" role="menu"> <li><a href="{{{ URL::to(\'admin/roles/\' . $id . \'/edit\' ) }}}" class="modalfy">{{{ Lang::get(\'button.edit\') }}}</a></li> <li class="divider"></li> @if(in_array($name, Role::$protected) || $id == Setting::get("users.default_role_id")) <li><a href="#disabled" class="disabled">{{{ Lang::get(\'button.delete\') }}}</a></li> @else <li><a data-row="{{{ $id }}}" data-method="delete" data-table="roles" href="{{{ URL::to(\'admin/roles/\' . $id . \'\' ) }}}" class="confirm-ajax-update">{{{ Lang::get(\'button.delete\') }}}</a></li> @endif </ul> </div> ')->make(); } }
/** * Show a list of all the blog posts formatted for Datatables. * * @return Datatables JSON */ public function getData() { $list = TicketStatuses::select(array('id', 'title', 'auto_close', 'color'))->orderBy('sort'); if (Api::Enabled()) { $u = $list->get(); return Api::make($u->toArray()); } else { return Datatables::of($list)->edit_column('auto_close', '{{{ $auto_close ? "Yes" : "No" }}} ')->edit_column('title', '@if($color)<span style="color: {{{ $color }}}">{{{ $title }}}</span>@else{{{ $title }}}@endif')->add_column('actions', '<div class="btn-group"><a href="{{{ URL::to(\'admin/support/statuses/\' . $id . \'/edit\' ) }}}" class="btn btn-primary btn-sm modalfy" >{{{ Lang::get(\'button.edit\') }}}</a> <a data-method="delete" data-row="{{{ $id }}}" data-table="statuses" href="{{{ URL::to(\'admin/support/statuses/\' . $id . \'\' ) }}}" class="confirm-ajax-update btn btn-sm btn-danger">{{{ Lang::get(\'button.delete\') }}}</a></div> ')->remove_column('color')->make(); } }
/** * Show a list of all the blog posts formatted for Datatables. * * @return Datatables JSON */ public function getData() { $list = TicketDeps::select(array('id', 'name', 'description'))->orderBy('sort'); if (Api::Enabled()) { $u = $list->get(); return Api::make($u->toArray()); } else { return Datatables::of($list)->edit_column('description', '{{{ Filter::filter(Str::limit(strip_tags($description), 100, "..."), "*") }}} ')->add_column('actions', '<div class="btn-group"><a href="{{{ URL::to(\'admin/support/departments/\' . $id . \'/edit\' ) }}}" class="btn btn-primary btn-sm modalfy" >{{{ Lang::get(\'button.edit\') }}}</a> <a data-method="delete" data-row="{{{ $id }}}" data-table="departments" href="{{{ URL::to(\'admin/support/departments/\' . $id . \'\' ) }}}" class="confirm-ajax-update btn btn-sm btn-danger">{{{ Lang::get(\'button.delete\') }}}</a></div> ')->make(); } }
/** * Show a list of all the users formatted for Datatables. * * @return Datatables JSON */ public function getData() { $users = User::leftjoin('assigned_roles', 'assigned_roles.user_id', '=', 'users.id')->leftjoin('roles', 'roles.id', '=', 'assigned_roles.role_id')->select(DB::raw('users.id, users.displayname,users.email, group_concat(roles.name SEPARATOR \', \') as rolename'))->groupBy(DB::raw('users.id , users.displayname , users.email')); if (Api::Enabled()) { $u = $users->get(); return Api::make($u->toArray()); } else { return Datatables::of($users)->add_column('actions', '<div class="btn-group"> <a href="{{{ URL::to(\'admin/users/\' . $id . \'/edit\' ) }}}" class="modalfy btn btn-sm btn-primary">{{{ Lang::get(\'button.edit\') }}}</a> <a href="{{{ URL::to(\'admin/users/\' . $id . \'/email\' ) }}}" class="modalfy btn btn-sm btn-default">{{{ Lang::get(\'button.email\') }}}</a> @if($id == Auth::user()->id) <a href="#" class="disabled btn btn-sm btn-danger">{{{ Lang::get(\'button.delete\') }}}</a> @else <a data-row="{{{ $id }}}" data-table="users" data-method="delete" href="{{{ URL::to(\'admin/users/\' . $id . \'\' ) }}}" class="ajax-alert-confirm btn btn-sm btn-danger">{{{ Lang::get(\'button.delete\') }}}</a> @endif</div> ')->make(); } }
/** * Show a list of all the blog posts formatted for Datatables. * * @return Datatables JSON */ public function getData($slug = false) { if ($slug) { $department = Support::getStatusByName($slug); if ($department->default_flag) { $list = Ticket::select(array('ticket.id', 'priority', 'users.displayname', 'ticket.title', 'ticket_deps.name', 'ticket_statuses.title as status', 'ticket.updated_at', 'ticket_statuses.color as color'))->leftjoin('ticket_flags', 'ticket_flags.ticket_id', '=', 'ticket.id')->where('ticket_flags.user_id', '=', Confide::user()->id)->leftjoin('ticket_statuses', 'ticket_statuses.id', '=', 'ticket.status'); } else { $list = Ticket::select(array('ticket.id', 'priority', 'users.displayname', 'ticket.title', 'ticket_deps.name', 'ticket.updated_at'))->where('status', '=', $department->id); } } else { $list = Ticket::select(array('ticket.id', 'priority', 'users.displayname', 'ticket.title', 'ticket_deps.name', 'ticket_statuses.title as status', 'ticket.updated_at', 'ticket_statuses.color as color'))->leftjoin('ticket_statuses', 'ticket_statuses.id', '=', 'ticket.status')->where('ticket_statuses.show_active', '=', '1'); } //->leftjoin('ticket_flags', 'ticket_flags.ticket_id', '=', 'ticket.id')->where(DB::raw('ticket_flags.user_id = '. Confide::user()->id. ' OR ticket_flags.user_id = ""')); $list->leftjoin('users', 'users.id', '=', 'ticket.user_id')->leftjoin('ticket_deps', 'ticket_deps.id', '=', 'ticket.department_id'); if (Api::Enabled()) { $u = $list->get(); return Api::make($u->toArray()); } else { return Datatables::of($list)->remove_column('color')->edit_column('displayname', '<a href="{{{ URL::to(\'admin/support/\' . $id . \'/thread\' ) }}}">{{{ $displayname }}}')->edit_column('updated_at', '{{{ Carbon::parse($updated_at)->diffForHumans() }}}')->edit_column('priority', '{{ $priority > 0 ? "<span class=\\"fa fa-flag". ($priority > 1 ? ($priority == 3 ? "-checkered" : "-o") : null) ." \\"></span>" : null}}')->edit_column('title', '<a href="{{{ URL::to(\'admin/support/\' . $id . \'/thread\' ) }}}">{{{ Filter::filter(Str::limit(strip_tags($title), 42, "..."), "*") }}}</a>')->edit_column('status', '@if(isset($status))@if(isset($color))<span style="color: {{{ $color }}}">{{{ $status }}}</span>@else{{{ $status }}}@endif@endif')->add_column('actions', '<div class="btn-group"><a href="{{{ URL::to(\'admin/support/\' . $id . \'/thread\' ) }}}" class="link-through btn btn-info btn-sm" >{{{ Lang::get(\'button.view\') }}}</a><a href="{{{ URL::to(\'admin/support/\' . $id . \'/edit\' ) }}}" class="btn btn-primary btn-sm modalfy" >{{{ Lang::get(\'button.edit\') }}}</a> <a data-method="delete" data-row="{{{ $id }}}" data-table="tickets" href="{{{ URL::to(\'admin/support/\' . $id . \'\' ) }}}" class="confirm-ajax-update btn btn-sm btn-danger">{{{ Lang::get(\'button.delete\') }}}</a></div> ')->make(); } }
/** * get data * * @return Response */ public function getData() { $list = Todos::leftjoin('users', 'users.id', '=', 'todos.admin_id')->select(array('todos.id', 'todos.title', 'todos.status', 'todos.description', 'todos.created_at', 'todos.due_at', 'users.displayname')); if (Api::Enabled()) { $u = $list->get(); return Api::make($u->toArray()); } else { return Datatables::of($list)->edit_column('status', '{{{ Lang::get(\'admin/todos/todos.status_\'.$status) }}}')->edit_column('due_at', '{{{ Carbon::parse($due_at)->diffForHumans() }}}')->edit_column('created_at', '{{{ Carbon::parse($created_at)->diffForHumans() }}}')->edit_column('displayname', '{{{ $displayname ? : "Nobody" }}}')->add_column('actions', '<div class="btn-group" style="width: 200px"> <a href="{{{ URL::to(\'admin/todos/\' . $id . \'/edit\' ) }}}" class="modalfy btn btn-sm btn-primary">{{{ Lang::get(\'button.edit\') }}}</a> <a href="{{{ URL::to(\'admin/todos/\' . $id . \'/assign\' ) }}}" data-row="{{{ $id }}}" data-table="todos" class="ajax-alert-confirm btn btn-sm btn-default">{{{ Lang::get(\'button.assign_to_me\') }}}</a> <a data-row="{{{ $id }}}" data-table="todos" data-method="delete" href="{{{ URL::to(\'admin/todos/\' . $id . \'\' ) }}}" class="ajax-alert-confirm btn btn-sm btn-danger">{{{ Lang::get(\'button.delete\') }}}</a> </div> ')->make(); } }
/** * Show a list of all the blog posts formatted for Datatables. * * @return Datatables JSON */ public function getData() { $list = TicketAutoreply::join('ticket_autoreply_deps', 'ticket_autoreply_deps.ticket_autoreply_id', '=', 'ticket_autoreply.id')->join('ticket_deps', 'ticket_autoreply_deps.ticket_deps_id', '=', 'ticket_deps.id')->select(DB::raw('ticket_autoreply.id, ticket_autoreply.title, ticket_autoreply.content, group_concat(ticket_deps.name SEPARATOR \', \') as depname'))->groupBy(DB::raw('ticket_autoreply.id, ticket_autoreply.title, ticket_autoreply.content')); if (Api::Enabled()) { $u = $list->get(); return Api::make($u->toArray()); } else { return Datatables::of($list)->edit_column('title', '{{{ Filter::filter(Str::limit($title, 100, "..."), "***") }}} ')->edit_column('content', '{{{ Filter::filter(Str::limit(strip_tags($content), 100, "..."), "***") }}} ')->add_column('actions', '<div class="btn-group"><a href="{{{ URL::to(\'admin/support/autoreplies/\' . $id . \'/edit\' ) }}}" class="btn btn-primary btn-sm modalfy" >{{{ Lang::get(\'button.edit\') }}}</a> <a data-method="delete" data-row="{{{ $id }}}" data-table="replies" href="{{{ URL::to(\'admin/support/autoreplies/\' . $id . \'\' ) }}}" class="confirm-ajax-update btn btn-sm btn-danger">{{{ Lang::get(\'button.delete\') }}}</a></div> ')->make(); } }
/** * Show a list of all the roles formatted for Datatables. * * @return Datatables JSON */ public function getData() { $roles = Role::select(array('roles.id', 'roles.name', 'roles.id as users', 'roles.created_at')); if (Api::Enabled()) { $u = $roles->get(); return Api::make($u->toArray()); } else { return Datatables::of($roles)->edit_column('users', '{{{ DB::table(\'assigned_roles\')->where(\'role_id\', \'=\', $id)->count() }}}')->add_column('actions', '<div class="btn-group"><a href="{{{ URL::to(\'admin/roles/\' . $id . \'/edit\' ) }}}" class="modalfy btn btn-sm btn-primary">{{{ Lang::get(\'button.edit\') }}}</a> <a data-row="{{{ $id }}}" data-method="delete" data-table="roles" href="{{{ URL::to(\'admin/roles/\' . $id . \'\' ) }}}" class="ajax-alert-confirm btn btn-sm btn-danger" @if($name == "admin" || $name == "users")disabled@endif>{{{ Lang::get(\'button.delete\') }}}</a></div> ')->make(); } }
/** * Show a list of all the blog posts formatted for Datatables. * * @return Datatables JSON */ public function getData() { $list = TicketEscalations::select(array('id', 'name', 'delay')); if (Api::Enabled()) { $u = $list->get(); return Api::make($u->toArray()); } else { return Datatables::of($list)->edit_column('delay', '{{{ $delay ? : "None" }}}')->add_column('actions', '<div class="btn-group"><a href="{{{ URL::to(\'admin/support/escalations/\' . $id . \'/edit\' ) }}}" class="btn btn-primary btn-sm modalfy" >{{{ Lang::get(\'button.edit\') }}}</a> <a data-method="delete" data-row="{{{ $id }}}" data-table="escalations" href="{{{ URL::to(\'admin/support/escalations/\' . $id . \'\' ) }}}" class="confirm-ajax-update btn btn-sm btn-danger">{{{ Lang::get(\'button.delete\') }}}</a></div> ')->make(); } }
public function get() { if (Api::Enabled()) { return Api::make($this->user->all()->get()->toArray()); } else { return Datatables::of($this->user->all())->edit_column('displayname', '<a href="{{{ URL::to(\'admin/users/\' . $id . \'/edit\' ) }}}" class="modalfy">{{{$displayname}}}</a>')->edit_column('email', '<a href="{{{ URL::to(\'admin/users/\' . $id . \'/email\' ) }}}" class="modalfy">{{{$email}}}</a>')->add_column('actions', ' <div class="btn-group btn-hover"> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> <span class="fa fa-lg fa-cog fa-fw"></span> <span class="caret"></span> </button> <ul class="dropdown-menu pull-right" role="menu"> <li><a href="{{{ URL::to(\'admin/users/\' . $id . \'/edit\' ) }}}" class="modalfy">{{{ Lang::get(\'button.edit\') }}}</a></li> <li class="divider"></li> <li><a href="{{{ URL::to(\'admin/users/\' . $id . \'/email\' ) }}}" class="modalfy">{{{ Lang::get(\'button.email\') }}}</a></li> <li class="divider"></li> @if($id == Auth::user()->id) <li><a href="#disabled" class="disabled">{{{ Lang::get(\'button.delete\') }}}</a></li> @else <li><a data-row="{{{ $id }}}" data-table="users" data-method="delete" href="{{{ URL::to(\'admin/users/\' . $id . \'\' ) }}}" class="confirm-ajax-update">{{{ Lang::get(\'button.delete\') }}}</a></li> @endif </ul> </div> ')->make(); } }
/** * Show a list of all the blog posts formatted for Datatables. * * @return Datatables JSON */ public function getData() { $list = TicketSpam::select(array('id', 'type', 'content')); if (Api::Enabled()) { $u = $list->get(); return Api::make($u->toArray()); } else { return Datatables::of($list)->edit_column('content', '{{{ Str::limit($content, 100, "...") }}} ')->add_column('actions', '<div class="btn-group"><a href="{{{ URL::to(\'admin/support/spam/\' . $id . \'/edit\' ) }}}" class="btn btn-primary btn-sm modalfy" >{{{ Lang::get(\'button.edit\') }}}</a> <a data-method="delete" data-row="{{{ $id }}}" data-table="spam" href="{{{ URL::to(\'admin/support/spam/\' . $id . \'\' ) }}}" class="confirm-ajax-update btn btn-sm btn-danger">{{{ Lang::get(\'button.delete\') }}}</a></div> ')->make(); } }
public function get() { if (Api::Enabled()) { return Api::make($this->user->all()->get()->toArray()); } else { return Datatables::of($this->user->all())->add_column('actions', '<div class="btn-group"> <a href="{{{ URL::to(\'admin/users/\' . $id . \'/edit\' ) }}}" class="modalfy btn btn-sm btn-primary"><span class="glyphicon glyphicon-pencil"></span></a> <a href="{{{ URL::to(\'admin/users/\' . $id . \'/email\' ) }}}" class="modalfy btn btn-sm btn-default"><span class="glyphicon glyphicon-envelope"></span></a> @if($id == Auth::user()->id) <a href="#" class="disabled btn btn-sm btn-danger"><span class="glyphicon glyphicon-remove"></span></a> @else <a data-row="{{{ $id }}}" data-table="users" data-method="delete" href="{{{ URL::to(\'admin/users/\' . $id . \'\' ) }}}" class="confirm-ajax-update btn btn-sm btn-danger"><span class="glyphicon glyphicon-remove"></span></a> @endif</div> ')->make(); } }
/** * Show a list of all the blog posts formatted for Datatables. * * @return Datatables JSON */ public function getData() { $posts = Post::select(array('posts.id', 'posts.title', 'posts.id as comments', 'posts.created_at')); if (Api::Enabled()) { $u = $posts->get(); return Api::make($u->toArray()); } else { return Datatables::of($posts)->edit_column('comments', '{{ DB::table(\'comments\')->where(\'post_id\', \'=\', $id)->count() }}')->add_column('actions', '<div class="btn-group"><a href="{{{ URL::to(\'admin/slugs/\' . $id . \'/edit\' ) }}}" class="btn btn-primary btn-sm modalfy" >{{{ Lang::get(\'button.edit\') }}}</a> <a data-method="delete" data-row="{{{ $id }}}" data-table="blogs" href="{{{ URL::to(\'admin/slugs/\' . $id . \'\' ) }}}" class="ajax-alert-confirm btn btn-sm btn-danger">{{{ Lang::get(\'button.delete\') }}}</a></div> ')->make(); } }