diff --git a/root/includes/acp/acp_portal.php b/root/includes/acp/acp_portal.php
index 73979106..9336674e 100644
--- a/root/includes/acp/acp_portal.php
+++ b/root/includes/acp/acp_portal.php
@@ -39,6 +39,8 @@ class acp_portal
$form_key = 'acp_portal';
add_form_key($form_key);
+
+ // @todo: add a way to show custom HTML files, instead of the standard board3 portal one, on the settings page of the modules
/**
* Validation types are:
diff --git a/root/language/en/mods/portal/portal_main_menu_module.php b/root/language/en/mods/portal/portal_main_menu_module.php
new file mode 100644
index 00000000..bc293cd1
--- /dev/null
+++ b/root/language/en/mods/portal/portal_main_menu_module.php
@@ -0,0 +1,56 @@
+ 'Menu',
+ 'M_CONTENT' => 'Content',
+ 'M_ACP' => 'ACP',
+ 'M_HELP' => 'Help',
+ 'M_BBCODE' => 'BBCode FAQ',
+ 'M_TERMS' => 'Terms of use',
+ 'M_PRV' => 'Privacy policy',
+ 'M_SEARCH' => 'Search',
+
+ // ACP
+ 'ACP_PORTAL_MENU' => 'Menu settings',
+ 'ACP_PORTAL_MENU_EXP' => 'Manage your main menu',
+ 'ACP_PORTAL_MENU_MANAGE' => 'Manage menu',
+ 'ACP_PORTAL_MENU_MANAGE_EXP' => 'You can manage the links of your main menu here.
Change the type of link by changing the selected option in the drop-down list next to the link.',
+ 'ACP_PORTAL_MENU_CAT' => 'Category',
+ 'ACP_PORTAL_MENU_INT' => 'Internal link',
+ 'ACP_PORTAL_MENU_EXT' => 'External link',
+ 'ACP_PORTAL_MENU_TITLE' => 'Title',
+ 'ACP_PORTAL_MENU_URL' => 'URL',
+ 'ACP_PORTAL_MENU_TYPE' => 'Type',
+));
+
+?>
\ No newline at end of file
diff --git a/root/portal/modules/portal_main_menu.php b/root/portal/modules/portal_main_menu.php
new file mode 100644
index 00000000..6b9be633
--- /dev/null
+++ b/root/portal/modules/portal_main_menu.php
@@ -0,0 +1,173 @@
+lang}/mods/portal/"
+ */
+ var $language = 'portal_main_menu_module';
+
+ function get_template_side($module_id)
+ {
+ global $config, $template, $phpEx, $phpbb_root_path;
+
+ $template->assign_vars(array(
+ 'U_M_BBCODE' => append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode'),
+ 'U_M_TERMS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'),
+ 'U_M_PRV' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'),
+ ));
+
+ return 'main_menu_side.html';
+ }
+
+ function get_template_acp($module_id)
+ {
+ return array(
+ 'title' => 'ACP_PORTAL_MENU',
+ 'vars' => array(
+ 'legend1' => 'ACP_PORTAL_MENU',
+ 'board3_links_urls' => array('lang' => 'ACP_PORTAL_MENU_MANAGE', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => 'manage_links', 'submit' => 'update_links'),
+ ),
+ );
+ }
+
+ /**
+ * API functions
+ */
+ function install($module_id)
+ {
+ set_config('board3_links_manage', '');
+ set_config('board3_links_options', '');
+ return true;
+ }
+
+ function uninstall($module_id)
+ {
+ global $db;
+
+ $del_config = array(
+ 'board3_links_manage',
+ 'board3_links_options',
+ );
+ $sql = 'DELETE FROM ' . CONFIG_TABLE . '
+ WHERE ' . $db->sql_in_set('config_name', $del_config);
+ return $db->sql_query($sql);
+ }
+
+ /*
+ * create a table that lets the user manage the links
+ * @todo: finish the main menu manage section
+ * links_options:
+ * 0 = category
+ * 1 = internal link
+ * 2 = external link
+ * links_urls: contains the URLs or titles (for categories)
+ */
+ function manage_links($key)
+ {
+ global $config, $phpbb_admin_path, $user, $phpEx, $db;
+
+ // @todo: merge into constants file, maybe even portal contants file
+ define('B3_LINKS_CAT', 0);
+ define('B3_LINKS_INT', 1);
+ define('B3_LINKS_EXT', 2);
+
+ $sql = 'SELECT module_id FROM ' . PORTAL_MODULES_TABLE . " WHERE module_classname = 'main_menu'";
+ $result = $db->sql_query($sql);
+ $module_id = $db->sql_fetchfield('module_id');
+ $db->sql_freeresult($result);
+
+ $u_action = append_sid($phpbb_admin_path . 'index.' . $phpEx, 'i=portal&mode=config&module_id=' . $module_id);
+ // opening code of the table
+ $table_begin = "
| {$user->lang['ACP_PORTAL_MENU_TITLE']} | {$user->lang['ACP_PORTAL_MENU_URL']} | {$user->lang['ACP_PORTAL_MENU_TYPE']} | {$user->lang['ACTIONS']} |
|---|