Пример #1
0
 /**
  * Standard constructor
  * @param string Name of the widget
  * @param string Label of the widget
  * @param string type of the input TEXT|TEXTAREA
  * @param boolean can this field not be left empty?
  */
 function WZText($name, $label, $type = "TEXT", $mandatory = false)
 {
     WZO::WZO($name);
     $this->type = strtoupper($type);
     $this->label = $label;
     $this->mandatory = $mandatory;
 }
Пример #2
0
 /**
  * Standard constructor
  * @param string Label of the widget
  * @param string Link to a certain page
  */
 function WZLabel($label, $linkto = "")
 {
     global $c;
     WZO::WZO("label");
     $this->label = $label;
     if ($linkto != "") {
         $this->label = '<a style="text-decoration:underline;" href="' . $c["docroot"] . $linkto . '">' . $this->label . '</a>';
     }
 }
 /**
  * Standard constructor
  * @param string Name of the widget
  * @param string Label of the widget
  * @param string type of the input TEXT|TEXTAREA
  * @param boolean can this field not be left empty?
  */
 function WZUploadArchive($name)
 {
     global $c, $errors, $lang, $_FILES;
     WZO::WZO($name);
     if ($_FILES[$this->name]['name'] != "") {
         if (stristr(strtoupper($_FILES[$this->name]['type']), "ZIP") === false) {
             $this->errortext = "<br/>" . $lang->get("no_archive", "The file you uploaded is not an zip-archive or your browser does not send the file correct!");
             $errors .= "-NOZIP";
             $this->css = "error";
         } else {
             $this->value = "";
             mt_srand((double) microtime() * 1000000);
             $tmpfilename = md5(uniqid(mt_rand())) . ".zip";
             move_uploaded_file($_FILES[$this->name]['tmp_name'], $c["path"] . "cache/" . $tmpfilename);
             $tmpFolder = $c['path'] . "cache/" . md5(uniqid(mt_rand()));
             mkdir($tmpFolder);
             nxunzip($c["path"] . "cache/" . $tmpfilename, $tmpFolder . "/");
             $_SESSION["archivefolder"] = $tmpFolder;
             @unlink($c['path'] . "cache/" . $tmpfilename);
         }
     }
 }
Пример #4
0
 /**
  * Standard constructor
  * @param string Name of the widget
  * @param string Label of the widget
  * @param string type of the input TEXT|TEXTAREA
  * @param boolean can this field not be left empty?
  */
 function WZUpload($name)
 {
     global $c, $errors, $lang;
     WZO::WZO($name);
     if ($_FILES[$this->name]['name'] != "") {
         if (strtoupper($_FILES[$this->name]['type']) != "TEXT/XML" && strtoupper($_FILES[$this->name]['type']) != "TEXT/PLAIN" && strtoupper($_FILES[$this->name]['type']) != "APPLICATION/OCTET-STREAM") {
             $this->errortext = "<br/>" . $lang->get("no_xml", "The file you uploaded is not XML or your browser does not send the file correct!");
             $errors .= "-NOXML";
             $this->css = "error";
         } else {
             $this->value = "";
             mt_srand((double) microtime() * 1000000);
             $tmpfilename = md5(uniqid(mt_rand())) . ".xml";
             move_uploaded_file($_FILES[$this->name]['tmp_name'], $c["path"] . "cache/" . $tmpfilename);
             $fp = @fopen($c["path"] . "cache/" . $tmpfilename, "r");
             while (!feof($fp)) {
                 $this->value .= fgets($fp, 128);
             }
             @fclose($fp);
             @unlink($c["path"] . "cache/" . $tmpfilename);
             $_SESSION[$this->name] = $this->value;
         }
     }
 }
Пример #5
0
 /**
  * Standard constructor
  * @param string Name of the widget
  * @param mixed NameValue-Array
  */
 function WZRadio($name, $nameValueArray)
 {
     WZO::WZO($name);
     $this->nameValueArray = $nameValueArray;
 }
Пример #6
0
 /**
  * Standard constructor
  * @param string Name of the widget
  * @param mixed NameValue-Array
  */
 function WZSelect($name, $label, $nameValueArray)
 {
     WZO::WZO($name);
     $this->label = $label;
     $this->nameValueArray = $nameValueArray;
 }
 /**
  * Standard constructor
  * @param string Name of the widget
  * @param mixed NameValue-Array
  * @param integer Width of the Inputbox in pixel
  * @param integer Colspan of the widget.
  */
 function WZSelectCluster($name, $width = 300, $columns = 1)
 {
     WZO::WZO($name);
     $this->ifo = new IFrameObject($this->name, $this->value, "ifclselector.php", "standard", $width, 250, $columns);
 }
Пример #8
0
 /**
  * Standard constructor
  * @param string Name of the widget
  * @param mixed NameValue-Array
  */
 function WZCheckbox($name, $nameValueArray)
 {
     WZO::WZO($name);
     $this->nameValueArray = $nameValueArray;
 }