Minor - fix URL

1.10.x
Julio Montoya 10 years ago
parent 57d4385d5d
commit 1956e06800
  1. 18
      main/glossary/index.php
  2. 25
      main/inc/lib/glossary.lib.php

@ -98,7 +98,13 @@ if (api_is_allowed_to_edit(null, true)) {
switch ($action) {
case 'addglossary':
$form = new FormValidator('glossary','post', api_get_self().'?action='.Security::remove_XSS($_GET['action']));
$form = new FormValidator(
'glossary',
'post',
api_get_self().'?action='.Security::remove_XSS(
$_GET['action']
).'&'.api_get_cidreq()
);
// Setting the form elements
$form->addElement('header', '', get_lang('TermAddNew'));
$form->addElement('text', 'glossary_title', get_lang('TermName'), array('size'=>'80', 'id'=>'glossary_title'));
@ -106,7 +112,7 @@ if (api_is_allowed_to_edit(null, true)) {
$form->addElement('html_editor', 'glossary_comment', get_lang('TermDefinition'), null, array('ToolbarSet' => 'Glossary', 'Height' => '300'));
$form->addButtonCreate(get_lang('TermAddButton'), 'SubmitGlossary');
// setting the rules
$form->addRule('glossary_title',get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('glossary_title', get_lang('ThisFieldIsRequired'), 'required');
// The validation or display
if ($form->validate()) {
$check = Security::check_token('post');
@ -118,7 +124,7 @@ if (api_is_allowed_to_edit(null, true)) {
GlossaryManager::display_glossary();
} else {
$token = Security::get_token();
$form->addElement('hidden','sec_token');
$form->addElement('hidden', 'sec_token');
$form->setConstants(array('sec_token' => $token));
$form->display();
}
@ -126,7 +132,11 @@ if (api_is_allowed_to_edit(null, true)) {
case 'edit_glossary':
if (is_numeric($_GET['glossary_id'])) {
// initiate the object
$form = new FormValidator('glossary','post', api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&glossary_id='.Security::remove_XSS($_GET['glossary_id']));
$form = new FormValidator(
'glossary',
'post',
api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&glossary_id='.intval($_GET['glossary_id']).'&'.api_get_cidreq()
);
// Setting the form elements
$form->addElement('header', '', get_lang('TermEdit'));
$form->addElement('hidden', 'glossary_id');

@ -332,24 +332,35 @@ class GlossaryManager
echo '<div class="actions">';
if (api_is_allowed_to_edit(null,true)) {
echo '<a href="index.php?'.api_get_cidreq().'&action=addglossary&msg=add">'.Display::return_icon('new_glossary_term.png',get_lang('TermAddNew'),'','32').'</a>';
echo '<a href="index.php?'.api_get_cidreq().'&action=addglossary&msg=add?'.api_get_cidreq().'">'.
Display::return_icon('new_glossary_term.png',get_lang('TermAddNew'),'', ICON_SIZE_MEDIUM).'</a>';
}
echo '<a href="index.php?'.api_get_cidreq().'&action=export">'.Display::return_icon('export_csv.png',get_lang('ExportGlossaryAsCSV'),'','32').'</a>';
echo '<a href="index.php?'.api_get_cidreq().'&action=export">'.
Display::return_icon('export_csv.png',get_lang('ExportGlossaryAsCSV'),'',ICON_SIZE_MEDIUM).'</a>';
if (api_is_allowed_to_edit(null,true)) {
echo '<a href="index.php?'.api_get_cidreq().'&action=import">'.Display::return_icon('import_csv.png',get_lang('ImportGlossary'),'','32').'</a>';
echo '<a href="index.php?'.api_get_cidreq().'&action=import">'.
Display::return_icon('import_csv.png',get_lang('ImportGlossary'),'',ICON_SIZE_MEDIUM).'</a>';
}
echo '<a href="index.php?'.api_get_cidreq().'&action=export_to_pdf">'.Display::return_icon('pdf.png',get_lang('ExportToPDF'),'', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="index.php?'.api_get_cidreq().'&action=export_to_pdf">'.
Display::return_icon('pdf.png',get_lang('ExportToPDF'),'', ICON_SIZE_MEDIUM).'</a>';
if ((isset($_SESSION['glossary_view']) && $_SESSION['glossary_view'] == 'table') or (!isset($_SESSION['glossary_view']))){
echo '<a href="index.php?'.api_get_cidreq().'&action=changeview&view=list">'.Display::return_icon('view_detailed.png',get_lang('ListView'),'','32').'</a>';
echo '<a href="index.php?'.api_get_cidreq().'&action=changeview&view=list">'.
Display::return_icon('view_detailed.png',get_lang('ListView'),'',ICON_SIZE_MEDIUM).'</a>';
} else {
echo '<a href="index.php?'.api_get_cidreq().'&action=changeview&view=table">'.Display::return_icon('view_text.png',get_lang('TableView'),'','32').'</a>';
echo '<a href="index.php?'.api_get_cidreq().'&action=changeview&view=table">'.
Display::return_icon('view_text.png',get_lang('TableView'),'',ICON_SIZE_MEDIUM).'</a>';
}
echo '</div>';
if (!$_SESSION['glossary_view'] OR $_SESSION['glossary_view'] == 'table') {
$table = new SortableTable('glossary', array('GlossaryManager','get_number_glossary_terms'), array('GlossaryManager','get_glossary_data'),0);
$table = new SortableTable(
'glossary',
array('GlossaryManager', 'get_number_glossary_terms'),
array('GlossaryManager', 'get_glossary_data'),
0
);
//$table->set_header(0, '', false);
$table->set_header(0, get_lang('TermName'), true);
$table->set_header(1, get_lang('TermDefinition'), true);

Loading…
Cancel
Save