common_config_set('db', 'database', $mirror);
}
- $status = $this->prepare($args);
- if ($status) {
- $this->handle($args);
- } else {
- common_debug('Prepare failed for Action.');
+ if (Event::handle('StartActionExecute', array($this, &$args))) {
+ $prepared = $this->prepare($args);
+ if ($prepared) {
+ $this->handle($args);
+ } else {
+ common_debug('Prepare failed for Action.');
+ }
}
$this->flush();
- Event::handle('EndActionExecute', array($status, $this));
+ Event::handle('EndActionExecute', array($this));
}
/**
$this->action = strtolower($this->trimmed('action'));
if ($this->ajax || $this->boolean('ajax')) {
- // check with StatusNet::isAjax()
- StatusNet::setAjax(true);
+ // check with GNUsocial::isAjax()
+ GNUsocial::setAjax(true);
}
if ($this->needLogin) {
*/
function showPage()
{
- if (StatusNet::isAjax()) {
+ if (GNUsocial::isAjax()) {
self::showAjax();
return;
}
} else {
// favicon.ico should be HTTPS if the rest of the page is
$this->element('link', array('rel' => 'shortcut icon',
- 'href' => common_path('favicon.ico', StatusNet::isHTTPS())));
+ 'href' => common_path('favicon.ico', GNUsocial::isHTTPS())));
}
if (common_config('site', 'mobile')) {
$this->script('extlib/jquery.form.js');
$this->script('extlib/jquery-ui/jquery-ui.js');
$this->script('extlib/jquery.cookie.js');
- $this->inlineScript('if (typeof window.JSON !== "object") { $.getScript("'.common_path('js/extlib/json2.js', StatusNet::isHTTPS()).'"); }');
+ $this->inlineScript('if (typeof window.JSON !== "object") { $.getScript("'.common_path('js/extlib/json2.js', GNUsocial::isHTTPS()).'"); }');
$this->script('extlib/jquery.infieldlabel.js');
Event::handle('EndShowJQueryScripts', array($this));
$this->elementStart('a', array('class' => 'home bookmark',
'href' => $url));
- if (StatusNet::isHTTPS()) {
+ if (GNUsocial::isHTTPS()) {
$logoUrl = common_config('site', 'ssllogo');
if (empty($logoUrl)) {
// if logo is an uploaded file, try to fall back to HTTPS file URL
$image = common_config('license', 'image');
$sslimage = common_config('license', 'sslimage');
- if (StatusNet::isHTTPS()) {
+ if (GNUsocial::isHTTPS()) {
if (!empty($sslimage)) {
$url = $sslimage;
} else if (preg_match('#^http://i.creativecommons.org/#', $image)) {
}
}
+ /**
+ * This is a cheap hack to avoid a bug in DB_DataObject
+ * where '' is non-type-aware compared to 0, which means it
+ * will always be true for values like false and 0 too...
+ *
+ * Upstream bug is::
+ * https://pear.php.net/bugs/bug.php?id=20291
+ */
+ function booleanintstring($key, $def)
+ {
+ return $this->boolean($key, $def) ? '1' : '0';
+ }
+
/**
* Integer value of an argument
*