function confirmation (name) { if (confirm(\" ". get_lang("TermConfirmDelete") ." \"+ name + \" ?\")) {return true;} else {return false;} } function text_focus(){ document.form_glossary.n_glossary.focus(); document.form_glossary.n_glossary.select(); } "; $tool = TOOL_GLOSSARY; Display::display_header(get_lang(ucfirst($tool))); //--------------------------------------------------------- if ($is_allowed_to_edit) { echo ' '.get_lang('TermAddNew').''; /*====================================== Form Glossary ======================================*/ echo '
'; if ($_GET['action'] == 'addglossary') { echo '
'; echo '
'.get_lang('TermName').'
'; echo '
'.get_lang('TermDefinition').'
'; echo '
'; echo '
'; } echo '
'; } /*====================================== Add Glossary Details ======================================*/ $name_glossary = Security::remove_XSS($_GET['name_glossary']); $description_glossary = Security::remove_XSS($_GET['description_glossary']); $add_glossary = add_glossary_details($name_glossary,$description_glossary); /*====================================== Edit Glossary Details ======================================*/ $g_id = Security::remove_XSS($_GET['g_id']); $n_glossary = Security::remove_XSS($_GET['n_glossary']); $d_glossary = Security::remove_XSS($_GET['d_glossary']); $edit_glossary = edit_glossary_details($g_id,$n_glossary,$d_glossary); /*====================================== Delete Glossary Details ======================================*/ if ($_GET['action'] == 'delete_glossary') { $g_id = Security::remove_XSS($_GET['glossary_id']); $delete_glossary = delete_glossary_details($g_id); Display::display_confirmation_message(get_lang('TermDeleted')); } /*====================================== Display Glossary Details ======================================*/ // order by up/down $action = (!empty($_REQUEST['action'])?$_REQUEST['action']:''); switch($action) { case 'move_lp_up': move_up($_REQUEST['id']); break; case 'move_lp_down': move_down($_REQUEST['id']); break; } // order by type (one = By Start Date, two = By End Date, three = By Term Name) $type = (int)$_GET['type']; $glossary_list=get_glossary_details($type); //returns a results resource $max = Database::num_rows($glossary_list); $current = 0; if ($max > 1) { if ($type == 1) { echo ''; } elseif ($type == 2) { echo ''; } elseif ($type == 3) { echo ''; } elseif ($type == 4){ echo ''; } else { echo ''; } } echo '
'; echo '
'; // glossary list while ($row_glossary_list=Database::fetch_array($glossary_list)) { $dsp_order = ''; if ( ($_GET['action'] == 'edit_glossary') && ($_GET['glossary_id'] == $row_glossary_list['glossary_id']) ) { if ($is_allowed_to_edit) { echo '
'; echo '
'; echo ''; echo ''.get_lang('TermName').'
'; echo '
'; echo ''.get_lang('TermDefinition').'

'; echo ''; echo '
'; } } else { echo '
'.$row_glossary_list['name'].'
'; echo ''.$row_glossary_list['description'].'
'; if ($is_allowed_to_edit) { $id = $row_glossary_list['glossary_id']; $icon_edit ='edit.gif'; $icon_delete ='delete.gif'; $icon_move_down = 'down.gif'; $icon_move_up ='up.gif'; $icon_gray_down = 'down_na.gif'; $icon_gray_up = 'up_na.gif'; // links order by up/down if (isset($type) && $type == 4) { if ($row_glossary_list['display_order'] == 1 && $max != 1) { $dsp_order .= '' . ''.get_lang(' . ''; } elseif($current == $max-1 && $max != 1) { //last element $dsp_order .= '' . ''.get_lang(' . ''; } elseif($max == 1) { $dsp_order = ' '; } else { $dsp_order .= '' . ''.get_lang(' . ' '; $dsp_order .= '' . ''.get_lang(' . ''; } } // action links echo ''; echo ' '; echo ''; echo $dsp_order; echo ''; } echo '
'; } $current++; } echo '
'; /* ============================================================================== FOOTER ============================================================================== */ Display::display_footer();