Ejemplo n.º 1
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 . ";'");
 }
Ejemplo n.º 2
0
 /**
  * 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 . ";'");
 }