]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/action.php
Moved oEmbed stuff out to a plugin (Oembed).
[quix0rs-gnu-social.git] / lib / action.php
index 95c88b2299fe30867dd9848264dfca42cfc7222d..4d917dc69e1fe7d2581b1a604e9a1a10799cb1c8 100644 (file)
@@ -166,6 +166,11 @@ class Action extends HTMLOutputter // lawsuit
         return $this->scoped;
     }
 
+    public function getActionName()
+    {
+        return $this->action;
+    }
+
     /**
      * Show page, a template method.
      *
@@ -681,7 +686,8 @@ class Action extends HTMLOutputter // lawsuit
     function showNoticeForm()
     {
         // TRANS: Tab on the notice form.
-        $tabs = array('status' => _m('TAB','Status'));
+        $tabs = array('status' => array('title' => _m('TAB','Status'),
+                                        'href'  => common_local_url('newnotice')));
 
         $this->elementStart('div', 'input_forms');
 
@@ -689,7 +695,8 @@ class Action extends HTMLOutputter // lawsuit
             $this->elementStart('ul', array('class' => 'nav',
                                             'id' => 'input_form_nav'));
 
-            foreach ($tabs as $tag => $title) {
+            foreach ($tabs as $tag => $data) {
+                $tag = htmlspecialchars($tag);
                 $attrs = array('id' => 'input_form_nav_'.$tag,
                                'class' => 'input_form_nav_tab');
 
@@ -702,8 +709,9 @@ class Action extends HTMLOutputter // lawsuit
                 $this->elementStart('li', $attrs);
 
                 $this->element('a',
-                               array('href' => 'javascript:SN.U.switchInputFormTab("'.$tag.'")'),
-                               $title);
+                               array('onclick' => 'return SN.U.switchInputFormTab("'.$tag.'");',
+                                     'href' => $data['href']),
+                               $data['title']);
                 $this->elementEnd('li');
             }
 
@@ -716,7 +724,7 @@ class Action extends HTMLOutputter // lawsuit
             $form->show();
             $this->elementEnd('div');
 
-            foreach ($tabs as $tag => $title) {
+            foreach ($tabs as $tag => $data) {
                 $attrs = array('class' => 'input_form',
                                'id' => 'input_form_'.$tag);
 
@@ -1330,9 +1338,9 @@ class Action extends HTMLOutputter // lawsuit
      */
     function int($key, $defValue=null, $maxValue=null, $minValue=null)
     {
-        $arg = strtolower($this->trimmed($key));
+        $arg = intval($this->arg($key));
 
-        if (is_null($arg) || !is_integer($arg)) {
+        if (!is_numeric($this->arg($key)) || $arg != $this->arg($key)) {
             return $defValue;
         }