XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
formselecteditor.php
Go to the documentation of this file.
1 <?php
21 defined('XOOPS_ROOT_PATH') or die('Restricted access');
22 
24 
28 class XoopsFormSelectEditor extends XoopsFormElementTray
29 {
30  var $allowed_editors = array();
31  var $form;
32  var $value;
33  var $name;
34  var $nohtml;
35 
44  function XoopsFormSelectEditor(&$form, $name = 'editor', $value = null, $nohtml = false, $allowed_editors = array())
45  {
46  $this->XoopsFormElementTray(_SELECT);
47  $this->allowed_editors = $allowed_editors;
48  $this->form = &$form;
49  $this->name = $name;
50  $this->value = $value;
51  $this->nohtml = $nohtml;
52  }
53 
59  function render()
60  {
61  xoops_load('XoopsEditorHandler');
62  $editor_handler = XoopsEditorHandler::getInstance();
63  $editor_handler->allowed_editors = $this->allowed_editors;
64  $option_select = new XoopsFormSelect("", $this->name, $this->value);
65  $extra = 'onchange="if(this.options[this.selectedIndex].value.length > 0 ){
66  window.document.forms.' . $this->form->getName() . '.submit();
67  }"';
68  $option_select->setExtra($extra);
69  $option_select->addOptionArray($editor_handler->getList($this->nohtml));
70  $this->addElement($option_select);
71  return parent::render();
72  }
73 }
74 
75 ?>