예제 #1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $data["message"] = old("top_message") ?: Session::pull("top_message");
     //不正アクセスアラートを受け取る
     $data["alert"] = old("top_alert");
     return view('top/index', $data);
 }
예제 #2
0
파일: Field.php 프로젝트: eliasrosa/bw-core
 public function getValue()
 {
     if ($this->name != '' && $this->model && isset($this->model->{$this->name})) {
         $this->value = $this->model->{$this->name};
     }
     return old($this->name, $this->value);
 }
예제 #3
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $role = Role::findOrFail($id);
     $permissions = Permission::all();
     $assignedPermissions = old('permissions', $role->permissions()->lists('id')->toArray());
     return view('admin.roles.edit', compact('role', 'permissions', 'assignedPermissions'));
 }
예제 #4
0
 public function create()
 {
     $data = [];
     foreach ($this->fields as $field => $default) {
         $data[$field] = old($field, $default);
     }
     return view("admin.coupon.create", ['data' => $data]);
 }
예제 #5
0
 public function create()
 {
     $data = [];
     foreach ($this->fields as $field => $default) {
         $data[$field] = old($field, $default);
     }
     return view("admin.itemType.create", $data);
 }
예제 #6
0
 public static function formValue($field, $modelField = '')
 {
     if (old($field)) {
         return old($field);
     } else {
         return $modelField;
     }
 }
예제 #7
0
 public function render(array $attributes = [], array $viewData = [])
 {
     $this->options = array_merge($this->options, $attributes);
     $value = old(str_replace('[]', '', $this->name), $this->getOption('value'));
     unset($this->options['value']);
     $this->setSelectOptions($value);
     return parent::render($attributes, $viewData);
 }
예제 #8
0
 function getValue()
 {
     if ($this->useOldValue && \Request::hasSession()) {
         return old($this->name, $this->value);
     } else {
         return $this->value;
     }
 }
예제 #9
0
 public function index()
 {
     $settings = ['sms_off_enabled', 'sms_off_to', 'sms_off_message', 'sms_on_enabled', 'sms_on_to', 'sms_on_message', 'sms_login', 'email_off_enabled', 'email_off_to', 'email_off_subject', 'email_off_message', 'email_on_enabled', 'email_on_to', 'email_on_subject', 'email_on_message', 'email_from'];
     foreach ($settings as $key) {
         $data[$key] = old($key, Setting::get($key));
     }
     return view('settings', $data);
 }
 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     $data = [];
     foreach ($this->fields as $field => $default) {
         $data[$field] = old($field, $default);
     }
     return view('blog.post', $data);
 }
예제 #11
0
 public function create()
 {
     $data = [];
     foreach ($this->fields as $field => $default) {
         $data[$field] = old($field, $default);
     }
     return view('admin.role.create', $data);
 }
예제 #12
0
function oom($oldField, $modelField)
{
    if (strlen(old($oldField)) > 0) {
        return old($oldField);
    } else {
        return $modelField;
    }
}
예제 #13
0
 function formText($col, $name, $id, $errors, $label = '', $icon = '', $memory = true, $value = '', $type = 'text')
 {
     return sprintf('
         <div class="input-field col %s">
             <input type="%s" name="%s" id="%s" class="validate %s" value="%s"/>
             <label for="%s">%s</label>
         </div>', $col, $type, $name, $id, $errors->first($name) ? 'invalid' : '', $memory ? old($name) ? old($name) : $value : $value, $id, $label ? '<i class="material-icons">' . $icon . '</i>' . $label : '');
 }
예제 #14
0
 /**
  * @param \Yajra\CMS\Entities\Navigation $navigation
  * @param \Yajra\CMS\Entities\Menu $menu
  * @return mixed
  */
 public function create(Navigation $navigation, Menu $menu)
 {
     $menu->extension_id = old('extension_id', Extension::MENU_INTERNAL);
     $menu->published = true;
     $menu->setHighestOrderNumber();
     $menu->load('extension');
     return view('administrator.navigation.menu.create', compact('navigation', 'menu'));
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $skilltag = SkillsTag::findOrFail($id);
     $data = ['id' => $id];
     foreach (array_keys($this->fields) as $field) {
         $data[$field] = old($field, $skilltag->{$field});
     }
     return view('admin.pages.skill-tag-edit', $data);
 }
예제 #16
0
 /**
  * Show the form for editing a tag
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $tag = Tag::findOrFail($id);
     $data = ['id' => $id];
     foreach (array_keys($this->fields) as $field) {
         $data[$field] = old($field, $tag->{$field});
     }
     return view('admin.tag.edit', $data);
 }
예제 #17
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $menu = Menu::findOrFail($id);
     $data = ['id' => $id];
     foreach (array_keys($this->fields) as $field) {
         $data[$field] = old($field, $menu->{$field});
     }
     $parent_list = Menu::where('parent_id', '=', 0)->where('id', '!=', $id)->orderBy('order', 'asc')->select('id', 'title')->get();
     return view('admin.menu.edit', $data)->with('parent_list', $parent_list);
 }
예제 #18
0
 public function edit($id)
 {
     $place = Place::findOrFail($id);
     $data = ['id' => $id];
     $data['place'] = $place;
     foreach (array_keys($this->updateFields) as $field) {
         $data[$field] = old($field, $place->{$field});
     }
     return view('admin.place.edit', $data);
 }
예제 #19
0
 public function haveDefaultNode($node, $snode)
 {
     if (count($node) && ($snode && $node->id == $snode->id)) {
         return true;
     }
     if (old('node_id') && ($snode && old('node_id') == $snode->id)) {
         return true;
     }
     return false;
 }
예제 #20
0
 public function edit($id)
 {
     $itemType = ItemType::findOrFail($id);
     //  var_dump($itemType);exit;
     $data = ['id' => $id];
     foreach (array_keys($this->fields) as $field) {
         $data[$field] = old($field, $itemType->{$field});
     }
     return view('admin.itemtype.edit', ['data' => $data]);
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $decodedId = Hashids::decode($id);
     $subscriber = Subscriber::findOrFail($decodedId[0]);
     $data = ['id' => $decodedId[0]];
     foreach (array_keys($this->fields) as $field) {
         $data[$field] = old($field, $subscriber->{$field});
     }
     return view('pages.subscribers.edit', $data);
 }
예제 #22
0
 /**
  * View user profile.
  *
  * @return \Illuminate\View\View
  */
 public function index()
 {
     $user = Auth::user();
     $code = $this->google2fa->generateSecretKey();
     if ($user->has_two_factor_authentication || old('google_code')) {
         $code = old('google_code', $user->google2fa_secret);
     }
     $img = $this->google2fa->getQRCodeGoogleUrl('Deployer', $user->email, $code);
     return view('user.profile', ['google_2fa_url' => $img, 'google_2fa_code' => $code, 'title' => Lang::get('users.update_profile')]);
 }
예제 #23
0
 public function edit(Request $request, $id)
 {
     $station = \App\Station::findOrFail($id);
     if (!$request->user()->isAdmin() && $station->user_id != $request->user()->id) {
         return abort(403);
     }
     $selected_tags = old('tags', $station->tags()->lists('name')->toArray());
     $tags = array_unique(array_merge($selected_tags, \App\Tag::get()->lists('name')->toArray()));
     return view('backend.stations.edit', compact('station', 'tags', 'selected_tags'));
 }
예제 #24
0
 public function handle()
 {
     $fields = $this->fieldList;
     if ($this->id) {
         $fields = $this->fieldsFromModel($this->id, $fields);
     }
     foreach ($fields as $fieldName => $fieldValue) {
         $fields[$fieldName] = old($fieldName, $fieldValue);
     }
     return array_merge($fields, ['allLinhas' => Linha::lists('titulo')->all()], ['allSegmentos' => Segmento::lists('titulo')->all()], ['allSuperficies' => Superficie::lists('titulo')->all()], ['allSujeiras' => Sujeira::lists('titulo')->all()]);
 }
 /**
  * Execute the job.
  *
  * @param int $id
  * @return array of fieldnames => values
  */
 public function getFormFields($id = 0)
 {
     $fields = $this->getFields();
     if ($id) {
         $fields = $this->fieldsFromModel($id, $fields);
     }
     foreach ($fields as $fieldName => $fieldValue) {
         $fields[$fieldName] = old($fieldName, $fieldValue);
     }
     return $fields;
 }
예제 #26
0
 public function editPage($model_name, $id)
 {
     $model_name = snake_case($model_name);
     $model = Podm::getModelById($model_name, $id);
     if ($model !== null) {
         $user_values = old();
         return view('PodmView::edit_form', ['content' => $model->getEditForm($user_values), 'errors' => session('errors', [])]);
     } else {
         return redirect('/');
     }
 }
예제 #27
0
 /**
  * Kita gunakan ini di bagian untuk melakukan setting terhadap value sebuah inputan!
  * @param \Illuminate\Database\Eloquent\Model $model
  * @param string $field
  */
 function load_input_value($model, $field)
 {
     $value = old($field);
     // check apakah ini adalah editing yang tidak langsung dimasukkan nilainya?
     if ($value !== null) {
         return $value;
     }
     // bila tidak (awal mengedit) maka nilai field ada
     // kembalikan saja nilainya!
     return $model === null ? null : $model->{$field};
 }
예제 #28
0
 public function edit($id)
 {
     $article = Article::findOrFail($id);
     $data = ['id' => $id];
     $data['article'] = $article;
     $data['places'] = $article->places()->get();
     foreach (array_keys($this->updateFields) as $field) {
         $data[$field] = old($field, $article->{$field});
     }
     return view('admin.article.edit', $data);
 }
예제 #29
0
 /**
  * @return mixed
  */
 function country_select()
 {
     app('html')->macro('country_select', function ($name = 'country', $selected = 'US', $options = ['class' => 'form-control'], $title = 'Select a Country') {
         $countries = ['' => $title, 'AF' => 'Afghanistan', 'AL' => 'Albania', 'DZ' => 'Algeria', 'AS' => 'American Samoa', 'AD' => 'Andorra', 'AO' => 'Angola', 'AI' => 'Anguilla', 'AQ' => 'Antarctica', 'AG' => 'Antigua and Barbuda', 'AR' => 'Argentina', 'AM' => 'Armenia', 'AW' => 'Aruba', 'AU' => 'Australia', 'AT' => 'Austria', 'AZ' => 'Azerbaijan', 'BS' => 'Bahamas', 'BH' => 'Bahrain', 'BD' => 'Bangladesh', 'BB' => 'Barbados', 'BY' => 'Belarus', 'BE' => 'Belgium', 'BZ' => 'Belize', 'BJ' => 'Benin', 'BM' => 'Bermuda', 'BT' => 'Bhutan', 'BO' => 'Bolivia', 'BA' => 'Bosnia and Herzegovina', 'BW' => 'Botswana', 'BV' => 'Bouvet Island', 'BR' => 'Brazil', 'BQ' => 'British Antarctic Territory', 'IO' => 'British Indian Ocean Territory', 'VG' => 'British Virgin Islands', 'BN' => 'Brunei', 'BG' => 'Bulgaria', 'BF' => 'Burkina Faso', 'BI' => 'Burundi', 'KH' => 'Cambodia', 'CM' => 'Cameroon', 'CA' => 'Canada', 'CT' => 'Canton and Enderbury Islands', 'CV' => 'Cape Verde', 'KY' => 'Cayman Islands', 'CF' => 'Central African Republic', 'TD' => 'Chad', 'CL' => 'Chile', 'CN' => 'China', 'CX' => 'Christmas Island', 'CC' => 'Cocos [Keeling] Islands', 'CO' => 'Colombia', 'KM' => 'Comoros', 'CG' => 'Congo - Brazzaville', 'CD' => 'Congo - Kinshasa', 'CK' => 'Cook Islands', 'CR' => 'Costa Rica', 'HR' => 'Croatia', 'CU' => 'Cuba', 'CY' => 'Cyprus', 'CZ' => 'Czech Republic', 'CI' => 'Côte d’Ivoire', 'DK' => 'Denmark', 'DJ' => 'Djibouti', 'DM' => 'Dominica', 'DO' => 'Dominican Republic', 'NQ' => 'Dronning Maud Land', 'DD' => 'East Germany', 'EC' => 'Ecuador', 'EG' => 'Egypt', 'SV' => 'El Salvador', 'GQ' => 'Equatorial Guinea', 'ER' => 'Eritrea', 'EE' => 'Estonia', 'ET' => 'Ethiopia', 'FK' => 'Falkland Islands', 'FO' => 'Faroe Islands', 'FJ' => 'Fiji', 'FI' => 'Finland', 'FR' => 'France', 'GF' => 'French Guiana', 'PF' => 'French Polynesia', 'TF' => 'French Southern Territories', 'FQ' => 'French Southern and Antarctic Territories', 'GA' => 'Gabon', 'GM' => 'Gambia', 'GE' => 'Georgia', 'DE' => 'Germany', 'GH' => 'Ghana', 'GI' => 'Gibraltar', 'GR' => 'Greece', 'GL' => 'Greenland', 'GD' => 'Grenada', 'GP' => 'Guadeloupe', 'GU' => 'Guam', 'GT' => 'Guatemala', 'GG' => 'Guernsey', 'GN' => 'Guinea', 'GW' => 'Guinea-Bissau', 'GY' => 'Guyana', 'HT' => 'Haiti', 'HM' => 'Heard Island and McDonald Islands', 'HN' => 'Honduras', 'HK' => 'Hong Kong SAR China', 'HU' => 'Hungary', 'IS' => 'Iceland', 'IN' => 'India', 'ID' => 'Indonesia', 'IR' => 'Iran', 'IQ' => 'Iraq', 'IE' => 'Ireland', 'IM' => 'Isle of Man', 'IL' => 'Israel', 'IT' => 'Italy', 'JM' => 'Jamaica', 'JP' => 'Japan', 'JE' => 'Jersey', 'JT' => 'Johnston Island', 'JO' => 'Jordan', 'KZ' => 'Kazakhstan', 'KE' => 'Kenya', 'KI' => 'Kiribati', 'KW' => 'Kuwait', 'KG' => 'Kyrgyzstan', 'LA' => 'Laos', 'LV' => 'Latvia', 'LB' => 'Lebanon', 'LS' => 'Lesotho', 'LR' => 'Liberia', 'LY' => 'Libya', 'LI' => 'Liechtenstein', 'LT' => 'Lithuania', 'LU' => 'Luxembourg', 'MO' => 'Macau SAR China', 'MK' => 'Macedonia', 'MG' => 'Madagascar', 'MW' => 'Malawi', 'MY' => 'Malaysia', 'MV' => 'Maldives', 'ML' => 'Mali', 'MT' => 'Malta', 'MH' => 'Marshall Islands', 'MQ' => 'Martinique', 'MR' => 'Mauritania', 'MU' => 'Mauritius', 'YT' => 'Mayotte', 'FX' => 'Metropolitan France', 'MX' => 'Mexico', 'FM' => 'Micronesia', 'MI' => 'Midway Islands', 'MD' => 'Moldova', 'MC' => 'Monaco', 'MN' => 'Mongolia', 'ME' => 'Montenegro', 'MS' => 'Montserrat', 'MA' => 'Morocco', 'MZ' => 'Mozambique', 'MM' => 'Myanmar [Burma]', 'NA' => 'Namibia', 'NR' => 'Nauru', 'NP' => 'Nepal', 'NL' => 'Netherlands', 'AN' => 'Netherlands Antilles', 'NT' => 'Neutral Zone', 'NC' => 'New Caledonia', 'NZ' => 'New Zealand', 'NI' => 'Nicaragua', 'NE' => 'Niger', 'NG' => 'Nigeria', 'NU' => 'Niue', 'NF' => 'Norfolk Island', 'KP' => 'North Korea', 'VD' => 'North Vietnam', 'MP' => 'Northern Mariana Islands', 'NO' => 'Norway', 'OM' => 'Oman', 'PC' => 'Pacific Islands Trust Territory', 'PK' => 'Pakistan', 'PW' => 'Palau', 'PS' => 'Palestinian Territories', 'PA' => 'Panama', 'PZ' => 'Panama Canal Zone', 'PG' => 'Papua New Guinea', 'PY' => 'Paraguay', 'YD' => "People's Democratic Republic of Yemen", 'PE' => 'Peru', 'PH' => 'Philippines', 'PN' => 'Pitcairn Islands', 'PL' => 'Poland', 'PT' => 'Portugal', 'PR' => 'Puerto Rico', 'QA' => 'Qatar', 'RO' => 'Romania', 'RU' => 'Russia', 'RW' => 'Rwanda', 'RE' => 'Réunion', 'BL' => 'Saint Barthélemy', 'SH' => 'Saint Helena', 'KN' => 'Saint Kitts and Nevis', 'LC' => 'Saint Lucia', 'MF' => 'Saint Martin', 'PM' => 'Saint Pierre and Miquelon', 'VC' => 'Saint Vincent and the Grenadines', 'WS' => 'Samoa', 'SM' => 'San Marino', 'SA' => 'Saudi Arabia', 'SN' => 'Senegal', 'RS' => 'Serbia', 'CS' => 'Serbia and Montenegro', 'SC' => 'Seychelles', 'SL' => 'Sierra Leone', 'SG' => 'Singapore', 'SK' => 'Slovakia', 'SI' => 'Slovenia', 'SB' => 'Solomon Islands', 'SO' => 'Somalia', 'ZA' => 'South Africa', 'GS' => 'South Georgia and the South Sandwich Islands', 'KR' => 'South Korea', 'ES' => 'Spain', 'LK' => 'Sri Lanka', 'SD' => 'Sudan', 'SR' => 'Suriname', 'SJ' => 'Svalbard and Jan Mayen', 'SZ' => 'Swaziland', 'SE' => 'Sweden', 'CH' => 'Switzerland', 'SY' => 'Syria', 'ST' => 'São Tomé and Príncipe', 'TW' => 'Taiwan', 'TJ' => 'Tajikistan', 'TZ' => 'Tanzania', 'TH' => 'Thailand', 'TL' => 'Timor-Leste', 'TG' => 'Togo', 'TK' => 'Tokelau', 'TO' => 'Tonga', 'TT' => 'Trinidad and Tobago', 'TN' => 'Tunisia', 'TR' => 'Turkey', 'TM' => 'Turkmenistan', 'TC' => 'Turks and Caicos Islands', 'TV' => 'Tuvalu', 'UM' => 'U.S. Minor Outlying Islands', 'PU' => 'U.S. Miscellaneous Pacific Islands', 'VI' => 'U.S. Virgin Islands', 'UG' => 'Uganda', 'UA' => 'Ukraine', 'SU' => 'Union of Soviet Socialist Republics', 'AE' => 'United Arab Emirates', 'GB' => 'United Kingdom', 'US' => 'United States', 'ZZ' => 'Unknown or Invalid Region', 'UY' => 'Uruguay', 'UZ' => 'Uzbekistan', 'VU' => 'Vanuatu', 'VA' => 'Vatican City', 'VE' => 'Venezuela', 'VN' => 'Vietnam', 'WK' => 'Wake Island', 'WF' => 'Wallis and Futuna', 'EH' => 'Western Sahara', 'YE' => 'Yemen', 'ZM' => 'Zambia', 'ZW' => 'Zimbabwe', 'AX' => 'Åland Islands'];
         if (!$selected && isset($name)) {
             $selected = old($name);
         }
         return app('form')->select($name, $countries, $selected, $options);
     });
     return app('html')->country_select();
 }
예제 #30
0
 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle()
 {
     $fields = $this->fieldList;
     if ($this->id) {
         $fields = $this->fieldsFromModel($this->id, $fields);
     }
     foreach ($fields as $fieldName => $fieldValue) {
         $fields[$fieldName] = old($fieldName, $fieldValue);
     }
     return $fields;
 }