/** * Process datatables ajax request. * * @return \Illuminate\Http\JsonResponse */ public function search() { $auth_account = $this->auth_user->account; //return all accounts when we are in the system account //in a normal account only show the current linked one if ($auth_account->isSystemAccount()) { $accounts = Account::all(); } else { // retrieve the account as a collection $accounts = Account::where('id', '=', $auth_account->id)->get(); } return Datatables::of($accounts)->addColumn('actions', function ($account) { $actions = \Form::open(['route' => ['admin.accounts.destroy', $account->id], 'method' => 'DELETE', 'class' => 'form-inline']); $actions .= ' <a href="accounts/' . $account->id . '" class="btn btn-xs btn-primary"><span class="glyphicon glyphicon-eye-open"></span> ' . trans('misc.button.show') . '</a> '; $actions .= ' <a href="accounts/' . $account->id . '/edit" class="btn btn-xs btn-primary"><span class="glyphicon glyphicon-edit"></span> ' . trans('misc.button.edit') . '</a> '; if ($account->disabled) { $actions .= ' <a href="accounts/' . $account->id . '/enable' . '" class="btn btn-xs btn-success"><span class="glyphicon glyphicon-ok-circle"></span> ' . trans('misc.button.enable') . '</a> '; } else { $actions .= ' <a href="accounts/' . $account->id . '/disable' . '" class="btn btn-xs btn-warning"><span class="glyphicon glyphicon-ban-circle"></span> ' . trans('misc.button.disable') . '</a> '; } $actions .= \Form::button('<i class="glyphicon glyphicon-remove"></i> ' . trans('misc.button.delete'), ['type' => 'submit', 'class' => 'btn btn-danger btn-xs']); $actions .= \Form::close(); return $actions; })->make(true); }
function do_private_post($content, $results) { global $config, $speak; $results = Mecha::O($results); $results = $config->is->post ? Get::postHeader($results->path, POST . DS . $config->page_type, '/', $config->page_type . ':') : false; if ($results === false) { return $speak->plugin_private_post->description; } $s = isset($results->fields->pass) ? $results->fields->pass : ""; if (strpos($s, ':') !== false) { $s = explode(':', $s, 2); if (isset($s[1])) { $speak->plugin_private_post->hint = ltrim($s[1]); } // override password hint $s = $s[0]; } $hash = md5($s . PRIVATE_POST_SALT); $html = Notify::read(false) . '<div class="overlay--' . File::B(__DIR__) . '"></div><form class="form--' . File::B(__DIR__) . '" action="' . $config->url . '/' . File::B(__DIR__) . '/do:access" method="post">' . NL; $html .= TAB . Form::hidden('token', Guardian::token()) . NL; $html .= TAB . Form::hidden('_', $hash) . NL; $html .= TAB . Form::hidden('kick', $config->url_current) . NL; $html .= TAB . '<p>' . $speak->plugin_private_post->hint . '</p>' . NL; $html .= TAB . '<p>' . Form::text('access', "", $speak->password . '…', array('autocomplete' => 'off')) . ' ' . Form::button($speak->submit, null, 'submit') . '</p>' . NL; $html .= '</form>' . O_END; if ($results && isset($results->fields->pass) && trim($results->fields->pass) !== "") { if (!Guardian::happy() && Session::get('is_allow_post_access') !== $hash) { return $html; } } return $content; }
/** * Render view. * * @return string */ public function content() { ob_start(); echo Form::open(); ?> <fieldset> <?php echo Form::control_group(Form::input('name', $this->tag->name, array('class' => 'input-xxlarge', 'maxlength' => 32)), array('name' => __('Name')), Arr::get($this->errors, 'name')); ?> <?php echo Form::control_group(Form::input('description', $this->tag->description, array('class' => 'input-xxlarge')), array('description' => __('Short description')), Arr::get($this->errors, 'description')); ?> </fieldset> <fieldset class="form-actions"> <?php echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-success btn-large')); ?> <?php echo HTML::anchor(Request::back(Route::url('tags'), true), __('Cancel'), array('class' => 'cancel')); ?> </fieldset> <?php echo Form::close(); return ob_get_clean(); }
function delete_form($request, $routeParams, $id, $modal, $url, $label = "Delete", $class = "btn btn-danger") { $form = Form::model($request, ['method' => 'DELETE', 'id' => 'formDelete', 'action' => [$routeParams, $id]]); $form .= Form::button('<i class="fa fa-trash fa-lg"></i> بلی', ['type' => 'submit', 'data-target' => "#{$modal}", 'data-url' => "{$url}", 'class' => "{$class} delete ", 'id' => 'btnDelete', 'data-id' => $id]); $form .= Form::close(); return $form; }
/** * Creates a button form input. * * @param string $name input name * @param string $body input value * @param array $attributes html attributes * * @param string $label * @param string|array $error * @param string|array $tip * @return string */ public static function button_wrap($name, $body, array $attributes = null, $label = null, $error = null, $tip = null) { $body = is_array($body) ? Arr::get($body, $name) : $body; $attributes = (array) $attributes + array('id' => self::input_id($name, 'button-')); $input = Form::button($name, $body, $attributes); return Form::wrap($input, $name, $label, $error, $tip); }
/** * Render view. * * @return string */ public function content() { ob_start(); if (self::$_request_type == Controller::REQUEST_AJAX) { $cancel_attributes = array('class' => 'ajaxify'); } else { $cancel_attributes = null; } echo Form::open($this->action, array('enctype' => 'multipart/form-data')); ?> <fieldset> <?php echo Form::file('file'); ?> </fieldset> <fieldset> <?php echo Form::csrf(); ?> <?php echo Form::button('save', '<i class="icon-upload icon-white"></i> ' . __('Upload'), array('type' => 'submit', 'class' => 'btn btn-primary btn-small')); ?> <?php echo $this->cancel ? HTML::anchor($this->cancel, __('Cancel'), $cancel_attributes) : ''; ?> </fieldset> <?php echo Form::close(); return ob_get_clean(); }
/** * Render view. * * @return string */ public function content() { ob_start(); $tags = $this->group->tags(); if (empty($tags)) { ?> <div class="empty"> <?php echo __('No tags yet.'); ?> </div> <?php } else { ?> <ul> <?php foreach ($tags as $tag) { ?> <li><?php echo HTML::anchor(Route::model($tag), $tag->name); ?> </li> <?php } ?> </ul> <?php } echo Form::open(); ?> <fieldset> <?php echo Form::control_group(Form::input('name', $this->group->name, array('class' => 'input-xxlarge', 'maxlength' => 32)), array('name' => __('Name')), Arr::get($this->errors, 'name')); ?> <?php echo Form::control_group(Form::input('description', $this->group->description, array('class' => 'input-xxlarge')), array('description' => __('Short description')), Arr::get($this->errors, 'description')); ?> </fieldset> <fieldset class="form-actions"> <?php echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-success btn-large')); ?> <?php echo HTML::anchor(Request::back(Route::url('tags'), true), __('Cancel'), array('class' => 'cancel')); ?> </fieldset> <?php echo Form::close(); return ob_get_clean(); }
/** * Render view. * * @return string */ public function content() { ob_start(); echo Form::open(); ?> <fieldset> <?php echo Form::control_group(Form::input('name', $this->blog_entry->name, array('class' => 'input-xxlarge')), array('name' => __('Title')), Arr::get($this->errors, 'name')); ?> <?php echo Form::control_group(Form::textarea_editor('content', $this->blog_entry->content, array('class' => 'input-xxlarge'), true), array('content' => __('Content')), Arr::get($this->errors, 'content')); ?> </fieldset> <fieldset class="form-actions"> <?php echo Form::csrf(); ?> <?php echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-success btn-large')); ?> <?php echo $this->cancel ? HTML::anchor($this->cancel, __('Cancel'), array('class' => 'cancel')) : ''; ?> </fieldset> <?php echo Form::close(); return ob_get_clean(); }
/** * Render view. * * @return string */ public function content() { ob_start(); echo $this->message; echo Form::open(); echo Form::input_wrap('email', $this->email, array('type' => 'email', 'required', 'class' => 'input-lg', 'placeholder' => __('Username or email')), __('Send a new password to'), null, __('We will send you a "new" password generated from the hash of your current, forgotten password.') . '<br><em>' . __('Please change your password after signing in!') . '</em>'); echo Form::button(null, '<i class="fa fa-envelope"></i> ' . __('Send'), array('class' => 'btn btn-primary')); echo Form::close(); ?> <hr /> <blockquote cite="http://dilbert.com/strips/comic/1996-09-05/"> <dl class="dl-horizontal"> <dt>Asok:</dt> <dd>I have forgotten my password. I humbly beg for assistance.</dd> <dt>Dogbert:</dt> <dd>I have no time for boring administrative tasks, you fool! I'm too busy upgrading the network.</dd> <dt>Asok:</dt> <dd>You could have given me a new password in the time it took to belittle me.</dd> <dt>Dogbert:</dt> <dd>Yeah, but which option would give me job satisfaction?</dd> </dl> <small class="pull-right"><a href="http://dilbert.com/strips/comic/1996-09-05/">Dilbert</a></small> </blockquote> <?php return ob_get_clean(); }
/** * Render view. * * @return string */ public function content() { ob_start(); echo Form::open(); ?> <fieldset> <?php echo Form::input_wrap('name', $this->blog_entry->name, array('class' => 'input-lg', 'placeholder' => __('Title')), null, Arr::get($this->errors, 'name')); ?> <?php echo Form::textarea_wrap('content', $this->blog_entry->content, array('class' => 'input-lg', 'placeholder' => __('Content')), true, null, Arr::get($this->errors, 'content'), null, true); ?> </fieldset> <fieldset> <?php echo Form::csrf(); ?> <?php echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-primary btn-lg')); ?> <?php echo $this->cancel ? HTML::anchor($this->cancel, __('Cancel'), array('class' => 'cancel')) : ''; ?> </fieldset> <?php echo Form::close(); return ob_get_clean(); }
public function process($only_fields = FALSE) { $this->_fields_required['id'] = $this->_pos_data['id']; if (empty($this->_fields['URL'])) { $this->_fields['URL'] = url::site($this->action_return()); } foreach ($this->_fields_required as $field) { if (empty($field)) { return FALSE; } } $fields = array_merge($this->_fields_required, $this->_fields); $form = ''; if (!$only_fields) { $form .= Form::open(self::PAYMENT_URL, array('method' => 'post', 'name' => 'dotpay')); } foreach ($fields as $key => $value) { if (!empty($value)) { $form .= Form::hidden($key, $value); } } if (!$only_fields) { $form .= Form::button('platnosci', __("Przejdź do Dotpay.pl"), array('type' => 'submit')); $form .= Form::close(); $form .= '<script type="text/javascript">document.dotpay.submit();</script>'; } return $form; }
/** * Render view. * * @return string */ public function content() { ob_start(); $gallery = $this->image->gallery(); echo Form::open(Route::url('gallery_image', array('gallery_id' => Route::model_id($gallery), 'id' => $this->image->id, 'action' => 'report')), array('class' => Request::current()->is_ajax() ? 'ajaxify' : '')); ?> <fieldset> <?php echo Form::control_group(Form::input('reason', null, array('class' => 'input-block-level')), array('name' => __('Reason')), null, __('You can enter an optional reason for reporting this image, e.g. why it should be removed')); ?> </fieldset> <fieldset class="form-actions"> <?php echo Form::button('save', __('Report'), array('type' => 'submit', 'class' => 'btn btn-danger btn-large')); ?> <?php echo Request::current()->is_ajax() ? '' : HTML::anchor(Route::url('gallery_image', array('gallery_id' => Route::model_id($gallery), 'id' => $this->image->id, 'action' => '')), __('Cancel'), array('class' => 'cancel')); ?> <?php echo Form::csrf(); ?> </fieldset> <?php return ob_get_clean(); }
public static function displayForm($value, &$settings, $model) { $settings = static::settings($settings); if (!is_array($value)) { $value = array(); } // Search input or $searchInput = \Form::input($settings['mapping']['fieldName'] . '[search]', null, array('class' => 'input input-xxlarge search-input', 'placeholder' => \Lang::get('admin.common.map_search_placeholder'))); $searchButton = \Form::button('mapsearch', \Lang::get('admin.verbs.search'), array('class' => 'btn btn-primary')); $searchInput = html_tag('div', array('class' => 'form form-inline search-form'), $searchInput . $searchButton); // Hidden inputs $latInput = \Form::hidden($settings['mapping']['fieldName'] . '[lat]', \Arr::get($value, 'lat'), array('class' => 'lat')); $lngInput = \Form::hidden($settings['mapping']['fieldName'] . '[lng]', \Arr::get($value, 'lng'), array('class' => 'lng')); $zoomInput = \Form::hidden($settings['mapping']['fieldName'] . '[zoom]', \Arr::get($value, 'zoom'), array('class' => 'zoom')); // Other elements $required = isset($settings['required']) ? $settings['required'] : false; $label_text = $settings['title'] . ($required ? ' *' : ''); $label = \Form::label($label_text); $mapDiv = html_tag('div', array('class' => 'map', 'id' => \Inflector::friendly_title($settings['mapping']['fieldName'], '-', true) . '-bing-map'), ' '); // Check that we have an API key if (empty($settings['api_key'])) { $content = $label . '<div class="well"><p>' . \Lang::get('admin.bing.api_key_not_set') . '</p></div>'; } else { $content = $label . $searchInput . $latInput . $lngInput . $zoomInput . $mapDiv; } $content = html_tag('div', array('class' => 'controls control-group field-type-bing-map', 'data-field-name' => $settings['mapping']['fieldName']), $content); return array('content' => $content, 'js_data' => $settings); }
public function process($only_fields = FALSE) { if (empty($this->_fields_required['pos_id']) && empty($this->_fields_required['pos_auth_key'])) { $this->_set_active_pos(); } foreach ($this->_fields_required as $field) { if (empty($field)) { return FALSE; } } $this->_fields['ts'] = time(); $fields = array_merge($this->_fields_required, $this->_fields); $data = array('pos_id' => $fields['pos_id'], 'pay_type' => $fields['pay_type'], 'session_id' => $fields['session_id'], 'pos_auth_key' => $fields['pos_auth_key'], 'amount' => $fields['amount'], 'desc' => $fields['desc'], 'desc2' => $fields['desc2'], 'order_id' => $fields['order_id'], 'first_name' => $fields['first_name'], 'last_name' => $fields['last_name'], 'payback_login' => $fields['payback_login'], 'street' => $fields['street'], 'street_hn' => $fields['street_hn'], 'street_an' => $fields['street_an'], 'city' => $fields['city'], 'post_code' => $fields['post_code'], 'country' => $fields['country'], 'email' => $fields['email'], 'phone' => $fields['phone'], 'language' => $fields['language'], 'client_ip' => $fields['client_ip'], 'ts' => $fields['ts'], 'key' => $this->_pos_data['key']); $fields['sig'] = $this->_get_sig($data); unset($fields['key']); if (!$only_fields) { $form = Form::open(self::PAYMENT_URL . $this->_codepage . '/' . self::PAYMENT_NEW, array('method' => 'post', 'name' => 'platnoscipl')); } foreach ($fields as $key => $value) { if (!empty($value)) { $form .= Form::hidden($key, $value); } } if (!$only_fields) { $form .= Form::button('platnosci', __("Przejdź do Płatności.pl"), array('type' => 'submit')); $form .= Form::close(); $form .= '<script type="text/javascript">document.platnoscipl.submit();</script>'; } return $form; }
function recurse_pages($pages, $spaces = 0, $layoutsBlocks = [], $pageWidgets = [], $pagesWidgets = []) { $data = ''; foreach ($pages as $page) { // Блок $currentBlock = array_get($pageWidgets, $page['id'] . '.0'); $currentPosition = array_get($pageWidgets, $page['id'] . '.1'); $data .= '<tr data-id="' . $page['id'] . '" data-parent-id="' . $page['parent_id'] . '">'; $data .= '<td>'; if (!empty($page['childs'])) { $data .= '<div class="input-group">'; } $data .= Form::select('blocks[' . $page['id'] . '][block]', [], $currentBlock, ['class' => 'widget-blocks form-control', 'data-layout' => $page['layout_file'], 'data-value' => $currentBlock]); if (!empty($page['childs'])) { $data .= "<div class=\"input-group-btn\">" . Form::button(NULL, ['data-icon' => 'level-down', 'class' => 'set_to_inner_pages btn btn-warning', 'title' => trans('widgets::core.button.select_childs')]) . '</div></div>'; } $data .= '</td><td>'; $data .= Form::text('blocks[' . $page['id'] . '][position]', (int) $currentPosition, ['maxlength' => 4, 'size' => 4, 'class' => 'form-control text-right widget-position']); $data .= '</td><td></td>'; if (acl_check('page::edit')) { $data .= '<th>' . str_repeat("- ", $spaces) . link_to_route('backend.page.edit', $page['title'], [$page['id']]) . '</th>'; } else { $data .= '<th>' . str_repeat("- ", $spaces) . $page['title'] . '</th>'; } $data .= '</tr>'; if (!empty($page['childs'])) { $data .= recurse_pages($page['childs'], $spaces + 5, $layoutsBlocks, $pageWidgets, $pagesWidgets); } } return $data; }
/** * Renders the Searchbox object to a string. * * @return string */ public function render() { $elements[] = '<div ' . Html::attributes($this->get_option('attributes')) . '>'; $elements[] = Form::input($this->_name . '_searchbox_string', $this->_search_string, $this->get_option('search_field_attributes')); $elements[] = Form::button($this->_name . '_searchbox_string', $this->get_option('search_button_label', __('Search')), $this->get_option('search_button_attributes')); $elements[] = '<div ' . Html::attributes($this->get_option('result_box_attributes')) . '>'; $elements[] = '</div>'; return "\n" . implode("\n", $elements) . "\n"; }
protected function request() { $f = new Form(); $f->start($_POST); $f->radio('dest', 'Screen', 'screen'); $f->hspace(2); $f->radio('dest', 'PDF', 'pdf', false); $f->button('action_report', 'Report'); $f->end(); }
/** * [delete_form_x description] * @param [type] $route [description] * @param [type] $parameters [description] * @param array $btnOptions [description] * @param array $frmOptions [description] * @return [type] [description] */ function delete_form_x($route, $parameters = null, $btnOptions = [], $frmOptions = []) { $btnDefaults = ['d_class' => 'btn', 'class' => 'btn-link', 'type' => 'submit', 'name' => 'deleteBtn', 'label' => "<i class='text-danger fa fa-remove'></i>", 'style' => '']; $btnOptions = array_merge($btnDefaults, $btnOptions); $frmDefaults = ['class' => '', 'name' => 'delete_form', 'name' => 'deleteBtn', 'method' => 'DELETE', 'display' => 'inline-block']; $frmOptions = array_merge($frmDefaults, $frmOptions); $form = Form::open(['route' => [$route, $parameter], 'method' => $frmOptions['method'], 'form_name' => $frmOptions['form_name'], 'id' => $frmOptions['form_name'], 'style' => $frmOptions['style'] . '; display: ' . $frmOptions['display']], $parameters); $form .= Form::button($btnOptions['label'], ['class' => $btnOptions['d_class'] . ' ' . $btnOptions['class'], 'type' => $btnOptions['type'], 'id' => $btnOptions['name'], 'name' => $btnOptions['name'], 'style' => $btnOptions['style']]); return $form .= Form::close(); }
public static function submit($name, $value, $confirm = NULL, $postAttributes = array()) { if (!isset($postAttributes['class'])) { $postAttributes['class'] = ''; } $attributes['class'] = $postAttributes['class'] . ' btn SaveButton'; $attributes['style'] = 'float: none;'; if ($confirm) { $attributes['class'] .= ' btn-delete'; } return Form::button($name, $value, $attributes); }
protected function request() { $f = new Form(); $f->start($_POST); $f->radio('dest', 'Screen', 'screen'); $f->hspace(2); $f->radio('dest', 'PDF', 'pdf', false); $f->hspace(2); $f->radio('dest', 'CSV', 'csv', false); $f->text('year', 'Year:', 30, 'YYYY'); $f->button('action_report', 'Report', false); $f->end(); }
/** * add a nested form with the option to delete passed model * * @param [string] $route Route name * @param string $parameter Route parameter * @param array $options the set of options to update current options * @return form the form to be presente in the form */ function delete_button($route, $parameter = null, $options = []) { $settings = ['class' => 'btn btn-link', 'type' => 'submit', 'name' => 'deleteBtn', 'label' => "<i class='text-danger fa fa-remove'></i>", 'method' => 'DELETE', 'form_name' => 'delete_form', 'form_display' => 'inline-block', 'style' => '']; if (trim($settings['class']) == 'btn btn-link') { $settings['style'] = 'padding: 0px'; } else { $settings['label'] = "Delete"; } $options = array_merge($settings, $options); $form = Form::open(['route' => [$route, $parameter], 'method' => $options['method'], 'form_name' => $options['form_name'], 'id' => $options['form_name'], 'style' => 'display: ' . $options['form_display']], $parameter); $form .= Form::button($options['label'], ['class' => $options['class'], 'type' => $options['type'], 'id' => $options['name'], 'name' => $options['name'], 'style' => $options['style']]); return $form .= Form::close(); }
/** * Get form. * * @return string */ public static function form() { ob_start(); echo HTML::anchor(Route::url('oauth', array('action' => 'login', 'provider' => 'facebook')), ' <i class="fa fa-facebook"></i> ' . __('Connect with Facebook') . ' ', array('class' => 'btn btn-block btn-facebook', 'title' => __('Sign in with your Facebook account'))); echo '<hr>'; echo Form::open(Route::url('sign', array('action' => 'in'))); echo Form::input_wrap('username', null, array('autofocus'), __('Username or email')); echo Form::password_wrap('password', null, null, __('Password') . ' ' . HTML::anchor(Route::url('sign', array('action' => 'password')), __('Forgot?'), array('class' => 'text-muted'))); echo Form::form_group(Form::checkbox_wrap('remember', 'true', true, null, __('Stay logged in'))); echo Form::button(null, __('Login'), array('class' => 'btn btn-block btn-primary', 'title' => __('Remember to sign out if on a public computer!'))); echo Form::close(); return ob_get_clean(); }
/** * Build * * Builds a button for the grid * container and returns it as * either a view or html * * @access public * @return string|View */ public function build() { // We need a label and an action at the very least if (!$this->has_label() or !$this->has_action() and !$this->has_onclick()) { throw new Exception('You must provide at least a label and an action (or substitute an onclick for an action) when adding a button to the grid'); } // If we haven't been given // something to do onclick, // default to the action uri // given if (!$this->has_onclick()) { $this->set_onclick('window.location.href=\'' . \Uri::create($this->get_action()) . '\'')->uns_action(); } // Return a form button return \Form::button(null, $this->get_label(), $this->get_data()); }
public function index(Request $request) { if ($request->ajax()) { $patient = Patient::select(['id', 'name', 'mobile', 'date_of_birth', 'image'])->get(); return Datatables::of($patient)->addColumn('Image', function ($item) { return '<img src="' . $item->image . ' " alt="Smiley face" height="42" width="42">'; })->addColumn('Operations', function ($item) { $form = \Form::open(['method' => 'DELETE', 'url' => 'patient/' . $item->id, 'class' => 'table-form-inline', 'data-bb' => 'confirm']); $form .= \Form::hidden('id', $item->id); $form .= \Form::button('<i class="glyphicon glyphicon-trash"></i> Delete', ['class' => 'btn btn-danger btn-xs', 'type' => 'submit']); $form .= \Form::close(); $form .= ' ' . link_to('patient/' . $item->id . '/edit', $title = "Edit", $attributes = ['class' => 'btn btn-primary btn-xs glyphicon glyphicon-edit'], $secure = null); return $form; })->removeColumn('id')->removeColumn('image')->make(); } return view('patient.list'); }
/** * Render view. * * @return string */ public function content() { ob_start(); echo Form::open(); ?> <fieldset> <legend><?php echo __('Almost there!'); ?> </legend> <?php echo Form::control_group(Form::input('username', $this->user->userame, array('class' => 'input-small', 'placeholder' => __('JohnDoe'))), array('username' => __('Username')), Arr::get($this->errors, 'username'), __('Choose a unique username with at least <var>:length</var> characters. No special characters, thank you.', array(':length' => Kohana::$config->load('visitor.username.length_min')))); ?> <?php echo Form::control_group(Form::password('password'), array('password' => __('Password')), Arr::get($this->errors, 'password')); ?> <?php echo Form::control_group(Form::password('password_confirm'), array('password_confirm' => __('Confirm')), Arr::get($this->errors, 'password_confirm'), __('Try to use letters, numbers and special characters for a stronger password, with at least <var>8</var> characters.')); ?> <?php echo Form::control_group(Form::input('email', $this->user->email, array('disabled' => 'disabled', 'class' => 'input-xxlarge', 'placeholder' => __('*****@*****.**'))), array('email' => __('Email')), Arr::get($this->errors, 'email'), __('Please remember: sign up is available only with a valid, invited email.')); ?> </fieldset> <fieldset> <?php echo Form::hidden('code', $this->code); ?> <?php echo Form::button('register', __('Sign up!'), array('type' => 'submit', 'class' => 'btn btn-primary btn-large')); ?> <?php echo HTML::anchor(Request::back('/', true), __('Cancel'), array('class' => 'cancel')); ?> </fieldset> <?php echo Form::close(); return ob_get_clean(); }
private function generate_form($formDefLocal) { $formLocal = "<form id='RegisterForm' method='post' action='/user/register'><h3>{$this->template->subTitle} (Fields labeled <span class='req'>*</span> are required.)</h3>"; foreach ($formDefLocal as $idx => $group) { $formLocal .= "<fieldset><legend>{$group["title"]} </legend>"; foreach ($group["fields"] as $field => $attributes) { if ($attributes["req"] == 1) { $reqLabel = "<span class='req'>*</span>"; } else { $reqLabel = ""; } $formLocal .= "<label for='{$field}'>{$attributes["title"]} {$reqLabel}: </label>"; switch ($attributes["type"]) { case "text": case "password": case "file": $formLocal .= "<input type='{$attributes["type"]}' name='{$field}' id='{$field}'/>"; break; case "textarea": $formLocal .= "<textarea name='{$field}' id='{$field}'></textarea>"; break; case "select": $formLocal .= "<select name='{$field}' id='{$field}'>"; foreach ($attributes["options"] as $key => $val) { $formLocal .= "<option value='{$key}'>{$val}</option>"; } $formLocal .= "</select>"; break; case "checkbox": $formLocal .= "<div class='optContainer'>"; foreach ($attributes["options"] as $key => $val) { $formLocal .= "<input type='checkbox' name='{$field}[] id='{$field}_{$key}'/>{$val}<br/>"; } $formLocal .= "</div>"; break; } $formLocal .= "<div class='info'>{$attributes["info"]}</div>"; } $formLocal .= "</fieldset>"; } $formLocal .= "<label> </label>" . Form::button('save', 'Register Profile', array('type' => 'submit')) . "</form>"; return $formLocal; }
/** * Render view. * * @return string */ public function content() { ob_start(); echo Form::open(); ?> <div class="row"> <fieldset class="col-sm-6"> <?php echo Form::input_wrap('name', $this->name, null, __('Name'), Arr::get($this->errors, 'name')); ?> <?php echo Form::input_wrap('email', $this->email, array('type' => 'email'), __('Email'), Arr::get($this->errors, 'email')); ?> <?php echo Form::input_wrap('subject', $this->subject, null, __('Subject'), Arr::get($this->errors, 'subject')); ?> <?php echo Form::textarea_wrap('content', $this->content, null, true, __('Content'), Arr::get($this->errors, 'content')); ?> </fieldset> </div> <fieldset> <?php echo Form::csrf(); ?> <?php echo Form::button('save', __('Send'), array('type' => 'submit', 'class' => 'btn btn-primary btn-lg')); ?> </fieldset> <?php echo Form::close(); return ob_get_clean(); }
/** * Render view. * * @return string */ public function content() { ob_start(); echo Form::open(); ?> <fieldset> <?php echo Form::input_wrap('name', $this->group->name, null, __('Name'), Arr::get($this->errors, 'name')); ?> <?php echo Form::input_wrap('description', $this->group->description, null, __('Description'), Arr::get($this->errors, 'description')); ?> <?php echo Form::input_wrap('sort', $this->group->sort, null, __('Sort'), Arr::get($this->errors, 'sort')); ?> </fieldset> <fieldset> <?php echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-success btn-large')); ?> <?php echo HTML::anchor(Request::back(Route::url('forum'), true), __('Cancel'), array('class' => 'cancel')); ?> <?php echo Form::csrf(); ?> </fieldset> <?php echo Form::close(); return ob_get_clean(); }
/** * Top buttons * @param array $links * @return string */ public function show_top_buttons(array $links = []) { Assets::instance()->add_inlineJS("\n\t\t \$('#nestable-menu').on('click', function(e) {\n\t\t var target = \$(e.target),\n\t\t action = target.data('action');\n\t\t if (action === 'expand-all') {\n\t\t \$('.dd').nestable('expandAll');\n\t\t }\n\t\t if (action === 'collapse-all') {\n\t\t \$('.dd').nestable('collapseAll');\n\t\t }\n\t\t });\n\t\t"); $class = 'btn btn-default btn-sm'; $html = PHP_EOL; foreach ($links as $url => $title) { $action = explode('/', $url); switch (end($action)) { case 'list': $html .= HTML::anchor($url, '<i class="fa fa-chevron-left"></i> ' . $title, ['class' => $class]) . PHP_EOL; break; case 'add': $html .= HTML::anchor($url, '<i class="fa fa-plus"></i> ' . $title, ['class' => $class]) . PHP_EOL; break; } } if ($this->_max_nested > 1) { $html .= Form::button('collapse', '<i class="fa fa-plus-square-o"></i> ' . __('settings.collapse_all'), ['class' => $class, 'data-action' => 'collapse-all']) . PHP_EOL; $html .= Form::button('expand', '<i class="fa fa-minus-square-o"></i> ' . __('settings.expand_all'), ['class' => $class, 'data-action' => 'expand-all']) . PHP_EOL; } return '<div id="nestable-menu" class="btn-group">' . $html . '</div>'; }
/** * Process datatables ajax request. * * @return \Illuminate\Http\JsonResponse */ public function search() { $account = $this->auth_user->account; //return all brands when we are in the system account //in a normal account only show the current linked one if ($account->isSystemAccount()) { $brands = Brand::all(); } else { // retrieve it as a collection $brands = Brand::where('id', '=', $account->brand->id)->get(); } return Datatables::of($brands)->addColumn('actions', function ($brand) { $actions = \Form::open(['route' => ['admin.brands.destroy', $brand->id], 'method' => 'DELETE', 'class' => 'form-inline']); $actions .= ' <a href="brands/' . $brand->id . '" class="btn btn-xs btn-primary"><i class="glyphicon glyphicon-eye-open"></i> ' . trans('misc.button.show') . '</a> '; $actions .= ' <a href="brands/' . $brand->id . '/edit" class="btn btn-xs btn-primary"><i class="glyphicon glyphicon-edit"></i> ' . trans('misc.button.edit') . '</a> '; $actions .= \Form::button('<i class="glyphicon glyphicon-remove"></i> ' . trans('misc.button.delete'), ['type' => 'submit', 'class' => 'btn btn-danger btn-xs']); $actions .= \Form::close(); return $actions; })->addColumn('logo', function ($brand) { $logo = '<img src="/admin/logo/' . $brand->id . '" height="40px"/>'; return $logo; })->make(true); }