/**
  * Constructor
  *
  * @param	string  $caption	Caption
  * @param	string  $name	   "name" attribute
  * @param	string  $value	  Initial text
  * @param	int	 $rows	   Number of rows
  * @param	int	 $cols	   Number of columns
  * @param	string  $hiddentext Hidden Text
  */
 public function __construct($caption, $name, $value, $rows = 5, $cols = 50, $hiddentext = "xoopsHiddenText", $options = array())
 {
     parent::__construct($caption, $name, $value, $rows, $cols);
     $this->_hiddenText = $hiddentext;
     global $icmsConfig, $icmsModule;
     $groups = is_object(icms::$user) ? icms::$user->getGroups() : ICMS_GROUP_ANONYMOUS;
     $moduleid = is_object($icmsModule) && $name != 'com_text' ? $icmsModule->getVar('mid') : 1;
     if (isset($options['editor']) && $options['editor'] != '' && $options['editor'] != $icmsConfig['editor_default']) {
         $editor_default = $options['editor'];
     } else {
         $editor_default = $icmsConfig['editor_default'];
     }
     $gperm_handler = icms::handler('icms_member_groupperm');
     if (file_exists(ICMS_EDITOR_PATH . "/" . $editor_default . "/xoops_version.php") && $gperm_handler->checkRight('use_wysiwygeditor', $moduleid, $groups, 1, FALSE)) {
         include ICMS_EDITOR_PATH . "/" . $editor_default . "/xoops_version.php";
         $this->htmlEditor = array($editorversion['class'], ICMS_EDITOR_PATH . "/" . $editorversion['dirname'] . "/" . $editorversion['file']);
     }
     if (!empty($this->htmlEditor)) {
         $options['name'] = $this->_name;
         $options['value'] = $this->_value;
         list($class, $path) = $this->htmlEditor;
         include_once $path;
         if (class_exists($class)) {
             $this->htmlEditor = new $class($options);
         } else {
             $this->htmlEditor = FALSE;
         }
     }
 }
示例#2
0
 /**
  * Constructor
  *
  * @param	array   $configs  Editor Options
  * @param	binary 	$checkCompatible  true - return false on failure
  */
 public function __construct($configs, $checkCompatible = false)
 {
     $current_path = __FILE__;
     if (DIRECTORY_SEPARATOR != "/") {
         $current_path = str_replace(strpos($current_path, "\\\\", 2) ? "\\\\" : DIRECTORY_SEPARATOR, "/", $current_path);
     }
     $this->rootpath = substr(dirname($current_path), strlen(ICMS_ROOT_PATH));
     if (is_array($configs)) {
         $vars = array_keys(get_object_vars($this));
         foreach ($configs as $key => $val) {
             if (in_array("_" . $key, $vars)) {
                 $this->{"_" . $key} = $val;
             } elseif (in_array($key, array('name', 'value'))) {
                 $method = "set" . ucfirst($key);
                 $this->{$method}($val);
             } else {
                 $this->config[$key] = $val;
             }
         }
     }
     if ($checkCompatible && !$this->isCompatible()) {
         return false;
     }
     parent::__construct("", $this->getName(), $this->getValue());
     parent::setExtra("style='width: " . $this->_width . "; height: " . $this->_height . ";'");
 }
示例#3
0
 /**
  * Constructor
  * @param	object    $object   reference to targetobject (@link icms_ipf_Object)
  * @param	string    $key      the form name
  */
 public function __construct($object, $key)
 {
     global $icmsConfig;
     parent::__construct($object->vars[$key]['form_caption'], $key, $object->getVar($key, 'e'));
     $control = $object->getControl($key);
     $editor_handler = icms_plugins_EditorHandler::getInstance('source');
     $this->_editor =& $editor_handler->get($icmsConfig['sourceeditor_default'], array('name' => $key, 'value' => $object->getVar($key, 'e'), 'language' => isset($control['language']) ? $control['language'] : _LANGCODE, 'width' => isset($control['width']) ? $control['width'] : '100%', 'height' => isset($control['height']) ? $control['height'] : '400px', 'syntax' => isset($control['syntax']) ? $control['syntax'] : 'php'));
 }
 /**
  * Constructor
  *
  * @param	array   $configs  Editor Options
  * @param	binary 	$checkCompatible  true - return false on failure
  */
 function XoopsFormFckeditor($configs, $checkCompatible = false)
 {
     $current_path = __FILE__;
     if (DIRECTORY_SEPARATOR != "/") {
         $current_path = str_replace(strpos($current_path, "\\\\", 2) ? "\\\\" : DIRECTORY_SEPARATOR, "/", $current_path);
     }
     $this->rootpath = substr(dirname($current_path), strlen(ICMS_ROOT_PATH));
     if (is_array($configs)) {
         $vars = array_keys(get_object_vars($this));
         foreach ($configs as $key => $val) {
             if (in_array("_" . $key, $vars)) {
                 $this->{"_" . $key} = $val;
             } else {
                 $this->config[$key] = $val;
             }
         }
     }
     if ($checkCompatible && !$this->isCompatible()) {
         return false;
     }
     parent::__construct("", @$this->_name, @$this->_value);
     parent::setExtra("style='width: " . $this->_width . "; height: " . $this->_height . ";'");
 }
示例#5
0
 /**
  * Constuctor
  *
  * @param	string  $caption    caption
  * @param	string  $name       name
  * @param	string  $value      initial content
  * @param	int     $rows       number of rows
  * @param	int     $cols       number of columns
  */
 function XoopsFormTextArea($caption, $name, $value = "", $rows = 5, $cols = 50)
 {
     parent::__construct($caption, $name, $value, $rows, $cols);
     $this->_deprecated = icms_core_Debug::setDeprecated('icms_form_elements_Textarea', sprintf(_CORE_REMOVE_IN_VERSION, '1.4'));
 }
示例#6
0
 /**
  * Constructor
  *
  * @param	string  $caption    Caption
  * @param	string  $name       "name" attribute
  * @param	string  $value      Initial text
  * @param	array 	$configs     configures
  * @param	bool  	$noHtml       use non-WYSIWYG eitor onfailure
  * @param	string  $OnFailure editor to be used if current one failed
  */
 function icms_form_elements_Editor($caption, $name, $editor_configs = null, $noHtml = false, $OnFailure = "")
 {
     parent::__construct($caption, $editor_configs["name"]);
     $editor_handler = icms_plugins_EditorHandler::getInstance();
     $this->editor =& $editor_handler->get($name, $editor_configs, $noHtml, $OnFailure);
 }