public function createComponentPhotoForm($name) { $form = new LiveForm($this, $name); $form->getElementPrototype()->class = 'ajax_uploader'; $form->addFile('photo', 'Photo')->getControlPrototype()->class('multi'); $form->addText('name', 'Name')->addRule(Form::FILLED, 'Please enter a album name'); $form->addTextArea('description', 'Description'); $form->addButton('btnClose', 'Close'); $form->addSubmit('btnSubmit', 'OK')->onClick[] = callback($this, 'PhotoFormSubmitted'); $form->addHidden('album_id')->setValue($this->getParam('albumId')); return $form; }
public function createComponentFormModuleInstaller($name) { $form = new LiveForm($this, $name); $form->addFile('file', 'Select file')->addCondition(Form::FILLED, 'Please select a file'); $form->addButton('btnClose', 'Close'); $form->addSubmit('btnSubmit', 'Install')->onClick[] = array($this, 'formModuleInstallerSubmitted'); return $form; }