Przeglądaj źródła

Show custom plugins tabs in the public part of the platform

nosolored 8 lat temu
rodzic
commit
1c568a04f3

+ 19 - 0
main/inc/lib/banner.lib.php

@@ -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(

+ 1 - 0
plugin/buycourses/lang/english.php

@@ -3,6 +3,7 @@ $strings['plugin_title'] = "Sell courses";
 $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";

+ 1 - 0
plugin/buycourses/lang/spanish.php

@@ -3,6 +3,7 @@ $strings['plugin_title'] = "Venta de cursos";
 $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";

+ 1 - 0
plugin/buycourses/src/buy_course_plugin.class.php

@@ -76,6 +76,7 @@ class BuyCoursesPlugin extends Plugin
             ",
             array(
                 'show_main_menu_tab' => 'boolean',
+                'public_main_menu_tab' => 'boolean',
                 'include_sessions' => 'boolean',
                 'include_services' => 'boolean',
                 'paypal_enable' => 'boolean',