diff --git a/install.xml b/install.xml index ce93b817..22b3d5a0 100644 --- a/install.xml +++ b/install.xml @@ -538,18 +538,6 @@ Deny from All }]]> - - - - - - diff --git a/root/includes/acp/acp_portal.php b/root/includes/acp/acp_portal.php index 725982b0..dfdce18f 100644 --- a/root/includes/acp/acp_portal.php +++ b/root/includes/acp/acp_portal.php @@ -23,6 +23,8 @@ class acp_portal { global $db, $user, $cache, $template, $display_vars; global $config, $phpbb_root_path, $portal_root_path, $phpbb_admin_path, $phpEx; + + include($phpbb_root_path . 'portal/includes/constants.' . $phpEx); $portal_root_path = PORTAL_ROOT_PATH; if (!function_exists('column_string_const')) { diff --git a/root/portal.php b/root/portal.php index 1de76de3..e4a41b07 100644 --- a/root/portal.php +++ b/root/portal.php @@ -16,8 +16,8 @@ $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); +include($phpbb_root_path . 'portal/includes/constants.' . $phpEx); $portal_root_path = PORTAL_ROOT_PATH; -$portal_icons_path = PORTAL_ICONS_PATH; include($phpbb_root_path . $portal_root_path . 'includes/functions_modules.' . $phpEx); include($phpbb_root_path . 'includes/functions_display.' . $phpEx); include($phpbb_root_path . $portal_root_path . 'includes/functions.' . $phpEx); diff --git a/root/portal/includes/constants.php b/root/portal/includes/constants.php new file mode 100644 index 00000000..1fc5977f --- /dev/null +++ b/root/portal/includes/constants.php @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/root/portal/modules/portal_main_menu.php b/root/portal/modules/portal_main_menu.php index 54a3ff43..dea9c1a8 100644 --- a/root/portal/modules/portal_main_menu.php +++ b/root/portal/modules/portal_main_menu.php @@ -54,12 +54,7 @@ class portal_main_menu_module function get_template_side($module_id) { - global $config, $template, $phpEx, $phpbb_root_path; - - // @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); + global $config, $template, $phpEx, $phpbb_root_path, $user; $links_urls = $links_options = $links_titles = array(); @@ -67,12 +62,14 @@ class portal_main_menu_module $links_options = explode(';', $config['board3_links_options']); $links_titles = explode(';', $config['board3_links_titles']); + // @todo: add posibility to set permissions for links + for ($i = 0; $i < sizeof($links_urls); $i++) { if($links_options[$i] == B3_LINKS_CAT) { $template->assign_block_vars('portalmenu', array( - 'CAT_TITLE' => $links_titles[$i], + 'CAT_TITLE' => (isset($user->lang[$links_titles[$i]])) ? $user->lang[$links_titles[$i]] : $links_titles[$i], )); } else @@ -88,7 +85,7 @@ class portal_main_menu_module } $template->assign_block_vars('portalmenu.links', array( - 'LINK_TITLE' => $links_titles[$i], + 'LINK_TITLE' => (isset($user->lang[$links_titles[$i]])) ? $user->lang[$links_titles[$i]] : $links_titles[$i], 'LINK_URL' => $cur_url, )); } @@ -105,7 +102,8 @@ class portal_main_menu_module function get_template_acp($module_id) { - return array( + // do not remove this as it is needed in order to run manage_links + return array( 'title' => 'ACP_PORTAL_MENU', 'vars' => array( 'legend1' => 'ACP_PORTAL_MENU', @@ -119,9 +117,53 @@ class portal_main_menu_module */ function install($module_id) { - set_config('board3_links_urls', ''); - set_config('board3_links_options', ''); - set_config('board3_links_titles', ''); + global $phpbb_root_path, $phpEx; + + $links_titles = array( + 'M_CONTENT', + 'INDEX', + 'SEARCH', + 'REGISTER', + 'MEMBERLIST', + 'THE_TEAM', + 'M_HELP', + 'FAQ', + 'M_BBCODE', + 'M_TERMS', + 'M_PRV', + ); + + $links_options = array( + B3_LINKS_CAT, + B3_LINKS_INT, + B3_LINKS_INT, + B3_LINKS_INT, + B3_LINKS_INT, + B3_LINKS_INT, + B3_LINKS_CAT, + B3_LINKS_INT, + B3_LINKS_INT, + B3_LINKS_INT, + B3_LINKS_INT, + ); + + $links_urls = array( + '', + 'index.' . $phpEx, + 'search.' . $phpEx, + 'ucp.' . $phpEx . '?mode=register', + 'memberlist.' . $phpEx, + 'memberlist.' . $phpEx . '?mode=leaders', + '', + 'faq.' . $phpEx, + 'faq.' . $phpEx . '?mode=bbcode', + 'ucp.' . $phpEx . '?mode=terms', + 'ucp.' . $phpEx . '?mode=privacy', + ); + + set_config('board3_links_urls', implode(';', $links_urls)); + set_config('board3_links_options', implode(';', $links_options)); + set_config('board3_links_titles', implode(';', $links_titles)); return true; } @@ -143,11 +185,6 @@ class portal_main_menu_module { global $config, $phpbb_admin_path, $user, $phpEx, $db, $template; - // @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); - $action = request_var('action', ''); $action = (isset($_POST['add'])) ? 'add' : $action; $action = (isset($_POST['save'])) ? 'save' : $action; diff --git a/root/styles/prosilver/template/portal/portal_body.html b/root/styles/prosilver/template/portal/portal_body.html index 613275f2..2ad336f5 100644 --- a/root/styles/prosilver/template/portal/portal_body.html +++ b/root/styles/prosilver/template/portal/portal_body.html @@ -71,6 +71,6 @@ - + \ No newline at end of file