upstream patch by ian
This commit is contained in:
parent
97cb741907
commit
679e261fdc
|
@ -1,13 +1,17 @@
|
|||
1.14:
|
||||
-----
|
||||
* Fix "Illegal string offset 'from'" error
|
||||
* Use lang API - extends required Serendipity version to 1.6
|
||||
|
||||
1.13:
|
||||
-----
|
||||
Add lang <de>
|
||||
Add new option for case bottom, closing a div class with certain templates
|
||||
* Add lang <de>
|
||||
* Add new option for case bottom, closing a div class with certain templates
|
||||
|
||||
1.12:
|
||||
-----
|
||||
Add ability for "plaintext" markup
|
||||
* Add ability for "plaintext" markup
|
||||
|
||||
1.11:
|
||||
-----
|
||||
|
||||
Add support for putting nuggets in RSS feeds
|
||||
* Add support for putting nuggets in RSS feeds
|
||||
|
|
|
@ -4,14 +4,8 @@ if (IN_serendipity !== true) {
|
|||
die ("Don't hack!");
|
||||
}
|
||||
|
||||
|
||||
// Probe for a language include with constants. Still include defines later on, if some constants were missing
|
||||
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
|
||||
if (file_exists($probelang)) {
|
||||
include $probelang;
|
||||
}
|
||||
|
||||
include dirname(__FILE__) . '/lang_en.inc.php';
|
||||
// Load possible language files.
|
||||
@serendipity_plugin_api::load_language(dirname(__FILE__));
|
||||
|
||||
class serendipity_event_page_nugget extends serendipity_event
|
||||
{
|
||||
|
@ -23,19 +17,21 @@ class serendipity_event_page_nugget extends serendipity_event
|
|||
$propbag->add('description', PLUGIN_PAGE_NUGGET_DESC);
|
||||
$propbag->add('stackable', true);
|
||||
$propbag->add('author', 'Wesley Hwang-Chung');
|
||||
$propbag->add('version', '1.13');
|
||||
$propbag->add('version', '1.14');
|
||||
$propbag->add('requirements', array(
|
||||
'serendipity' => '0.8',
|
||||
'serendipity' => '1.6',
|
||||
'smarty' => '2.6.7',
|
||||
'php' => '4.1.0'
|
||||
));
|
||||
$propbag->add('groups', array('FRONTEND_ENTRY_RELATED'));
|
||||
$propbag->add('event_hooks', array('frontend_header' => true,
|
||||
$propbag->add('event_hooks', array(
|
||||
'frontend_header' => true,
|
||||
'entries_header' => true,
|
||||
'entry_display' => true,
|
||||
'entries_footer' => true,
|
||||
'frontend_footer' => true,
|
||||
'frontend_display' => true));
|
||||
'frontend_display' => true)
|
||||
);
|
||||
$propbag->add('configuration', array('title', 'placement', 'language', 'content', 'content_plain', 'footer_close', 'markup', 'show_where'));
|
||||
}
|
||||
|
||||
|
@ -144,7 +140,8 @@ class serendipity_event_page_nugget extends serendipity_event
|
|||
$title = $this->get_config('title');
|
||||
}
|
||||
|
||||
function event_hook($event, &$bag, &$eventData, $addData = null) {
|
||||
function event_hook($event, &$bag, &$eventData, $addData = null)
|
||||
{
|
||||
global $serendipity;
|
||||
|
||||
$hooks = &$bag->get('event_hooks');
|
||||
|
@ -153,10 +150,12 @@ class serendipity_event_page_nugget extends serendipity_event
|
|||
$show_where = $this->get_config('show_where', 'both');
|
||||
|
||||
// if the language doesn't match, do not display
|
||||
if ($language != 'all' && $serendipity['lang'] != $language) return false;
|
||||
if ($language != 'all' && $serendipity['lang'] != $language) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// RSS-Feed special case
|
||||
if ($event == 'frontend_display' && $addData['from'] == 'functions_entries:printEntries_rss') {
|
||||
if ($event == 'frontend_display' && (isset($addData['from']) && $addData['from'] == 'functions_entries:printEntries_rss')) {
|
||||
if ($placement == 'rss') {
|
||||
if (serendipity_db_bool($this->get_config('markup', 'true')) && $event != 'frontend_header') {
|
||||
$entry = array('html_nugget' => $this->get_config('content'));
|
||||
|
@ -166,7 +165,6 @@ class serendipity_event_page_nugget extends serendipity_event
|
|||
$eventData['body'] .= $this->get_config('content') . $this->get_config('content_plain');
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -210,6 +208,7 @@ class serendipity_event_page_nugget extends serendipity_event
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
Loading…
Reference in a new issue