]> git.mjollnir.org Git - s9y.git/commitdiff
Fix wrong URL button
authorgarvinhicking <garvinhicking>
Fri, 27 Jan 2006 14:40:21 +0000 (14:40 +0000)
committergarvinhicking <garvinhicking>
Fri, 27 Jan 2006 14:40:21 +0000 (14:40 +0000)
Allow templatechoose to remember template in a cookie

include/functions_entries_admin.inc.php
plugins/serendipity_event_templatechooser/serendipity_event_templatechooser.php

index 94bb2a239af8bf0fa88abc94221c08242b2435e5..382bdbbe23501cc27f820fea96fbd2b29d665293 100644 (file)
@@ -311,7 +311,7 @@ function serendipity_printEntryForm($targetURL, $hiddens = array(), $entry = arr
                         document.write('<input type="button" class="serendipityPrettyButton" name="insQ" value="<?php echo QUOTE ?>" accesskey="q" style="font-style: italic" onclick="wrapSelection(document.forms[\'serendipityEntry\'][\'serendipity[body]\'],\'<blockquote>\',\'</blockquote>\')" />');\r
                         document.write('<input type="button" class="serendipityPrettyButton" name="insJ" value="img" accesskey="j" onclick="wrapInsImage(document.forms[\'serendipityEntry\'][\'serendipity[body]\'])" />');\r
                         document.write('<input type="button" class="serendipityPrettyButton" name="insImage" value="<?php echo MEDIA; ?>" style="" onclick="window.open(\'serendipity_admin_image_selector.php?serendipity[textarea]=body\', \'ImageSel\', \'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1\');" />');\r
-                        document.write('<input type="button" class="serendipityPrettyButton" name="insU" value="URL" accesskey="l" style="color: blue; text-decoration: underline;" onclick="wrapSelectionWithLink(document.forms[\'serendipityEntry\'][\'serendipity[body]\'])" />');\r
+                        document.write('<input type="button" class="serendipityPrettyButton" name="insURL" value="URL" accesskey="l" onclick="wrapSelectionWithLink(document.forms[\'serendipityEntry\'][\'serendipity[body]\'])" />');\r
                   </script>\r
 <?php\r
         /* Do the "old" non-WYSIWYG editor */\r
@@ -380,7 +380,7 @@ if (!$serendipity['wysiwyg']) {
                         <input type="button" class="serendipityPrettyButton" name="insQ" value="<?php echo QUOTE ?>" accesskey="q" style="font-style: italic" onclick="wrapSelection(document.forms['serendipityEntry']['serendipity[extended]'],'<blockquote>','</blockquote>')" />\r
                         <input type="button" class="serendipityPrettyButton" name="insJ" value="img" accesskey="j" onclick="wrapInsImage(document.forms['serendipityEntry']['serendipity[extended]'])" />\r
                         <input type="button" class="serendipityPrettyButton" name="insImage" value="<?php echo MEDIA; ?>" onclick="window.open('serendipity_admin_image_selector.php?serendipity[textarea]=extended', 'ImageSel', 'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1');" />\r
-                        <input type="button" class="serendipityPrettyButton" name="insU" value="URL" accesskey="l" style="color: blue; text-decoration: underline;" onclick="wrapSelectionWithLink(document.forms['serendipityEntry']['serendipity[extended]'])" />\r
+                        <input type="button" class="serendipityPrettyButton" name="insURL" value="URL" accesskey="l" onclick="wrapSelectionWithLink(document.forms['serendipityEntry']['serendipity[extended]'])" />\r
 <?php\r
         /* Do the "old" non-WYSIWYG editor */\r
         } else { ?>\r
index c903c3549217ca57836875297dcbaf668b58752f..3ab1cd216142cce4c85e3b6ab37b75a1dd85cf60 100644 (file)
@@ -21,7 +21,7 @@ class serendipity_event_templatechooser extends serendipity_event
         $propbag->add('description', PLUGIN_EVENT_TEMPLATECHOOSER_DESC);
         $propbag->add('stackable',   false);
         $propbag->add('author',      'Evan Nemerson');
-        $propbag->add('version',     '1.2');
+        $propbag->add('version',     '1.3');
         $propbag->add('requirements',  array(
             'serendipity' => '0.8',
             'smarty'      => '2.6.7',
@@ -49,8 +49,13 @@ class serendipity_event_templatechooser extends serendipity_event
             switch($event) {
               case 'frontend_configure':
 
+                if (isset($serendipity['COOKIE']['user_template']) && !isset($_REQUEST['user_template'])) {
+                    $_REQUEST['user_template'] = $serendipity['COOKIE']['user_template'];
+                }
+
                 if (isset($_REQUEST['user_template']) && (in_array($_REQUEST['user_template'], serendipity_fetchTemplates())) ) {
                     $_SESSION['serendipityUseTemplate'] = $_REQUEST['user_template'];
+                    serendipity_setCookie('user_template', $_REQUEST['user_template']);
                 }
 
                 if (isset($_SESSION['serendipityUseTemplate']) ) {