1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17:
18:
19: 20: 21:
22: class XlanguageTinymceForm extends Xoops\Form\SimpleForm
23: {
24: 25: 26: 27: 28:
29: public function __construct($xlanguage)
30: {
31: $xoops = Xoops::getInstance();
32:
33: parent::__construct('', 'xlanguage_form', $xoops->getEnv('PHP_SELF'), 'post', true, 'horizontal');
34:
35: $lang_tray = new Xoops\Form\Select(_XLANGUAGE_TINYMCE_SUBTITLE, 'select_language');
36: $lang_tray->addOption('', _XLANGUAGE_TINYMCE_SELECT);
37: foreach ($xlanguage as $k => $v) {
38: $lang_tray->addOption($v['xlanguage_code'], $v['xlanguage_description']);
39: }
40: $this->addElement($lang_tray, true);
41:
42: $text_tray = new Xoops\Form\TextArea('', 'text_language', '', 7, 7);
43: $text_tray->setExtra('onkeyup="Xoops_xlanguageDialog.onkeyupMLC(this);"');
44: $this->addElement($text_tray);
45:
46: $this->addElement(new Xoops\Form\Raw('<div id="text_language_msg"><script type="text/javascript">Xoops_xlanguageDialog.onkeyupMLC(this);</script></div>'));
47:
48: 49: 50:
51: $buttonTray = new Xoops\Form\ElementTray('', '');
52:
53: $buttonSubmit = new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'insert');
54: $buttonSubmit->setExtra('onclick="Xoops_xlanguageDialog.insertMLC();return false;"');
55: $buttonSubmit->setClass('btn btn-success');
56: $buttonTray->addElement($buttonSubmit);
57:
58: $buttonClose = new Xoops\Form\Button('', 'button', XoopsLocale::A_CLOSE, 'button');
59: $buttonClose->setExtra('onclick="tinyMCEPopup.close();"');
60: $buttonClose->setClass('btn btn-danger');
61: $buttonTray->addElement($buttonClose);
62:
63: $this->addElement($buttonTray);
64: }
65: }
66: