summaryrefslogtreecommitdiff
path: root/lib/action.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-06-14 11:27:48 -0700
committerEvan Prodromou <evan@controlyourself.ca>2009-06-14 11:27:48 -0700
commit7f76c36f24bd51fd4f204f363d5ddf35e9ea9950 (patch)
tree4879f89f393e1a71d721cdaff8bcd7e45d3721c2 /lib/action.php
parente0bdaa787ddf5102417ec35a4996e68cfc8981f2 (diff)
parent77c94c44a622052366dcc03fee522232672d71d9 (diff)
Merge branch '0.8.x' of git@gitorious.org:+laconica-developers/laconica/dev into 0.8.x
Diffstat (limited to 'lib/action.php')
-rw-r--r--lib/action.php30
1 files changed, 21 insertions, 9 deletions
diff --git a/lib/action.php b/lib/action.php
index 7643e5afb..89a8c8f4d 100644
--- a/lib/action.php
+++ b/lib/action.php
@@ -575,20 +575,32 @@ class Action extends HTMLOutputter // lawsuit
/**
* Show page notice block.
*
+ * Only show the block if a subclassed action has overrided
+ * Action::showPageNotice(), or an event handler is registered for
+ * the StartShowPageNotice event, in which case we assume the
+ * 'page_notice' definition list is desired. This is to prevent
+ * empty 'page_notice' definition lists from being output everywhere.
+ *
* @return nothing
*/
function showPageNoticeBlock()
{
- $this->elementStart('dl', array('id' => 'page_notice',
- 'class' => 'system_notice'));
- $this->element('dt', null, _('Page notice'));
- $this->elementStart('dd');
- if (Event::handle('StartShowPageNotice', array($this))) {
- $this->showPageNotice();
- Event::handle('EndShowPageNotice', array($this));
+ $rmethod = new ReflectionMethod($this, 'showPageNotice');
+ $dclass = $rmethod->getDeclaringClass()->getName();
+
+ if ($dclass != 'Action' || Event::hasHandler('StartShowPageNotice')) {
+
+ $this->elementStart('dl', array('id' => 'page_notice',
+ 'class' => 'system_notice'));
+ $this->element('dt', null, _('Page notice'));
+ $this->elementStart('dd');
+ if (Event::handle('StartShowPageNotice', array($this))) {
+ $this->showPageNotice();
+ Event::handle('EndShowPageNotice', array($this));
+ }
+ $this->elementEnd('dd');
+ $this->elementEnd('dl');
}
- $this->elementEnd('dd');
- $this->elementEnd('dl');
}
/**