]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/action.php
Added new 'Scroller' plugin from @buttle which aims to replace the out-dated
[quix0rs-gnu-social.git] / lib / action.php
index f4bbb85f82feac7cc78b2d9d05c10ea53af34c13..5dff73906a620f186007ba6b90b54d6f0abb4b06 100644 (file)
@@ -418,7 +418,6 @@ class Action extends HTMLOutputter // lawsuit
                 $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', GNUsocial::isHTTPS()).'"); }');
-                $this->script('extlib/jquery.infieldlabel.js');
 
                 Event::handle('EndShowJQueryScripts', array($this));
             }
@@ -432,6 +431,7 @@ class Action extends HTMLOutputter // lawsuit
                 $this->inlineScript('var _peopletagAC = "' .
                                     common_local_url('peopletagautocomplete') . '";');
                 $this->showScriptMessages();
+                $this->showScriptVariables();
                 // Anti-framing code to avoid clickjacking attacks in older browsers.
                 // This will show a blank page if the page is being framed, which is
                 // consistent with the behavior of the 'X-Frame-Options: SAMEORIGIN'
@@ -474,6 +474,19 @@ class Action extends HTMLOutputter // lawsuit
         return $messages;
     }
 
+    protected function showScriptVariables()
+    {
+        $vars = array();
+
+        if (Event::handle('StartScriptVariables', array($this, &$vars))) {
+            $vars['urlNewNotice'] = common_local_url('newnotice');
+        }
+        if (!empty($vars)) {
+            $this->inlineScript('SN.V = ' . json_encode($vars));
+        }
+        return $vars;
+    }
+
     /**
      * If the action will need localizable text strings, export them here like so:
      *
@@ -1212,7 +1225,7 @@ class Action extends HTMLOutputter // lawsuit
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return false;
     }
@@ -1358,7 +1371,7 @@ class Action extends HTMLOutputter // lawsuit
      * Upstream bug is::
      * https://pear.php.net/bugs/bug.php?id=20291
      */
-    function booleanintstring($key, $def)
+    function booleanintstring($key, $def=false)
     {
         return $this->boolean($key, $def) ? '1' : '0';
     }