[svn r20385] Added interbreadcrumb to notebook and glossary tools - partial FS#3909

skala
Cristian Fasanando 17 years ago
parent 16bd5eaea1
commit 3f8b1b0735
  1. 17
      main/glossary/index.php
  2. 12
      main/notebook/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
@ -77,9 +83,9 @@ if (api_is_allowed_to_edit())
{
$values = $form->exportValues();
save_glossary($values);
display_glossary();
}
Security::clear_token();
display_glossary();
}
else
{
@ -118,9 +124,9 @@ if (api_is_allowed_to_edit())
{
$values = $form->exportValues();
update_glossary($values);
display_glossary();
}
Security::clear_token();
display_glossary();
}
else
{
@ -345,7 +351,7 @@ function delete_glossary($glossary_id)
function display_glossary()
{
// action links
echo '<div class="actions">';
echo '<div class="actions" style="margin-bottom:10px">';
if (api_is_allowed_to_edit())
{
echo '<a href="index.php?'.api_get_cidreq().'&action=addglossary&msg=add">'.Display::return_icon('filenew.gif',get_lang('TermAddNew')).get_lang('TermAddNew').'</a>';
@ -454,8 +460,12 @@ function get_glossary_data($from, $number_of_items, $column, $direction)
$return = array ();
while ($data = Database::fetch_row($res))
{
if (!$_SESSION['glossary_view'] OR $_SESSION['glossary_view'] == 'table') {
$data[2] = str_replace(array('<p>','</p>'),array('','<br />'),$data[2]);
}
$return[] = $data;
}
return $return;
}
@ -477,7 +487,6 @@ 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)
{

@ -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)));
@ -98,9 +103,6 @@ if (isset($_GET['action']) && $_GET['action'] == 'addnote')
}
else
{
echo '<div class="actions">';
echo '<a href="index.php?'.api_get_cidreq().'">'.Display::return_icon('back.png',get_lang('BackToNoteList')).get_lang('BackToNoteList').'</a>';
echo '</div>';
$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']).'&notebook_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 '<div class="actions">';
echo '<a href="index.php?'.api_get_cidreq().'">'.Display::return_icon('back.png',get_lang('BackToNotesList')).get_lang('BackToNotesList').'</a>';
echo '</div>';
$token = Security::get_token();
$form->addElement('hidden','sec_token');
$form->setConstants(array('sec_token' => $token));

Loading…
Cancel
Save