Exemple #1
0
 /**
  * init
  */
 public function init()
 {
     $ff = \Form\Factory::getInstance();
     $arr = $this->getConfig()->exportFormArray();
     $this->form = $ff->createForm('Settings', $arr);
     $se = new SettingsSaveEvent('update', 'icon-arrow-left icon-white');
     $this->form->attach($se->setRedirectUrl(\Tk\Url::createHomeUrl('/index.html')), 'update');
     $se = new SettingsSaveEvent('save');
     $this->form->attach($se->setRedirectUrl(\Tk\Request::getInstance()->getRequestUri()), 'save');
     $this->form->attach($ff->createEventLink('cancel'), 'cancel')->setRedirectUrl(\Tk\Url::createHomeUrl('/index.html'));
     // Site
     $this->form->addField($ff->createFieldText('system-site-title'))->setTabGroup('Site')->setRequired()->setLabel('Site Title');
     $this->form->addField($ff->createFieldText('system-site-email'))->setTabGroup('Site')->setLabel('Site Email')->setRequired()->setNotes('This email is used for site notifications like user sign-up, contact forms, etc.');
     $this->form->addField($ff->createFieldText('system-site-email-support'))->setTabGroup('Site')->setLabel('Support Email')->setRequired()->setNotes('This email is used for any site support forms or errors that are generated.');
     $this->form->addField($ff->createFieldText('system-site-email-dev'))->setTabGroup('Site')->setLabel('Developer Email')->setRequired()->setNotes('This email is used for any site error emails and notifications to developers.');
     $this->form->addField($ff->createFieldText('system-google-apikey'))->setTabGroup('Site')->setRequired()->setLabel('Google API Key');
     $this->form->addField($ff->createFieldTimezoneSelect('system-timezone'))->setTabGroup('Site')->setRequired()->prependOption('-- Select --', '')->setLabel('Timezone');
     $this->form->addField($ff->createFieldText('system-site-proxy'))->setTabGroup('Site')->setLabel('Site Proxy')->setNotes('Only set this if you require a proxy to access the outside network.');
     $this->form->addField($ff->createFieldCheckbox('system-enableSsl'))->setTabGroup('Site')->setLabel('Enable SSL')->setNotes('Only check this option if you have a valid SSL cert installed.');
     // Maintenance
     $this->form->addField($ff->createFieldCheckbox('system-maintenance-enable'))->setTabGroup('Maintenance')->setLabel('Enable')->setNotes('If enabled, the site is disabled with only the access given to those below.');
     $this->form->addField($ff->createFieldTextarea('system-maintenance-message'))->addStyle('width', '600px')->addStyle('height', '100px')->setTabGroup('Maintenance')->setLabel('Message')->setNotes('Enter the message (HTML) that will be displayed when in maintenance mode.');
     $this->form->addField($ff->createFieldText('system-maintenance-access-ip'))->setTabGroup('Maintenance')->setLabel('IP Access')->setNotes('Enter a comma separated list of allowable IP addresses in maintenance mode');
     $list = array(array('Admin', \Tk\Auth\Auth::P_ADMIN), array('User', \Tk\Auth\Auth::P_USER));
     $this->form->addField($ff->createFieldCheckbox('system-maintenance-access-permission', $list))->setTabGroup('Maintenance')->setLabel('Permission Access')->setNotes('Select user permissions allowed to access the site in maintenance mode');
     $this->addChild($ff->createFormRenderer($this->form), $this->form->getId());
 }
Exemple #2
0
 /**
  * Create a delete action
  *
  * @return \Table\Action\Delete
  */
 static function create()
 {
     $obj = new self('delete', \Tk\Request::getInstance()->getRequestUri(), 'fa fa-times');
     $obj->setLabel('Delete Selected');
     return $obj;
 }