function dellink() { checkPerm('view', false, 'storage'); $lang =& DoceboLanguage::createInstance('link'); $back_url = urldecode($_GET['back_url']); $back_coded = htmlentities(urlencode($back_url)); $GLOBALS['page']->add(getTitleArea($lang->def('_SECT_LINK'), 'link'), 'content'); if (isset($_GET['confirm'])) { list($idCategory, $seq) = sql_fetch_row(sql_query("\r\n\t\tSELECT idCategory, sequence\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_link \r\n\t\tWHERE idLink = '" . (int) $_GET['idLink'] . "'")); if (!sql_query("\r\n\t\tDELETE FROM " . $GLOBALS['prefix_lms'] . "_link \r\n\t\tWHERE idLink = '" . (int) $_GET['idLink'] . "'")) { $GLOBALS['page']->add(getErrorUi($lang->def('_OPERATION_FAILURELINK') . getBackUi('index.php?modname=link&op=modlinkgui&idCategory=' . $idCategory . '&back_url=' . $back_coded, $lang->def('_BACK'))), 'content'); return; } sql_query("\r\n\t\tUPDATE " . $GLOBALS['prefix_lms'] . "_link \r\n\t\tSET sequence = sequence -1\r\n\t\tWHERE sequence > '" . $seq . "'"); Util::jump_to('index.php?modname=link&op=modlinkgui&idCategory=' . $idCategory . '&back_url=' . $back_coded); } else { list($idCategory, $title, $link_a, $description) = sql_fetch_row(sql_query("\r\n\t\tSELECT idCategory, title, link_address, description \r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_link \r\n\t\tWHERE idLink = '" . (int) $_GET['idLink'] . "'")); $GLOBALS['page']->add('<div class="std_block">' . getDeleteUi($lang->def('_AREYOUSURE'), '<span>' . $lang->def('_TITLE') . ' : </span>' . $title . '<br />' . '<span>' . $lang->def('_URL') . ' : </span>' . $link_a . '<br />' . '<span>' . $lang->def('_DESCRIPTION') . ' : </span>' . $description, true, 'index.php?modname=link&op=dellink&idLink=' . $_GET['idLink'] . '&back_url=' . $back_coded . '&confirm=1', 'index.php?modname=link&op=modlinkgui&idCategory=' . $idCategory . '&back_url=' . $back_coded . '') . '</div>' . '</div>', 'content'); } }
function delnotes() { checkPerm('view'); $lang =& DoceboLanguage::createInstance('notes', 'lms'); if (isset($_GET['confirm'])) { $query = "\r\n\t\tDELETE FROM " . $GLOBALS['prefix_lms'] . "_notes\r\n\t\tWHERE idNotes='" . $_GET['idNotes'] . "' AND owner='" . getLogUserId() . "' AND idCourse='" . $_SESSION['idCourse'] . "'"; if (!sql_query($query)) { Util::jump_to('index.php?modname=notes&op=notes&result=err'); } Util::jump_to('index.php?modname=notes&op=notes&result=ok'); } else { list($title) = sql_fetch_row(sql_query("\r\n\t\tSELECT title\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_notes \r\n\t\tWHERE owner = '" . getLogUserId() . "' AND idNotes = '" . (int) $_GET['idNotes'] . "'")); $title_page = array('index.php?modname=notes&op=notes' => $lang->def('_NOTES'), $lang->def('_DEL')); $GLOBALS['page']->add(getTitleArea($title_page, 'notes') . '<div class="std_block">' . getDeleteUi($lang->def('_AREYOUSURE'), '<span>' . $lang->def('_TITLE') . ' : </span>' . $title, true, 'index.php?modname=notes&op=delnotes&idNotes=' . $_GET['idNotes'] . '&confirm=1', 'index.php?modname=notes&op=notes') . '</div>', 'content'); } }
function ioTask_UITaskDelete(&$module, $action) { checkPerm('view'); require_once _base_ . '/lib/lib.form.php'; $connMgr =& $module->get_connMgr(); $lang =& $module->get_lang(); $out =& $module->get_out(); $form = new Form(); if (is_array($action)) { if (key($action) == '--confirm--') { if ($connMgr->delete_task_byname($_POST['task_name'])) { Util::jump_to('index.php?modname=iotask&op=display&deletetaskok&gotab=tasks'); } else { Util::jump_to('index.php?modname=iotask&op=display&deletetaskerror&gotab=tasks'); } } } $params = $connMgr->get_task_byname(key($action)); $task_name = $params[CONNMGR_TASK_NAME]; $out->setWorkingZone('content'); $out->add(getTitleArea($lang->def('_TASKS'), 'iotask')); $out->add('<div class="std_block">'); $out->add($form->getFormHeader($lang->def('_TASK_DEL'))); $out->add($form->openForm('task_delete', 'index.php?modname=iotask&op=display&gotab=tasks')); $out->add($form->getHidden('task_name', 'task_name', $task_name)); $out->add(getDeleteUi($lang->def('_CONFIRM_DELETION'), str_replace('%name%', $task_name, $lang->def('_AREYOUSURE')), FALSE, 'action[delete_task][--confirm--]', 'cancel')); $out->add($form->closeForm()); $out->add('</div>'); }
function delgroup() { checkPerm('mod'); require_once _base_ . '/lib/lib.form.php'; $lang =& DoceboLanguage::createInstance('groups', 'lms'); $acl_man =& Docebo::user()->getAclManager(); $acl_man->setContext('/lms/course/' . $_SESSION['idCourse'] . '/group'); $id_group = importVar('id_group', true, 0); if (isset($_POST['confirm']) || isset($_GET['confirm'])) { if ($acl_man->deleteGroup($id_group)) { Util::jump_to('index.php?modname=groups&op=groups&result=ok'); } else { Util::jump_to('index.php?modname=groups&op=groups&result=err'); } } else { $acl_man->setContext('/lms/course/' . $_SESSION['idCourse'] . '/group'); $group = $acl_man->getGroup($_GET['id_group'], false); $form = new Form(); $page_title = array('index.php?modname=groups&op=groups' => $lang->def('_GROUPS'), $lang->def('_DEL')); $GLOBALS['page']->add(getTitleArea($page_title, 'groups') . '<div class="std_block">' . $form->openForm('del_advice', 'index.php?modname=groups&op=delgroup') . $form->getHidden('id_group', 'id_group', $id_group) . getDeleteUi($lang->def('_AREYOUSURE'), '<span>' . $lang->def('_NAME') . ' : </span>' . $acl_man->relativeId($group[ACL_INFO_GROUPID]), false, 'confirm', 'undo') . $form->closeForm() . '</div>', 'content'); } }
function delTeacherCurriculumGui() { if (isset($_GET['confirm'])) { $query = "UPDATE " . $GLOBALS['prefix_lms'] . "_teacher_profile" . " SET curriculum = ''" . " WHERE id_user = '******'"; $result = sql_query($query); Util::jump_to($this->_url_man->getUrl()); //'index.php?modname=profile&op=profile'); } else { require_once _base_ . '/lib/lib.template.php'; $html = '<div class="std_block">'; $html .= getDeleteUi($this->_lang->def('_AREYOUSURE'), $this->_lang->def('_NAME'), true, $this->_url_man->getUrl('ap=del_teach_curric&confirm=1'), $this->_url_man->getUrl()); $html .= '</div>'; return $html; } }
function delclassroom() { //checkPerm('mod'); require_once _base_ . '/lib/lib.form.php'; $idClassroom = importVar('idClassroom', true, 0); $lang =& DoceboLanguage::createInstance('admin_classroom', 'lms'); if (isset($_POST['confirm'])) { $query_classroom = "\r\n\t\t\tDELETE FROM " . $GLOBALS['prefix_lms'] . "_classroom\r\n\t\t\tWHERE idClassroom = '" . $idClassroom . "'"; if (!sql_query($query_classroom)) { Util::jump_to('index.php?modname=classroom&op=classroom&result=err_del'); } else { Util::jump_to('index.php?modname=reservation&op=classroom&result=ok'); } } else { list($name, $descr) = sql_fetch_row(sql_query("\r\n\t\t\tSELECT name, description\r\n\t\t\tFROM " . $GLOBALS['prefix_lms'] . "_classroom\r\n\t\t\tWHERE idClassroom = '" . $idClassroom . "'")); $form = new Form(); $page_title = array('index.php?modname=reservation&op=classroom' => $lang->def('_TITLE_CLASSROOM'), $lang->def('_DEL_CLASSROOM')); $GLOBALS['page']->add(getTitleArea($page_title, 'admin_classroom') . '<div class="std_block">' . $form->openForm('del_classroom', 'index.php?modname=reservation&op=delclassroom') . $form->getHidden('idClassroom', 'idClassroom', $idClassroom) . getDeleteUi($lang->def('_AREYOUSURE'), '<span>' . $lang->def('_NAME') . ' : </span>' . $name . '<br />' . '<span>' . $lang->def('_DESCRIPTION') . ' : </span>' . $descr, false, 'confirm', 'undo') . $form->closeForm() . '</div>', 'content'); } }
function delnews() { checkPerm('mod'); require_once _base_ . '/lib/lib.form.php'; $id_news = Get::req('id_news', DOTY_INT, 0); $lang =& DoceboLanguage::createInstance('admin_news', 'lms'); if (Get::req('confirm', DOTY_INT, 0) == 1) { $query_news = "\r\n\t\tDELETE FROM " . $GLOBALS['prefix_lms'] . "_news_internal\r\n\t\tWHERE idNews = '" . $id_news . "'"; if (!sql_query($query_news)) { Util::jump_to('index.php?modname=internal_news&op=news&result=err_del'); } else { Util::jump_to('index.php?modname=internal_news&op=news&result=ok'); } } else { list($title, $short_desc) = sql_fetch_row(sql_query("\r\n\t\tSELECT title, short_desc\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_news_internal\r\n\t\tWHERE idNews = '" . $id_news . "'")); $form = new Form(); $page_title = array('index.php?modname=internal_news&op=news' => $lang->def('_NEWS'), $lang->def('_DEL')); $GLOBALS['page']->add(getTitleArea($page_title, 'admin_news') . '<div class="std_block">' . $form->openForm('del_news', 'index.php?modname=internal_news&op=delnews') . $form->getHidden('id_news', 'id_news', $id_news) . getDeleteUi($lang->def('_AREYOUSURE'), '<span>' . $lang->def('_TITLE') . ' : </span>' . $title . '<br />' . '<span>' . $lang->def('_SHORTDESC') . ' : </span>' . $short_desc, false, 'confirm', 'undo') . $form->closeForm() . '</div>', 'content'); } }
function remfiles() { checkPerm('mod'); $lang =& DoceboLanguage::createInstance('course'); require_once _base_ . '/lib/lib.upload.php'; if (isset($_GET['confirm']) && $_GET['confirm'] == '1') { list($old_file) = sql_fetch_row(sql_query("\r\n\t\tSELECT path \r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_course_file \r\n\t\tWHERE id_course='" . $_SESSION['idCourse'] . "' AND id_file='" . (int) $_GET['id_file'] . "'")); $size = Get::file_size($GLOBALS['where_files_relative'] . _PATH_COURSE . $old_file); if (!sl_unlink(_PATH_COURSE . $old_file)) { $GLOBALS['page']->add(getErrorUi($lang->def('_OPERATION_FAILURE'))); return; } $GLOBALS['course_descriptor']->subFileToUsedSpace(false, $size); if (!sql_query("\r\n\t\tDELETE FROM " . $GLOBALS['prefix_lms'] . "_course_file \r\n\t\tWHERE id_course = '" . (int) $_SESSION['idCourse'] . "' AND id_file = '" . (int) $_GET['id_file'] . "'")) { $GLOBALS['page']->add(getErrorUi($lang->def('_OPERATION_FAILURE'))); return; } Util::jump_to('index.php?modname=course&op=infocourse'); } else { list($title, $file) = sql_fetch_row(sql_query("\r\n\t\tSELECT title, path \r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_course_file \r\n\t\tWHERE id_course = '" . (int) $_SESSION['idCourse'] . "' AND id_file = '" . (int) $_GET['id_file'] . "'")); //request erase confirm $GLOBALS['page']->add(getTitleArea(array('index.php?modname=course&op=infocourse' => $lang->def('_INFO'), $lang->def('_DEL')), 'infocourse') . '<div class="std_block">' . getDeleteUi($lang->def('_AREYOUSURE'), '<img src="' . getPathImage('fw') . mimeDetect($file) . '" alt="mime-type" /> ' . $title, true, 'index.php?modname=course&op=remfiles&id_file=' . (int) $_GET['id_file'] . '&confirm=1', 'index.php?modname=course&op=infocourse') . '</div>', 'content'); } }
function delRegistration() { checkPerm('view'); require_once _base_ . '/lib/lib.form.php'; $id_event = importVar('id_event', true, 0); $id_user = importVar('id_user', true, 0); $lang =& DoceboLanguage::createInstance('reservation'); $out = $GLOBALS['page']; $out->setWorkingZone('content'); $man_res = new Man_Reservation(); if (Get::req('confirm', DOTY_INT, 0) == 1) { $confirm = importVar('confirm', true, 0); if ($confirm) { $result = $man_res->delSubscription($id_user, $id_event); } if ($result) { Util::jump_to('index.php?modname=reservation&op=view_user_event&id_event=' . $id_event); } Util::jump_to('index.php?modname=reservation&op=view_user_event&id_event=' . $id_event . '&error=del_registration'); } $GLOBALS['page']->add(getTitleArea($lang->def('_DEL_SUBSCRIPTION_TITLE'), '', $lang->def('_EVENT')) . '<div class="std_block">' . getDeleteUi($lang->def('_AREYOUSURE_DEL_SUBSCRIPTION'), $lang->def('_DEL_SUBSCRIPTION_INFO'), true, 'index.php?modname=reservation&op=del_registration&id_event=' . $id_event . '&id_user='******'&confirm=1', 'index.php?modname=reservation&op=view_user_event&id_event=' . $id_event) . '</div>', 'content'); }
function delmodule() { checkPerm('mod'); require_once _base_ . '/lib/lib.form.php'; $out =& $GLOBALS['page']; $out->setWorkingZone('content'); $id_main = Get::req('id_main', DOTY_INT, 0); $id_module = Get::req('id_module', DOTY_INT, 0); $lang =& DoceboLanguage::createInstance('manmenu', 'framework'); $menu_lang =& DoceboLanguage::createInstance('menu_course', 'lms'); if (isset($_POST['undo'])) { Util::jump_to('index.php?modname=manmenu&op=manmodule&id_main=' . $id_main); } if (isset($_POST['confirm']) || isset($_GET['confirm'])) { $re = removeModule($id_module, $id_main, $_SESSION['idCourse']); Docebo::user()->loadUserSectionST(); Docebo::user()->SaveInSession(); Util::jump_to('index.php?modname=manmenu&op=manmodule&id_main=' . $id_main . '&result=' . ($re ? 1 : 0)); } else { // Load module info $query_module = "\r\n\t\tSELECT default_name \r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_module \r\n\t\tWHERE idModule = '" . $id_module . "'"; list($name_db) = sql_fetch_row(sql_query($query_module)); $query_custom = "\r\n\t\tSELECT name \r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_menucourse_main\r\n\t\tWHERE idMain = '" . $id_main . "'"; list($main_title) = sql_fetch_row(sql_query($query_custom)); $name = Lang::t($name_db, 'menu_course', false, false, $name_db); $page_title = array('index.php?modname=manmenu&op=manmenu' => $lang->def('_TITLE_MANMENU'), 'index.php?modname=manmenu&op=manmodule&id_main=' . $id_main => $main_title, $lang->def('_DEL') . ' : ' . $name); $strip_name = strip_tags($name); $out->add(getTitleArea($page_title, 'manmenu') . '<div class="std_block">' . Form::openForm('delcustom_form', 'index.php?modname=manmenu&op=delmodule') . Form::getHidden('id_main', 'id_main', $id_main) . Form::getHidden('id_module', 'id_module', $id_module) . getDeleteUi($lang->def('_AREYOUSURE'), '<span class="text_bold">' . $lang->def('_TITLE_MODULE') . ' : </span>' . $name, false, 'confirm', 'undo') . Form::closeForm() . '</div>'); } }
function del_item() { include_once _base_ . '/lib/lib.form.php'; include_once _base_ . '/lib/lib.upload.php'; $out =& $GLOBALS['page']; $out->setWorkingZone('content'); $lang =& DoceboLanguage::createInstance('project', "lms"); $form = new Form(); // Controllo che l'utente non cerchi di entrare in progetti a cui non e' iscritto. $id = (int) importVar("id"); $itemid = (int) importVar("itemid"); $myprj = user_projects(Docebo::user()->getIdSt()); $view_perm = checkPerm('view', true); if ($view_perm && in_array($id, $myprj) && (is_owner(Docebo::user()->getIdSt(), $id) || is_admin(Docebo::user()->getIdSt(), $id))) { if (!isset($_GET["type"])) { return 0; } $type = $_GET["type"]; $back_url = "index.php?modname=project&op=showprj&id=" . $id; if (isset($_POST["undo"])) { Util::jump_to($back_url); } else { if (isset($_POST["conf_del"]) || isset($_GET['confirm'])) { del_item_now($id, $itemid, $type); Util::jump_to($back_url); } else { switch ($type) { case "news": $field = "ntitle"; $table = $GLOBALS["prefix_lms"] . "_prj_news"; break; case "todo": $field = "ttitle"; $table = $GLOBALS["prefix_lms"] . "_prj_todo"; break; case "task": $field = "tname"; $table = $GLOBALS["prefix_lms"] . "_prj_tasks"; break; case "file": $field = "ftitle"; $table = $GLOBALS["prefix_lms"] . "_prj_files"; break; } $qtxt = "SELECT " . $field . " as title FROM " . $table . " WHERE id='" . $itemid . "' AND pid='" . $id . "'"; $q = sql_query($qtxt); if ($q && mysql_num_rows($q) > 0) { $row = mysql_fetch_array($q); $title = $row["title"]; } $out->add(getTitleArea($lang->def("_PROJECT_MANAGER"), "project")); $out->add("<div class=\"std_block\">\n"); $url = "index.php?modname=project&op=prjdelitem&type=" . $type . "&id=" . $id . "&itemid=" . $itemid; $out->add($form->openForm("project_form", $url)); $out->add(getDeleteUi($lang->def('_AREYOUSURE'), '<span class="text_bold">' . $lang->def('_TITLE') . ' :</span> ' . $title . '<br />', false, 'conf_del', 'undo')); $out->add($form->closeForm()); $out->add("</div>\n"); } } } else { die("You can't access!"); } }
function deleteFaq($cat_id, $faq_id) { include_once _base_ . "/lib/lib.form.php"; $um =& UrlManager::getInstance(); $back_url = $um->getUrl("op=showcat&catid=" . $cat_id); if (isset($_POST["undo"])) { Util::jump_to($back_url); } else { if (isset($_POST["conf_del"])) { $this->wikiManager->deleteFaq($faq_id); Util::jump_to($back_url); } else { $res = ""; $info = $this->wikiManager->getFaqInfo($faq_id); $title = $info["title"]; $form = new Form(); $url = ""; $res .= $form->openForm("delete_form", $url); $res .= $form->getHidden("faq_id", "faq_id", $faq_id); $res .= $form->getHidden("cat_id", "cat_id", $cat_id); $res .= getDeleteUi($this->lang->def('_AREYOUSURE'), '<span class="text_bold">' . $this->lang->def('_TITLE') . ' :</span> ' . $title . '<br />', false, 'conf_del', 'undo'); $res .= $form->closeForm(); return $res; } } }
function deleteDataForm($type, $data_id = 0, $parent_id) { include_once _base_ . "/lib/lib.form.php"; include_once _base_ . '/lib/lib.upload.php'; $out =& $GLOBALS['page']; $back_url = "index.php?modname=feedreader&op=feedreader"; if ($parent_id > 0) { $back_url .= "&parent=" . $parent_id; } if (isset($_POST["undo"])) { Util::jump_to($back_url); } else { if (isset($_POST["conf_del"])) { $this->frManager->deleteData((int) $_POST["data_id"], $_POST["type"]); Util::jump_to($back_url); } else { $id = (int) importVar("id"); $stored_val["data_txt"] = $this->frManager->getItemLangText($id); $data_txt = $stored_val["data_txt"][getLanguage()]; $out->add(getTitleArea($this->lang->def("_BUGTRACKER"), "feedreader")); $out->add("<div class=\"std_block\">\n"); $form = new Form(); $url = "index.php?modname=feedreader&op=del&type=" . $type . "&id=" . $id; if ($parent_id > 0) { $url .= "&parent=" . $parent_id; } $out->add($form->openForm("feedreader_form", $url)); $out->add($form->getHidden("data_id", "data_id", $data_id)); $out->add($form->getHidden("parent_id", "parent_id", $parent_id)); $out->add($form->getHidden("type", "type", $type)); $out->add(getDeleteUi($this->lang->def('_AREYOUSURE'), '<span class="text_bold">' . $this->lang->def('_TITLE') . ' :</span> ' . $data_txt . '<br />', false, 'conf_del', 'undo')); $out->add($form->closeForm()); $out->add("</div>\n"); } } }
function delterm() { checkPerm('view', false, 'storage'); $lang =& DoceboLanguage::createInstance('glossary'); $back_url = urldecode($_GET['back_url']); $back_coded = htmlentities(urlencode($back_url)); $GLOBALS['page']->add(getTitleArea($lang->def('_GLOSSARY'), 'glossary', $lang->def('_GLOSSARY')), 'content'); if (isset($_GET['confirm'])) { list($idGlossary) = sql_fetch_row(sql_query("\r\n\t\tSELECT idGlossary\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_glossaryterm \r\n\t\tWHERE idTerm = '" . (int) $_GET['idTerm'] . "'")); if (!sql_query("\r\n\t\tDELETE FROM " . $GLOBALS['prefix_lms'] . "_glossaryterm \r\n\t\tWHERE idTerm='" . (int) $_GET['idTerm'] . "'")) { $GLOBALS['page']->add(getErrorUi($lang->def('_OPERATION_FAILURE') . getBackUi('index.php?modname=glossary&op=modglossarygui&idGlossary=' . $idGlossary . '&back_url=' . $back_coded, $lang->def('_BACK')), 'content')); return; } Util::jump_to('index.php?modname=glossary&op=modglossarygui&idGlossary=' . $idGlossary . '&back_url=' . $back_coded); } else { list($idGlossary, $term, $descr) = sql_fetch_row(sql_query("\r\n\t\tSELECT idGlossary, term, description\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_glossaryterm \r\n\t\tWHERE idTerm = '" . (int) $_GET['idTerm'] . "'")); $GLOBALS['page']->add('<div class="std_block">' . getDeleteUi($lang->def('_AREYOUSURE'), '<span class="text_bold">' . $lang->def('_TERM') . ' : </span>' . $term . '<br />' . '' . $descr . '', true, 'index.php?modname=glossary&op=delterm&idTerm=' . $_GET['idTerm'] . '&back_url=' . $back_coded . '&confirm=1', 'index.php?modname=glossary&op=modglossarygui&idGlossary=' . $idGlossary . '&back_url=' . $back_coded) . '</div>' . '</div>', 'content'); } }
function courseEditionDelete() { checkPerm('mod'); if (isset($_POST['confirm_del_edition_course'])) { $is_ok = removeCourseEdition($_POST['id_course_edition']); Util::jump_to('index.php?modname=course&op=course_list&course_category_status=' . importVar('course_category_status') . '&result=' . ($is_ok ? 'ok_course' : 'fail_course')); } else { //require_once(_i18n_.'/lib.lang.php'); require_once _base_ . '/lib/lib.form.php'; $lang =& DoceboLanguage::CreateInstance('course', 'lms'); list($id_course_edition) = each($_POST['del_course_edition']); $query_course = "\r\n\t\tSELECT code, name\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_course_edition\r\n\t\tWHERE idCourseEdition = '" . $id_course_edition . "'"; list($code, $name) = sql_fetch_row(sql_query($query_course)); $title_area = array('index.php?modname=course&op=course_list' => $lang->def('_COURSE'), $lang->def('_COURSE_EDITION')); $GLOBALS['page']->add(getTitleArea($title_area, 'course') . '<div class="std_block">' . Form::openForm('course_edition_del', 'index.php?modname=course&op=del_course') . Form::getHidden('id_course_edition', 'id_course_edition', $id_course_edition) . getDeleteUi($lang->def('_AREYOUSURE'), '<span class="text_bold">' . $lang->def('_CODE') . ' : </span>' . $code . '<br />' . '<span class="text_bold">' . $lang->def('_COURSE_NAME') . ' : </span>' . $name, false, 'confirm_del_edition_course[' . $id_course_edition . ']', 'course_undo') . Form::closeForm() . '</div>', 'content'); } }
function delmessage() { checkPerm('view'); require_once _base_ . '/lib/lib.form.php'; $lang =& DoceboLanguage::createInstance('forum', 'lms'); $id_message = importVar('idMessage', true, 0); $moderate = checkPerm('moderate', true); $mod_perm = checkPerm('mod', true); $ini = importVar('ini'); $mess_query = "\r\n\tSELECT idThread, title, textof, author, attach, answer_tree\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_forummessage\r\n\tWHERE idMessage = '" . $id_message . "'"; list($id_thread, $title, $textof, $author, $file, $answer_tree) = sql_fetch_row(sql_query($mess_query)); if (!$moderate && !$mod_perm && $author != getLogUserId()) { die("You can't access"); } $thread_query = "\r\n\tSELECT idForum, title, num_post, last_post\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_forumthread\r\n\tWHERE idThread = '" . $id_thread . "'"; list($id_forum, $thread_title, $num_post, $last_post) = sql_fetch_row(sql_query($thread_query)); $forum_query = "\r\n\tSELECT title\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_forum\r\n\tWHERE idForum = '" . $id_forum . "'"; list($forum_title) = sql_fetch_row(sql_query($forum_query)); if (isset($_POST['undo'])) { Util::jump_to('index.php?modname=forum&op=message&idThread=' . $id_thread . '&ini=' . $ini); } if (isset($_GET['confirm'])) { $new_answer_tree = substr($answer_tree, 0, -21); if (!sql_query("\r\n\t\tUPDATE " . $GLOBALS['prefix_lms'] . "_forummessage\r\n\t\tSET answer_tree = CONCAT( '{$new_answer_tree}', SUBSTRING( answer_tree FROM " . strlen($answer_tree) . " ) )\r\n\t\tWHERE answer_tree LIKE '" . $answer_tree . "/%' AND idCourse = '" . $_SESSION['idCourse'] . "'")) { Util::jump_to('index.php?modname=forum&op=message&idThread=' . $id_thread . '&result=err_del'); } if (!sql_query("\r\n\t\tUPDATE " . $GLOBALS['prefix_lms'] . "_forum\r\n\t\tSET num_post = num_post - 1\r\n\t\t\t" . ($num_post == 0 ? " ,num_thread = num_thread - 1 " : " ") . "\r\n\t\tWHERE idForum = '" . $id_forum . "'")) { Util::jump_to('index.php?modname=forum&op=message&idThread=' . $id_thread . '&result=err_del'); } if ($num_post != 0 && $last_post == $id_message) { $query_text = "\r\n\t\t\tSELECT idMessage\r\n\t\t\tFROM " . $GLOBALS['prefix_lms'] . "_forummessage\r\n\t\t\tWHERE idThread = '" . $id_thread . "'\r\n\t\t\tORDER BY posted DESC"; $re = sql_query($query_text); list($id_new, $post) = sql_fetch_row($re); } if ($num_post == 0) { if (!sql_query("\r\n\t\t\tDELETE FROM " . $GLOBALS['prefix_lms'] . "_forumthread\r\n\t\t\tWHERE idThread = '" . $id_thread . "'")) { Util::jump_to('index.php?modname=forum&op=message&idThread=' . $id_thread . '&result=err_del'); } unsetNotify('thread', $id_thread); } else { if (!sql_query("\r\n\t\t\tUPDATE " . $GLOBALS['prefix_lms'] . "_forumthread\r\n\t\t\tSET num_post = num_post - 1 " . ($last_post == $id_message ? " , last_post = '" . $id_new . "'" : '') . "\r\n\t\t\tWHERE idThread = '" . $id_thread . "'")) { Util::jump_to('index.php?modname=forum&op=message&idThread=' . $id_thread . '&result=err_del'); } } delete_file($file); if (!sql_query("\r\n\t\tDELETE FROM " . $GLOBALS['prefix_lms'] . "_forummessage\r\n\t\tWHERE idMessage = '" . $id_message . "' AND idCourse = '" . $_SESSION['idCourse'] . "'")) { Util::jump_to('index.php?modname=forum&op=message&idThread=' . $id_thread . '&result=err_del'); } require_once $GLOBALS['where_framework'] . '/lib/lib.tags.php'; $tags = new Tags('lms_forum'); $tags->deleteResource($id_message, 'lms_forum'); Util::jump_to('index.php?modname=forum&op=message&idThread=' . $id_thread . '&result=ok'); } else { $page_title = array('index.php?modname=forum&op=forum' => $lang->def('_FORUM'), 'index.php?modname=forum&op=thread&idForum=' . $id_forum => $forum_title, 'index.php?modname=forum&op=message&idThread=' . $id_thread . '&ini=' . $ini => $thread_title, $lang->def('_DEL')); $GLOBALS['page']->add(getTitleArea($page_title, 'forum') . '<div class="std_block">' . Form::openForm('del_thread', 'index.php?modname=forum&op=delmessage') . Form::getHidden('idMessage', 'idMessage', $id_message) . Form::getHidden('ini', 'ini', $ini) . getDeleteUi($lang->def('_AREYOUSURE'), '<span>' . $lang->def('_SUBJECT') . ' :</span> ' . $title . '<br />' . $textof, false, 'confirm', 'undo') . Form::closeForm() . '</div>', 'content'); } }
function deleteClassEvent() { $res = ""; include_once _base_ . '/lib/lib.form.php'; require_once $GLOBALS["where_lms"] . "/admin/modules/classevent/lib.classevent.php"; $out =& $GLOBALS["page"]; $out->setWorkingZone("content"); $lang =& DoceboLanguage::createInstance("classevent", "lms"); $clm = new ClassEventManager(); $back_url = "index.php?modname=classevent&op=main"; if (isset($_POST["undo"])) { Util::jump_to($back_url); } else { if (Get::req('conf_del', DOTY_INT, 0) == 1) { $clm->deleteClassEvent($_POST["id"]); Util::jump_to($back_url); } else { $id = (int) importVar("id"); $stored = $clm->getClassEventInfo($id); $location = $stored["location"]; $back_ui_url = "index.php?modname=classevent&op=main"; $title_arr = array(); $title_arr[$back_ui_url] = $lang->def("_CLASS_EVENT"); $title_arr[] = $lang->def("_DEL") . ": " . $location; $res .= getTitleArea($title_arr, "classevent"); $res .= "<div class=\"std_block\">\n"; $res .= getBackUi($back_ui_url, $lang->def('_BACK')); $form = new Form(); $url = "index.php?modname=classevent&op=del"; $res .= $form->openForm("main_form", $url); $res .= $form->getHidden("id", "id", $id); $res .= getDeleteUi($lang->def('_AREYOUSURE'), '<span class="text_bold">' . $lang->def('_LOCATION') . ' :</span> ' . $location . '<br />', false, 'conf_del', 'undo'); $res .= $form->closeForm(); $res .= "</div>\n"; $out->add($res); } } }
function deladvice() { checkPerm('mod'); require_once _base_ . '/lib/lib.form.php'; $lang =& DoceboLanguage::createInstance('advice'); $id_advice = importVar('idAdvice', true, 0); if (isset($_POST['undo'])) { Util::jump_to('index.php?modname=advice&op=advice'); } elseif (isset($_GET['confirm'])) { if (!sql_query("\r\n\t\t\tDELETE FROM " . $GLOBALS['prefix_lms'] . "_adviceuser\r\n\t\t\tWHERE idAdvice='" . $id_advice . "'")) { Util::jump_to('index.php?modname=advice&op=advice&result=err_del'); } elseif (!sql_query("\r\n\t\t\tDELETE FROM " . $GLOBALS['prefix_lms'] . "_advice\r\n\t\t\tWHERE idAdvice='" . $id_advice . "'")) { Util::jump_to('index.php?modname=advice&op=advice&result=err_del'); } else { Util::jump_to('index.php?modname=advice&op=advice&result=ok'); } } else { list($advice, $text) = sql_fetch_row(sql_query("\r\n\t\t\tSELECT title, description\r\n\t\t\tFROM " . $GLOBALS['prefix_lms'] . "_advice\r\n\t\t\tWHERE idAdvice = '" . (int) $_GET['idAdvice'] . "'")); $form = new Form(); $page_title = array('index.php?modname=advice&op=advice' => $lang->def('_ADVICE'), $lang->def('_DEL')); $GLOBALS['page']->add(getTitleArea($page_title, 'advice') . '<div class="std_block">' . $form->openForm('del_advice', 'index.php?modname=advice&op=deladvice') . $form->getHidden('idAdvice', 'idAdvice', $id_advice) . getDeleteUi($lang->def('_AREYOUSURE'), '<span>' . $lang->def('_TITLE') . ' : </span>' . $advice . '<br />' . '<span>' . $lang->def('_DESCRIPTION') . ' : </span>' . $text, false, 'confirm', 'undo') . $form->closeForm() . '</div>', 'content'); } }
function delfiles(&$url) { checkPerm('view'); $file_man = new MyFile(getLogUserId()); $lang =& DoceboLanguage::createInstance('myfiles'); $area = importVar('working_area', false, $file_man->getDefaultArea()); $id_file = importVar('id_file', true, 0); if (isset($_GET['confirm'])) { $result = $file_man->deleteFile($id_file); Util::jump_to($url->getUrl('op=myfiles&working_area=' . $area . '&result=' . ($result ? 'delete_ok' : 'delete_fail'))); } else { $f_info = $file_man->getFileInfo($id_file); $title_page = array($url->getUrl('op=myfiles') => $lang->def('_MYFILE'), $lang->def('_DEL') . ' : ' . $f_info[MYFILE_TITLE]); $GLOBALS['page']->add(getTitleArea($title_page, 'myfile') . '<div class="std_block">' . getDeleteUi($lang->def('_AREYOUSURE'), '<span>' . $lang->def('_TITLE') . ' : </span>' . $f_info[MYFILE_TITLE] . '<br />' . '<span>' . $lang->def('_DESCRIPTION') . ' : </span>' . $f_info[MYFILE_DESCRIPTION], true, $url->getUrl('op=delfiles&id_file=' . $id_file . '&confirm=1&working_area=' . $area), $url->getUrl('op=myfiles&working_area=' . $area)) . '</div>', 'content'); } }
function del_report_certificate() { checkPerm('view'); require_once _base_ . '/lib/lib.form.php'; require_once $GLOBALS['where_lms'] . '/lib/lib.certificate.php'; $certificate = new Certificate(); $form = new Form(); $lang =& DoceboLanguage::createInstance('certificate', 'lms'); $id_certificate = importVar('certificate_id', true, 0); $id_course = importVar('course_id', true, 0); $id_user = importVar('user_id', true, 0); $certificate_info = array(); $certificate_info = $certificate->getCertificateInfo($id_certificate); $c_infos = $certificate->getInfoForCourseCertificate($id_course, $id_certificate, $id_user); $certificate_info = current($c_infos); if (Get::req('confirm_del_report_certificate', DOTY_INT, 0) == 1 || isset($_GET['confirm']) && $_GET['confirm'] == 1) { require_once _base_ . '/lib/lib.upload.php'; $path = '/appLms/certificate/'; $deletion_result = true; if ($certificate_info[CERT_NAME] != '') { $deletion_result = sl_unlink($path . $certificate_info[ASSIGN_CERT_FILE]); } if ($deletion_result) { $deletion_result = $certificate->delCertificateForUserInCourse($id_certificate, $id_user, $id_course); if ($deletion_result) { Util::jump_to('index.php?modname=pcertificate&op=view_report_certificate&id_certificate=' . $id_certificate . '&id_course=' . $id_course . '&deletion=1'); } else { Util::jump_to('index.php?modname=pcertificate&op=view_report_certificate&id_certificate=' . $id_certificate . '&id_course=' . $id_course . '&deletion=2'); } } else { Util::jump_to('index.php?modname=pcertificate&op=view_report_certificate&id_certificate=' . $id_certificate . '&id_course=' . $id_course . '&deletion=3'); } } elseif (isset($_POST['undo_del_report_certificate'])) { Util::jump_to('index.php?modname=pcertificate&op=view_report_certificate&id_certificate=' . $id_certificate . '&id_course=' . $id_course); } else { $GLOBALS['page']->add(getTitleArea($lang->def('_VIEW_REPORT_DELETION'), 'certificate') . '<div class="std_block">' . $form->openForm('del_certificate', 'index.php?modname=pcertificate&op=del_report_certificate&certificate_id=' . $id_certificate . '&course_id=' . $id_course . '&user_id=' . $id_user) . $form->getHidden('id_certificate', 'id_certificate', $id_certificate) . getDeleteUi($lang->def('_AREYOUSURE'), '<span>' . $lang->def('_NAME') . ' : </span>' . $certificate_info[$id_certificate][CERT_NAME] . '<br />' . '<span>' . $lang->def('_DESCRIPTION') . ' : </span>' . $certificate_info[$id_certificate][CERT_DESCR], false, 'confirm_del_report_certificate', 'undo_del_report_certificate') . $form->closeForm() . '</div>', 'content'); } }
function delactivity() { checkPerm('mod'); require_once $GLOBALS['where_lms'] . '/lib/lib.coursereport.php'; require_once _base_ . '/lib/lib.form.php'; require_once _base_ . '/lib/lib.table.php'; // XXX: Initializaing $id_report = importVar('id_report', true, 0); $lang =& DoceboLanguage::createInstance('coursereport', 'lms'); $out =& $GLOBALS['page']; $out->setWorkingZone('content'); // XXX: Instance management $acl_man = Docebo::user()->getAclManager(); $report_man = new CourseReportManager(); if (isset($_POST['confirm'])) { if (!$report_man->deleteReportScore($id_report)) { Util::jump_to('index.php?modname=coursereport&op=coursereport&result=err'); } $re = $report_man->deleteReport($id_report); Util::jump_to('index.php?modname=coursereport&op=coursereport&result=' . ($re ? 'ok' : 'err')); } // retirive activity info $query_report = "\r\n\tSELECT id_report, title, max_score, required_score, weight, show_to_user, use_for_final\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_coursereport\r\n\tWHERE id_course = '" . $_SESSION['idCourse'] . "' AND id_report = '" . $id_report . "'\r\n\t\t\tAND source_of = 'activity' AND id_source = '0'"; $info_report = sql_fetch_assoc(sql_query($query_report)); // XXX: Write in output $page_title = array('index.php?modname=coursereport&op=coursereport' => $lang->def('_COURSEREPORT', 'menu_course'), $lang->def('_DEL') . ' : ' . strip_tags($info_report['title'])); $out->add(getTitleArea($page_title, 'coursereport') . '<div class="std_block">' . Form::openForm('delactivity', 'index.php?modname=coursereport&op=delactivity') . Form::getHidden('id_report', 'id_report', $id_report) . getDeleteUi($lang->def('_AREYOUSURE'), $lang->def('_TITLE_ACT') . ' : ' . $info_report['title'], false, 'confirm', 'undo') . Form::closeForm() . '</div>'); }
function delquest() { checkPerm('view', false, 'storage'); $lang =& DoceboLanguage::createInstance('test'); $idQuest = importVar('idQuest', true, 0); $back_url = urldecode(importVar('back_url')); $url_coded = htmlentities(urlencode($back_url)); list($idTest, $title_quest, $type_quest, $seq) = sql_fetch_row(sql_query("\r\n\tSELECT idTest, title_quest, type_quest, sequence \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_testquest \r\n\tWHERE idQuest = '" . $idQuest . "'")); if (isset($_GET['confirm'])) { $quest_obj = istanceQuest($type_quest, $idQuest); if (!$quest_obj->del()) { errorCommunication($lang->def('_OPERATION_FAILURE') . 'index.php?modname=test&op=delquest&idTest=' . $idTest . '&back_url=' . $url_coded, $lang->def("_BACK")); return; } sql_query("\r\n\t\tUPDATE " . $GLOBALS['prefix_lms'] . "_testquest \r\n\t\tSET sequence = sequence -1 \r\n\t\tWHERE sequence > '{$seq}'"); fixPageSequence($idTest); $max_score = _getTestMaxScore($idTest); if ($max_score !== false) { $query = "UPDATE " . $GLOBALS['prefix_lms'] . "_test SET score_max=" . (int) $max_score . " WHERE idTest=" . (int) $idTest; $res = mysql_query($query); } Util::jump_to('index.php?modname=test&op=modtestgui&idTest=' . $idTest . '&back_url=' . $url_coded); } else { $GLOBALS['page']->add('<div class="std_block">' . getDeleteUi($lang->def('_AREYOUSURE'), '<span class="text_bold">' . $lang->def('_TYPE') . ' : </span>' . $lang->def('_QUEST_ACRN_' . strtoupper($type_quest)) . ' - ' . $lang->def('_QUEST_' . strtoupper($type_quest)) . '<br />' . '<span class="text_bold">' . $lang->def('_QUESTION') . ' : </span>' . $title_quest, true, 'index.php?modname=test&op=delquest&idQuest=' . $idQuest . '&back_url=' . $url_coded . '&confirm=1', 'index.php?modname=test&op=modtestgui&idTest=' . $idTest . '&back_url=' . $url_coded) . '</div>', 'content'); } }
function conference_delconf() { checkPerm('mod'); $id = importVar('id'); $conference = new Conference_Manager(); $room = $conference->roomInfo($id); $lang =& DoceboLanguage::createInstance('conference', 'lms'); if (Get::req('confirm', DOTY_INT, 0)) { $conference->deleteRoom($id); require_once $GLOBALS['where_scs'] . '/lib/lib.booking.php'; $booking = new RoomBooking(); $booking->deleteBookingByRoom($id); Util::jump_to('index.php?modname=conference&op=list'); } else { $title_page = array('index.php?modname=conference&op=list' => $lang->def('_VIDEOCONFERENCE'), $lang->def('_DEL')); $GLOBALS['page']->add(getTitleArea($title_page, 'conference', $lang->def('_VIDEOCONFERENCE')) . '<div class="std_block">' . getDeleteUi($lang->def('_AREYOUSURE'), '<span>' . $lang->def('_VIDEOCONFERENCE') . ' : </span>' . $room["name"], true, 'index.php?modname=conference&op=delconf&id=' . $id . '&confirm=1', 'index.php?modname=conference&op=list') . '</div>', 'content'); } }
function delReleased() { checkPerm('mod'); require_once _base_ . '/lib/lib.form.php'; require_once _base_ . '/lib/lib.upload.php'; $id_certificate = importVar('id_certificate', true, 0); $id_meta = importVar('idmeta', true, 0); $id_user = importVar('iduser', true, 0); $lang =& DoceboLanguage::createInstance('certificate', 'lms'); $acl_man =& Docebo::user()->getAclManager(); if (Get::req('confirm', DOTY_INT, 0) == 1) { $query = "SELECT cert_file" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_assign" . " WHERE idUser = '******'" . " AND idMetaCertificate = '" . $id_meta . "'"; list($cert_file) = sql_fetch_row(sql_query($query)); $path = '/appLms/certificate/'; sl_open_fileoperations(); $res = sl_unlink($path . $cert_file); sl_close_fileoperations(); if (!$res) { Util::jump_to('index.php?modname=meta_certificate&op=create&id_certificate=' . $id_certificate . '&result=err_del_cert'); } $query = "DELETE FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_assign" . " WHERE idUser = '******'" . " AND idMetaCertificate = '" . $id_meta . "'"; if (!sql_query($query)) { Util::jump_to('index.php?modname=meta_certificate&op=create&id_certificate=' . $id_certificate . '&result=err_del_cert'); } else { Util::jump_to('index.php?modname=meta_certificate&op=create&id_certificate=' . $id_certificate . '&result=ok'); } } else { list($name, $descr) = sql_fetch_row(sql_query("\r\n\t\tSELECT name, description\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_certificate\r\n\t\tWHERE id_certificate = '" . $id_certificate . "'")); $user_info = $acl_man->getUser($id_user, false); $user = $user_info[ACL_INFO_LASTNAME] . ' ' . $user_info[ACL_INFO_FIRSTNAME] . ' (' . $acl_man->relativeId($user_info[ACL_INFO_USERID]) . ')'; $form = new Form(); $page_title = array('index.php?modname=meta_certificate&op=meta_certificate' => $lang->def('_TITLE_CERTIFICATE'), $lang->def('_DEL_RELEASED')); $GLOBALS['page']->add(getTitleArea($page_title, 'certificate') . '<div class="std_block">' . $form->openForm('del_certificate', 'index.php?modname=meta_certificate&op=del_released') . $form->getHidden('id_certificate', 'id_certificate', $id_certificate) . $form->getHidden('idmeta', 'idmeta', $id_meta) . $form->getHidden('iduser', 'iduser', $id_user) . getDeleteUi($lang->def('_AREYOUSURE'), '<span>' . $lang->def('_NAME') . ' : </span>' . $name . '<br />' . '<span>' . $lang->def('_DESCRIPTION') . ' : </span>' . $descr . '<br />' . '<span>' . $lang->def('_USER') . ' : </span>' . $user, false, 'confirm', 'undo') . $form->closeForm() . '</div>', 'content'); } }
function del_personal_media(&$out, &$lang) { include_once _base_ . '/lib/lib.upload.php'; include_once _base_ . "/lib/lib.form.php"; if (isset($_POST["canc_del"])) { Util::jump_to(getPopupBaseUrl() . "&op=personal"); } else { if (isset($_POST["conf_del"])) { $id = (int) $_POST["id"]; $user_id = Docebo::user()->getIdSt(); $qtxt = "SELECT real_fname FROM " . $GLOBALS["prefix_fw"] . "_user_file "; $qtxt .= "WHERE id='" . $id . "' AND user_idst='" . $user_id . "' AND type='image'"; $q = sql_query($qtxt); if ($q && mysql_num_rows($q) > 0) { $row = mysql_fetch_array($q); $real_fname = $row["real_fname"]; //@sl_unlink(_USER_FPATH.$real_fname); $qtxt = "DELETE FROM " . $GLOBALS["prefix_fw"] . "_user_file WHERE id='{$id}';"; $q = sql_query($qtxt); } Util::jump_to(getPopupBaseUrl() . "&op=personal"); } else { //load info $id = (int) importVar("item_id"); $user_id = Docebo::user()->getIdSt(); list($fname) = sql_fetch_row(sql_query("\r\n\t\tSELECT fname\r\n\t\tFROM " . $GLOBALS["prefix_fw"] . "_user_file\r\n\t\tWHERE id='" . $id . "' AND user_idst='" . $user_id . "'")); $GLOBALS['page']->add("<div class=\"std_block\">\n"); $form = new Form(); $GLOBALS['page']->add($form->openForm("popup_form", getPopupBaseUrl() . "&op=delpersonal")); $GLOBALS['page']->add($form->getHidden("id", "id", $id)); $GLOBALS['page']->add(getDeleteUi($lang->def('_AREYOUSURE'), '<span class="text_bold">' . $lang->def('_FILENAME') . ' :</span> ' . $fname . '<br />', false, 'conf_del', 'canc_del')); $GLOBALS['page']->add($form->closeForm()); $GLOBALS['page']->add("</div>\n"); } } }
function deletePerson($userid) { require_once _base_ . '/lib/lib.form.php'; //if( $userid === FALSE ) //this has been commented after dialogbox introduction return; $arrUser = $this->aclManager->getUser(FALSE, $userid); if ($arrUser !== FALSE) { $idst = $arrUser[0]; $firstname = $arrUser[2]; $lastname = $arrUser[3]; } $are_title = array(); $GLOBALS['page']->add('<h2 id="directory_deluser">' . $this->lang->def('_DEL') . '</h2>' . Form::openForm('directorydeleteperson', 'index.php?modname=directory&op=org_chart') . '<input type="hidden" id="idst" name="idst" value="' . $idst . '" \\>' . getDeleteUi($this->lang->def('_AREYOUSURE'), $this->lang->def('_USERNAME') . ' : ' . $userid . '<br />' . $this->lang->def('_LASTNAME') . ' : ' . $lastname . '<br />' . $this->lang->def('_FIRSTNAME') . ' : ' . $firstname, false, 'deleteperson', "deletepersoncancel") . Form::closeForm(), 'content'); }
function loadDeleteFolder() { $tdb = $this->tdb; $folder = $tdb->getFolderById($this->getSelectedFolderId()); $lang =& DoceboLanguage::createInstance('course', 'lms'); return $this->printState() . getDeleteUi($lang->def('_AREYOUSURE'), '<span class="text_bold">' . $lang->def('_CATEGORY') . ' : </span>' . $this->getFolderPrintName($folder), false, $this->_getDeleteFolderId(), $this->_getCancelId()); }
function delpages() { checkPerm('mod'); require_once _base_ . '/lib/lib.form.php'; $lang =& DoceboLanguage::createInstance('admin_webpages', 'lms'); $id_page = importVar('id_page', true, 0); list($title, $seq) = sql_fetch_row(sql_query("\r\n\tSELECT title, sequence\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_webpages \r\n\tWHERE idPages = '" . $id_page . "'")); if (Get::req('confirm', DOTY_INT, 0) == 1) { $query_delete = "\r\n\t\tDELETE FROM " . $GLOBALS['prefix_lms'] . "_webpages \r\n\t\tWHERE idPages = '" . $id_page . "'"; if (!sql_query($query_delete)) { Util::jump_to('index.php?modname=webpages&op=webpages&result=err'); } sql_query("\r\n\t\tUPDATE " . $GLOBALS['prefix_lms'] . "_webpages\r\n\t\tSET sequence = sequence -1\r\n\t\tWHERE sequence > '" . $seq . "'"); Util::jump_to('index.php?modname=webpages&op=webpages&result=ok'); } else { $form = new Form(); $page_title = array('index.php?modname=news&op=news' => $lang->def('_NEWS'), $lang->def('_DEL')); $GLOBALS['page']->add(getTitleArea($page_title, 'admin_webpages') . '<div class="std_block">' . $form->openForm('del_pages', 'index.php?modname=webpages&op=delpages') . $form->getHidden('id_page', 'id_page', $id_page) . getDeleteUi($lang->def('_AREYOUSURE'), '<span>' . $lang->def('_TITLE') . ' : </span>' . $title, false, 'confirm', 'undo') . $form->closeForm() . '</div>', 'content'); } }
function delfriend(&$url) { checkPerm('view'); require_once $GLOBALS['where_framework'] . '/lib/lib.myfriends.php'; $lang =& DoceboLanguage::createInstance('myfriends', 'lms'); $my_fr = new MyFriends(getLogUserId()); $id_friend = importVar('id_friend', true, 0); $GLOBALS['page']->add(getTitleArea(array($url->getUrl() => $lang->def('_MY_FRIENDS'), $lang->def('_REMOVE_FRIEND')), 'myfriends') . '<div class="std_block">', 'content'); if (isset($_GET['confirm'])) { if ($my_fr->delFriend($id_friend)) { Util::jump_to($url->getUrl('result=ok_del')); } $GLOBALS['page']->add(getErrorUi($lang->def('_ERR_REMOVE_FRIEND'))); } $ui = $my_fr->getFriendsInfo(array($id_friend)); if ($ui == false) { $GLOBALS['page']->add(getErrorUi($lang->def('_INVALID_FRIEND'))); } else { $acl_man =& Docebo::user()->getAclManager(); $ui = current($ui); $GLOBALS['page']->add(getDeleteUi($lang->def('_AREYOUSURE'), '<span>' . $lang->def('_USERNAME') . ' : </span>' . $acl_man->relativeId($ui[ACL_INFO_USERID]) . '<br />' . '<span>' . $lang->def('_USERCOMPLETENAME') . ' : </span>' . $ui[ACL_INFO_LASTNAME] . ($ui[ACL_INFO_LASTNAME] != '' ? ' ' : '') . $ui[ACL_INFO_FIRSTNAME], true, $url->getUrl('op=delfriend&id_friend=' . $id_friend . '&confirm=1'), $url->getUrl()), 'content'); } $GLOBALS['page']->add('</div>', 'content'); }
function delslot() { checkPerm('mod'); require_once _base_ . '/lib/lib.form.php'; require_once $GLOBALS['where_lms'] . '/lib/lib.coursepath.php'; $out =& $GLOBALS['page']; $lang =& DoceboLanguage::createInstance('coursepath', 'lms'); $id_slot = importVar('id_slot'); $id_path = importVar('id_path'); $cpath_man = new CoursePath_Manager(); $path = $cpath_man->getCoursepathInfo($id_path); if (isset($_POST['confirm'])) { if ($id_slot != false) { $re = $cpath_man->deleteSlot($id_slot, $id_path); } Util::jump_to('index.php?modname=coursepath&op=pathelem&id_path=' . $id_path); } $slot = $cpath_man->getSlotInfo($id_slot); $title_area = array('index.php?modname=coursepath&op=pathlist' => $lang->def('_COURSEPATH')); $title_area['index.php?modname=coursepath&op=pathelem&id_path=' . $id_path] = $path['path_name']; $title_area[] = $lang->def('_DEL_SLOT'); $GLOBALS['page']->add(getTitleArea($title_area, 'coursepath') . '<div class="std_block">' . Form::openForm('deletepath', 'index.php?modname=coursepath&op=delslot') . Form::getHidden('id_path', 'id_path', $id_path) . Form::getHidden('id_slot', 'id_slot', $id_slot) . getDeleteUi($lang->def('_AREE_YOU_SURE_TO_DELETE_SLOT'), '<span class="text_bold">' . $lang->def('_MIN_SELECTION') . ' : </span>' . $slot['min_selection'] . '<br />' . '<span class="text_bold">' . $lang->def('_MAX_SELECTION') . ' : </span>' . $slot['max_selection'], false, 'confirm', 'undo') . Form::closeForm() . '</div>', 'content'); }