X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fuapplugin.php;h=dd72c8723d0224ab9c184d0f8f5416c7cb4226c3;hb=d5d806863240379fe23e081c75097ddee53babec;hp=e3801f08ae87e7d31624b5293e13742c6f504e8f;hpb=ea123800e991352d862c05a2f81e82ef53e72eeb;p=quix0rs-gnu-social.git diff --git a/lib/uapplugin.php b/lib/uapplugin.php index e3801f08ae..dd72c8723d 100644 --- a/lib/uapplugin.php +++ b/lib/uapplugin.php @@ -28,7 +28,7 @@ * @link http://status.net/ */ -if (!defined('STATUSNET') && !defined('LACONICA')) { +if (!defined('STATUSNET')) { exit(1); } @@ -51,13 +51,12 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - abstract class UAPPlugin extends Plugin { - public $MediumRectangle = null; - public $Rectangle = null; - public $Leaderboard = null; - public $WideSkyscraper = null; + public $mediumRectangle = null; + public $rectangle = null; + public $leaderboard = null; + public $wideSkyscraper = null; /** * Output our dedicated stylesheet @@ -66,8 +65,7 @@ abstract class UAPPlugin extends Plugin * * @return boolean hook flag */ - - function onEndShowStatusNetStyles($action) + public function onEndShowStylesheets(Action $action) { // XXX: allow override by theme $action->cssLink('css/uap.css', 'base', 'screen, projection, tv'); @@ -81,8 +79,7 @@ abstract class UAPPlugin extends Plugin * * @return boolean hook flag */ - - function onStartShowAside($action) + function onStartShowAside(Action $action) { if (!is_null($this->mediumRectangle)) { @@ -95,6 +92,24 @@ abstract class UAPPlugin extends Plugin $action->elementEnd('div'); } + // XXX: Hack to force ads to show on single-notice pages + + if (!is_null($this->rectangle) && + $action->trimmed('action') == 'shownotice') { + + $action->elementStart('div', array('id' => 'aside_primary', + 'class' => 'aside')); + + if (Event::handle('StartShowSections', array($action))) { + $action->showSections(); + Event::handle('EndShowSections', array($action)); + } + + $action->elementEnd('div'); + + return false; + } + return true; } @@ -126,8 +141,7 @@ abstract class UAPPlugin extends Plugin * * @return boolean hook flag */ - - function onStartShowSections($action) + function onStartShowSections(Action $action) { if (!is_null($this->rectangle)) { $action->elementStart('div', @@ -147,8 +161,7 @@ abstract class UAPPlugin extends Plugin * * @return boolean hook flag */ - - function onEndShowAside($action) + function onEndShowAside(Action $action) { if (!is_null($this->wideSkyscraper)) { $action->elementStart('div', @@ -169,7 +182,6 @@ abstract class UAPPlugin extends Plugin * * @return void */ - abstract protected function showMediumRectangle($action); /** @@ -179,7 +191,6 @@ abstract class UAPPlugin extends Plugin * * @return void */ - abstract protected function showRectangle($action); /** @@ -189,7 +200,6 @@ abstract class UAPPlugin extends Plugin * * @return void */ - abstract protected function showWideSkyscraper($action); /** @@ -199,6 +209,5 @@ abstract class UAPPlugin extends Plugin * * @return void */ - abstract protected function showLeaderboard($action); }