protected function init() { parent::init(); // FIXME (CSH) Re-implement fallback / root panel submission / find a better solution ... // $this->form('POST', null, Io_Mimetype::APPLICATION_FORM_URLENCODED(), 'ISO-8859-15'); $this->form(); // $this->ajaxEnabled=false; $this->add(new Ui_Panel_Label('labela', null, 'Google.com.hk 使用下列语言: 中文(繁體) English')); $this->add(new Ui_Panel_Label('labelb', null, I18n_Script::Hans()->transformToLatn('Google.com.hk 使用下列语言: 中文(繁體) English'))); $this->add(new Ui_Panel_Label('labelc', null, I18n_Script::Hans()->transformToAscii('Google.com.hk 使用下列语言: 中文(繁體) English'))); $this->add(new Ui_Panel_Label('labeld', null, String::toLowercaseUrlIdentifier(I18n_Script::Hans()->transformToAscii('Google.com.hk 使用下列语言: 中文(繁體) English')))); $this->add(new Ui_Panel_Tabs('tabs')); $this->tabs->add(new Ui_Panel_Disclosure('disclosure', null, 'Disclosure')); $this->tabs->disclosure->add(new Ui_Panel_Datetime('date')); $this->tabs->add(new Ui_Panel_Editor_Text('text', null, 'Text')); $this->tabs->add(new Ui_Panel_Image('image', Io_Image::valueOf(__DIR__ . '/test.jpg'), 'Image')); $this->tabs->image->attribute('width', 64); $this->tabs->image->embedded = true; $this->tabs->add(new Ui_Panel_Upload_File('file', null, 'File')); $this->tabs->add(new Ui_Panel_Select('list', null, 'List', ['A', 'B', 'C'])); $this->tabs->add(new Ui_Panel_Editor_Html('html', null, 'HTML')); $button = new Ui_Panel_Button_Submit('submit', null, 'Submit'); $button->callback = [$this, 'onSubmit']; $this->add($button); }
/** * @return \Components\I18n_Script */ public function script() { if (null === $this->m_script) { $this->m_script = I18n_Script::valueOf($this->scriptName()); } return $this->m_script; }
/** * Transforms passed string to script of given instance. * * @param I18n_Script $script_ * @param string $string_ * * @return string * * @throws Exception_NotSupported If requested transformation is not * supported by this script. */ public function transformTo(I18n_Script $script_, $string_) { return $this->{'transformTo' . $script_->name()}($string_); }