]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/uapplugin.php
common_to_alphanumeric added, filtering Notice->source in classic layout
[quix0rs-gnu-social.git] / lib / uapplugin.php
index ef35bafbfb0fabce891c3439320d8d78438f2f68..dd72c8723d0224ab9c184d0f8f5416c7cb4226c3 100644 (file)
@@ -28,7 +28,7 @@
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) {
+if (!defined('STATUSNET')) {
     exit(1);
 }
 
@@ -51,7 +51,6 @@ 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;
@@ -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);
 }