Exemplo n.º 1
0
 public static function adviceAboveList()
 {
     $bps = BPS::getAllProperties("FileManagerGUI");
     #
     $bps["path"] = str_replace('\\', "/", preg_replace("/^([A-Z]):/", "\\1%", $bps["path"]));
     #print_r($bps);
     $mF = new mFileGUI();
     return $mF->getUploadForm($bps["path"], BPS::getProperty("FileManagerGUI", "reloadFunction", "contentManager.reloadFrame('contentLeft');"), false, "width:100%;");
 }
Exemplo n.º 2
0
 public function getPopupManager($rootDir = null, $class = null, $classID = null, $usePool = false, $fieldDefaultFile = "", $uploadTargetFilename = null)
 {
     if ($rootDir != null) {
         $T = new HTMLTable(1);
         #$rel = "$rootDir";
         $root = FileStorage::getFilesDir() . $rootDir;
         $_SESSION["BPS"]->setProperty("mFileGUI", "path", $root);
         $_SESSION["BPS"]->setProperty("mFileGUI", "root", $root);
         $F = new File($root);
         $F->loadMe();
         if ($F->getA() == null) {
             if (is_writable(FileStorage::getFilesDir())) {
                 mkdir($root, 0777, true);
             } else {
                 $B = new Button("", "stop");
                 $B->type("icon");
                 $B->style("float:left;margin-right:10px;");
                 $T->addRow($B . "Das Verzeichnis <code>{$rootDir}</code> existiert nicht und kann nicht automatisch angelegt werden, da keine Schreibberechtigung für <code>specifics</code> vorliegt.");
                 die($T);
             }
         }
     }
     $bps = $this->getMyBPSData();
     if (strpos($bps["path"], $bps["root"]) === false) {
         $bps["path"] = $bps["root"];
     }
     if ($bps != -1 and isset($bps["path"])) {
         $this->setDir($bps["path"]);
     }
     $this->hideDirs(true);
     $gui = new HTMLGUIX();
     $gui->object($this);
     $cols = array();
     if ($fieldDefaultFile != "") {
         $C = new $class($classID);
         self::$fieldDefaultFile = array($C, $C->A($fieldDefaultFile), $fieldDefaultFile);
         $cols[] = "isDefault";
         $gui->colWidth("isDefault", 20);
         $gui->parser("isDefault", "mFileGUI::parserDefault");
     }
     $cols[] = "FileName";
     $gui->attributes($cols);
     $gui->parser("FileName", "mFileGUI::nameParser2");
     $gui->options(true, false, false);
     $gui->name("Datei");
     $gui->addToEvent("onDelete", OnEvent::reloadPopup("mFile"));
     $oldFiles = "";
     if ($class != null and $classID != null) {
         $AC = anyC::get("Datei", "DateiClassID", $classID);
         $AC->addAssocV3("DateiClass", "=", $class);
         $oldFiles = new HTMLTable(2, "Verknüpfte Dateien");
         while ($F = $AC->getNextEntry()) {
             $BDL = new Button("Datei herunterladen", "./plugins/Files/download.png", "icon");
             $BDL->onclick("windowWithRme('File','" . $F->A("DateiPath") . "','download','');");
             $BDL->style("float:right;");
             $oldFiles->addRow(array($BDL . $F->A("DateiName")));
         }
     }
     $BPool = new Button("Pool\nanzeigen", "./lightCRM/Mail/images/attach.png");
     $BPool->style("float:right;margin:10px;");
     $BPool->onclick(OnEvent::popupSidePanel("mFile", -1, "sidePanelPool", array("'{$class}Pool'", "'{$rootDir}'")));
     if ($usePool and $rootDir) {
         echo $BPool . "<div style=\"clear:both;\"></div>";
         if (file_exists(FileStorage::getFilesDir() . "{$class}Pool")) {
             echo OnEvent::script("window.setTimeout(function(){ if(\$j('#editDetailsmFileSidePanel').length > 0) return; " . OnEvent::popupSidePanel("mFile", -1, "sidePanelPool", array("'{$class}Pool'", "'{$rootDir}'")) . "}, 100);");
         }
     }
     $F = new HTMLForm("fileUpload", array("datei"));
     $s = array("path" => $bps["path"], "class" => "File");
     if ($uploadTargetFilename != null) {
         $s["targetFilename"] = $uploadTargetFilename;
     }
     $F->setType("datei", "file", null, $s);
     $F->addJSEvent("datei", "onChange", OnEvent::reloadPopup("mFile"));
     $F->getTable()->setColWidth(1, 120);
     echo "<p class=\"prettyTitle\">/" . basename($bps["path"]) . "</p><p style=\"color:grey;margin-top:-15px;margin-bottom:10px;\"><small>" . dirname(realpath($bps["path"])) . "</small></p>" . $F . $gui->getBrowserHTML(-1) . $oldFiles;
 }
Exemplo n.º 3
0
 public function addFile($id)
 {
     mFileGUI::addFile("Todo", $this->ID, $id);
     echo "message:EventMessages.M004";
 }