]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'master' into testing
authorBrion Vibber <brion@pobox.com>
Thu, 2 Sep 2010 21:58:11 +0000 (14:58 -0700)
committerBrion Vibber <brion@pobox.com>
Thu, 2 Sep 2010 21:58:11 +0000 (14:58 -0700)
1  2 
lib/action.php

diff --combined lib/action.php
index 1d85f19e9925fc920362cebaeef06c4b754a1fdb,3614c04e92a3b7609f678548a5288731ca0172da..c86dd2d869003a4bf9e41d27557c44f9d1bdcf52
@@@ -121,10 -121,7 +121,10 @@@ class Action extends HTMLOutputter // l
          // XXX: attributes (profile?)
          $this->elementStart('head');
          if (Event::handle('StartShowHeadElements', array($this))) {
 -            $this->showTitle();
 +            if (Event::handle('StartShowHeadTitle', array($this))) {
 +                $this->showTitle();
 +                Event::handle('EndShowHeadTitle', array($this));
 +            }
              $this->showShortcutIcon();
              $this->showStylesheets();
              $this->showOpenSearch();
  
              if (Event::handle('StartShowStatusNetStyles', array($this)) &&
                  Event::handle('StartShowLaconicaStyles', array($this))) {
-                 $this->cssLink('css/display.css',null, 'screen, projection, tv, print');
+                 $this->primaryCssLink(null, 'screen, projection, tv, print');
                  Event::handle('EndShowStatusNetStyles', array($this));
                  Event::handle('EndShowLaconicaStyles', array($this));
              }
                  Event::handle('EndShowDesign', array($this));
              }
              Event::handle('EndShowStyles', array($this));
 -            
 +
              if (common_config('custom_css', 'enabled')) {
                  $css = common_config('custom_css', 'css');
                  if (Event::handle('StartShowCustomCss', array($this, &$css))) {
          }
      }
  
+     function primaryCssLink($mainTheme=null, $media=null)
+     {
+         // If the currently-selected theme has dependencies on other themes,
+         // we'll need to load their display.css files as well in order.
+         $theme = new Theme($mainTheme);
+         $baseThemes = $theme->getDeps();
+         foreach ($baseThemes as $baseTheme) {
+             $this->cssLink('css/display.css', $baseTheme, $media);
+         }
+         $this->cssLink('css/display.css', $mainTheme, $media);
+     }
      /**
       * Show javascript headers
       *
      function showContentBlock()
      {
          $this->elementStart('div', array('id' => 'content'));
 -        $this->showPageTitle();
 +        if (Event::handle('StartShowPageTitle', array($this))) {
 +            $this->showPageTitle();
 +            Event::handle('EndShowPageTitle', array($this));
 +        }
          $this->showPageNoticeBlock();
          $this->elementStart('div', array('id' => 'content_inner'));
          // show the actual content (forms, lists, whatever)