Created
July 3, 2012 10:53
-
-
Save jdlx/3039059 to your computer and use it in GitHub Desktop.
Verbesserte Action zum Erweitern von REX_VALUES (von Redaxo Forums-user "Frezl")
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// wirkt bei "Block speichern" und "Block übernehmen", bevor in die DB gespeichert wird. | |
// rexname serialisieren und in REX_VALUE[20] schreiben: | |
$REX_ACTION['VALUE'][20] = urlencode (serialize (rex_request ("rexname", "array"))); | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// wirkt bei nach "Block übernehmen", bevor das Slice wieder angezeigt wird. | |
$REX_ACTION['VALUE'][20] = $rexname; | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$rexname = unserialize (urldecode ("REX_VALUE[20]")); | |
?> | |
<label for="input_aepfel">Äpfel:</label><input type="text" name="rexname[aepfel]" value="<?php echo $rexname['aepfel']; ?>" id="input_aepfel" /><br /> | |
<label for="input_birnen">Birnen:</label><input type="text" name="rexname[birnen]" value="<?php echo $rexname['birnen']; ?>" id="input_birnen"/><br /> | |
<input type="checkbox" name="rexname[leben]" value="<?php echo $row['type_id']; ?>" id="checkbox_leben" <?php if (isset ($rexname["leben"])) { echo "checked=\"checked\""; } ?>/> | |
<label for="checkbox_leben">Das Leben ist schön!</label> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$rexname = unserialize (urldecode ("REX_VALUE[20]")); | |
?> | |
Äpfel: <?php echo $rexname['aepfel']; ?><br /> | |
Birnen: <?php echo $rexname['birnen']; ?><br /> | |
<?php | |
if (isset ($rexname['leben'])) { | |
echo "Das Leben ist schön!"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bei mir gab's immer mal ein paar Probleme.
Zum einen werden Anführungszeichen innerhalb von TinyMCE-Blöcken (bspw. im IMG-Tag) mit Escape-Zeichen gespeichert, das habe ich behoben, indem die action_PRESAVE_Add-Edit.php bei mir so aussieht:
Zum anderen verschwanden die Werte, wenn man lediglich BLOCK ÜBERNEHMEN statt BLOCK SPEICHERN geklickt hat - hab's nun so gelöst, dass die action_PREVIEW_Add-Edit.php nun so aussieht: