From 3f8b1b0735e1296667d1724da7475b01ab950049 Mon Sep 17 00:00:00 2001 From: Cristian Fasanando Date: Thu, 7 May 2009 01:05:50 +0200 Subject: [PATCH] [svn r20385] Added interbreadcrumb to notebook and glossary tools - partial FS#3909 --- main/glossary/index.php | 29 +++++++++++++++++++---------- main/notebook/index.php | 14 +++++++------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/main/glossary/index.php b/main/glossary/index.php index 7ecb92317f..fc8dac2e83 100755 --- a/main/glossary/index.php +++ b/main/glossary/index.php @@ -32,6 +32,12 @@ $tool = TOOL_GLOSSARY; event_access_tool(TOOL_GLOSSARY); // displaying the header + +if ( isset($_GET['action']) && ($_GET['action'] == 'addglossary' || $_GET['action'] == 'edit_glossary')) { +$tool=get_lang('GlossaryManagement'); +$interbreadcrumb[] = array ("url"=>"index.php", "name"=> ucfirst(get_lang(TOOL_GLOSSARY))); +} + Display::display_header(get_lang(ucfirst($tool))); // Tool introduction @@ -76,10 +82,10 @@ if (api_is_allowed_to_edit()) if ($check) { $values = $form->exportValues(); - save_glossary($values); - display_glossary(); + save_glossary($values); } Security::clear_token(); + display_glossary(); } else { @@ -117,10 +123,10 @@ if (api_is_allowed_to_edit()) if ($check) { $values = $form->exportValues(); - update_glossary($values); - display_glossary(); + update_glossary($values); } Security::clear_token(); + display_glossary(); } else { @@ -345,7 +351,7 @@ function delete_glossary($glossary_id) function display_glossary() { // action links - echo '
'; + echo '
'; if (api_is_allowed_to_edit()) { echo ''.Display::return_icon('filenew.gif',get_lang('TermAddNew')).get_lang('TermAddNew').''; @@ -453,9 +459,13 @@ function get_glossary_data($from, $number_of_items, $column, $direction) $return = array (); while ($data = Database::fetch_row($res)) - { - $return[] = $data; - } + { + if (!$_SESSION['glossary_view'] OR $_SESSION['glossary_view'] == 'table') { + $data[2] = str_replace(array('

','

'),array('','
'),$data[2]); + } + $return[] = $data; + } + return $return; } @@ -476,8 +486,7 @@ function actions_filter($glossary_id,$url_params,$row) { $_SESSION['max_glossary_display'] = get_max_glossary_item(); } - - $return = ''; + if (empty($_GET['glossary_column'])) { if ($row[0] > 1) { diff --git a/main/notebook/index.php b/main/notebook/index.php index 5f931c31f6..ca25a7611b 100755 --- a/main/notebook/index.php +++ b/main/notebook/index.php @@ -34,6 +34,11 @@ $tool = TOOL_NOTEBOOK; // tracking event_access_tool(TOOL_NOTEBOOK); +if ( isset($_GET['action']) && ($_GET['action'] == 'addnote' || $_GET['action'] == 'editnote')) { +$tool=get_lang('NotebookManagement'); +$interbreadcrumb[] = array ("url"=>"index.php", "name"=> ucfirst(get_lang(TOOL_NOTEBOOK))); +} + // displaying the header Display::display_header(get_lang(ucfirst($tool))); @@ -97,10 +102,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'addnote') display_notes(); } else - { - echo ''; + { $token = Security::get_token(); $form->addElement('hidden','sec_token'); $form->setConstants(array('sec_token' => $token)); @@ -120,6 +122,7 @@ else if (isset($_GET['action']) && $_GET['action'] == 'editnote' && is_numeric($ // initiate the object $form = new FormValidator('note','post', api_get_self().'?action='.Security::remove_XSS($_GET['action']).'¬ebook_id='.Security::remove_XSS($_GET['notebook_id'])); // settting the form elements + $form->addElement('header', '', get_lang('ModifyNote')); $form->addElement('hidden', 'notebook_id'); $form->addElement('text', 'note_title', get_lang('NoteTitle'),array('size'=>'100')); $form->applyFilter('note_title', 'html_filter'); @@ -147,9 +150,6 @@ else if (isset($_GET['action']) && $_GET['action'] == 'editnote' && is_numeric($ } else { - echo ''; $token = Security::get_token(); $form->addElement('hidden','sec_token'); $form->setConstants(array('sec_token' => $token));