Beispiel #1
0
 public function sidePanelAttachments($filesDir)
 {
     $I = new HTMLInput("TBAttachments", "file");
     $I->onchange(OnEvent::rme($this, "processAttachmentUpload", array("'{$filesDir}'", "fileName"), " " . OnEvent::reloadSidePanel("tinyMCE")));
     echo "<div style=\"padding:5px;height:50px;\">" . $I . "</div></div>";
     if (!file_exists(FileStorage::getFilesDir() . "{$filesDir}")) {
         mkdir(FileStorage::getFilesDir() . "{$filesDir}");
     }
     $T = new HTMLTable(2, "Bilder");
     $dir = new DirectoryIterator(FileStorage::getFilesDir() . "{$filesDir}");
     foreach ($dir as $file) {
         if ($file->isDot()) {
             continue;
         }
         if ($file->isDir()) {
             continue;
         }
         $BI = new Button("Datei löschen", "./images/i2/insert.png", "icon");
         $BD = new Button("Datei löschen", "./images/i2/delete.gif", "icon");
         $BD->style("float:right;margin-left:5px;");
         $BD->rmePCR("tinyMCE", "", "deleteAttachment", array("'{$filesDir}'", "'" . $file->getFilename() . "'"), OnEvent::reloadSidePanel("tinyMCE"));
         $T->addRow(array($BI, "{$BD}<small style=\"color:grey;float:right;margin-top:4px;\">" . Util::formatByte($file->getSize()) . " </small>" . (strlen($file->getFilename()) > 15 ? substr($file->getFilename(), 0, 15) . "..." : $file->getFilename())));
         $T->addRowStyle("cursor:pointer;");
         $T->addRowEvent("click", "contentManager.tinyMCEAddImage('" . DBImageGUI::imageLink("tinyMCEGUI", $filesDir, $file->getFilename(), true) . "');");
     }
     echo $T;
 }
Beispiel #2
0
 public function sidePanelPool($dir, $copyTo)
 {
     $I = new HTMLInput("filesPool", "file");
     $I->onchange(OnEvent::rme($this, "processPoolUpload", array("'{$dir}'", "fileName"), " " . OnEvent::reloadSidePanel("mFile")));
     echo "<div style=\"padding:5px;height:50px;\">" . $I . "</div></div>";
     if (!file_exists(FileStorage::getFilesDir() . "{$dir}")) {
         return;
     }
     $T = new HTMLTable(1, "Pool");
     $Idir = new DirectoryIterator(FileStorage::getFilesDir() . "{$dir}");
     foreach ($Idir as $file) {
         if ($file->isDot()) {
             continue;
         }
         if ($file->isDir()) {
             continue;
         }
         $BD = new Button("Datei löschen", "./images/i2/delete.gif", "icon");
         $BD->style("float:right;margin-left:5px;");
         $BD->rmePCR("mFile", -1, "deletePoolFile", array("'{$dir}'", "'" . $file->getFilename() . "'"), OnEvent::reloadSidePanel("mFile"));
         $BU = new Button("Datei verwenden", "./images/i2/insert.png", "icon");
         $BU->style("float:left;margin-right:5px;");
         $BU->rmePCR("mFile", -1, "copyFile", array("'{$dir}'", "'{$copyTo}'", "'" . $file->getFilename() . "'"), OnEvent::reloadPopup("mFile"));
         $T->addRow(array("{$BU}{$BD}<small style=\"color:grey;float:right;margin-top:4px;\">" . Util::formatByte($file->getSize()) . " </small>" . (strlen($file->getFilename()) > 15 ? substr($file->getFilename(), 0, 15) . "..." : $file->getFilename())));
     }
     echo $T;
 }