Browse Source

Blocking breadcrumb if option is set see BT#6528

Julio Montoya 11 years ago
parent
commit
fcf77f44af

+ 6 - 1
main/inc/lib/template.lib.php

@@ -647,7 +647,7 @@ class Template
         }
         $this->assign('profile_link', $profile_link);
 
-        //Message link
+        // Message link.
         $message_link = null;
         if (api_get_setting('allow_message_tool') == 'true') {
             $message_link = '<a href="'.api_get_path(WEB_CODE_PATH).'messages/inbox.php">'.get_lang('Inbox').'</a>';
@@ -682,6 +682,11 @@ class Template
      */
     public function loadBreadcrumbToTemplate()
     {
+
+        if (api_get_setting('breadcrumb_navigation_display') == 'false') {
+            return;
+        }
+
         $breadcrumb = $this->returnBreadcrumb();
         $this->assign('breadcrumb', $breadcrumb);
     }

+ 4 - 1
main/install/1.10.0/db_main.sql

@@ -968,6 +968,7 @@ VALUES
 ('template', NULL, 'text', 'stylesheets', 'default', 'DefaultTemplateTitle', 'DefaultTemplateComment', NULL, NULL, 1),
 ('log_transactions','exercise_attempt','checkbox','LogTransactions','false','LogTransactionsForExerciseAttempts','LogTransactionsForExerciseAttemptsComment',NULL,'LogTransactionsForExerciseAttemptsText', 1),
 ('transaction_action_map','exercise_attempt','text','TransactionMapping','a:0:{}','TransactionMapForExerciseAttempts','TransactionMapForExerciseAttemptsComment',NULL,'TransactionMapForExerciseAttemptsText', 1),
+('breadcrumb_navigation_display', NULL, 'radio', 'Platform','true','BreadcrumbNavigationDisplayTitle', 'BreadcrumbNavigationDisplayComment', NULL, NULL, 1),
 ('chamilo_database_version', NULL, 'textfield', NULL, '1.10.0.001','DatabaseVersion','', NULL, NULL, 0); -- base value, updated at end of file. Don't change here
 
 UNLOCK TABLES;
@@ -1325,7 +1326,9 @@ VALUES
 ('login_as_allowed','true','Yes'),
 ('login_as_allowed','false','No'),
 ('admins_can_set_users_pass','true','Yes'),
-('admins_can_set_users_pass','false','No');
+('admins_can_set_users_pass','false','No'),
+('breadcrumb_navigation_display', 'true', 'Show'),
+('breadcrumb_navigation_display', 'false', 'Hide');
 
 UNLOCK TABLES;
 

+ 4 - 0
main/install/1.10.0/migrate-db-1.9.0-1.10.0-pre.sql

@@ -338,5 +338,9 @@ ALTER TABLE branch_sync ADD branch_type varchar(250) default null;
 ALTER TABLE c_quiz_question ADD INDEX idx_c_q_qst_cpt (c_id, parent_id, type);
 ALTER TABLE c_quiz_question_rel_category ADD INDEX idx_c_q_qst_r_cat_qc(question_id, c_id);
 
+INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('breadcrumb_navigation_display', NULL, 'radio', 'Platform','true','BreadcrumbNavigationDisplayTitle', 'BreadcrumbNavigationDisplayComment', NULL, NULL, 1);
+INSERT INTO settings_options (variable, value, display_text) VALUES ('breadcrumb_navigation_display', 'true', 'Show');
+INSERT INTO settings_options (variable, value, display_text) VALUES ('breadcrumb_navigation_display', 'false', 'Hide');
+
 -- Do not move this
 UPDATE settings_current SET selected_value = '1.10.0.029' WHERE variable = 'chamilo_database_version';