/** * Display a listing of reportgroupings * * @return Response */ public function index($report_id) { if (!ReportGrouping::canList()) { return $this->_access_denied(); } if (Request::ajax()) { $users_under_me = Auth::user()->getAuthorizedUserids(ReportGrouping::$show_authorize_flag); if (empty($users_under_me)) { $reportgroupings = ReportGrouping::whereNotNull('report_groupings.created_at'); } else { $reportgroupings = ReportGrouping::whereIn('report_groupings.user_id', $users_under_me); } $reportgroupings->where('report_id', $report_id); $reportgroupings = $reportgroupings->select(['report_groupings.id', 'report_groupings.name', 'report_groupings.label', 'report_groupings.id as actions']); return Datatables::of($reportgroupings)->edit_column('actions', function ($reportgrouping) use($report_id) { $actions = []; $actions[] = $reportgrouping->canShow() ? link_to_action('ReportGroupingsController@show', 'Show', [$report_id, $reportgrouping->id], ['class' => 'btn btn-xs btn-primary']) : ''; $actions[] = $reportgrouping->canUpdate() ? link_to_action('ReportGroupingsController@edit', 'Update', [$report_id, $reportgrouping->id], ['class' => 'btn btn-xs btn-default']) : ''; $actions[] = $reportgrouping->canDelete() ? Former::open(action('ReportGroupingsController@destroy', [$report_id, $reportgrouping->id]))->class('form-inline') . Former::hidden('_method', 'DELETE') . '<button type="button" class="btn btn-xs btn-danger confirm-delete">Delete</button>' . Former::close() : ''; return implode(' ', $actions); })->remove_column('id')->make(); return Datatables::of($reportgroupings)->make(); } Asset::push('js', 'datatables'); return View::make('reportgroupings.index', compact('report_id')); }
/** * Get all vehicles * GET /vehicle-types * * @return Response */ public function index() { $data = VehicleTypeRef::paginate(); return View::make('admin.dicts.list', ['columns' => ['ID', 'Название RU', 'Название AZ', 'Действия'], 'data' => $data->transform(function ($v) { return ['id' => $v->id, 'ru' => $v->ru, 'az' => $v->az, 'edit' => link_to_action('VehicleTypeRefsController@edit', 'Редактировать', [$v->id])]; }), 'links' => $data->links(), 'actions' => [['link' => '/vehicle-types/create', 'text' => 'Добавить']]]); }
/** * Display a listing of users * * @return Response */ public function index() { if (!User::canList()) { return $this->_access_denied(); } if (Request::ajax()) { $users_under_me = Auth::user()->getAuthorizedUserids(User::$show_authorize_flag); if (empty($users_under_me)) { $users = User::with('roles')->whereNotNull('users.created_at'); } else { $users = User::with('roles')->whereIn('users.user_id', $users_under_me); } $users = $users->select(['users.id', 'users.last_name', 'users.id as roles_column', 'users.confirmed', 'users.id as actions', 'users.first_name']); return Datatables::of($users)->edit_column('last_name', function ($user) { return $user->first_name . ' ' . $user->last_name; })->edit_column('roles_column', function ($user) { return '<ul>' . implode('', array_map(function ($name) { return '<li>' . $name . '</li>'; }, $user->roles->lists('name'))) . '</ul>'; })->edit_column('confirmed', function ($user) { return $user->status(); })->edit_column('actions', function ($data) { $actions = []; $actions[] = $data->canShow() ? link_to_action('users.show', 'Show', $data->id, ['class' => 'btn btn-xs btn-primary']) : ''; $actions[] = $data->canUpdate() ? link_to_action('users.edit', 'Update', $data->id, ['class' => 'btn btn-xs btn-default']) : ''; $actions[] = $data->canDelete() ? Former::open(action('users.destroy', $data->id))->class('form-inline') . Former::hidden('_method', 'DELETE') . '<button type="button" class="btn btn-danger btn-xs confirm-delete">Delete</button>' . Former::close() : ''; return implode(' ', $actions); })->remove_column('id')->make(); } Asset::push('js', 'datatables'); return View::make('users.index'); }
function fa_link_to_action($action, $text, $icon = '', $params = array(), $attrs = array()) { if ($icon) { $text = '<i class="fa fa-' . $icon . '"></i> ' . $text; } return link_to_action($action, $text, $params, $attrs); }
function fa_link_to_action($route, $text, $icon = '', $params = array(), $attrs = array()) { if ($icon) { $text = '<span class="fi-' . $icon . '" aria-hidden="true"></span> ' . $text; } return link_to_action($route, $text, $params, $attrs); }
public function sendSubscriptionMail($array) { $this->view = 'emails.subscription'; $this->recepientEmail = $array['email']; $this->recepientName = $array['name_en']; $this->subject = trans('general.subscription_email_subject'); switch ($array['status']) { case 'PENDING': $array['body'] = trans('general.subscription_email_pending', ['title' => $array['title']]); break; case 'APPROVED': $array['body'] = trans('general.subscription_email_approved', ['title' => $array['title'], 'link' => link_to_action('SubscriptionsController@confirmSubscription', trans('word.click_here'), $array['event_id'])]); break; case 'CONFIRMED': $array['body'] = trans('general.subscription_email_confirmed', ['title' => $array['title']]); break; case 'WAITING': $array['body'] = trans('general.subscription_email_waiting', ['title' => $array['title']]); break; case 'REJECTED': $array['body'] = trans('general.subscription_email_rejected', ['title' => $array['title']]); break; case 'PAYMENT': $array['body'] = trans('general.subscription_email_payment', ['title' => $array['title'], 'link' => link_to_action('PaymentsController@getPayment', trans('word.click_here'), [$array['event_id'], 'token' => $array['token']])]); break; default: break; } // If the custom reason set by admin if (!empty($array['reason'])) { $array['body'] = $array['reason']; } $this->fire($array); }
/** * Display a listing of the resource. * GET /body-types * * @return Response */ public function index() { $bodies = BodyTypeRef::paginate(); return View::make('admin.dicts.list', ['columns' => ['ID', 'Ru', 'AZ', 'Действия'], 'data' => $bodies->transform(function ($b) { return ['id' => $b->id, 'ru' => $b->ru, 'az' => $b->az, 'edit' => link_to_action('BodyTypeRefsController@edit', 'редактировать →', [$b->id])]; }), 'links' => $bodies->links(), 'title' => 'Типы кузова', 'actions' => [['link' => '/admin/body-types/create', 'text' => 'Добавить']]]); }
public function listAll() { $models = ModelRef::with(['marks', 'vehicleTypes'])->paginate(); $links = $models->links(); $vehicleTypes = VehicleTypeRef::all(); $models = $models->transform(function ($model) use($vehicleTypes) { return ['id' => $model->id, 'name' => $model->name, 'mark' => $model->marks->name, 'vehicle_type' => $vehicleTypes->filter(function ($vehicleType) use($model) { return $model->vehicle_type_id == $vehicleType->id; })->first()->name, 'edit' => link_to_action('ModelRefsController@edit', 'редактировать →', [$model->marks->id, $model->id])]; }); return View::make('admin.dicts.list', ['columns' => ['ID', 'Название', 'Марка', 'Тип Авто', 'Действия'], 'data' => $models, 'links' => $links, 'title' => 'Модели', 'actions' => [['link' => '/admin/models/create', 'text' => 'Добавить']]]); }
/** * Display a listing of permissions * * @return Response */ public function index() { if (!Permission::canList()) { return $this->_access_denied(); } if (Request::ajax()) { $permissions = Permission::select(['id', 'group_name', 'name', 'display_name']); return Datatables::of($permissions)->add_column('actions', function ($data) { $actions = []; $actions[] = $data->canShow() ? link_to_action('permissions.show', 'Show', $data->id, ['class' => 'btn btn-xs btn-primary']) : ''; $actions[] = $data->canUpdate() ? link_to_action('permissions.edit', 'Update', $data->id, ['class' => 'btn btn-xs btn-default']) : ''; $actions[] = $data->canDelete() ? Former::open(action('permissions.destroy', $data->id))->class('form-inline') . Former::hidden('_method', 'DELETE') . '<button type="button" class="btn btn-danger btn-xs confirm-delete">Delete</button>' . Former::close() : ''; return implode(' ', $actions); })->remove_column('id')->make(); } Asset::push('js', 'datatables'); return View::make('permissions.index'); }
private function buildModArray($mod) { $supported_versions = ''; $authors = ''; $links = ''; $version_array = []; $i = 0; $name = link_to_action('ModController@getMod', $mod->name, [$mod->slug]); foreach ($mod->versions as $v) { if (!in_array($v->name, $version_array)) { $version_array[] = $v->name; $supported_versions .= $v->name; $supported_versions .= ', '; } $i++; } if (!$supported_versions) { $supported_versions = 'Unknown'; } foreach ($mod->authors as $v) { $authors .= $v->name; $authors .= ', '; } if (!$authors) { $authors = 'N/A'; } if ($mod->website) { $links .= link_to($mod->website, 'Website'); $links .= ' / '; } if ($mod->donate_link) { $links .= link_to($mod->donate_link, 'Donate'); $links .= ' / '; } if ($mod->wiki_link) { $links .= link_to($mod->wiki_link, 'Wiki'); $links .= ' / '; } return ['name' => $name, 'deck' => $mod->deck, 'links' => rtrim($links, ' / '), 'versions' => rtrim($supported_versions, ', '), 'authors' => rtrim($authors, ', ')]; }
/** * Display a listing of roles * * @return Response */ public function index() { if (!Role::canList()) { return $this->_access_denied(); } if (Request::ajax()) { $roles = Role::with('users', 'perms')->select(['roles.id', 'roles.name', 'roles.id as permissions', 'roles.id as user_count', 'roles.id as actions']); return Datatables::of($roles)->edit_column('actions', function ($role) { $actions = []; $actions[] = $role->canShow() ? link_to_action('roles.show', 'Show', $role->id, ['class' => 'btn btn-xs btn-primary']) : ''; $actions[] = $role->canUpdate() ? link_to_action('roles.edit', 'Update', $role->id, ['class' => 'btn btn-xs btn-default']) : ''; $actions[] = $role->canDelete() ? Former::open(action('roles.destroy', $role->id))->class('form-inline') . Former::hidden('_method', 'DELETE') . '<button type="button" class="btn btn-danger btn-xs confirm-delete">Delete</button>' . Former::close() : ''; return implode(' ', $actions); })->edit_column('user_count', function ($role) { return $role->users->count(); })->edit_column('permissions', function ($role) { return '<ul>' . implode('', array_map(function ($name) { return '<li>' . $name . '</li>'; }, $role->perms->lists('name'))) . '</ul>'; })->remove_column('id')->make(); } Asset::push('js', 'datatables'); return View::make('roles.index'); }
public function cars($id) { $user = User::find($id); $cars = User::find($id)->cars()->paginate(); return View::make('admin.dicts.admin-list', ['columns' => ['ID', 'Изображение', 'Модель', 'Марка', 'Цвет', 'Тип кузова', 'Номер', '', ''], 'data' => $cars->transform(function ($car) { return ['id' => $car->id, 'img' => $car->images->first() ? HTML::image($car->images->first()->thumbnail, null, ['height' => '50px']) : '', 'mark' => $this->returnIfPresent($car, 'markRef', 'name'), 'model' => $this->returnIfPresent($car, 'modelRef', 'name'), 'color' => $car->color, 'body_type' => $this->returnIfPresent($car, 'bodyTypeRef', 'ru'), 'number' => $car->number, 'edit' => link_to_action('CarsController@show', 'ред', [$car->user_id, $car->id]), 'delete' => link_to("admin/cars/{$car->id}/delete", 'удалить')]; }), 'actions' => $this->actions($user), 'links' => $cars->links(), 'title' => 'Машины пользователя']); }
public function activeLink($action, $title = null, $parameters = array(), $attributes = array()) { $same = $action == \Route::currentRouteAction(); $same = $same && array_values(\Route::getCurrentRoute()->parameters()) == array_values($parameters); $active = $same ? ' class="active"' : ''; return "<li{$active}>" . link_to_action($action, $title, $parameters, $attributes) . '</li>'; }
<div class="form-group"> {!! Form::label('Twitch URL: ') !!} {!! Form::text('url', null, array('required', 'class'=>'form-control', 'placeholder'=>'www.twitch.tv/username')) !!} </div> <div class="form-group" id="submit"> {!! Form::submit('Submit!', array('class'=>'btn btn-primary')) !!} </div> {!! Form::close() !!} <section class="col-md-8" id=""> @foreach($twitches->all() as $twitch) <div class="single-blog-item"> <span> <?php echo link_to_action('TwitchController@show', $title = $twitch->url, $parameters = array('pid' => $twitch->url), $attributes = array()); ?> </span> <span> </span> </div> @endforeach <iframe src="http://player.twitch.tv/?channel=esl_csgo" height="720" width="1280" frameborder="0" scrolling="no"
<li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> Hello {!! $user->name !!} <span class="caret"></span> </a> <ul class="dropdown-menu"> <li><?php echo link_to_action('AdminController@getLogout', 'Logout'); ?> </li> </ul> </li>
/** * @param mixed $model * * @return string */ protected function getUpdatedEventDescription($model) { $modelName = trans("back-{$this->moduleName}.singular"); $linkToModel = link_to_action("Back\\{$this->modelName}Controller@edit", $model->name, ['id' => $model->id]); if ($model->wasDraft) { return trans('back.events.created', ['model' => $modelName, 'name' => $linkToModel]); } return trans('back.events.updated', ['model' => $modelName, 'name' => $linkToModel]); }
function link_to_action_fa($controller, $route, $icon, $title = '', $id = null) { return link_to_action(ucfirst($controller) . 'Controller@' . $route, $title, [$id], ['class' => "fa fa-{$icon}", "_method" => "delete"]); //echo link_to_action('HomeController@getIndex', $title, $parameters = array(), $attributes = array()); }
<h3>Lista ordini</h3> {{-- messaggi vari --}} <?php $message = Session::get('message'); ?> @if( isset($message) ) <div class="alert alert-success">{{$message}}</div> @endif @if($errors && ! $errors->isEmpty() ) @foreach($errors->all() as $error) <div class="alert alert-danger">{{$error}}</div> @endforeach @endif {{-- Lists orders --}} <ul class="list-group"> @if(! empty($orders)) <?php $table = new BootstrapTable(); $table->setConfig(["table-striped" => true]); $table->setHeader(["Utente", "Data ordine", "Importo totale", ""]); foreach ($orders as $order) { $table->addRows([$order->author_email, $order->date, $order->total_price, link_to_action('Palmabit\\Catalog\\Controllers\\OrderController@show', 'dettaglio', ['id' => $order->id])]); } echo $table; echo $orders->getLinks(); ?> @else <h5>Non ho trovato ordini.</h5> @endif </ul> @stop
<?php HTML::macro('discussion', function ($discussion, $article_id, $level) { $result = '<div class="discussion-main col-xs-12 ' . ($level < 5 ? 'commentary-new-level' : 'x') . '"> <div class="discussion-commentary row"> <div class="col-xs-3">' . HTML::profilePicture($discussion->user, '100%', '100%', ['class' => 'discussion-profile col-xs-3']) . '</div> <div class="col-xs-9 discussion-right"> <span class="discussion-author-info">' . link_to_action('UserController@getProfile', $discussion->user->fullname, ['user_id' => $discussion->user->slug]) . ' <a class="discussion-date"> ' . $discussion->created_at . ' </a></span> <p>' . $discussion->text . '</p> </div>'; if (Auth::check()) { $result .= '<div class="col-xs-12 discussion-bottom"> <span class="reply-link pull-right"> <a onclick="resizeArea(' . $discussion->id . ')" name="reply">Odpovedať</a>'; if (Auth::user()->hasRole(\App\Models\User::ADMIN_ROLE) || Auth::user()->hasRole(\App\Models\User::TEACHER_ROLE)) { $result .= '<br> <a href="' . action('DiscussionController@getDelete', ['id' => $discussion->id]) . '" style="color:red">Zmazať nevhodný komentár</a>'; } $result .= '</span>' . Form::open(['url' => action('DiscussionController@postAddDiscussion'), 'method' => 'post']) . Form::hidden('parent', $discussion->id) . Form::hidden('article_id', $article_id) . '<textarea id="' . $discussion->id . '" class="reply" style="" name="text"></textarea><br>' . Form::submit('Odoslať', ['class' => 'btn btn-ba-style hidden-btn ' . $discussion->id, 'name' => 'action']) . Form::close() . '</div>'; } $children = \App\Models\Discussion::where('parent', '=', $discussion->id)->orderBy('created_at', 'ASC')->get(); foreach ($children as $child) { $result .= HTML::discussion($child, $article_id, $level + 1); } $result .= '</div> </div>'; return $result; });
private function prepareResetPasswordLink($token, $to) { $this->body = link_to_action("Jacopo\\Authentication\\Controllers\\AuthController@getChangePassword", "Click here to change your password.", ["email" => $to, "token" => $token]); }
private function prepareResetPasswordLink($token, $to) { $this->body = link_to_action("Jacopo\\Authentication\\Controllers\\AuthController@getChangePassword", Config::get('laravel-authentication-acl::messages.links.change_password'), ["email" => $to, "token" => $token]); }
public function getServers() { $servers_array = []; $versions = []; $input = Input::only('modpack', 'tags', 'country', 'permission'); $query = Server::where('active', 1); if ($input['modpack']) { $input_modpacks_array = explode(',', $input['modpack']); $query->where(function ($query) use($input_modpacks_array) { foreach ($input_modpacks_array as $modpack_id) { $query->orWhere('modpack_id', $modpack_id); } }); } if ($input['tags']) { $input_tags_array = explode(',', $input['tags']); foreach ($input_tags_array as $tag) { $query->whereHas('tags', function ($q) use($tag) { $q->where('server_tags.id', '=', $tag); }); } } if ($input['country']) { $query->where('country', $input['country']); } if ($input['permission']) { $query->where('permissions', $input['permission']); } $servers = $query->with('modpack')->with('status')->get(); $countries = Server::countryList(); $raw_versions = MinecraftVersion::all(); foreach ($raw_versions as $v) { $versions[$v->id] = $v->name; } foreach ($servers as $server) { $server_status = $server->status; $modpack = $server->modpack; if ($server->server_address_hide == 1) { $server_address = 'Hidden / Private'; } else { $server_address = $server->ip_host . ':' . $server->port; } $version_slug = $this->getVersion($versions[$modpack->minecraft_version_id]); $options = ''; //1 = Whitelist //2 = Greylist //3 = Open switch ($server->permissions) { case 1: $options = '<i class="fa fa-lock" title="Whitelist"></i>'; break; case 2: $options = '<i class="fa fa-lock" title="Greylist"></i>'; break; case 3: $options = '<i class="fa fa-unlock-alt" title="Open"></i>'; break; } $country_name = $countries[$server->country]; $options .= '<span class="flag-icon flag-icon-' . strtolower($server->country) . '" title="' . $country_name . '"></span> '; $server_name = link_to_action('ServerController@getServer', $server->name, [$server->id, $server->slug]); $modpack = link_to_action('ModpackController@getModpack', $modpack->name, [$version_slug, $modpack->slug]); $players = $server_status->current_players . ' / ' . $server_status->max_players; $servers_array[] = ['id' => $server->id, 'name' => $server_name, 'modpack' => $modpack, 'options' => $options, 'server_address' => $server_address, 'players' => $players, 'deck' => $server->deck]; } shuffle($servers_array); return $this->buildDTServerOutput($servers_array); }
public function getCompare() { $results = false; $error = false; $modpacks = []; $json_string = ''; $input = Input::only('modpacks'); $title = 'Compare Modpacks - ' . $this->site_name; $meta_description = 'Compare mods between two or more modpacks. Select the modpacks you are interested in below and we will generate a table comparing the mods in each pack.'; if (!$input['modpacks']) { return View::make('modpacks.compare', ['chosen' => true, 'title' => $title, 'meta_description' => $meta_description, 'error' => $error, 'results' => $results, 'selected_modpacks' => false]); } $modpack_ids = explode(',', $input['modpacks']); foreach ($modpack_ids as $id) { $modpack = Modpack::find($id); if ($modpack) { $modpacks[$id] = link_to_action('ModpackController@getModpack', $modpack->name, [$this->getVersion($modpack->version->name), $modpack->slug]); $json_string .= $modpack->id . ','; } } $table_javascript = route('tdf', ['compare', 'all']) . '?modpacks=' . rtrim($json_string, ','); if (count($modpacks) >= 2) { $results = true; } else { $error = 'You must select two or more modpacks!'; } return View::make('modpacks.compare', ['modpacks' => $modpacks, 'table_javascript' => $table_javascript, 'chosen' => true, 'selected_modpacks' => $modpack_ids, 'results' => $results, 'title' => $title, 'meta_description' => $meta_description, 'error' => $error, 'table_fixed_header' => true]); }
<p> By: <a href="html5-templates.html"> {{$item->user->name}} </a> , Tags: @foreach($tags as $tag) <a href="#" class="searchTag">{{$tag}}</a> @endforeach <time>{{$item->date}} </time> </p> <h1> <?php //title and the destination with parameters echo link_to_action('QAController@show', $title = $item->title, $parameters = array('pid' => $item->id), $attributes = array()); ?> </h1> </div> </div> </article> @endforeach <a class="btn btn-large btn-success" href="{{ URL::to('/QA/create') }}">Ask A Question!</a> <div class="page-turn"> <div class="row"> <div class="col-md-6 col-md-offset-3 text-center"> <nav> <ul class="pagination pagination-sm"> <?php
public function getDescriptionForEvent(string $eventName) : string { $link = link_to_action('Back\\FragmentController@edit', $this->fullName, [$this->id]); return "Fragment '{$link}' werd bijgewerkt"; }