]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/action.php
Merge branch '0.7.x' into 0.8.x
[quix0rs-gnu-social.git] / lib / action.php
index 975c2bfcb8a23adb01c4ec7dbeb479119547479c..75531d34b51a308bec75e393445ddcd9fbac452f 100644 (file)
@@ -112,6 +112,7 @@ class Action extends HTMLOutputter // lawsuit
         // XXX: attributes (profile?)
         $this->elementStart('head');
         $this->showTitle();
+        $this->showShortcutIcon();
         $this->showStylesheets();
         $this->showScripts();
         $this->showOpenSearch();
@@ -147,6 +148,32 @@ class Action extends HTMLOutputter // lawsuit
         return _("Untitled page");
     }
 
+    /**
+     * Show themed shortcut icon
+     *
+     * @return nothing
+     */
+    function showShortcutIcon()
+    {
+        if (is_readable(INSTALLDIR . '/theme/' . common_config('site', 'theme') . '/favicon.ico')) {
+            $this->element('link', array('rel' => 'shortcut icon',
+                                         'href' => theme_path('favicon.ico')));
+        } else {
+            $this->element('link', array('rel' => 'shortcut icon',
+                                         'href' => common_path('favicon.ico')));
+        }
+
+        if (common_config('site', 'mobile')) {
+            if (is_readable(INSTALLDIR . '/theme/' . common_config('site', 'theme') . '/apple-touch-icon.png')) {
+                $this->element('link', array('rel' => 'apple-touch-icon',
+                                             'href' => theme_path('apple-touch-icon.png')));
+            } else {
+                $this->element('link', array('rel' => 'apple-touch-icon',
+                                             'href' => common_path('apple-touch-icon.png')));
+            }
+        }
+    }
+
     /**
      * Show stylesheets
      *
@@ -299,7 +326,9 @@ class Action extends HTMLOutputter // lawsuit
      */
     function showBody()
     {
-        $this->elementStart('body', array('id' => $this->trimmed('action')));
+        $this->elementStart('body', (common_current_user()) ? array('id' => $this->trimmed('action'),
+                                                                    'class' => 'user_in')
+                                                            : array('id' => $this->trimmed('action')));
         $this->elementStart('div', array('id' => 'wrap'));
         if (Event::handle('StartShowHeader', array($this))) {
             $this->showHeader();
@@ -801,10 +830,12 @@ class Action extends HTMLOutputter // lawsuit
         }
         if ($lm) {
             header('Last-Modified: ' . date(DATE_RFC1123, $lm));
-            if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
-                $ims = strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']);
+            if (array_key_exists('HTTP_IF_MODIFIED_SINCE', $_SERVER)) {
+                $if_modified_since = $_SERVER['HTTP_IF_MODIFIED_SINCE'];
+                $ims = strtotime($if_modified_since);
                 if ($lm <= $ims) {
-                    $if_none_match = $_SERVER['HTTP_IF_NONE_MATCH'];
+                    $if_none_match = (array_key_exists('HTTP_IF_NONE_MATCH', $_SERVER)) ?
+                      $_SERVER['HTTP_IF_NONE_MATCH'] : null;
                     if (!$if_none_match ||
                         !$etag ||
                         $this->_hasEtag($etag, $if_none_match)) {