]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/action.php
Introduced isCurrentProfileInScope() which shall check if current profile is
[quix0rs-gnu-social.git] / lib / action.php
index 508145da40eb5934f84bbdc999e148ca0c124ce7..c019b65dc92f40e38f2acfe74991cbc5149d8bb4 100644 (file)
@@ -206,6 +206,10 @@ class Action extends HTMLOutputter // lawsuit
      */
     function showPage()
     {
+        if (StatusNet::isAjax()) {
+            self::showAjax();
+            return;
+        }
         if (Event::handle('StartShowHTML', array($this))) {
             $this->startHTML();
             $this->flush();
@@ -226,6 +230,23 @@ class Action extends HTMLOutputter // lawsuit
         }
     }
 
+    public function showAjax()
+    {
+        $this->startHTML('text/xml;charset=utf-8');
+        $this->elementStart('head');
+        // TRANS: Title for conversation page.
+        $this->element('title', null, $this->title());
+        $this->elementEnd('head');
+        $this->elementStart('body');
+        if ($this->getError()) {
+            $this->element('p', array('id'=>'error'), $this->getError());
+        } else {
+            $this->showContent();
+        }
+        $this->elementEnd('body');
+        $this->endHTML();
+    }
+
     function endHTML()
     {
         global $_startTime;
@@ -705,6 +726,8 @@ class Action extends HTMLOutputter // lawsuit
 
         $this->elementStart('div', 'input_forms');
 
+        $this->element('label', array('for'=>'input_form_nav'), _m('TAB', 'Share your:'));
+
         if (Event::handle('StartShowEntryForms', array(&$tabs))) {
             $this->elementStart('ul', array('class' => 'nav',
                                             'id' => 'input_form_nav'));
@@ -715,9 +738,6 @@ class Action extends HTMLOutputter // lawsuit
                                'class' => 'input_form_nav_tab');
 
                 if ($tag == 'status') {
-                    // We're actually showing the placeholder form,
-                    // but we special-case the 'Status' tab as if
-                    // it were a small version of it.
                     $attrs['class'] .= ' current';
                 }
                 $this->elementStart('li', $attrs);
@@ -731,16 +751,12 @@ class Action extends HTMLOutputter // lawsuit
 
             $this->elementEnd('ul');
 
-            $attrs = array('class' => 'input_form current',
-                           'id' => 'input_form_placeholder');
-            $this->elementStart('div', $attrs);
-            $form = new NoticePlaceholderForm($this);
-            $form->show();
-            $this->elementEnd('div');
-
             foreach ($tabs as $tag => $data) {
                 $attrs = array('class' => 'input_form',
                                'id' => 'input_form_'.$tag);
+                if ($tag == 'status') {
+                    $attrs['class'] .= ' current';
+                }
 
                 $this->elementStart('div', $attrs);
 
@@ -1151,12 +1167,10 @@ class Action extends HTMLOutputter // lawsuit
                 // TRANS: license message in footer.
                 // TRANS: %1$s is the site name, %2$s is a link to the license URL, with a licence name set in configuration.
                 $notice = _('All %1$s content and data are available under the %2$s license.');
-                $link = "<a class=\"license\" rel=\"external license\" href=\"" .
-                        htmlspecialchars(common_config('license', 'url')) .
-                        "\">" .
-                        htmlspecialchars(common_config('license', 'title')) .
-                        "</a>";
-                $this->raw(sprintf(htmlspecialchars($notice),
+                $link = sprintf('<a class="license" rel="external license" href="%1$s">%2$s</a>',
+                                htmlspecialchars(common_config('license', 'url')),
+                                htmlspecialchars(common_config('license', 'title')));
+                $this->raw(@sprintf(htmlspecialchars($notice),
                                    htmlspecialchars(common_config('site', 'name')),
                                    $link));
                 $this->elementEnd('p');
@@ -1202,7 +1216,7 @@ class Action extends HTMLOutputter // lawsuit
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return false;
     }