* @link http://status.net/
*/
-if (!defined('STATUSNET') && !defined('LACONICA')) {
+if (!defined('STATUSNET')) {
exit(1);
}
* @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
*
* @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');
*
* @return boolean hook flag
*/
-
- function onStartShowAside($action)
+ function onStartShowAside(Action $action)
{
if (!is_null($this->mediumRectangle)) {
$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;
}
/**
- * Add a leaderboard and/or rectangle in the header
+ * Add a leaderboard in the header
*
* @param Action $action Action being shown
*
* @return boolean hook flag
*/
- function onStartShowHeader($action)
+ function onEndShowHeader($action)
{
if (!is_null($this->leaderboard)) {
$action->elementStart('div',
$action->elementEnd('div');
}
+ return true;
+ }
+
+ /**
+ * Add a rectangle before aside sections
+ *
+ * @param Action $action Action being shown
+ *
+ * @return boolean hook flag
+ */
+ function onStartShowSections(Action $action)
+ {
if (!is_null($this->rectangle)) {
$action->elementStart('div',
array('id' => 'ad_rectangle',
*
* @return boolean hook flag
*/
-
- function onEndShowAside($action)
+ function onEndShowAside(Action $action)
{
if (!is_null($this->wideSkyscraper)) {
$action->elementStart('div',
*
* @return void
*/
-
abstract protected function showMediumRectangle($action);
/**
*
* @return void
*/
-
abstract protected function showRectangle($action);
/**
*
* @return void
*/
-
abstract protected function showWideSkyscraper($action);
/**
*
* @return void
*/
-
abstract protected function showLeaderboard($action);
}