summaryrefslogtreecommitdiff
path: root/lib/action.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/action.php')
-rw-r--r--lib/action.php46
1 files changed, 12 insertions, 34 deletions
diff --git a/lib/action.php b/lib/action.php
index 926fe93fb..602118cdf 100644
--- a/lib/action.php
+++ b/lib/action.php
@@ -82,11 +82,6 @@ class Action extends HTMLOutputter // lawsuit
*/
function prepare($argarray)
{
-
- // For PEAR_Errors comming from DB_DataObject
- PEAR::setErrorHandling(PEAR_ERROR_CALLBACK,
- array($this, "handleError"));
-
$this->args =& common_copy_args($argarray);
return true;
}
@@ -280,9 +275,15 @@ class Action extends HTMLOutputter // lawsuit
{
$this->elementStart('body', array('id' => $this->trimmed('action')));
$this->elementStart('div', array('id' => 'wrap'));
- $this->showHeader();
+ if (Event::handle('StartShowHeader', array($this))) {
+ $this->showHeader();
+ Event::handle('EndShowHeader', array($this));
+ }
$this->showCore();
- $this->showFooter();
+ if (Event::handle('StartShowFooter', array($this))) {
+ $this->showFooter();
+ Event::handle('EndShowFooter', array($this));
+ }
$this->elementEnd('div');
$this->elementEnd('body');
}
@@ -437,7 +438,10 @@ class Action extends HTMLOutputter // lawsuit
{
$this->elementStart('div', array('id' => 'core'));
$this->showLocalNavBlock();
- $this->showContentBlock();
+ if (Event::handle('StartShowContentBlock', array($this))) {
+ $this->showContentBlock();
+ Event::handle('EndShowContentBlock', array($this));
+ }
$this->showAside();
$this->elementEnd('div');
}
@@ -850,32 +854,6 @@ class Action extends HTMLOutputter // lawsuit
}
/**
- * Handle old fashioned PEAR_Error msgs coming from DB_DataObject
- *
- * Logs the DB_DataObject error. Override to do something else.
- *
- * @param PEAR_Error
- *
- * @return nothing
- */
-
- function handleError($error) {
-
- common_log(LOG_ERR, "PEAR error: " . $error->getMessage());
- $msg = sprintf(_('The database for %s isn\'t responding correctly, '.
- 'so the site won\'t work properly. '.
- 'The site admins probably know about the problem, '.
- 'but you can contact them at %s to make sure. '.
- 'Otherwise, wait a few minutes and try again.'),
- common_config('site', 'name'),
- common_config('site', 'email'));
-
- $dac = new DBErrorAction($msg, 500);
- $dac->showPage();
- exit(-1);
- }
-
- /**
* Returns the current URL
*
* @return string current URL