/** * 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()); }