Wenn ich in einen Artikel einen neuen Inhalt vom Typ "Bilder" einfüge, öffnet sich ein neues PopUp-Fenster mit den verfügbaren Dateien. Nach der Bildauswahl schließt sich das PopUp immer gleich wieder. Möchte ich mehrere Bilder auf einmal einfügen, muss ich jedes Bild einzeln hinzufügen. Ich möchte einen kleinen Patch schreiben und für den Quellcode zur Verfügung stellen, damit auch mehrere oder auch alle Bilder eines Ordners auf einmal eingefügt werden können (nützlich für Galerien).
Dafür brauche ich folgende Info: Wenn sich das PopUp öffnet, weiß es dann, ob der Inhaltstyp "Bilder" angeklickt wurde? Wenn ja, welche Variablen (und Werte) verraten das? Ansonsten müsste man für diesen Fall nämlich noch eine Variable per $_GET an das PopUp übergeben, um das unterscheiden zu können.
--
When I create new content for an existing article of the type "images" a new popup-window is opened showing all available files. After selecting an image the popup-window closes immediately. If I want to select more than one images, I have to open the popup each time and insert every image singly. For this reason I want to write a little patch and offer it for inclusion into the sourcecode. It shall that solve this problem and allow more than one image to select (useful for galleries).
But I need some more information: When the popup-window opens, does it know that the selected content-type was "images"? If yes, which variables (and vaues) reveal this info? Otherwise you would have to add another $_GET variable by opening the popup-window.
Bild einfügen / Insert image
prePatch
Diese drei Code-Schnipsel reichen aus, um den gewünschten Effekt zu erzielen. Allerdings soll der "ALLE" Button nur erscheinen, wenn auch mehrere Bilder eingefügt werden können. Deswegen brauche ich die oben gefragte Info.
--
These three code-snippets last out for the desired effect. But the "ALL"-button only shall be available if more than one image can be selected. This for I need the information asked above.
--
These three code-snippets last out for the desired effect. But the "ALL"-button only shall be available if more than one image can be selected. This for I need the information asked above.
Code: Select all
phpwcms Development release 1.2.3 [phpwcms_1.2.3-DEV.zip]
-- description --
Patch for adding all files of a folder. Useful for creating galleries.
-- installation/configuration --
Insert the following code in or after the given line.
-- code --
IN line 26 (empty):
$addAllFiles = "<div style=\"position:absolute; top:5px; left:279px;\"><a href=\"javascript:;\" onClick=\"";
IN line 255 (empty):
$addAllFiles .= $js;
AFTER line 284 (press enter, then insert):
<?php
$addAllFiles .= "\">ALLE <img src=\"img/button/add_9x9a.gif\" width=\"9\" height=\"9\" border=\"0\"></a></div>";
echo($addAllFiles);
?>
phpwcms_1.2.5-DEV
Hier derselbe Kram für die neue Version 1.2.5 und zukünftige Versionen. / Here the same stuff for the new version 1.2.5 and future versions:
Code: Select all
phpwcms Development release 1.2.5 [phpwcms_1.2.5-DEV.zip]
-- description --
Patch for adding all files of a folder. Useful for creating galleries.
-- installation/configuration --
File: filebrowser.php
Insert the following code in or after the given line.
-- code --
1.2.5-DEV: IN line 27 (empty):
Für die Zukunft / For the future: Such dir eine leere Zeile oder erstelle eine neue irgendwo am Anfang der Datei, z.B. nach den session-Funktionen und allen Includes, aber noch vor der ersten Aktion. / Choose an empty or make a new line somewhere at the beginning of the file, for example after the session-functions and all includes but before the first action.
$addAllFiles = "<div style=\"position:absolute; top:5px; left:279px;\"><a href=\"javascript:;\" onClick=\"";
1.2.5-DEV: IN line 257 (empty):
Für die Zukunft / For the future: In der Datei kommt eine switch-Funktion mit mehreren case-Anweisungen vor. In dieser switch-Funktion wird das JavaScript für jedes Thumbnail erstellt. Danach hängen wir das fertige JS einfach an unsere frisch erstellte Variable ran. / In the file appears a switch-function with several case-instructions. Inside this switch-function the JavaScript for each thumbnail is generated. After that we append the JS to our fresh defined variable.
$addAllFiles .= $js;
1.2.5-DEV: AFTER line 296 (press enter, then insert):
Für die Zukunft / For the future: Ziemlich am Ende wird der HTML-Code mit dem </html>-Tag geschlossen. Davor wird die letzte Tabelle geschlossen. Die beste Position für den neuen "ALLE"-Button wäre nach dem letzten HTML-Element aber noch vor dem </body> Tag. / Pretty at the end the HTML-code is closed by the </html> tag. Before it the last table is closed. The best position for the new "ALL"-button would be a place after the last HTML-element but before the closing </body>-tag.
<?php
$addAllFiles .= "\">ALLE <img src=\"img/button/add_9x9a.gif\" width=\"9\" height=\"9\" border=\"0\"></a></div>";
echo($addAllFiles);
?>
Hi droptix,
nice thing, usefull! I'll try it.
Thx
Cheers
nice thing, usefull! I'll try it.
Thx
Cheers
1.3 out, testing, testing...
Sponsoring 4 phpwcms Blog and Usermanagement
Sponsoring 4 phpwcms Blog and Usermanagement