]> git.mjollnir.org Git - s9y.git/commitdiff
fix caching frontend_display
authorgarvinhicking <garvinhicking>
Tue, 2 May 2006 07:59:37 +0000 (07:59 +0000)
committergarvinhicking <garvinhicking>
Tue, 2 May 2006 07:59:37 +0000 (07:59 +0000)
include/functions_entries.inc.php
plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php

index 61f3529d79aed7d1cbad98feb6652a76d8537017..05c122addc169fedfe5d4050432d10bb0c3e95cc 100644 (file)
@@ -907,7 +907,11 @@ function serendipity_printEntries($entries, $extended = 0, $preview = false, $sm
                 $entry['authorid'] = $serendipity['authorid'];
             }
 
-            serendipity_plugin_api::hook_event('frontend_display', $entry);
+            $addData = array('from' => 'functions_entries:printEntries');
+            if ($entry['is_cached']) {
+                $addData['no_scramble'] = true;
+            }
+            serendipity_plugin_api::hook_event('frontend_display', $entry, $addData);
 
             if ($preview) {
                 $entry['author']   = $entry['realname'];
@@ -1181,7 +1185,7 @@ function serendipity_updertEntry($entry) {
     }
 
     if (!serendipity_db_bool($entry['isdraft'])) {
-        serendipity_plugin_api::hook_event('frontend_display', $entry, array('no_scramble' => true));
+        serendipity_plugin_api::hook_event('frontend_display', $entry, array('no_scramble' => true, 'from' => 'functions_entries:updertEntry'));
         serendipity_handle_references($entry['id'], $serendipity['blogTitle'], $entry['title'], $entry['body'] . $entry['extended'], $newEntry);
     }
 
index d62269098712f448d43e05b201f89ed894322a7f..20ab2b376755d1ab443a6f8183d298f38ad99358 100644 (file)
@@ -190,7 +190,7 @@ class serendipity_event_entryproperties extends serendipity_event
                 $supported_properties[] = 'disable_markup_' . $instance;
             }
         }
-        
+
         foreach($supported_properties AS $prop_key) {
             $prop_val = (isset($properties[$prop_key]) ? $properties[$prop_key] : null);
             $prop_key = 'ep_' . $prop_key;
@@ -346,7 +346,7 @@ class serendipity_event_entryproperties extends serendipity_event
                                 <select name="serendipity[properties][disable_markups][]" multiple="multiple" size="4">
                                 <?php
                                 $plugins = serendipity_plugin_api::get_event_plugins();
-                        
+
                                 if (is_array($plugins)) {
                                     // foreach() operates on copies of values, but we want to operate on references, so we use while()
                                     @reset($plugins);
@@ -362,7 +362,7 @@ class serendipity_event_entryproperties extends serendipity_event
                                         } else {
                                             $selected = false;
                                         }
-                                        
+
                                         echo '<option ' . ($selected ? 'selected="selected"' : '') . ' value="' . $plugin_data['p']->instance . '">' . htmlspecialchars($plugin_data['p']->title) . '</option>' . "\n";
                                     }
                                 }
@@ -534,7 +534,8 @@ class serendipity_event_entryproperties extends serendipity_event
                     if ($is_cache) {
                         // Previous calls to frontend_display used the "no_scramble" atteribute to not tinker with the data.
                         // We now need to call those plugins that have not yet operated before.
-                        serendipity_plugin_api::hook_event('frontend_display_cache', $eventData);
+                        $to_addData = array('from' => 'entryproperties:' . $event);
+                        serendipity_plugin_api::hook_event('frontend_display_cache', $eventData, $to_addData);
                         $serendipity['POST']['properties']['cache_body']     = $eventData['body'];
                         $serendipity['POST']['properties']['cache_extended'] = $eventData['extended'];
                     }