Example #1
0
    /**
     * init
     */
    public function init()
    {
        $this->setPageTitle('COA Setup');
        $this->term = $this->getPage()->getTerm();
        $this->setup = \coa\Db\CoaSetup::getMapper()->findByCourseId($this->term->courseId);
        if (!$this->setup) {
            $this->setup = new \coa\Db\CoaSetup();
            $this->setup->courseId = $this->term->courseId;
        }
        $ff = \Form\Factory::getInstance();
        $this->form = $ff->createForm('settings', $this->setup);
        $this->form->attach(new Save('update', 'fa fa-arrow-left'))->setRedirectUrl($this->getBackUrl());
        $this->form->attach(new Save('save', 'fa fa-refresh'))->setRedirectUrl($this->getUri());
        $this->form->attach($ff->createEventLink('cancel'))->setRedirectUrl($this->getBackUrl());
        $this->form->addField($ff->createFieldText('pdfTopMargin'))->setLabel('Top Content padding');
        if (!$this->setup->pdfBgImage) {
            $this->form->addField($ff->createFieldFile('pdfBgImage'))->setLabel('Certificate Background')->setNotes('Set the background image of the Certificate. (Recommended Size: 1343x929)');
        } else {
            $delUrl = htmlentities($this->getUri()->set('delBgImage')->toString());
            $html = <<<HTML
<p>
<a href="{$this->setup->getPdfBgImageUrl()->toString()}" target="_blank"><img style="width: 100px;" src="{$this->setup->getPdfBgImageUrl()->toString()}" /></a>
<br/>
<a href="{$delUrl}">Delete</a>
</p>
HTML;
            $this->form->addField($ff->createFieldRenderer('bgImage', $html))->setLabel('Certificate Background')->setNotes('Set the background image of the Certificate. (Recommended Size: 1343x929)');
        }
        $this->form->addField($ff->createFieldTextarea('pdfContent'))->setLabel('Certificate HTML')->setNotes('Available variables: {name}, {dateFrom}, {dateTo}, {date}, {year}, {totalUnits}, {totalPlaces}, {cpd}');
        $this->form->addField($ff->createFieldText('emailSubject'))->setLabel('Email Subject');
        $this->form->addField($ff->createFieldTextarea('emailContent'))->addCssClass('mce-full')->setNotes('Available variables: {name}, {dateFrom}, {dateTo}, {date}, {year}, {email}, {totalUnits}, {totalPlaces}, {cpd}');
        $this->addChild($ff->createFormRenderer($this->form), $this->form->getId());
    }
Example #2
0
 /**
  * init
  */
 public function init()
 {
     $this->term = $this->getPage()->getTerm();
     $this->setup = \coa\Db\CoaSetup::getMapper()->findByCourseId($this->term->courseId);
     // Create Tk_Table structure
     $ff = \Form\Factory::getInstance();
     $tf = \Table\Factory::getInstance();
     $this->table = $tf->createTable('CompanyManager');
     //$this->table->addCell($tf->createCellCheckbox());
     $this->table->addCell($tf->createCellString('name'))->setKey();
     $this->table->addCell($tf->createCellString('status'));
     $this->table->addCell($tf->createCellEmail('email'));
     $this->table->addCell($tf->createCellString('country'));
     $this->table->addCell($tf->createCellString('totalUnits'));
     $this->table->addCell($tf->createCellString('totalPlaces'));
     $this->table->addAction($tf->createActionCsv());
     $this->table->addFilter($ff->createFieldText('keywords')->setPlaceholder('Keywords'))->setLabel('');
     $now = \Tk\Date::create();
     $this->table->addFilter($ff->createFieldDate('dateFrom')->setPlaceholder('Date From')->setValue(\Tk\Date::create($now->getYear() . '-01-01')->floor()));
     $this->table->addFilter($ff->createFieldDate('dateTo')->setPlaceholder('Date To')->setValue(\Tk\Date::create($now->getYear() . '-12-31')->ceil()));
     $list = \Ext\Db\PlacementType::getMapper()->findByTermId($this->term->id);
     $this->table->addFilter($ff->createFieldSelectMulti('placementTypeId', $list))->addStyle('width', '200px');
     $list = \Ext\Db\Term::getMapper()->findByCourseId($this->term->courseId);
     $this->table->addFilter($ff->createFieldSelect('termId', $list)->prependOption('-- All Terms --', ''))->addStyle('width', '200px');
     $this->addChild($tf->createTableRenderer($this->table), 'Table');
 }
Example #3
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());
 }
Example #4
0
 /**
  * init
  */
 public function init()
 {
     $ff = \Form\Factory::getInstance();
     $this->form = $ff->createForm('Contact');
     $this->form->attach(new Send('send'), 'send')->setRedirectUrl(\Tk\Url::create('/contactUs.html'));
     $this->form->attach($ff->createEventLink('cancel'), 'cancel')->setRedirectUrl(\Tk\Url::create('/index.html'));
     $this->form->addField($ff->createFieldText('name'))->setRequired();
     $this->form->addField($ff->createFieldText('email'))->setRequired();
     $this->form->addField($ff->createFieldTextarea('comments'))->setRequired();
     $this->form->addField($ff->createFieldCaptcha('valid'))->setRequired();
     $this->addChild($ff->createFormRenderer($this->form), $this->form->getId());
 }
Example #5
0
 /**
  * init
  */
 public function init()
 {
     $fac = $this->getConfig()->getPluginFactory();
     $this->plugin = $fac->getPlugin($this->getNamespace());
     $arr = $this->plugin->getDataArray()->exportFormArray();
     $backUrl = \Tk\Url::createHomeUrl('/plugin/manager.html');
     $ff = \Form\Factory::getInstance();
     $this->form = $ff->createForm('Config', $arr);
     $this->form->attach(new Save('update'))->setRedirectUrl($backUrl);
     $this->form->attach($ff->createEventLink('cancel'), 'cancel')->setRedirectUrl($backUrl);
     $courseList = \Ext\Db\Course::findAll(\Tk\Db\Tool::create('`name`'));
     $this->form->addField($ff->createFieldDualSelect('coa-course-enable', $courseList))->setLabel('Enable Courses')->setRequired();
     $this->addChild($ff->createFormRenderer($this->form), $this->form->getId());
 }
Example #6
0
 /**
  * init
  */
 public function init()
 {
     $this->tool = $this->getConfig()->getLtiToolProvider();
     // Create Table structure
     $ff = \Form\Factory::getInstance();
     $tf = \Table\Factory::getInstance();
     $this->table = $tf->createTable('Manager');
     $this->table->addCell(Checkbox::create());
     $this->table->addCell(NameCell::create('name'))->setKey()->setUrl(\Tk\Url::createHomeUrl('/consumer/edit.html'));
     $this->table->addCell(KeyCell::create('key'));
     $this->table->addCell($tf->createCellString('secret'));
     //$this->table->addCell($tf->createCellString('consumer_version'))->setLabel('Version');
     $this->table->addCell($tf->createCellBoolean('enabled'));
     $this->table->addCell($tf->createCellBoolean('protected'));
     $this->table->addCell(DateCell::create('updated'));
     $this->table->addCell(DateCell::create('created'));
     $this->table->addAction(DeleteAction::create());
     $this->addChild($tf->createTableRenderer($this->table), 'Manager');
 }
Example #7
0
 /**
  * init
  */
 public function init()
 {
     $ff = \Form\Factory::getInstance();
     $this->form = $ff->createForm('Edit', $this->consumer);
     $this->form->attach(new Save('save', 'fa fa-refresh'))->setRedirectUrl($this->getBackUrl());
     $this->form->attach($ff->createEventLink('cancel'))->setRedirectUrl($this->getBackUrl());
     //$this->form->attach(new EditEvent());
     $this->form->addField($ff->createFieldText('name'))->setRequired();
     $cc = $this->form->addField($ff->createFieldText('key'))->setRequired();
     //        if ($this->consumer->getKey()) {
     //            $cc->setEnabled(false);
     //        }
     $this->form->addField($ff->createFieldText('secret'))->setRequired();
     $this->form->addField($ff->createFieldText('css_path'));
     $this->form->addField($ff->createFieldCheckbox('enabled'));
     //$this->form->addField($ff->createFieldDate('enabledFrom'));
     //$this->form->addField($ff->createFieldDate('enabledTo'));
     //$this->form->addField($ff->createFieldCheckbox('protected'));
     $this->addChild($ff->createFormRenderer($this->form), $this->form->getId());
 }