Просмотр исходного кода

#273 Cover image area: homepage cover

Alex Trofimov 10 лет назад
Родитель
Сommit
dc0dfcdcda

+ 23 - 0
inc/classes/BxDolCover.php

@@ -38,6 +38,7 @@ class BxDolCover extends BxDol implements iBxDolSingleton
     protected $_sTemplateName = 'cover.html';
     protected $_sTemplateName = 'cover.html';
     protected $_sTemplateNameEmpty = 'cover_empty.html';
     protected $_sTemplateNameEmpty = 'cover_empty.html';
     protected $_sCoverImageUrl = false;
     protected $_sCoverImageUrl = false;
+    protected $_aOptiondDefault = array();
 
 
     /**
     /**
      * Constructor
      * Constructor
@@ -48,6 +49,28 @@ class BxDolCover extends BxDol implements iBxDolSingleton
             trigger_error ('Multiple instances are not allowed for the BxDolCover class.', E_USER_ERROR);
             trigger_error ('Multiple instances are not allowed for the BxDolCover class.', E_USER_ERROR);
 
 
         parent::__construct();
         parent::__construct();
+
+        $this->_aOptiondDefault = array(
+            'class' => '',
+            'title' => '',
+            'actions' => '',
+            'bx_if:image' => array (
+                'condition' => false,
+                'content' => array(),
+            ),
+            'bx_if:icon' => array (
+                'condition' => false,
+                'content' => array(),
+            ),
+            'bx_if:bg' => array (
+                'condition' => false,
+                'content' => array(),
+            ),
+            'bx_if:logged_in' => array(
+                'condition' => isLogged(),
+                'content' => array(),
+            ),
+        );
     }
     }
 
 
     /**
     /**

+ 1 - 1
modules/boonex/english/data/langs/system/en.xml

@@ -2144,7 +2144,7 @@ If it is not enabled then please consider implement this optimization, since it
     <string name="_sys_txt_form_entry_input_picture_use_as_thumb"><![CDATA[Use as Thumbnail]]></string>
     <string name="_sys_txt_form_entry_input_picture_use_as_thumb"><![CDATA[Use as Thumbnail]]></string>
 	<string name="_sys_txt_form_submission_error"><![CDATA[Incorrect info. Please, check your inputs and try to submit again.]]></string>
 	<string name="_sys_txt_form_submission_error"><![CDATA[Incorrect info. Please, check your inputs and try to submit again.]]></string>
 
 
-    <string name="_sys_txt_homepage_cover"><![CDATA[Welcome!]]></string>
+    <string name="_sys_txt_homepage_cover"><![CDATA[Unity is strength... when there is teamwork and collaboration, wonderful things can be achieved.<br /><button class="bx-btn bx-hide-when-logged-in" onclick="document.location='{0}'">Join Now!</button>]]></string>
 	<string name="_sys_txt_login_description"><![CDATA[Not a member yet? <a href="{0}">Join now!</a>]]></string>
 	<string name="_sys_txt_login_description"><![CDATA[Not a member yet? <a href="{0}">Join now!</a>]]></string>
 	<string name="_sys_txt_login_error"><![CDATA[Entered email or password is incorrect. Please try again.]]></string>
 	<string name="_sys_txt_login_error"><![CDATA[Entered email or password is incorrect. Please try again.]]></string>
 	<string name="_sys_txt_login_invalid_role"><![CDATA[Access denied]]></string>
 	<string name="_sys_txt_login_invalid_role"><![CDATA[Access denied]]></string>

+ 1 - 1
modules/boonex/russian/data/langs/system/ru.xml

@@ -2145,7 +2145,7 @@
     <string name="_sys_txt_form_entry_input_picture_use_as_thumb"><![CDATA[Использовать в качестве Миниатюры]]></string>
     <string name="_sys_txt_form_entry_input_picture_use_as_thumb"><![CDATA[Использовать в качестве Миниатюры]]></string>
 	<string name="_sys_txt_form_submission_error"><![CDATA[Неправильная информация. Пожалуйста, проверьте ввод и отошлите снова.]]></string>
 	<string name="_sys_txt_form_submission_error"><![CDATA[Неправильная информация. Пожалуйста, проверьте ввод и отошлите снова.]]></string>
 
 
-    <string name="_sys_txt_homepage_cover"><![CDATA[Добро пожаловать!]]></string>
+    <string name="_sys_txt_homepage_cover"><![CDATA[Сплоченность людей — нерушимая крепость.<br /><button class="bx-btn bx-hide-when-logged-in" onclick="document.location='{0}'">Присоедениться!</button>]]></string>
 	<string name="_sys_txt_login_description"><![CDATA[Ещё нет аккаунта? <a href="{0}">Зарегистрируйтесь!</a>]]></string>
 	<string name="_sys_txt_login_description"><![CDATA[Ещё нет аккаунта? <a href="{0}">Зарегистрируйтесь!</a>]]></string>
 	<string name="_sys_txt_login_error"><![CDATA[Введённый имейл или пароль неправильны. Пожалуйста, попытайтесь снова.]]></string>
 	<string name="_sys_txt_login_error"><![CDATA[Введённый имейл или пароль неправильны. Пожалуйста, попытайтесь снова.]]></string>
 	<string name="_sys_txt_login_invalid_role"><![CDATA[Доступ запрещён]]></string>
 	<string name="_sys_txt_login_invalid_role"><![CDATA[Доступ запрещён]]></string>

+ 8 - 0
template/cover.html

@@ -1,3 +1,11 @@
+<bx_if:logged_in>
+<style>
+    .bx-hide-when-logged-in {
+        display:none !important;
+    }
+</style>
+</bx_if:logged_in>
+
 <div class="bx-menu-toolbar-padding">
 <div class="bx-menu-toolbar-padding">
 <div class="bx-cover-wrapper __class__" <bx_if:bg>style="background-image:url(__image_url__)"</bx_if:bg>>
 <div class="bx-cover-wrapper __class__" <bx_if:bg>style="background-image:url(__image_url__)"</bx_if:bg>>
 
 

+ 6 - 1
template/css/cover.css

@@ -17,7 +17,12 @@
 
 
 .bx-cover-title {
 .bx-cover-title {
     font-weight:bold;
     font-weight:bold;
-    text-shadow:0px 0px 0.125rem #000;
+    text-shadow:0 0 0.125rem rgba(0, 0, 0, .5);
+}
+
+.bx-cover-title .bx-btn {
+    display:inline-block;
+    float:none;
 }
 }
 
 
 .bx-cover-homepage {
 .bx-cover-homepage {

+ 5 - 5
template/scripts/BxBaseCover.php

@@ -37,21 +37,21 @@ class BxBaseCover extends BxDolCover
         if (!$this->_aOptions || !$this->_sTemplateName) {
         if (!$this->_aOptions || !$this->_sTemplateName) {
 
 
             $oMenuSubmenu = BxDolMenu::getObjectInstance('sys_site_submenu');
             $oMenuSubmenu = BxDolMenu::getObjectInstance('sys_site_submenu');
-            $mixedParams = $oMenuSubmenu->getParamsForCover();
+            $mixedOptions = $oMenuSubmenu->getParamsForCover();
 
 
-            if (!$mixedParams || !is_array($mixedParams))
+            if (!$mixedOptions || !is_array($mixedOptions))
                 return $this->_oTemplate->parseHtmlByName($this->_sTemplateNameEmpty, array());
                 return $this->_oTemplate->parseHtmlByName($this->_sTemplateNameEmpty, array());
             
             
             if ($this->_sCoverImageUrl)
             if ($this->_sCoverImageUrl)
-                $mixedParams['bx_if:bg'] = array (
+                $mixedOptions['bx_if:bg'] = array (
                     'condition' => true,
                     'condition' => true,
                     'content' => array('image_url' => $this->_sCoverImageUrl),
                     'content' => array('image_url' => $this->_sCoverImageUrl),
                 );
                 );
 
 
-            return $this->_oTemplate->parseHtmlByName($this->_sTemplateName, $mixedParams);
+            return $this->_oTemplate->parseHtmlByName($this->_sTemplateName, array_merge($this->_aOptiondDefault, $mixedOptions));
         }        
         }        
 
 
-        return $this->_oTemplate->parseHtmlByName($this->_sTemplateName, $this->_aOptions);
+        return $this->_oTemplate->parseHtmlByName($this->_sTemplateName, array_merge($this->_aOptiondDefault, $this->_aOptions));
     }
     }
 
 
     /**
     /**

+ 1 - 7
template/scripts/BxBaseMenuSubmenu.php

@@ -99,11 +99,9 @@ class BxBaseMenuSubmenu extends BxTemplMenu
         $oMenuActions = BxDolMenu::getObjectInstance($this->_sObjectActionsMenu);
         $oMenuActions = BxDolMenu::getObjectInstance($this->_sObjectActionsMenu);
 
 
         $aVars = array (
         $aVars = array (
-            'class' => '',
             'object' => $this->_sObject,
             'object' => $this->_sObject,
-            'id' => 'bx-menu-submenu-menu',
             'title' => $aMenuItemSelected['title'],
             'title' => $aMenuItemSelected['title'],
-            'link' => BxDolPermalinks::getInstance()->permalink($aMenuItemSelected['link']),            
+            'link' => BxDolPermalinks::getInstance()->permalink($aMenuItemSelected['link']),
             'actions' => $oMenuActions ? $oMenuActions->getCode() : '',
             'actions' => $oMenuActions ? $oMenuActions->getCode() : '',
             'bx_if:image' => array (
             'bx_if:image' => array (
                 'condition' => false !== strpos($aMenuItemSelected['icon'], '.'),
                 'condition' => false !== strpos($aMenuItemSelected['icon'], '.'),
@@ -113,10 +111,6 @@ class BxBaseMenuSubmenu extends BxTemplMenu
                 'condition' => false === strpos($aMenuItemSelected['icon'], '.'),
                 'condition' => false === strpos($aMenuItemSelected['icon'], '.'),
                 'content' => array('icon' => $aMenuItemSelected['icon']),
                 'content' => array('icon' => $aMenuItemSelected['icon']),
             ),
             ),
-            'bx_if:bg' => array (
-                'condition' => false,
-                'content' => array('image_url' => ''),
-            ),
         );
         );
 
 
         // if (!$this->_sObjectSubmenu && !$this->_mixedMainMenuItemSelected && $aMenuItemSelected['submenu_object'])
         // if (!$this->_sObjectSubmenu && !$this->_mixedMainMenuItemSelected && $aMenuItemSelected['submenu_object'])

+ 1 - 14
template/scripts/BxBasePageHome.php

@@ -22,20 +22,7 @@ class BxBasePageHome extends BxTemplPage
         $oCover = BxDolCover::getInstance();
         $oCover = BxDolCover::getInstance();
         $oCover->set(array(
         $oCover->set(array(
             'class' => 'bx-cover-homepage',
             'class' => 'bx-cover-homepage',
-            'title' => _t('_sys_txt_homepage_cover'),
-            'actions' => '',
-            'bx_if:image' => array (
-                'condition' => false,
-                'content' => array(),
-            ),
-            'bx_if:icon' => array (
-                'condition' => false,
-                'content' => array(),
-            ),
-            'bx_if:bg' => array (
-                'condition' => false,
-                'content' => array(),
-            ),
+            'title' => _t('_sys_txt_homepage_cover', BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=create-account')),
         ));
         ));
     }
     }