示例#1
0
 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;
 }
示例#2
0
文件: input.php 项目: dev-lucid/html
 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;
 }
示例#3
0
 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;
 }
示例#4
0
 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);
 }