Example #1
0
 function init()
 {
     parent::init();
     //$this->addClass('span3');
     $this->addClass('float-right stacked span4');
     $this->template->trySet('fieldset', 'atk-row');
     $this->template->tryDel('button_row');
     $this->search_field = $this->addField('line', 'q', '')->setNoSave();
     $this->search_field->addButton('')->setHtml(' ')->setIcon('search')->js('click', $this->js()->submit());
 }
Example #2
0
 /**
  * Initialization
  *
  * @return void
  */
 function init()
 {
     parent::init();
     // template fixes
     $this->addClass('atk-form atk-form-stacked atk-form-compact atk-move-right');
     $this->template->trySet('fieldset', 'atk-row');
     $this->template->tryDel('button_row');
     $this->addClass('atk-col-3');
     // add field
     $this->search_field = $this->addField('Line', 'q', '')->setAttr('placeholder', 'Search')->setNoSave();
     // cancel button
     if ($this->show_cancel && $this->recall($this->search_field->short_name)) {
         $this->add('View', null, 'cancel_button')->setClass('atk-cell')->add('HtmlElement')->setElement('A')->setAttr('href', 'javascript:void(0)')->setClass('atk-button')->setHtml('<span class="icon-cancel atk-swatch-red"></span>')->js('click', array($this->search_field->js()->val(null), $this->js()->submit()));
     }
     // search button
     $this->add('HtmlElement', null, 'form_buttons')->setElement('A')->setAttr('href', 'javascript:void(0)')->setClass('atk-button')->setHtml('<span class="icon-search"></span>')->js('click', $this->js()->submit());
 }
Example #3
0
 function init()
 {
     parent::init();
     $this->js(true)->_load('ui.atk4_form')->atk4_form();
     //on field change we should change a name of a button also: 'clear' in the name will clear fields
     /*
       $ff->js('focus',array(
       $x->js()->show(),
       $s->js()->hide()
       ));
       $ff->js('blur',array(
       $x->js()->hide(),
       $s->js()->show()
       ));
     */
     //$this->addSubmit('Go');
 }
Example #4
0
 /**
  * Initialization
  * 
  * @return void
  */
 function init()
 {
     parent::init();
     // template fixes
     $this->addClass('float-right span4 atk-quicksearch');
     $this->template->trySet('fieldset', 'atk-row');
     $this->template->tryDel('button_row');
     // add field
     $this->search_field = $this->addField('Line', 'q', '')->setNoSave();
     // add buttonset
     $this->bset = $this->bset_position == 'after' ? $this->search_field->afterField() : $this->search_field->beforeField();
     $this->bset = $this->bset->add($this->bset_class);
     // cancel button
     if ($this->show_cancel && $this->recall($this->search_field->short_name)) {
         $this->bset->addButton('', array('options' => array('text' => false)))->setHtml('&nbsp;')->setIcon($this->cancel_icon)->js('click', array($this->search_field->js()->val(null), $this->js()->submit()));
     }
     // search button
     $this->bset->addButton('', array('options' => array('text' => false)))->setHtml('&nbsp;')->setIcon($this->submit_icon)->js('click', $this->js()->submit());
 }
Example #5
0
    $eventsManager = new EventsManager();
    // Listen for events produced in the dispatcher using the Security plugin
    $eventsManager->attach('dispatch:beforeExecuteRoute', new SecurityPlugin());
    // Handle exceptions and not-found exceptions using NotFoundPlugin
    // $eventsManager->attach('dispatch:beforeException', new NotFoundPlugin);
    $dispatcher = new Dispatcher();
    // Assign the events manager to the dispatcher
    $dispatcher->setEventsManager($eventsManager);
    file_put_contents('e3.txt', 'f', FILE_APPEND);
    return $dispatcher;
});
$di->set('voltService', function ($view, $di) {
    $volt = new Volt($view, $di);
    $compiler = $volt->getCompiler();
    $filter = new Filter($compiler);
    $filter->init();
    $compiler->setOptions(array("compiledPath" => "./view/compiled-files/", "compiledExtension" => ".php", "compileAlways" => true));
    return $volt;
});
// Registering the view component
$di->set('view', function () {
    $view = new View();
    $view->setViewsDir(__DIR__ . '/view');
    $view->registerEngines(array(".phtml" => 'voltService'));
    return $view;
});
$di['tag'] = function () {
    return new AbTag();
};
$di->set('db', function () {
    $config = ApplicationConfig::getMySQLConnection();