* groupmode (string Indicates whether the input $entries array is already grouped in preparation for the smarty $entries output array [TRUE], or if it shall be grouped by date [FALSE]
* skip_smarty_hooks (boolean) If TRUE, no plugins will be executed at all
* skip_smarty_hook (mixed) Can be set to an array of plugin hooks to NOT execute
+ * prevent_reset (boolean) If set to TRUE, the smarty $entries array will NOT be cleared. (to prevent possible duplicate output of entries)
* @param object Smarty object
* @return string The Smarty HTML response
*/
$params['skip_smarty_hook'] = array();
}
+ if (empty($params['prevent_reset'])) {
+ $params['prevent_reset'] = false;
+ }
+
// Some functions deal with the $serendipity array. To modify them, we need to store
// their original contents.
$old_var = array();
$entry, // Entry data
(!empty($params['id']) ? true : false), // Extended data?
$params['preview'], // Entry preview?
+ 'ENTRIES',
false, // Prevent Smarty parsing
$params['use_hooks'],
$params['use_footer'],
- ($params['groupmode'] == 'date' ? true : false) // Grouping of $entry
+ ($params['groupmode'] == 'date' ? false : true) // Grouping of $entry
);
// Restore the $serendipity array after our modifications.
}
$out = serendipity_smarty_fetch($params['block'], $params['template']);
-
+ // Reset array list, because we might be in a nested code call.
+ if ($params['prevent_reset'] == false) {
+ $serendipity['smarty']->assign('entries', array());
+ }
$serendipity['skip_smarty_hook'] = $old_var['skip_smarty_hook'];
$serendipity['skip_smarty_hooks'] = $old_var['skip_smarty_hooks'];