Skip to content

Commit

Permalink
Show custom plugins tabs in the public part of the platform
Browse files Browse the repository at this point in the history
  • Loading branch information
nosolored authored and ywarnier committed Apr 25, 2017
1 parent 2165beb commit 1c568a0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
19 changes: 19 additions & 0 deletions main/inc/lib/banner.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,25 @@ function return_navigation_array()
}
}
}
}else{
// Custom tabs public
$customTabs = getCustomTabs();
if (!empty($customTabs)) {
foreach ($customTabs as $tab) {
if (api_get_setting($tab['variable'], $tab['subkey']) == 'true' &&
isset($possible_tabs[$tab['subkey']]) &&
api_get_plugin_setting(strtolower(str_replace('Tabs', '', $tab['subkeytext'])), 'public_main_menu_tab') == 'true'
) {
$possible_tabs[$tab['subkey']]['url'] = api_get_path(WEB_PATH).$possible_tabs[$tab['subkey']]['url'];
$navigation[$tab['subkey']] = $possible_tabs[$tab['subkey']];
} else {
if (isset($possible_tabs[$tab['subkey']])) {
$possible_tabs[$tab['subkey']]['url'] = api_get_path(WEB_PATH).$possible_tabs[$tab['subkey']]['url'];
$menu_navigation[$tab['subkey']] = $possible_tabs[$tab['subkey']];
}
}
}
}
}

return array(
Expand Down
1 change: 1 addition & 0 deletions plugin/buycourses/lang/english.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
$strings['plugin_comment'] = "Sell courses directly through your Chamilo portal, using a PayPal account to receive funds. Neither the Chamilo association nor the developers involved could be considered responsible of any issue you might suffer using this plugin.";
$strings['show_main_menu_tab'] = "Show tab in main menu";
$strings['show_main_menu_tab_help'] = "In case of not wanting to show the tab, you can create this link in your Chamilo homepage : %s";
$strings['public_main_menu_tab'] = "Show tab public main menu";
$strings['include_sessions'] = "Include sessions";
$strings['paypal_enable'] = "Enable PayPal";
$strings['commissions_enable'] = "Enable Commissions";
Expand Down
1 change: 1 addition & 0 deletions plugin/buycourses/lang/spanish.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
$strings['plugin_comment'] = "Vender cursos a través de PayPal directamente desde su portal Chamilo. La asociación Chamilo y los desarrolladores involucrados no pueden ser considerados responsables de cualquier inconveniente que se presente.";
$strings['show_main_menu_tab'] = "Mostrar pestaña en el menu principal";
$strings['show_main_menu_tab_help'] = "En caso de no querer mostrar la pestaña, puede agregar el siguiente enlace a su portal Chamilo: %s";
$strings['public_main_menu_tab'] = "Mostrar pestaña sin login";
$strings['include_sessions'] = "Incluir sesiones";
$strings['paypal_enable'] = "Habilitar PayPal";
$strings['commissions_enable'] = "Habilitar Comisiones";
Expand Down
1 change: 1 addition & 0 deletions plugin/buycourses/src/buy_course_plugin.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public function __construct()
",
array(
'show_main_menu_tab' => 'boolean',
'public_main_menu_tab' => 'boolean',
'include_sessions' => 'boolean',
'include_services' => 'boolean',
'paypal_enable' => 'boolean',
Expand Down

0 comments on commit 1c568a0

Please sign in to comment.