public function _loginForm() { $card = html::card(); $card->add(html::cardHeader(lucid::$app->i18n()->translate('navigation:authentication.view.login'))); $card->add(html::cardBlock()); $card->lastChild()->add(html::form('authform', '#!authentication.controller.process')); $form = $card->lastChild()->lastChild(); $form->add(html::formGroup(lucid::$app->i18n()->translate('model:users:email'), html::input('email', 'email')->preAddon('@'))); $form->add(html::formGroup(lucid::$app->i18n()->translate('model:users:password'), html::input('password', 'password')->preAddon(html::icon('lock')))); $form->add(html::submit(lucid::$app->i18n()->translate('button:login'))->pull('right')); $this->ruleset('login')->send($form->name); return $card; }
public function setType($type) { parent::settype($type); if ($type == 'date') { $this->attributes['type'] = 'text'; $this->postAddon = html::icon('calendar'); # { format:'Y-m-d H:i'} if (is_null($this->id)) { $this->id = 'datetimepicker-' . uniqid(); } html::$config['hooks']['javascript']("window.jQuery('#" . $this->id . "').datetimepicker({format:'" . html::$config->get('formats')['datetime'] . "',showMeridian: true, todayBtn:true});"); } return $this; }
public function enableSearchFilter($fields, $filter_name = 'search') { $id = $this->id . '-filter-' . $filter_name; $value = $this->determineFilterValue($filter_name); $this->components['filter_search'] = html::input('text', $filter_name, $value)->id($id)->preAddon(\Lucid\html\html::icon('search'))->size('sm')->style('width:auto;')->onkeyup('lucid.html.dataTable.filter(this, true);'); $this->filters[$filter_name] = ['field' => $fields, 'operator' => 'like', 'value' => $value]; return $this; }
public function buildPager() { $pager = html::buttonGroup(); #->size('sm'); $pager->add(html::button(html::icon('fast-backward'), 'primary', 'lucid.html.dataTable.page(this,\'first\');')); $pager->add(html::button(html::icon('backward'), 'primary', 'lucid.html.dataTable.page(this,\'previous\');')); $pager->add(html::select(null, $this->currentPage, $this->buildPagerOptions(), "lucid.html.dataTable.page(this,this.options[this.selectedIndex].value);")); $pager->lastChild()->modifier('primary'); $pager->add(html::button(html::icon('forward'), 'primary', 'lucid.html.dataTable.page(this,\'next\');')); $pager->add(html::button(html::icon('fast-forward'), 'primary', 'lucid.html.dataTable.page(this,\'last\');')); return html::span()->addClass('data-table-pager')->add($pager); }