diff --git a/main/glossary/index.php b/main/glossary/index.php index fe6b480ef1..e6891c5a3d 100755 --- a/main/glossary/index.php +++ b/main/glossary/index.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'); diff --git a/main/inc/lib/glossary.lib.php b/main/inc/lib/glossary.lib.php index 2406bb1dcf..adc84476f5 100755 --- a/main/inc/lib/glossary.lib.php +++ b/main/inc/lib/glossary.lib.php @@ -332,24 +332,35 @@ class GlossaryManager echo '
'; if (api_is_allowed_to_edit(null,true)) { - echo ''.Display::return_icon('new_glossary_term.png',get_lang('TermAddNew'),'','32').''; + echo ''. + Display::return_icon('new_glossary_term.png',get_lang('TermAddNew'),'', ICON_SIZE_MEDIUM).''; } - echo ''.Display::return_icon('export_csv.png',get_lang('ExportGlossaryAsCSV'),'','32').''; + echo ''. + Display::return_icon('export_csv.png',get_lang('ExportGlossaryAsCSV'),'',ICON_SIZE_MEDIUM).''; if (api_is_allowed_to_edit(null,true)) { - echo ''.Display::return_icon('import_csv.png',get_lang('ImportGlossary'),'','32').''; + echo ''. + Display::return_icon('import_csv.png',get_lang('ImportGlossary'),'',ICON_SIZE_MEDIUM).''; } - echo ''.Display::return_icon('pdf.png',get_lang('ExportToPDF'),'', ICON_SIZE_MEDIUM).''; + echo ''. + Display::return_icon('pdf.png',get_lang('ExportToPDF'),'', ICON_SIZE_MEDIUM).''; if ((isset($_SESSION['glossary_view']) && $_SESSION['glossary_view'] == 'table') or (!isset($_SESSION['glossary_view']))){ - echo ''.Display::return_icon('view_detailed.png',get_lang('ListView'),'','32').''; + echo ''. + Display::return_icon('view_detailed.png',get_lang('ListView'),'',ICON_SIZE_MEDIUM).''; } else { - echo ''.Display::return_icon('view_text.png',get_lang('TableView'),'','32').''; + echo ''. + Display::return_icon('view_text.png',get_lang('TableView'),'',ICON_SIZE_MEDIUM).''; } echo '
'; 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);