]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/action.php
Attachments and their list now provide "ajax" view. Also added a few sidebars relatin...
[quix0rs-gnu-social.git] / lib / action.php
index f2027e0f17c68daef94a50f04ec074907ed4cf35..fc123a6332933976e2b064a608467847645b35a3 100644 (file)
@@ -98,15 +98,15 @@ class Action extends HTMLOutputter // lawsuit
             Event::handle('EndShowHTML', array($this));
         }
         if (Event::handle('StartShowHead', array($this))) {
-        $this->showHead();
+            $this->showHead();
             Event::handle('EndShowHead', array($this));
         }
         if (Event::handle('StartShowBody', array($this))) {
-        $this->showBody();
+            $this->showBody();
             Event::handle('EndShowBody', array($this));
         }
         if (Event::handle('StartEndHTML', array($this))) {
-        $this->endHTML();
+            $this->endHTML();
             Event::handle('EndEndHTML', array($this));
         }
     }
@@ -124,6 +124,7 @@ class Action extends HTMLOutputter // lawsuit
         $this->showShortcutIcon();
         $this->showStylesheets();
         $this->showScripts();
+        $this->showRelationshipLinks();
         $this->showOpenSearch();
         $this->showFeeds();
         $this->showDescription();
@@ -192,10 +193,6 @@ class Action extends HTMLOutputter // lawsuit
     {
         if (Event::handle('StartShowStyles', array($this))) {
             if (Event::handle('StartShowLaconicaStyles', array($this))) {
-                $this->element('link', array('rel' => 'stylesheet',
-                                             'type' => 'text/css',
-                                             'href' => theme_path('css/display.css', 'base') . '?version=' . LACONICA_VERSION,
-                                             'media' => 'screen, projection, tv'));
                 $this->element('link', array('rel' => 'stylesheet',
                                              'type' => 'text/css',
                                              'href' => theme_path('css/display.css', null) . '?version=' . LACONICA_VERSION,
@@ -246,6 +243,12 @@ class Action extends HTMLOutputter // lawsuit
                 $this->element('script', array('type' => 'text/javascript',
                                                'src' => common_path('js/jquery.form.js')),
                                ' ');
+
+                $this->element('script', array('type' => 'text/javascript',
+                                               'src' => common_path('js/jquery.joverlay.min.js')),
+                               ' ');
+
+
                 Event::handle('EndShowJQueryScripts', array($this));
             }
             if (Event::handle('StartShowLaconicaScripts', array($this))) {
@@ -264,6 +267,19 @@ class Action extends HTMLOutputter // lawsuit
         }
     }
 
+    /**
+     * Show document relationship links
+     *
+     * SHOULD overload
+     *
+     * @return nothing
+     */
+    function showRelationshipLinks()
+    {
+        // output <link> elements with appropriate HTML4.01 link types:
+        // http://www.w3.org/TR/html401/types.html#type-links
+    }
+
     /**
      * Show OpenSearch headers
      *
@@ -791,9 +807,12 @@ class Action extends HTMLOutputter // lawsuit
      *
      * MAY override
      *
+     * @param array $args other arguments
+     *
      * @return boolean is read only action?
      */
-    function isReadOnly()
+
+    function isReadOnly($args)
     {
         return false;
     }
@@ -1041,4 +1060,36 @@ class Action extends HTMLOutputter // lawsuit
     {
         return null;
     }
+
+    /**
+     * Generate document metadata for sequential navigation
+     *
+     * @param boolean $have_before is there something before?
+     * @param boolean $have_after  is there something after?
+     * @param integer $page        current page
+     * @param string  $action      current action
+     * @param array   $args        rest of query arguments
+     *
+     * @return nothing
+     */
+    function sequenceRelationships($have_next, $have_previous, $page, $action, $args=null)
+    {
+        // Outputs machine-readable pagination in <link> elements.
+        // Pattern taken from $this->pagination() method.
+
+        // "next" is equivalent to "after"
+        if ($have_next) {
+            $pargs   = array('page' => $page-1);
+            $this->element('link', array('rel' => 'next',
+                                         'href' => common_local_url($action, $args, $pargs),
+                                         'title' => _('Next')));
+        }
+        // "previous" is equivalent to "before"
+        if ($have_previous=true) { // FIXME
+            $pargs   = array('page' => $page+1);
+            $this->element('link', array('rel' => 'prev',
+                                         'href' => common_local_url($action, $args, $pargs),
+                                         'title' => _('Previous')));
+        }
+    }
 }