Bladeren bron

#62 - Dashboard submenu and Notifications link there.

AntonLV 12 jaren geleden
bovenliggende
commit
fe59048273

+ 9 - 1
install/sql/system.sql

@@ -2591,6 +2591,8 @@ INSERT INTO `sys_objects_menu` (`object`, `title`, `set_name`, `module`, `templa
 ('sys_account', '_sys_menu_title_account', 'sys_account_links', 'system', 7, 0, 1, '', ''),
 ('sys_add_content', '_sys_menu_title_add_content', 'sys_add_content_links', 'system', 14, 0, 1, '', ''),
 ('sys_add_profile', '_sys_menu_title_add_profile', 'sys_add_profile_links', 'system', 4, 0, 1, '', ''),
+('sys_account_dashboard_submenu', '_sys_menu_title_account_dashboard', 'sys_account_dashboard', 'system', 8, 0, 1, '', ''),
+('sys_account_dashboard_administration', '_sys_menu_title_account_dashboard_administration', 'sys_account_dashboard_administration', 'system', 4, 0, 1, '', ''),
 ('sys_account_settings_submenu', '_sys_menu_title_account_settings', 'sys_account_settings', 'system', 8, 0, 1, '', ''),
 ('sys_account_settings_more', '_sys_menu_title_account_settings_more', 'sys_account_settings_more', 'system', 4, 0, 1, '', ''),
 ('sys_profiles_create', '_sys_menu_title_profiles_create', 'sys_profiles_create', 'system', 4, 0, 1, '', ''),
@@ -2620,6 +2622,8 @@ INSERT INTO `sys_menu_sets` (`set_name`, `module`, `title`, `deletable`) VALUES
 ('sys_account_notifications', 'system', '_sys_menu_set_title_account_notifications', 0),
 ('sys_add_content_links', 'system', '_sys_menu_set_title_add_content', 0),
 ('sys_add_profile_links', 'system', '_sys_menu_set_title_add_profile', 0),
+('sys_account_dashboard', 'system', '_sys_menu_set_title_account_dashboard', 0),
+('sys_account_dashboard_administration', 'system', '_sys_menu_set_title_account_dashboard_administration', 0),
 ('sys_account_settings', 'system', '_sys_menu_set_title_account_settings', 0),
 ('sys_account_settings_more', 'system', '_sys_menu_set_title_account_settings_more', 0),
 ('sys_profiles_create', 'system', '_sys_menu_set_title_profile_create_links', 0),
@@ -2677,6 +2681,10 @@ INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `tit
 ('sys_account_links', 'system', 'add-content', '_sys_menu_item_title_system_add_content', '_sys_menu_item_title_add_content', 'page.php?i=add-content', '', '', 'plus', '', 2147483646, 1, 1, 4),
 ('sys_account_links', 'system', 'logout', '_sys_menu_item_title_system_logout', '_sys_menu_item_title_logout', 'logout.php', '', '', 'sign-out', '', 2147483646, 1, 1, 5);
 
+-- account dashboard menu
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
+('sys_account_dashboard', 'system', 'account-dashboard-administration', '_sys_menu_item_title_system_account_dashboard_administration', '_sys_menu_item_title_account_dashboard_administration', 'javascript:void(0);', 'bx_menu_popup(''sys_account_dashboard_administration'', this);', '', '', '', 64, 1, 1, 1);
+
 -- account settings menu
 INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
 ('sys_account_settings', 'system', 'account-settings-profile-context', '_sys_menu_item_title_system_account_profile_context', '_sys_menu_item_title_account_profile_context', 'page.php?i=account-profile-switcher', '', '', 'user', '', 2147483646, 1, 1, 1),
@@ -3017,7 +3025,7 @@ CREATE TABLE IF NOT EXISTS `sys_objects_page` (
 INSERT INTO `sys_objects_page` (`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES
 ('sys_home', 'home', '_sys_page_title_system_home', '_sys_page_title_home', 'system', 5, 2147483647, 1, '', '', '', '', 0, 1, 0, 'BxTemplPageHome', ''),
 ('sys_about', 'about', '_sys_page_title_system_about', '_sys_page_title_about', 'system', 5, 2147483647, 1, 'page.php?i=about', '', '', '', 0, 1, 0, '', ''),
-('sys_dashboard', 'dashboard', '_sys_page_title_system_dashboard', '_sys_page_title_dashboard', 'system', 11, 2147483646, 1, 'page.php?i=dashboard', '', '', '', 0, 1, 0, '', ''),
+('sys_dashboard', 'dashboard', '_sys_page_title_system_dashboard', '_sys_page_title_dashboard', 'system', 11, 2147483646, 1, 'page.php?i=dashboard', '', '', '', 0, 1, 0, 'BxTemplPageDashboard', ''),
 ('sys_create_account', 'create-account', '_sys_page_title_system_create_account', '_sys_page_title_create_account', 'system', 5, 2147483647, 1, 'page.php?i=create-account', '', '', '', 0, 1, 0, '', ''),
 ('sys_login', 'login', '_sys_page_title_system_login', '_sys_page_title_login', 'system', 5, 2147483647, 1, 'page.php?i=login', '', '', '', 0, 1, 0, '', ''),
 ('sys_forgot_password', 'forgot-password', '_sys_page_title_system_forgot_password', '_sys_page_title_forgot_password', 'system', 5, 2147483647, 1, 'page.php?i=forgot-password', '', '', '', 0, 1, 0, '', ''),

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

@@ -1682,6 +1682,8 @@ If it is not enabled then please consider implement this optimization, since it
 	<string name="_sys_menu_item_title_switch_template_mask"><![CDATA[{0} ({1})]]></string>
 	<string name="_sys_menu_item_title_account_menu"><![CDATA[{member_display_name}]]></string>
 	<string name="_sys_menu_item_title_account_profile_context"><![CDATA[Profiles]]></string>
+	<string name="_sys_menu_item_title_account_dashboard"><![CDATA[Dashboard]]></string>
+	<string name="_sys_menu_item_title_account_dashboard_administration"><![CDATA[Administration]]></string>
 	<string name="_sys_menu_item_title_account_settings"><![CDATA[Settings]]></string>
 	<string name="_sys_menu_item_title_account_settings_delete"><![CDATA[Delete]]></string>
 	<string name="_sys_menu_item_title_account_settings_email"><![CDATA[Email]]></string>
@@ -1703,6 +1705,7 @@ If it is not enabled then please consider implement this optimization, since it
 	<string name="_sys_menu_item_title_system_switch_template"><![CDATA[Template]]></string>
 	<string name="_sys_menu_item_title_system_account_menu"><![CDATA[Account]]></string>
 	<string name="_sys_menu_item_title_system_account_profile_context"><![CDATA[Profiles]]></string>
+	<string name="_sys_menu_item_title_system_account_dashboard_administration"><![CDATA[Administration]]></string>
 	<string name="_sys_menu_item_title_system_account_settings"><![CDATA[Settings]]></string>
 	<string name="_sys_menu_item_title_system_account_settings_delete"><![CDATA[Delete]]></string>
 	<string name="_sys_menu_item_title_system_account_settings_email"><![CDATA[Email]]></string>
@@ -1722,6 +1725,8 @@ If it is not enabled then please consider implement this optimization, since it
 	<string name="_sys_menu_item_title_system_profile"><![CDATA[Profile]]></string>
 	<string name="_sys_menu_item_title_system_set_acl_level"><![CDATA[Set membership]]></string>
 	<string name="_sys_menu_set_title_account"><![CDATA[Account]]></string>
+	<string name="_sys_menu_set_title_account_dashboard"><![CDATA[Account Dashboard]]></string>
+	<string name="_sys_menu_set_title_account_dashboard_administration"><![CDATA[Account Dashboard Administration]]></string>
 	<string name="_sys_menu_set_title_account_settings"><![CDATA[Account Settings]]></string>
 	<string name="_sys_menu_set_title_account_settings_more"><![CDATA[Account Settings More]]></string>
 	<string name="_sys_menu_set_title_account_notifications"><![CDATA[Notifications]]></string>
@@ -1751,6 +1756,8 @@ If it is not enabled then please consider implement this optimization, since it
 	<string name="_sys_menu_template_title_ver_lite"><![CDATA[Vertical Links (lite)]]></string>
 	<string name="_sys_menu_template_title_account_popup"><![CDATA[Account popup]]></string>
 	<string name="_sys_menu_title_account"><![CDATA[Account Menu]]></string>
+	<string name="_sys_menu_title_account_dashboard"><![CDATA[Account Dashboard Menu]]></string>
+	<string name="_sys_menu_title_account_dashboard_administration"><![CDATA[Account Dashboard Administration Menu]]></string>
 	<string name="_sys_menu_title_account_settings"><![CDATA[Account Settings Menu]]></string>
 	<string name="_sys_menu_title_account_settings_more"><![CDATA[Account Settings More Menu]]></string>
 	<string name="_sys_menu_title_add_content"><![CDATA[Add Content Menu]]></string>

+ 32 - 0
modules/boonex/notifications/classes/BxNtfsPageView.php

@@ -0,0 +1,32 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Notifications Notifications
+ * @ingroup     DolphinModules
+ *
+ * @{
+ */
+
+bx_import('BxTemplPageDashboard');
+
+/**
+ * Entry create/edit pages
+ */
+class BxNtfsPageView extends BxTemplPageDashboard
+{
+	protected $sModule;
+
+    public function __construct($aObject, $oTemplate = false)
+    {
+        parent::__construct($aObject, $oTemplate);
+
+    	$this->sModule = 'bx_notifications';        
+
+    	bx_import('BxDolMenu');
+        BxDolMenu::getObjectInstance('sys_account_dashboard_submenu')->setSelected($this->sModule, 'account-dashboard-notifications');
+    }
+}
+
+/** @} */

+ 6 - 1
modules/boonex/notifications/install/sql/enable.sql

@@ -3,12 +3,17 @@ SET @sName = 'bx_notifications';
 
 -- PAGES & BLOCKS
 INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
-('bx_notifications_view', '_bx_ntfs_page_title_system_view', '_bx_ntfs_page_title_view', @sName, 5, 2147483647, 1, 'notifications-view', 'page.php?i=notifications-view', '', '', '', 0, 1, 0, '', '');
+('bx_notifications_view', '_bx_ntfs_page_title_system_view', '_bx_ntfs_page_title_view', @sName, 5, 2147483647, 1, 'notifications-view', 'page.php?i=notifications-view', '', '', '', 0, 1, 0, 'BxNtfsPageView', 'modules/boonex/notifications/classes/BxNtfsPageView.php');
 
 INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
 ('bx_notifications_view', 1, @sName, '_bx_ntfs_page_block_title_view', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:16:"bx_notifications";s:6:"method";s:14:"get_block_view";}', 0, 1, 1);
 
 
+-- MENU: Dashboard
+SET @iMIOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name` = 'sys_account_dashboard');
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
+('sys_account_dashboard', @sName, 'account-dashboard-notifications', '_bx_ntfs_menu_item_title_system_notifications', '_bx_ntfs_menu_item_title_notifications', 'page.php?i=notifications-view', '', '', 'bell col-green3', '', '', 2147483646, 1, 0, @iMIOrder + 1);
+
 -- MENU: Notifications
 SET @iMIOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name` = 'sys_account_notifications');
 INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES

+ 23 - 0
modules/boonex/uni/data/template/system/scripts/BxTemplPageDashboard.php

@@ -0,0 +1,23 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
+ */
+
+bx_import('BxBasePageDashboard');
+
+/**
+ * @see BxBasePageAccount
+ */
+class BxTemplPageDashboard extends BxBasePageDashboard
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 2 - 2
studio/template/login_form.html

@@ -4,13 +4,13 @@
         <input type="hidden" name="csrf_token" value="__csrf_token__" />
         <input type="hidden" name="relocate" value="__relocate_url__" />
         <div class="bx-std-lf-input">
-            <input class="bx-def-font-inputs bx-form-input-text bx-def-color-ft-grayed-i" id="admin_username" type="text" name="ID" value="" placeholder="<bx_text:_adm_txt_login_username />" tabindex="1" />
+            <input class="bx-def-font-inputs bx-form-input-text bx-def-color-ft-grayed-i" id="admin_username" type="text" name="ID" value="" placeholder="<bx_text_attribute:_adm_txt_login_username />" tabindex="1" />
             <div class="bx-def-padding-sec-top">
                 <input class="form_input_checkbox" type="checkbox" name="rememberMe" id="login_box_form_input_rememberMe" tabindex="3"  /> <label for="login_box_form_input_rememberMe"><bx_text:_adm_txt_remember_me /></label>
             </div>
         </div>
         <div class="bx-std-lf-input">
-            <input class="bx-def-font-inputs bx-form-input-text bx-def-color-ft-grayed-i" id="admin_password" type="password" name="Password" value="" placeholder="<bx_text:_adm_txt_login_password />" tabindex="2" />
+            <input class="bx-def-font-inputs bx-form-input-text bx-def-color-ft-grayed-i" id="admin_password" type="password" name="Password" value="" placeholder="<bx_text_attribute:_adm_txt_login_password />" tabindex="2" />
             <div class="bx-def-padding-sec-top">
                 <a href="__forgot_password_url__"><bx_text:_adm_txt_forgot_password /></a>
             </div>

+ 35 - 0
template/scripts/BxBasePageDashboard.php

@@ -0,0 +1,35 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
+ */
+
+bx_import('BxTemplPage');
+
+/**
+ * Dashboard page.
+ */
+class BxBasePageDashboard extends BxTemplPage
+{
+    public function __construct($aObject, $oTemplate)
+    {
+        parent::__construct($aObject, $oTemplate);
+
+        // set dashboard submenu
+        bx_import('BxDolMenu');
+        bx_import('BxDolPermalinks');
+        $oMenuSubmenu = BxDolMenu::getObjectInstance('sys_site_submenu');
+        if ($oMenuSubmenu) {
+            $oMenuSubmenu->setObjectSubmenu('sys_account_dashboard_submenu', array (
+                'title' => _t('_sys_menu_item_title_account_dashboard'),
+                'link' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=dashboard'),
+                'icon' => '',
+            ));
+        }
+    }
+}
+
+/** @} */