Explorar el Código

#159 site homepage tour

Alex Trofimov hace 11 años
padre
commit
dad7e765ec

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

@@ -2022,6 +2022,10 @@ If it is not enabled then please consider implement this optimization, since it
 	<string name="_sys_tour_launcher_add_apps_title"><![CDATA[Now DO add new Apps!]]></string>
 	<string name="_sys_tour_launcher_add_apps_txt"><![CDATA[Trident comes with only a handful of core Apps. Choose, download and install Apps to add profiles types, modules, system tools, plugins, languages and design templates. You can activate and deactivate installed Apps. Trident is super-modular and incredibly flexible, letting you choose your own combination of functionality, settings and database structure to make the social site of your dreams real. Even without changing anything you will have the perfectly functioning social site!]]></string>
 
+	<string name="_sys_tour_homepage_welcome_title"><![CDATA[This is the Homepage]]></string>
+	<string name="_sys_tour_homepage_welcome_txt"><![CDATA[At first there isn't much here. Install more Apps via Studio, add more blocks via Studio > Pages > Homepage, create profiles, appoint admins, post some content and your site will come alive!]]></string>
+	<string name="_sys_tour_homepage_account_menu_title"><![CDATA[Get to know your Account Menu]]></string>
+	<string name="_sys_tour_homepage_account_menu_txt"><![CDATA[Add and manage profiles, check notifications, access account settings. Admins and Moderators can use it to access Dash with links to site content and profiles management.]]></string>
 
 	<string name="_sys_txt_access_denied"><![CDATA[Access denied]]></string>
 	<string name="_sys_txt_account_pending"><![CDATA[Your account is pending approval, please wait until it is activated.]]></string>

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

@@ -2023,6 +2023,11 @@
 	<string name="_sys_tour_launcher_add_apps_title"><![CDATA[<i class="sys-icon plus"></i> А сейчас, добавь новые приложения!]]></string>
 	<string name="_sys_tour_launcher_add_apps_txt"><![CDATA[В Trident уже входят самые необходимые приложения. Выбери нужные, скачай и затем проинсталлируй приложения, чтобы добавить разные виды профайлов, модулей, системных утилит, языков и дизайнов. Проинсталлированные приложения можно активировать и деактивировать. Trident очень гибкий и имеет модульную архитектуру, тем самым позволяя создать сайт мечты выбрав нужную функциональность, настройки и структуру базы данных. Но даже не меняя ничего вы получите прекрасно фунционирующий сайт!]]></string>
 
+	<string name="_sys_tour_homepage_welcome_title"><![CDATA[Это главная страница сайта]]></string>
+	<string name="_sys_tour_homepage_welcome_txt"><![CDATA[В самом начале, тут не много информации, но после инсталляции нескольких модулей, добавлении дополнительных секций на страницу из Студии и добавлении содержимого - сайт оживёт!]]></string>
+	<string name="_sys_tour_homepage_account_menu_title"><![CDATA[Узнай меню своей учётной записи]]></string>
+	<string name="_sys_tour_homepage_account_menu_txt"><![CDATA[Здесь можно добавлять и управлять профилями, следить за уведомлениями, открывать настройки своей учётной записи. Администраторы и модераторы сайта могут использовать это меню, чтобы открыть приборную панель со ссылками по администрации сайта.]]></string>
+
 	<string name="_sys_txt_access_denied"><![CDATA[Доступ запрещён]]></string>
 	<string name="_sys_txt_account_pending"><![CDATA[Ваш аккаунт ожидает одобрения, пожалуйста, дождитесь его активации.]]></string>
 	<string name="_sys_txt_account_profile_context_change_suggestion"><![CDATA[Это Ваш профиль, Вы можете <a href="{0}">изменить свой текущий профиль</a> на этот]]></string>

+ 43 - 0
template/homepage_tour.html

@@ -0,0 +1,43 @@
+<script defer type="text/javascript">
+<!--    
+    glTour = new Shepherd.Tour({
+        defaults: {
+            classes: 'shepherd-theme-__tour_theme__ bx-def-z-index-modal',
+            showCancelLink: true,
+            scrollTo: true
+        }
+    });
+
+    Shepherd.on('cancel', function () {
+        $.cookie('homepage-tour-hidden', 1, {expires: 9999});
+    });
+
+    glTour.addStep('tour-homepage', {
+        title: '<bx_text_js:_sys_tour_homepage_welcome_title />',
+        text: '<bx_text_js:_sys_tour_homepage_welcome_txt />',
+        buttons: [{
+            text: '<bx_text_js:_sys_exit />',
+            action: glTour.cancel,
+            classes: 'shepherd-button-secondary'
+        },{
+            text: '<bx_text_js:_sys_next />',
+            action: glTour.next,
+            classes: 'shepherd-button-primary'
+        }]
+    });
+
+    glTour.addStep('tour-account-menu', {
+        title: '<bx_text_js:_sys_tour_homepage_account_menu_title />',
+        text: '<bx_text_js:_sys_tour_homepage_account_menu_txt />',
+        attachTo: '#bx-menu-toolbar-item-account bottom',
+        buttons: [{
+            text: '<bx_text_js:_sys_done />',
+            action: glTour.cancel,
+            classes: 'shepherd-button-primary'
+        }]
+    });
+
+    if (!$.cookie('homepage-tour-hidden'))
+        glTour.start();
+-->
+</script>

+ 19 - 0
template/scripts/BxBasePageHome.php

@@ -12,11 +12,30 @@
  */
 class BxBasePageHome extends BxTemplPage
 {
+    protected $_sTourTheme = 'default';
+
     public function __construct($aObject, $oTemplate)
     {
         parent::__construct($aObject, $oTemplate);
         $this->addMarkers(array('site_title' => getParam('site_title')));
     }
+
+    public function getCode ()
+    {
+        $s = parent::getCode ();
+        if (isAdmin())
+            $s .= $this->_oTemplate->parseHtmlByName('homepage_tour.html', array('tour_theme' => $this->_sTourTheme));
+        return $s;
+    }
+
+    protected function _addJsCss()
+    {
+        parent::_addJsCss();
+        if (isAdmin()) {
+            $this->_oTemplate->addJs('shepherd/shepherd.min.js');
+            $this->_oTemplate->addCss(BX_DIRECTORY_PATH_PLUGINS_PUBLIC . 'shepherd/css/|shepherd-theme-' . $this->_sTourTheme . '.css');
+        }
+    }
 }
 
 /** @} */