]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/action.php
Site-wide design configuration
[quix0rs-gnu-social.git] / lib / action.php
index 3bfa6ba15bd78d4b0818d457ded8635effe9e0c8..a5244371a5def60d0bf6635336044dba41a36185 100644 (file)
@@ -191,6 +191,7 @@ class Action extends HTMLOutputter // lawsuit
     function showStylesheets()
     {
         if (Event::handle('StartShowStyles', array($this))) {
+
             if (Event::handle('StartShowLaconicaStyles', array($this))) {
                 $this->element('link', array('rel' => 'stylesheet',
                                              'type' => 'text/css',
@@ -209,6 +210,7 @@ class Action extends HTMLOutputter // lawsuit
                                              'media' => 'print'));
                 Event::handle('EndShowLaconicaStyles', array($this));
             }
+
             if (Event::handle('StartShowUAStyles', array($this))) {
                 $this->comment('[if IE]><link rel="stylesheet" type="text/css" '.
                                'href="'.theme_path('css/ie.css', 'base').'?version='.LACONICA_VERSION.'" /><![endif]');
@@ -223,6 +225,21 @@ class Action extends HTMLOutputter // lawsuit
                                'href="'.theme_path('css/ie.css', null).'?version='.LACONICA_VERSION.'" /><![endif]');
                 Event::handle('EndShowUAStyles', array($this));
             }
+
+            if (Event::handle('StartShowDesign', array($this))) {
+
+                $user = common_current_user();
+
+                if (empty($user) || $user->viewdesigns) {
+                    $design = $this->getDesign();
+
+                    if (!empty($design)) {
+                        $design->showCSS($this);
+                    }
+                }
+
+                Event::handle('EndShowDesign', array($this));
+            }
             Event::handle('EndShowStyles', array($this));
         }
     }
@@ -383,15 +400,18 @@ class Action extends HTMLOutputter // lawsuit
     {
         $this->elementStart('address', array('id' => 'site_contact',
                                              'class' => 'vcard'));
-        $this->elementStart('a', array('class' => 'url home bookmark',
-                                       'href' => common_local_url('public')));
-        if (common_config('site', 'logo') || file_exists(theme_file('logo.png'))) {
-            $this->element('img', array('class' => 'logo photo',
-                                        'src' => (common_config('site', 'logo')) ? common_config('site', 'logo') : theme_path('logo.png'),
-                                        'alt' => common_config('site', 'name')));
+        if (Event::handle('StartAddressData', array($this))) {
+            $this->elementStart('a', array('class' => 'url home bookmark',
+                                           'href' => common_local_url('public')));
+            if (common_config('site', 'logo') || file_exists(theme_file('logo.png'))) {
+                $this->element('img', array('class' => 'logo photo',
+                                            'src' => (common_config('site', 'logo')) ? common_config('site', 'logo') : theme_path('logo.png'),
+                                            'alt' => common_config('site', 'name')));
+            }
+            $this->element('span', array('class' => 'fn org'), common_config('site', 'name'));
+            $this->elementEnd('a');
+            Event::handle('EndAddressData', array($this));
         }
-        $this->element('span', array('class' => 'fn org'), common_config('site', 'name'));
-        $this->elementEnd('a');
         $this->elementEnd('address');
     }
 
@@ -436,8 +456,6 @@ class Action extends HTMLOutputter // lawsuit
                     $this->menuItem(common_local_url('register'),
                                     _('Register'), _('Create an account'), false, 'nav_register');
                 }
-                $this->menuItem(common_local_url('openidlogin'),
-                                _('OpenID'), _('Login with OpenID'), false, 'nav_openid');
                 $this->menuItem(common_local_url('login'),
                                 _('Login'), _('Login to the site'), false, 'nav_login');
             }
@@ -705,6 +723,11 @@ class Action extends HTMLOutputter // lawsuit
                             _('About'));
             $this->menuItem(common_local_url('doc', array('title' => 'faq')),
                             _('FAQ'));
+            $bb = common_config('site', 'broughtby');
+            if (!empty($bb)) {
+                $this->menuItem(common_local_url('doc', array('title' => 'tos')),
+                                _('TOS'));
+            }
             $this->menuItem(common_local_url('doc', array('title' => 'privacy')),
                             _('Privacy'));
             $this->menuItem(common_local_url('doc', array('title' => 'source')),
@@ -766,7 +789,9 @@ class Action extends HTMLOutputter // lawsuit
         $this->elementStart('p');
         $this->element('img', array('id' => 'license_cc',
                                     'src' => common_config('license', 'image'),
-                                    'alt' => common_config('license', 'title')));
+                                    'alt' => common_config('license', 'title'),
+                                    'width' => '80',
+                                    'height' => '15'));
         //TODO: This is dirty: i18n
         $this->text(_('All '.common_config('site', 'name').' content and data are available under the '));
         $this->element('a', array('class' => 'license',
@@ -1066,4 +1091,15 @@ class Action extends HTMLOutputter // lawsuit
     {
         return null;
     }
+
+    /**
+     * A design for this action
+     *
+     * @return Design a design object to use
+     */
+
+    function getDesign()
+    {
+        return Design::siteDesign();
+    }
 }