function modglossarygui($object_glos = NULL) { checkPerm('view', false, 'storage'); $lang =& DoceboLanguage::createInstance('glossary'); require_once _base_ . '/lib/lib.table.php'; $tableGlossary = new Table(Get::sett('visuItem'), '', $lang->def('_GLOSSARY_SUMMARY')); $tableGlossary->initNavBar('ini', 'link'); $ini = $tableGlossary->getSelectedElement(); $back_coded = htmlentities(urlencode($object_glos->back_url)); list($title) = sql_fetch_row(sql_query("\r\n\tSELECT title\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_glossary \r\n\tWHERE idGlossary = '" . $object_glos->getId() . "'")); $reTerm = sql_query("\r\n\tSELECT idTerm, term \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_glossaryterm \r\n\tWHERE idGlossary = '" . $object_glos->getId() . "' \r\n\tORDER BY term \r\n\tLIMIT {$ini}," . Get::sett('visuItem')); list($num_of_term) = sql_fetch_row(sql_query("\r\n\tSELECT COUNT(*) \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_glossaryterm\r\n\tWHERE idGlossary = '" . $object_glos->getId() . "'")); if ($title == '') { $_SESSION['last_error'] = $lang->def('_FILEUNSPECIFIED'); Util::jump_to(Util::str_replace_once('&', '&', $object_glos->back_url) . '&create_result=0'); } $GLOBALS['page']->add(getTitleArea($lang->def('_GLOSSARY'), 'glossary', $lang->def('_GLOSSARY')) . '<div class="std_block">' . getBackUi(Util::str_replace_once('&', '&', $object_glos->back_url) . '&mod_result=0', $lang->def('_BACK')) . '<b>' . $lang->def('_GLOSSARY') . ' : ' . $title . '</b><br /><br />' . '<div class="mod_container">' . '<a href="index.php?modname=glossary&op=modglossary&idGlossary=' . $object_glos->getId() . '&back_url=' . $back_coded . '" title="' . $lang->def('_MOD_TITLE') . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" /> ' . $lang->def('_MOD_TITLE') . '</a>' . '</div><br />', 'content'); $contentArray = array($lang->def('_TERM'), '<img src="' . getPathImage() . 'standard/edit.png" title="' . $lang->def('_MOD') . '" alt="' . $lang->def('_MOD') . '" />', '<img src="' . getPathImage() . 'standard/delete.png" title="' . $lang->def('_DEL') . '" alt="' . $lang->def('_DEL') . '" />'); $typeArray = array('', 'image', 'image'); $GLOBALS['page']->add($tableGlossary->addHead($contentArray, $typeArray)); while (list($idTerm, $term) = sql_fetch_row($reTerm)) { $content = array($term, '<a href="index.php?modname=glossary&op=modterm&idTerm=' . $idTerm . '&back_url=' . $back_coded . '" title="' . $lang->def('_MOD') . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" /></a>', '<a href="index.php?modname=glossary&op=delterm&idTerm=' . $idTerm . '&back_url=' . $back_coded . '" title="' . $lang->def('_DEL') . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" /></a>'); $tableGlossary->addBody($content); } $tableGlossary->addActionAdd('<a href="index.php?modname=glossary&op=addterm&idGlossary=' . $object_glos->getId() . '&back_url=' . $back_coded . '" title="' . $lang->def('_ADDTERM') . '">' . '<img src="' . getPathImage() . 'standard/add.png" alt="' . $lang->def('_ADD') . '" /> ' . $lang->def('_ADDTERM') . '</a>'); $tableGlossary->setLink('index.php?modname=glossary&op=modglossarygui' . '&idGlossary=' . $object_glos->getId() . '&back_url=' . $back_coded); $GLOBALS['page']->add($tableGlossary->getTable() . $tableGlossary->getNavBar($ini, $num_of_term) . '</div>', 'content'); }
function publicAdminManager_list() { checkPerm('view'); require_once _base_ . '/lib/lib.table.php'; $lang =& DoceboLanguage::createInstance('adminrules', 'framework'); $lang =& DoceboLanguage::createInstance('public_admin_manager', 'framework'); $aclManager = new DoceboACLManager(); // get users to show -------------------------------------------------- $admin_group_idst = $aclManager->getGroupST(ADMIN_GROUP_PUBLICADMIN); $arr_admin_idst = $aclManager->getGroupUMembers($admin_group_idst); $arr_admin_id = array_flip($aclManager->getArrUserST($arr_admin_idst)); $pm =& PlatformManager::createInstance(); $lms_is_active = $pm->isLoaded("lms"); /*$cms_is_active = $pm->isLoaded("cms");*/ // print table -------------------------------------------------------- $table = new Table(Get::sett('visuItem'), $lang->def('_PUBLIC_ADMIN_USER'), $lang->def('_PUBLIC_ADMIN_USER')); $table->initNavBar('ini', 'link'); $table->setLink('index.php?modname=public_admin_manager&op=view&ini='); $ini = $table->getSelectedElement(); $GLOBALS['page']->add(getTitleArea($lang->def('_ADMIN_MANAGMENT'), 'admin_managmer', $lang->def('_ADMIN_MANAGMENT')) . '<div class="std_block">', 'content'); $contentH = array($lang->def('_USERNAME'), '<img src="' . getPathImage() . 'admin_manager/man_pref.gif" alt="' . $lang->def('_ADMIN_PREFERENCES_TITLE', 'adminrules') . '" ' . 'title="' . $lang->def('_ADMIN_PREFERENCES_TITLE', 'adminrules') . '" />', '<img src="' . getPathImage() . 'admin_manager/man_menu.gif" alt="' . $lang->def('_ASSIGN_USERS', 'adminrules') . '" ' . 'title="' . $lang->def('_ASSIGN_USERS', 'adminrules') . '" />', '<img src="' . getPathImage() . 'directory/tree.gif" alt="' . $lang->def('_ASSIGN_USERS', 'adminrules') . '" ' . 'title="' . $lang->def('_ASSIGN_USERS', 'adminrules') . '" />'); $typeH = array('', 'image', 'image', 'image'); if ($lms_is_active) { $contentH[] = '<img src="' . getPathImage() . 'admin_manager/man_course.gif" alt="' . $lang->def('_ASSIGN_USERS', 'adminrules') . '" ' . 'title="' . $lang->def('_ASSIGN_USERS', 'adminrules') . '" />'; $typeH[] = 'image'; } $table->setColsStyle($typeH); $table->addHead($contentH); $maxItem = count($arr_admin_id) < $ini + Get::sett('visuItem') ? count($arr_admin_id) : $ini + Get::sett('visuItem'); for ($index = $ini; $index < $maxItem; $index++) { $admin_userid = substr($arr_admin_id[$arr_admin_idst[$index]], 1); $rowContent = array($admin_userid); // Edit preferences $rowContent[] = '<a href="index.php?modname=public_admin_manager&op=edit_preferences&adminidst=' . $arr_admin_idst[$index] . '" title="' . $lang->def('_ADMIN_PREFERENCES_TITLE', 'adminrules') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'admin_manager/man_pref.gif"' . ' alt="' . $lang->def('_ADMIN_PREFERENCES_TITLE', 'adminrules') . ' : ' . $admin_userid . '" /></a>'; // Edit menu $rowContent[] = '<a href="index.php?modname=public_admin_manager&op=edit_menu&adminidst=' . $arr_admin_idst[$index] . '" title="' . $lang->def('_ASSIGN_USERS', 'adminrules') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'admin_manager/man_menu.gif"' . ' alt="' . $lang->def('_ASSIGN_USERS', 'adminrules') . ' : ' . $admin_userid . '" /></a>'; // Edit user $rowContent[] = '<a href="index.php?modname=public_admin_manager&op=assign_tree&adminidst=' . $arr_admin_idst[$index] . '" title="' . $lang->def('_ASSIGN_USERS', 'adminrules') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'directory/tree.gif" ' . 'alt="' . $lang->def('_ASSIGN_USERS', 'adminrules') . ' : ' . $admin_userid . '" /></a>'; // Edit course if ($lms_is_active) { $rowContent[] = '<a href="index.php?modname=public_admin_manager&op=edit_course&adminidst=' . $arr_admin_idst[$index] . '&load=1" title="' . $lang->def('_ASSIGN_USERS', 'adminrules') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'admin_manager/man_course.gif"' . ' alt="' . $lang->def('_ASSIGN_USERS', 'adminrules') . ' : ' . $admin_userid . '" /></a>'; } $table->addBody($rowContent); } $GLOBALS['page']->add($table->getTable() . $table->getNavBar($ini, count($arr_admin_id)), 'content'); $GLOBALS['page']->add('</div>', 'content'); }
function adminManager_list() { checkPerm('view'); require_once _base_ . '/lib/lib.table.php'; $lang =& DoceboLanguage::createInstance('adminrules', 'framework'); $aclManager = new DoceboACLManager(); // get users to show -------------------------------------------------- $admin_group_idst = $aclManager->getGroupST(ADMIN_GROUP_ADMIN); $arr_admin_idst = $aclManager->getGroupUMembers($admin_group_idst); $arr_admin_id = array_flip($aclManager->getArrUserST($arr_admin_idst)); $usres_info =& $aclManager->getUsers($arr_admin_idst); $pm =& PlatformManager::createInstance(); $lms_is_active = $pm->isLoaded("lms"); $cms_is_active = $pm->isLoaded("cms"); // print table -------------------------------------------------------- $table = new Table(Get::sett('visuItem'), $lang->def('_ADMIN_USER'), $lang->def('_ADMIN_USER')); $table->initNavBar('ini', 'link'); $table->setLink('index.php?modname=admin_manager&op=view&ini='); $ini = $table->getSelectedElement(); $GLOBALS['page']->add(getTitleArea($lang->def('_ADMIN_MANAGMENT'), 'admin_managmer', $lang->def('_ADMIN_MANAGMENT')) . '<div class="std_block">', 'content'); $contentH = array($lang->def('_USERNAME'), $lang->def('_EMAIL'), '<img src="' . getPathImage() . 'admin_manager/man_pref.gif" alt="' . $lang->def('_ADMIN_PREFERENCES_TITLE') . '" ' . 'title="' . $lang->def('_ADMIN_PREFERENCES_TITLE') . '" />', '<img src="' . getPathImage() . 'admin_manager/man_menu.gif" alt="' . $lang->def('_ASSIGN_USERS') . '" ' . 'title="' . $lang->def('_ADMIN_MENU_TITLE') . '" />', '<img src="' . getPathImage() . 'directory/tree.gif" alt="' . $lang->def('_ASSIGN_USERS') . '" ' . 'title="' . $lang->def('_ASSIGN_USERS') . '" />', '<img src="' . getPathImage() . 'admin_manager/lang_lang.gif" alt="' . $lang->def('_ASSIGN_USERS') . '" ' . 'title="' . $lang->def('_ASSIGN_USERS') . '" />'); $typeH = array('', '', 'image', 'image', 'image', 'image'); if ($lms_is_active) { $contentH[] = '<img src="' . getPathImage() . 'admin_manager/man_course.gif" alt="' . $lang->def('_ASSIGN_USERS') . '" ' . 'title="' . $lang->def('_ASSIGN_USERS') . '" />'; $typeH[] = 'image'; } if ($cms_is_active) { // Cms Pages $contentH[] = '<img src="' . getPathImage() . 'admin_manager/pagetree.png" alt="' . $lang->def('_ASSIGN_CMS_PAGES') . '" ' . 'title="' . $lang->def('_ASSIGN_CMS_PAGES') . '" />'; $typeH[] = 'image'; // Cms News $contentH[] = '<img src="' . getPathImage() . 'admin_manager/newstree.png" alt="' . $lang->def('_NEWS') . '" ' . 'title="' . $lang->def('_NEWS') . '" />'; $typeH[] = 'image'; // Cms Documents $contentH[] = '<img src="' . getPathImage() . 'admin_manager/docstree.png" alt="' . $lang->def('_ASSIGN_CMS_DOCS') . '" ' . 'title="' . $lang->def('_ASSIGN_CMS_DOCS') . '" />'; $typeH[] = 'image'; // Cms Media $contentH[] = '<img src="' . getPathImage() . 'admin_manager/mediatree.png" alt="' . $lang->def('_ASSIGN_CMS_MEDIA') . '" ' . 'title="' . $lang->def('_ASSIGN_CMS_MEDIA') . '" />'; $typeH[] = 'image'; // Cms Contents $contentH[] = '<img src="' . getPathImage() . 'admin_manager/contenttree.png" alt="' . $lang->def('_ASSIGN_CMS_CONTENT') . '" ' . 'title="' . $lang->def('_ASSIGN_CMS_CONTENT') . '" />'; $typeH[] = 'image'; } $table->setColsStyle($typeH); $table->addHead($contentH); $maxItem = count($arr_admin_id) < $ini + Get::sett('visuItem') ? count($arr_admin_id) : $ini + Get::sett('visuItem'); for ($index = $ini; $index < $maxItem; $index++) { $admin_userid = substr($arr_admin_id[$arr_admin_idst[$index]], 1); $rowContent = array($admin_userid, $usres_info[$arr_admin_idst[$index]][ACL_INFO_EMAIL]); // Edit preferences $rowContent[] = '<a href="index.php?modname=admin_manager&op=edit_preferences&adminidst=' . $arr_admin_idst[$index] . '" title="' . $lang->def('_ADMIN_PREFERENCES_TITLE') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'admin_manager/man_pref.gif"' . ' alt="' . $lang->def('_ADMIN_PREFERENCES_TITLE') . ' : ' . $admin_userid . '" /></a>'; // Edit menu $rowContent[] = '<a href="index.php?modname=admin_manager&op=edit_menu&adminidst=' . $arr_admin_idst[$index] . '" title="' . $lang->def('_ADMIN_MENU_TITLE') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'admin_manager/man_menu.gif"' . ' alt="' . $lang->def('_ADMIN_MENU_TITLE') . ' : ' . $admin_userid . '" /></a>'; // Edit user $rowContent[] = '<a href="index.php?modname=admin_manager&op=assign_tree&adminidst=' . $arr_admin_idst[$index] . '" title="' . $lang->def('_ASSIGN_USERS') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'directory/tree.gif" ' . 'alt="' . $lang->def('_ASSIGN_USERS') . ' : ' . $admin_userid . '" /></a>'; // Edit lang $rowContent[] = '<a href="index.php?modname=admin_manager&op=edit_lang&adminidst=' . $arr_admin_idst[$index] . '" title="' . $lang->def('_ASSIGN_USERS') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'admin_manager/lang_lang.gif"' . ' alt="' . $lang->def('_ASSIGN_USERS') . ' : ' . $admin_userid . '" /></a>'; // Edit course if ($lms_is_active) { $rowContent[] = '<a href="index.php?modname=admin_manager&op=edit_course&adminidst=' . $arr_admin_idst[$index] . '&load=1" title="' . $lang->def('_ASSIGN_USERS') . ' : ' . $admin_userid . '">' . '<img src="' . getPathImage() . 'admin_manager/man_course.gif"' . ' alt="' . $lang->def('_ASSIGN_USERS') . ' : ' . $admin_userid . '" /></a>'; } // Assign cms trees permissions if ($cms_is_active) { // Cms Pages $img = "<img src=\"" . getPathImage() . "admin_manager/pagetree.png\" alt=\"" . $lang->def("_ASSIGN_CMS_PAGES") . "\" "; $img .= "title=\"" . $lang->def("_ASSIGN_CMS_PAGES") . "\" />"; $url = "index.php?modname=admin_manager&op=assign_cmspag&adminidst=" . $arr_admin_idst[$index]; $rowContent[] = "<a href=\"" . $url . "\">" . $img . "</a>\n"; // Cms News $img = "<img src=\"" . getPathImage() . "admin_manager/newstree.png\" alt=\"" . $lang->def("_NEWS") . "\" "; $img .= "title=\"" . $lang->def("_NEWS") . "\" />"; $url = "index.php?modname=admin_manager&op=assign_cmsnews&adminidst=" . $arr_admin_idst[$index]; $rowContent[] = "<a href=\"" . $url . "\">" . $img . "</a>\n"; // Cms Documents $img = "<img src=\"" . getPathImage() . "admin_manager/docstree.png\" alt=\"" . $lang->def("_ASSIGN_CMS_DOCS") . "\" "; $img .= "title=\"" . $lang->def("_ASSIGN_CMS_DOCS") . "\" />"; $url = "index.php?modname=admin_manager&op=assign_cmsdocs&adminidst=" . $arr_admin_idst[$index]; $rowContent[] = "<a href=\"" . $url . "\">" . $img . "</a>\n"; // Cms Media $img = "<img src=\"" . getPathImage() . "admin_manager/mediatree.png\" alt=\"" . $lang->def("_ASSIGN_CMS_MEDIA") . "\" "; $img .= "title=\"" . $lang->def("_ASSIGN_CMS_MEDIA") . "\" />"; $url = "index.php?modname=admin_manager&op=assign_cmsmedia&adminidst=" . $arr_admin_idst[$index]; $rowContent[] = "<a href=\"" . $url . "\">" . $img . "</a>\n"; // Cms Contents $img = "<img src=\"" . getPathImage() . "admin_manager/contenttree.png\" alt=\"" . $lang->def("_ASSIGN_CMS_CONTENT") . "\" "; $img .= "title=\"" . $lang->def("_ASSIGN_CMS_CONTENT") . "\" />"; $url = "index.php?modname=admin_manager&op=assign_cmscontent&adminidst=" . $arr_admin_idst[$index]; $rowContent[] = "<a href=\"" . $url . "\">" . $img . "</a>\n"; } $table->addBody($rowContent); } $GLOBALS['page']->add($table->getTable() . $table->getNavBar($ini, count($arr_admin_id)), 'content'); $GLOBALS['page']->add('</div>', 'content'); }
function transaction() { require_once _base_ . '/lib/lib.table.php'; require_once _base_ . '/lib/lib.form.php'; require_once _base_ . '/lib/lib.dialog.php'; YuiLib::load(); $lang =& DoceboLanguage::createInstance('transaction'); $acl_man = Docebo::user()->getAclManager(); $man_transaction = new Man_Transaction(); cout(getTitleArea($lang->def('_TRANSACTION')) . '<div class="std_block">'); $tb = new Table(Get::sett('visuItem'), $lang->def('_TRANSACTION_TABLE'), $lang->def('_TRANSACTION_TABLE')); $tb->initNavBar('ini', 'button'); $tb->setLink('index.php?modname=transaction&op=transaction'); $page = ($tb->getSelectedPage() - 1) * Get::sett('visuItem'); $status_filter = Get::req('payment_status', DOTY_INT, '-2'); $course_filter = Get::req('course_status', DOTY_INT, '-2'); $tran_filter = Get::req('tran', DOTY_MIXED, ''); $display = false; if ($status_filter != -2) { $display = true; } if ($course_filter != -2) { $display = true; } $transactions = $man_transaction->getTransaction($page, $status_filter == '-2' ? false : $status_filter, $course_filter == '-2' ? false : $course_filter, $tran_filter); $tot_transaction = $man_transaction->getTotTransaction($status_filter == '-2' ? false : $status_filter, $course_filter == '-2' ? false : $course_filter, $tran_filter); if (count($transactions) > 0 || $display) { $mod_img = '<img src="' . getPathImage() . '/standard/edit.png" title="' . $lang->def('_MOD') . '" alt="' . $lang->def('_MOD') . '" />'; $del_img = '<img src="' . getPathImage() . '/standard/delete.png" title="' . $lang->def('_DEL') . '" alt="' . $lang->def('_DEL') . '" />'; $cont_h = array($lang->def('_USER'), $lang->def('_DATE'), $lang->def('_COURSE_PRIZE'), $lang->def('_PAYMENT_METHOD'), $lang->def('_PAYMENT_STATUS'), $lang->def('COURSE_STATUS'), $mod_img, $del_img); $type_h = array('', '', '', '', 'image', 'image', 'image', 'image'); $tb->setColsStyle($type_h); $tb->addHead($cont_h); foreach ($transactions as $transaction_info) { if ($transaction_info['firstname'] !== '' && $transaction_info['lastname'] !== '') { $user = $transaction_info['firstname'] . ' ' . $transaction_info['lastname'] . ' (' . $acl_man->relativeId($transaction_info['userid']) . ')'; } elseif ($transaction_info['firstname'] !== '') { $user = $transaction_info['firstname'] . ' (' . $acl_man->relativeId($transaction_info['userid']) . ')'; } elseif ($transaction_info['lastname'] !== '') { $user = $transaction_info['lastname'] . ' (' . $acl_man->relativeId($transaction_info['userid']) . ')'; } else { $user = $acl_man->relativeId($transaction_info['userid']); } switch ($transaction_info['payment_status']) { case '-1': $payment_status = '<img src="' . getPathImage() . '/standard/dot_red.gif" alt="' . $lang->def('_CANCELLED') . '" title="' . $lang->def('_CANCELLED') . '" />'; break; case '0': $payment_status = '<img src="' . getPathImage() . '/standard/dot_grey.gif" alt="' . $lang->def('_WAITING_PAYMENT') . '" title="' . $lang->def('_WAITING_PAYMENT') . '" />'; break; case '1': $payment_status = '<img src="' . getPathImage() . '/standard/dot_yellow.gif" alt="' . $lang->def('_PARTIAL_PAID') . '" title="' . $lang->def('_PARTIAL_PAID') . '" />'; break; case '2': $payment_status = '<img src="' . getPathImage() . '/standard/dot_green.gif" alt="' . $lang->def('_PAID') . '" title="' . $lang->def('_PAID') . '" />'; break; } switch ($transaction_info['course_status']) { case '-1': $course_status = '<img src="' . getPathImage() . '/standard/dot_red.gif" alt="' . $lang->def('_CANCELLED') . '" title="' . $lang->def('_CANCELLED') . '" />'; break; case '0': $course_status = '<img src="' . getPathImage() . '/standard/dot_grey.gif" alt="' . $lang->def('_NO_COURSE_ACTIVATED') . '" title="' . $lang->def('_NO_COURSE_ACTIVATED') . '" />'; break; case '1': $course_status = '<img src="' . getPathImage() . '/standard/dot_yellow.gif" alt="' . $lang->def('_SOME_COURSE_ACTIVATED') . '" title="' . $lang->def('_SOME_COURSE_ACTIVATED') . '" />'; break; case '2': $course_status = '<img src="' . getPathImage() . '/standard/dot_green.gif" alt="' . $lang->def('_ALL_COURSE_ACTIVATED') . '" title="' . $lang->def('_ALL_COURSE_ACTIVATED') . '" />'; break; } $tb->addBody(array($user, Format::date($transaction_info['date']), $transaction_info['price'], $lang->def('_' . strtoupper($transaction_info['method'])), $payment_status, $course_status, '<a href="index.php?modname=transaction&op=mod&id=' . $transaction_info['id_transaction'] . '">' . $mod_img . '</a>', '<a href="index.php?modname=transaction&op=del&id=' . $transaction_info['id_transaction'] . '">' . $del_img . '</a>')); } $array_payment_status = array('-2' => $lang->def('_ALL_STATUS'), '-1' => $lang->def('_CANCELLED'), '0' => $lang->def('_WAITING_PAYMENT'), '1' => $lang->def('_PARTIAL_PAID'), '2' => $lang->def('_PAID')); $array_course_status = array('-2' => $lang->def('_ALL_STATUS'), '-1' => $lang->def('_CANCELLED'), '0' => $lang->def('_NO_COURSE_ACTIVATED'), '1' => $lang->def('_SOME_COURSE_ACTIVATED'), '2' => $lang->def('_ALL_COURSE_ACTIVATED')); cout(Form::openForm('transaction_filter', 'index.php?modname=transaction&op=transaction') . $tb->getNavBar($page, $tot_transaction) . '<div class="quick_search_form">' . Form::getInputTextfield('search_t', 'tran', 'tran', $tran_filter, '', 255, '') . Form::getButton("filter", "filter", $lang->def('_FILTER'), "search_b") . '<br />' . '<a class="advanced_search" href="javascript:;" onclick="( this.nextSibling.style.display != \'block\' ? this.nextSibling.style.display = \'block\' : this.nextSibling.style.display = \'none\' );">' . $lang->def("_ADVANCED_SEARCH") . '</a>' . '<div class="overlay_menu" style="display:' . ($display ? 'block' : 'none') . '">' . Form::getDropdown($lang->def('_PAYMENT_STATUS_FILTER'), 'payment_status', 'payment_status', $array_payment_status, $status_filter) . Form::getDropdown($lang->def('_COURSE_STATUS_FILTER'), 'course_status', 'course_status', $array_course_status, $course_filter) . '</div>' . '</div>' . '<script type="text/javascript">' . 'var payment_status = YAHOO.util.Dom.get(\'payment_status\');' . 'var course_status = YAHOO.util.Dom.get(\'course_status\');' . 'var form = YAHOO.util.Dom.get(\'transaction_filter\');' . 'YAHOO.util.Event.on(payment_status, \'change\', function() { this.submit() } , form, true);' . 'YAHOO.util.Event.on(course_status, \'change\', function() { this.submit() } , form, true);' . '</script>' . $tb->getTable() . $tb->getNavBar($page, $tot_transaction) . Form::closeForm()); setupHrefDialogBox('a[href*=del]'); } else { cout(Lang::t('_NO_CONTENT', 'transaction')); } cout('</div>'); }
function classroom() { checkPerm('view'); require_once _base_ . '/lib/lib.form.php'; require_once _base_ . '/lib/lib.table.php'; $mod_perm = true; // create a language istance for module admin_classroom $lang =& DoceboLanguage::createInstance('admin_classroom', 'lms'); $out =& $GLOBALS['page']; $out->setWorkingZone('content'); $tb = new Table(Get::sett('visuItem'), $lang->def('_CLASSROOM_CAPTION'), $lang->def('_CLASSROOM_SUMMARY')); $tb->initNavBar('ini', 'link'); $tb->setLink('index.php?modname=reservation&op=classroom&id_course=' . $_SESSION['idCourse']); $ini = $tb->getSelectedElement(); //search query of classrooms $query_classroom = "\r\n\t\tSELECT idClassroom, name, description\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_classroom\r\n\t\tORDER BY name\r\n\t\tLIMIT {$ini}," . Get::sett('visuItem'); $query_classroom_tot = "\r\n\t\tSELECT COUNT(*)\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_classroom"; $re_classroom = sql_query($query_classroom); list($tot_classroom) = sql_fetch_row(sql_query($query_classroom_tot)); $type_h = array('', 'news_short_td', "image", "image"); $cont_h = array($lang->def('_NAME'), $lang->def('_DESCRIPTION')); if ($mod_perm) { $cont_h[] = '<img src="' . getPathImage() . 'standard/edit.png" title="' . $lang->def('_TITLE_MOD_CLASSROOM') . '" ' . 'alt="' . $lang->def('_MOD') . '" />'; $type_h[] = 'image'; $cont_h[] = '<img src="' . getPathImage() . 'standard/delete.png" title="' . $lang->def('_DEL') . '" ' . 'alt="' . $lang->def('_DEL') . '"" />'; $type_h[] = 'image'; } $tb->setColsStyle($type_h); $tb->addHead($cont_h); while (list($idClassroom, $name, $descr) = sql_fetch_row($re_classroom)) { $cont = array($name, $descr); if ($mod_perm) { $cont[] = '<a href="index.php?modname=reservation&op=modclassroom&idClassroom=' . $idClassroom . '" ' . 'title="' . $lang->def('_TITLE_MOD_CLASSROOM') . ' : ' . $name . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . ' : ' . $name . '" /></a>'; $cont[] = '<a href="index.php?modname=reservation&op=delclassroom&idClassroom=' . $idClassroom . '" ' . 'title="' . $lang->def('_DEL') . ' : ' . $name . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . ' : ' . $name . '" /></a>'; } $tb->addBody($cont); } if ($mod_perm) { $tb->addActionAdd('<a href="index.php?modname=reservation&op=addclassroom" title="' . $lang->def('_TITLE_NEW_CLASSROOM') . '">' . '<img src="' . getPathImage() . 'standard/add.png" alt="' . $lang->def('_ADD') . '" />' . $lang->def('_NEW_CLASSROOM') . '</a>'); } $out->add(getTitleArea($lang->def('_TITLE_CLASSROOM'), 'classroom', $lang->def('_ALT_TITLE_CLASSROOM')) . '<div class="std_block">'); if (isset($_GET['result'])) { switch ($_GET['result']) { case "ok": $out->add(getResultUi($lang->def('_OPERATION_SUCCESSFUL'))); break; case "err": $out->add(getErrorUi($lang->def('_OPERATION_FAILURE'))); break; case "err_del": $out->add(getErrorUi($lang->def('_OPERATION_FAILURE'))); break; } } $out->add(getBackUi('index.php?modname=reservation&op=reservation&active_tab=subscribed_user', $lang->def('_BACK'))); $out->add($tb->getTable() . $tb->getNavBar($ini, $tot_classroom) . '</div>'); }
function classroomToEdition() { require_once _base_ . '/lib/lib.form.php'; //require_once(_i18n_.'/lib.lang.php'); require_once _base_ . '/lib/lib.table.php'; require_once $GLOBALS['where_lms'] . '/lib/lib.course.php'; if (isset($_POST['classroom_to_edition'])) { list($edition_id) = each($_POST['classroom_to_edition']); } else { $edition_id = importVar('edition_id', true, 0); } $of_loc = importVar('of_loc', false, ''); $of_name = importVar('of_name', false, ''); $form = new Form(); $query_course_name = "SELECT idCourse, name\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_course_edition\r\n\tWHERE idCourseEdition = '" . $edition_id . "'"; list($idCourse, $edition_name) = sql_fetch_row(sql_query($query_course_name)); $lang =& DoceboLanguage::CreateInstance('course', 'lms'); $tb = new Table(Get::sett('visuItem'), $lang->def('_CLASSROOMTOCOURSE_CAPTION'), $lang->def('_CLASSROOMTOCOURSE_CAPTION')); $tb->initNavBar('ini', 'link'); $tb->setLink("index.php?modname=course&op=classroom_to_edition&edition_id={$edition_id}" . '&of_loc=' . $of_loc . '&of_name=' . $of_name); $ini = $tb->getSelectedElement(); $checked_class = checkAvailableClass($idCourse, $edition_id); $classroom_order = "l.location, c.name "; if ($of_loc == 'loc') { $classroom_order = "l.location, c.name "; } if ($of_loc == 'locd') { $classroom_order = "l.location DESC, c.name "; } if ($of_name == 'name') { $classroom_order = "c.name, l.location "; } if ($of_name == 'namec') { $classroom_order = "c.name DESC, l.location "; } if ($of_loc == '' && $of_name == '') { $of_loc = 'loc'; } //search query of classrooms --------------------------------- $query_classroom = "\r\n\tSELECT c.idClassroom, c.name, c.description, l.location\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_classroom AS c\r\n\t\tJOIN " . $GLOBALS['prefix_lms'] . "_class_location AS l\r\n\tWHERE l.location_id = c.location_id\r\n\tORDER BY " . $classroom_order . "\r\n\tLIMIT {$ini}," . Get::sett('visuItem'); $re_classroom = sql_query($query_classroom); // search classrooms assigned -------------------------------- $query_class_assigned = "\r\n\tSELECT classrooms\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_course_edition\r\n\twhere idCourseEdition= " . $edition_id . ""; list($assigned_classroom) = sql_fetch_row(sql_query($query_class_assigned)); $query_classroom_tot = "\r\n\tSELECT COUNT(*)\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_classroom "; list($tot_classroom) = sql_fetch_row(sql_query($query_classroom_tot)); // table intestation $type_h = array('', '', '', 'image'); $cont_h = array('<a href="' . "index.php?modname=course&op=classroom_to_edition&edition_id=" . $edition_id . "&of_loc=" . ($of_loc == 'loc' ? 'locd' : 'loc') . '">' . ($of_loc == 'loc' ? '<img src="' . getPathImage() . '/standard/1downarrow.png" alt="' . $lang->def('_DEF_DOWN') . '" />' : ($of_loc == 'locd' ? '<img src="' . getPathImage() . '/standard/1uparrow.png" alt="' . $lang->def('_DEF_UP') . '" />' : '<img src="' . getPathImage() . '/standard/sort.png" alt="' . $lang->def('_DEF_SORT') . '" />')) . $lang->def('_LOCATION') . '</a>', '<a href="' . "index.php?modname=course&op=classroom_to_edition&edition_id=" . $edition_id . "&of_name=" . ($of_name == 'name' ? 'named' : 'name') . '">' . ($of_name == 'name' ? '<img src="' . getPathImage() . '/standard/1downarrow.png" alt="' . $lang->def('_DEF_DOWN') . '" />' : ($of_name == 'named' ? '<img src="' . getPathImage() . '/standard/1uparrow.png" alt="' . $lang->def('_DEF_UP') . '" />' : '<img src="' . getPathImage() . '/standard/sort.png" alt="' . $lang->def('_DEF_SORT') . '" />')) . $lang->def('_CLASSROOM', 'course') . '</a>', $lang->def('_STATUS'), $lang->def('_USETHIS')); $tb->setColsStyle($type_h); $tb->addHead($cont_h); $class_room_to_edition = array(); while (list($idClassroom, $name, $descr, $location) = sql_fetch_row($re_classroom)) { $cont = array('<label for="class_room_to_edition_' . $idClassroom . '">' . $location . '</label>', '<label for="class_room_to_edition_' . $idClassroom . '">' . $name . '</label>'); if (isset($checked_class[$idClassroom])) { $cont[] = $lang->def('_CLASSROOM_OCCUPATED_YES'); } else { $cont[] = ''; } $cont[] = $form->getRadio('', 'class_room_to_edition_' . $idClassroom . '', 'class_room_to_edition', $idClassroom, $assigned_classroom == $idClassroom); $tb->addBody($cont); } $page_title = array('index.php?modname=course&op=course_list' => $lang->def('_CLASSROOM'), $edition_name); $GLOBALS['page']->add(getTitleArea($page_title, 'classroomtocourse', $lang->def('_CLASSROOM')) . '<div class="std_block">' . ($checked_class !== false ? getResultUi($lang->def('_CLASSROOM_OCCUPATED')) : '') . getBackUi('index.php?modname=course&op=course_list', $lang->def('_BACK')) . $form->openForm('assignEditionClassroom', 'index.php?modname=course&op=assignEditionClassroom', false, false, 'multipart/form-data') . $form->getHidden('edition_id', 'edition_id', $edition_id) . $form->getHidden('idCourse', 'idCourse', $idCourse) . $tb->getTable() . $tb->getNavBar($ini, $tot_classroom) . $form->openButtonSpace() . $form->getButton('assignEditionClassroom', 'assignEditionClassroom', $lang->def('_SAVE')) . $form->getButton('course_undo', 'course_undo', $lang->def('_UNDO')) . $form->closeButtonSpace() . $form->closeForm() . '</div>', 'content'); }
function modAssignmentAssignMetaCertificate() { checkPerm('mod'); require_once _base_ . '/lib/lib.form.php'; require_once $GLOBALS['where_framework'] . '/lib/lib.directory.php'; require_once _base_ . '/lib/lib.userselector.php'; require_once $GLOBALS['where_lms'] . '/lib/lib.course.php'; require_once $GLOBALS['where_lms'] . '/lib/lib.course_managment.php'; $lang =& DoceboLanguage::createInstance('certificate', 'lms'); $id_certificate = importVar('id_certificate', true, 0); $id_meta = Get::req('idmeta', DOTY_INT, 0); $step = Get::req('step', DOTY_INT, 0); $out =& $GLOBALS['page']; $out->setWorkingZone('content'); $acl_man =& Docebo::user()->getAclManager(); $aclManager = new DoceboACLManager(); $user_select = new UserSelector(); $form = new Form(); $sel = new Course_Manager(); $course_man = new Man_Course(); if (isset($_POST['okselector'])) { $user_selected = $user_select->getSelection($_POST); $_SESSION['meta_certificate']['users'] = $user_selected; $step++; } if (isset($_POST['import_filter'])) { $_SESSION['meta_certificate']['course'] = $sel->getCourseSelection($_POST); $step++; } if (isset($_POST['insert'])) { $step++; } if ($step == 3) { $array_user =& $aclManager->getAllUsersFromIdst($_SESSION['meta_certificate']['users']); $array_user = array_unique($array_user); $res = true; $user_reset = array(); $course_reset = array(); $reasign = array(); //array reasign $query = "SELECT idUser, idCourse" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course" . " WHERE idMetaCertificate = '" . $id_meta . "'"; $result = sql_query($query); while (list($id_user, $id_course) = sql_fetch_row($result)) { $reasign[$id_user][$id_course] = 1; } //array user_reset $query = "SELECT DISTINCT idUser" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course" . " WHERE idMetaCertificate = '" . $id_meta . "'"; $result = sql_query($query); while (list($id_user) = sql_fetch_row($result)) { $user_reset[$id_user] = $id_user; } //array course_reset $query = "SELECT DISTINCT idCourse" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course" . " WHERE idMetaCertificate = '" . $id_meta . "'"; $result = sql_query($query); while (list($id_course) = sql_fetch_row($result)) { $course_reset[$id_course] = $id_course; } //finish array initialization $query_course = "INSERT INTO " . $GLOBALS['prefix_lms'] . "_certificate_meta_course (idMetaCertificate, idUser, idCourse)" . " VALUES "; $first = true; $array_user_flipped = array_flip($array_user); foreach ($user_reset as $id_user) { if (!isset($array_user_flipped[$id_user])) { $query = "DELETE FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course" . " WHERE idUser = '******'" . " AND idMetaCertificate = '" . $id_meta . "'"; if (!sql_query($query)) { $res = false; } } } if (!$res) { Util::jump_to('index.php?modname=meta_certificate&op=assign&id_certificate=' . $id_certificate . '&res=error_mod_assign'); } foreach ($course_reset as $id_course) { if (!isset($_SESSION['meta_certificate']['course'][$id_course])) { $query = "DELETE FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course" . " WHERE idCourse = '" . $id_course . "'" . " AND idMetaCertificate = '" . $id_meta . "'"; if (!sql_query($query)) { $res = false; } } } if (!$res) { Util::jump_to('index.php?modname=meta_certificate&op=assign&id_certificate=' . $id_certificate . '&res=error_mod_assign'); } reset($_SESSION['meta_certificate']['course']); foreach ($array_user as $id_user) { foreach ($_SESSION['meta_certificate']['course'] as $id_course) { if (isset($_POST['_' . $id_user . '_' . $id_course . '_'])) { if (!isset($reasign[$id_user][$id_course])) { if ($first) { $query_course .= "('" . $id_meta . "', '" . $id_user . "', '" . $id_course . "')"; $first = false; } else { $query_course .= ", ('" . $id_meta . "', '" . $id_user . "', '" . $id_course . "')"; } } } else { if (isset($reasign[$id_user][$id_course])) { $query = "DELETE FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course" . " WHERE idUser = '******'" . " AND idCourse = '" . $id_course . "'" . " AND idMetaCertificate = '" . $id_meta . "'"; if (!sql_query($query)) { $res = false; } } } } } if (!$res) { Util::jump_to('index.php?modname=meta_certificate&op=assign&id_certificate=' . $id_certificate . '&res=error_mod_assign'); } $res = sql_query($query_course); if ($res) { Util::jump_to('index.php?modname=meta_certificate&op=assign&id_certificate=' . $id_certificate . '&res=ok'); } else { Util::jump_to('index.php?modname=meta_certificate&op=assign&id_certificate=' . $id_certificate . '&res=error_mod_assign'); } } elseif ($step == 2) { YuiLib::load(); Util::get_js(Get::rel_path('base') . '/lib/js_utils.js', true, true); $tb = new Table(0, $lang->def('_META_CERTIFICATE_NEW_ASSIGN_CAPTION'), $lang->def('_META_CERTIFICATE_NEW_ASSIGN_SUMMARY')); $tb->setLink('index.php?modname=meta_certificate&op=modassignment'); $out->add(getTitleArea($lang->def('_TITLE_META_CERTIFICATE_ASSIGN'), 'certificate') . '<div class="std_block">' . $form->openForm('new_assign_step_2', 'index.php?modname=meta_certificate&op=modassignment') . $form->getHidden('id_certificate', 'id_certificate', $id_certificate) . $form->getHidden('idmeta', 'idmeta', $id_meta) . $form->getHidden('step', 'step', 2) . $form->getHidden('reasign', 'reasign', 1)); $reasign = array(); if (!isset($_POST['reasign'])) { $query = "SELECT idUser, idCourse" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course" . " WHERE idMetaCertificate = '" . $id_meta . "'"; $result = sql_query($query); while (list($id_user, $id_course) = sql_fetch_row($result)) { $reasign[$id_user][$id_course] = 1; } } $form_name = 'new_assign_step_2'; $type_h = array('', ''); $cont_h = array($lang->def('_FULLNAME'), $lang->def('_USERNAME')); foreach ($_SESSION['meta_certificate']['course'] as $id_course) { $type_h[] = 'align_center'; $course_info = $course_man->getCourseInfo($id_course); $cont_h[] = $course_info['code'] . ' - ' . $course_info['name']; } $type_h[] = 'image'; $cont_h[] = $lang->def('_CHECKALL'); $type_h[] = 'image'; $cont_h[] = $lang->def('_UNCHECKALL'); $tb->setColsStyle($type_h); $tb->addHead($cont_h); reset($_SESSION['meta_certificate']['course']); $array_user =& $aclManager->getAllUsersFromIdst($_SESSION['meta_certificate']['users']); $array_user = array_unique($array_user); $query = "SELECT idst" . " FROM " . $GLOBALS['prefix_fw'] . "_user" . " WHERE idst IN (" . implode(',', $array_user) . ")" . " ORDER BY userid"; $result = sql_query($query); $array_user = array(); while (list($id_user) = sql_fetch_row($result)) { $array_user[] = $id_user; } foreach ($array_user as $id_user) { $cont = array(); $user_info = $acl_man->getUser($id_user, false); $cont[] = $user_info[ACL_INFO_LASTNAME] . ' ' . $user_info[ACL_INFO_FIRSTNAME]; $cont[] = $acl_man->relativeId($user_info[ACL_INFO_USERID]); foreach ($_SESSION['meta_certificate']['course'] as $id_course) { if (isset($_POST['_' . $id_user . '_' . $id_course . '_']) || isset($_POST['select_all']) || isset($reasign[$id_user][$id_course])) { $checked = true; } else { $checked = false; } $cont[] = $form->getCheckbox('', '_' . $id_user . '_' . $id_course . '_', '_' . $id_user . '_' . $id_course . '_', 1, $checked); } $cont[] = '<a href="javascript:;" onclick="checkall_fromback_meta(\'' . $form_name . '\', \'' . $id_user . '\', true); return false;">' . $lang->def('_CHECKALL') . '</a>'; $cont[] = '<a href="javascript:;" onclick="checkall_fromback_meta(\'' . $form_name . '\', \'' . $id_user . '\', false); return false;">' . $lang->def('_UNCHECKALL') . '</a>'; $tb->addBody($cont); } reset($_SESSION['meta_certificate']['course']); $cont = array(); $cont[] = ''; $cont[] = ''; foreach ($_SESSION['meta_certificate']['course'] as $id_course) { $cont[] = '<a href="javascript:;" onclick="checkall_meta(\'' . $form_name . '\', \'' . $id_course . '\', true); return false;">' . $lang->def('_CHECKALL') . '</a><br/>' . '<a href="javascript:;" onclick="checkall_meta(\'' . $form_name . '\', \'' . $id_course . '\', false); return false;">' . $lang->def('_UNCHECKALL') . '</a>'; } $cont[] = ''; $cont[] = ''; $tb->addBody($cont); $out->add($form->openElementSpace() . $tb->getTable() . $form->closeElementSpace() . $form->openButtonSpace() . $form->getButton('select_all', 'select_all', $lang->def('_SELECT_ALL')) . $form->getButton('insert', 'insert', $lang->def('_INSERT')) . $form->getButton('undo_assign', 'undo_assign', $lang->def('_UNDO')) . $form->closeButtonSpace() . $form->closeForm()); } elseif ($step == 1) { $sel->setLink('index.php?modname=meta_certificate&op=modassignment'); $out->add(getTitleArea($lang->def('_TITLE_META_CERTIFICATE_ASSIGN'), 'certificate') . '<div class="std_block">' . $form->openForm('new_assign_step_1', 'index.php?modname=meta_certificate&op=modassignment') . $form->getHidden('id_certificate', 'id_certificate', $id_certificate) . $form->getHidden('idmeta', 'idmeta', $id_meta) . $form->getHidden('step', 'step', 1) . $form->getHidden('course_reload', 'course_reload', 1)); if (!isset($_POST['course_reload'])) { $query = "SELECT DISTINCT idCourse" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course" . " WHERE idMetaCertificate = '" . $id_meta . "'"; $result = sql_query($query); $course_reset = array(); while (list($id_course) = sql_fetch_row($result)) { $course_reset[$id_course] = $id_course; } $sel->resetCourseSelection($course_reset); } $sel->loadSelector(); $out->add(Form::getHidden('update_tempdata', 'update_tempdata', 1) . Form::openButtonSpace() . Form::getBreakRow() . Form::getButton('ok_filter', 'import_filter', $lang->def('_NEXT')) . Form::getButton('undo_filter', 'undo_filter', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm() . '</div>'); } else { $user_select->show_orgchart_simple_selector = FALSE; $user_select->multi_choice = TRUE; $user_select->addFormInfo($form->getHidden('step', 'step', 0) . $form->getHidden('id_certificate', 'id_certificate', $id_certificate) . $form->getHidden('idmeta', 'idmeta', $id_meta) . $form->getHidden('user_reload', 'user_reload', 1)); $user_select->setPageTitle(getTitleArea($lang->def('_TITLE_META_CERTIFICATE_ASSIGN'), 'certificate') . '<div class="std_block">'); if (!isset($_POST['user_reload'])) { $query = "SELECT DISTINCT idUser" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course" . " WHERE idMetaCertificate = '" . $id_meta . "'"; $result = sql_query($query); $user_reset = array(); while (list($id_user) = sql_fetch_row($result)) { $user_reset[$id_user] = $id_user; } $user_select->resetSelection($user_reset); } $user_select->loadSelector('index.php?modname=meta_certificate&op=modassignment', false, $lang->def('_USER_FOR_META_CERTIFICATE_ASSIGN'), true); } }
function codeList() { require_once _base_ . '/lib/lib.form.php'; require_once _base_ . '/lib/lib.table.php'; $lang =& DoceboLanguage::createInstance('code'); $id_code_group = Get::req('id_code_group', DOTY_INT, '0'); $code_manager = new CodeManager(); $acl_man = Docebo::user()->getAclManager(); cout(getTitleArea(array('index.php?modname=code&op=list' => $lang->def('_CODE'), $lang->def('_CODE_LIST'))) . '<div class="std_block">'); if (isset($_POST['undo_filter'])) { unset($_POST['code_filter']); } cout('<div class="quick_search_form">' . Form::openForm('code_list_filter', 'index.php?modname=code&op=code_list&id_code_group=' . $id_code_group) . Form::getInputTextfield("search_t", "code_filter", "code_filter", isset($_POST['code_filter']) ? $_POST['code_filter'] : '', '', 255, '') . Form::getButton("filter", "filter", Lang::t('_SEARCH', 'standard'), "search_b") . Form::getButton("undo_filter", "undo_filter", Lang::t('_RESET', 'standard'), "reset_b") . Form::closeForm() . '</div>'); $result = Get::req('result', DOTY_STRING, ''); switch ($result) { case 'ok': UIFeedback::info($lang->def('_OPERATION_SUCCESSFUL')); break; case 'err': UIFeedback::error($lang->def('_OPERATION_FAILURE')); break; case 'err_dup': UIFeedback::error($lang->def('_DUPLICATED_CODE')); break; } $tot_code = $code_manager->getCodeNumber($id_code_group, isset($_POST['undo_filter']) ? $_POST['undo_filter'] : false); if ($tot_code) { $tb = new Table('20'); $tb->initNavBar('ini', 'link'); $tb->setLink('index.php?modname=code&op=code_list&id_code_group=' . $id_code_group); $ini = $tb->getSelectedElement(); $cont_h = array($lang->def('_CODE'), $lang->def('_USED'), $lang->def('_USERNAME'), $lang->def('_UNLIMITED_USE'), '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" />', '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" />'); $type_h = array('', 'image', '', 'image', 'image', 'image'); $tb->setColsStyle($type_h); $tb->addHead($cont_h); $array_code = $code_manager->getCodeList($id_code_group, $ini); foreach ($array_code as $code_info) { $cont = array(); $cont[] = $code_info['code']; if ($code_info['used']) { $cont[] = '<img src="' . getPathImage() . 'standard/status_active.png" alt="' . $lang->def('_USED') . '" />'; $user_info = $acl_man->getUser($code_info['id_user'], false); if ($user_info) { $cont[] = $acl_man->relativeId($user_info[ACL_INFO_USERID]); } else { $user_info = $acl_man->getTempUserInfo($code_info['id_user'], false); $cont[] = $acl_man->relativeId($user_info['userid']); } if ($code_info['unlimited_use'] == '1') { $cont[] = '<img src="' . getPathImage() . 'standard/status_active.png" alt="' . $lang->def('_UNLIMITED_USE') . '" />'; } else { $cont[] = '-'; } $cont[] = '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" />'; } else { $cont[] = '-'; $cont[] = $lang->def('_NONE'); if ($code_info['unlimited_use'] == '1') { $cont[] = '<img src="' . getPathImage() . 'standard/status_active.png" alt="' . $lang->def('_UNLIMITED_USE') . '" />'; } else { $cont[] = '-'; } $cont[] = '<a href="index.php?modname=code&op=mod_code&id_code_group=' . $id_code_group . '&code=' . $code_info['code'] . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" />'; } $cont[] = '<a href="index.php?modname=code&op=del_code&id_code_group=' . $id_code_group . '&code=' . $code_info['code'] . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" />'; $tb->addBody($cont); } $tb->addActionAdd('<a href="index.php?modname=code&op=add_code&id_code_group=' . $id_code_group . '">' . '<img src="' . getPathImage() . 'standard/add.png" alt="' . $lang->def('_ADD') . '" />' . $lang->def('_ADD') . '</a>'); $tb->addActionAdd('<a class="ico-wt-sprite subs_xls" title="' . Lang::t('_EXPORT_XLS', 'report') . '" ' . 'href="index.php?modname=code&op=export&id_code_group=' . $id_code_group . '&format=xls">' . '<span>' . Lang::t('_EXPORT_XLS', 'report') . '</span></a>'); $tb->addActionAdd('<a class="ico-wt-sprite subs_csv" title="' . Lang::t('_EXPORT_CSV', 'report') . '" ' . 'href="index.php?modname=code&op=export&id_code_group=' . $id_code_group . '&format=csv">' . '<span>' . Lang::t('_EXPORT_CSV', 'report') . '</span></a>'); cout($tb->getTable() . $tb->getNavBar($ini, $tot_code)); setupHrefDialogBox('a[href*=del_code]'); } else { cout($lang->def('_NO_CODE_FOUND') . '<br/>' . '<a href="index.php?modname=code&op=add_code&id_code_group=' . $id_code_group . '">' . '<img src="' . getPathImage() . 'standard/add.png" alt="' . $lang->def('_ADD') . '" />' . $lang->def('_ADD') . '</a>'); } cout('<br/><br/>' . getBackUi('index.php?modname=code&op=list', $lang->def('_BACK')) . '</div>'); }
function certificate() { checkPerm('view'); require_once _base_ . '/lib/lib.form.php'; require_once _base_ . '/lib/lib.table.php'; $mod_perm = checkPerm('mod', true); // create a language istance for module admin_certificate $lang =& DoceboLanguage::createInstance('certificate', 'lms'); $out =& $GLOBALS['page']; $out->setWorkingZone('content'); $tb = new Table(Get::sett('visuItem'), $lang->def('_CERTIFICATE_CAPTION'), $lang->def('_CERTIFICATE_SUMMARY')); $tb->initNavBar('ini', 'link'); $tb->setLink("index.php?modname=certificate&op=certificate"); $ini = $tb->getSelectedElement(); $form = new Form(); if (isset($_POST['filter_reset'])) { unset($_POST['filter_text']); } //search query of certificates $query_certificate = "\r\n\tSELECT id_certificate, code, name, description\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_certificate" . " WHERE meta = 0"; if (isset($_POST['filter_text'])) { $query_certificate .= " AND (name LIKE '%" . $_POST['filter_text'] . "%'" . " OR code LIKE '%" . $_POST['filter_text'] . "%')"; } $query_certificate .= " ORDER BY id_certificate\r\n\tLIMIT {$ini}," . Get::sett('visuItem'); $query_certificate_tot = "\r\n\tSELECT COUNT(*)\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_certificate"; $re_certificate = sql_query($query_certificate); list($tot_certificate) = sql_fetch_row(sql_query($query_certificate_tot)); $type_h = array('', '', ''); $cont_h = array($lang->def('_CODE'), $lang->def('_NAME'), $lang->def('_DESCRIPTION')); if ($mod_perm) { $cont_h[] = $lang->def('_TEMPLATE'); $type_h[] = 'image'; } $cont_h[] = Get::sprite('subs_view', Lang::t('_PREVIEW', 'certificate')); $type_h[] = 'image'; if ($mod_perm) { $cont_h[] = Get::sprite('subs_print', Lang::t('_CERTIFICATE_VIEW_CAPTION', 'certificate')); $type_h[] = 'image'; $cont_h[] = Get::sprite('subs_mod', Lang::t('_MOD', 'certificate')); $type_h[] = 'image'; $cont_h[] = Get::sprite('subs_del', Lang::t('_DEL', 'certificate')); $type_h[] = 'image'; } $tb->setColsStyle($type_h); $tb->addHead($cont_h); while (list($id_certificate, $code, $name, $descr) = sql_fetch_row($re_certificate)) { $title = strip_tags($name); $cont = array($code, $name, Util::cut($descr)); if ($mod_perm) { $cont[] = '<a href="index.php?modname=certificate&op=elemcertificate&id_certificate=' . $id_certificate . '" title="' . Lang::t('_TEMPLATE', 'certificate') . '">' . Lang::t('_TEMPLATE', 'certificate') . '</a>'; } $cont[] = Get::sprite_link('subs_view', 'index.php?modname=certificate&op=preview&id_certificate=' . $id_certificate, Lang::t('_PREVIEW', 'certificate')); if ($mod_perm) { $cont[] = Get::sprite_link('subs_print', 'index.php?modname=certificate&op=report_certificate&id_certificate=' . $id_certificate, Lang::t('_CERTIFICATE_VIEW_CAPTION', 'certificate')); $cont[] = Get::sprite_link('subs_mod', 'index.php?modname=certificate&op=modcertificate&id_certificate=' . $id_certificate, Lang::t('_MOD', 'certificate')); $cont[] = Get::sprite_link('subs_del', 'index.php?modname=certificate&op=delcertificate&id_certificate=' . $id_certificate, Lang::t('_DEL', 'certificate')); } $tb->addBody($cont); } require_once _base_ . '/lib/lib.dialog.php'; setupHrefDialogBox('a[href*=delcertificate]'); if ($mod_perm) { $tb->addActionAdd('<a class="ico-wt-sprite subs_add" href="index.php?modname=certificate&op=addcertificate" title="' . $lang->def('_ADD') . '">' . '<span>' . $lang->def('_ADD') . '</span></a>'); } $out->add(getTitleArea($lang->def('_TITLE_CERTIFICATE'), 'certificate') . '<div class="std_block">' . $form->openForm('certificate_filter', 'index.php?modname=certificate&op=certificate') . '<div class="quick_search_form"> <div> <div class="simple_search_box">' . Form::getInputTextfield("search_t", "filter_text", "filter_text", Get::req('filter_text', DOTY_MIXED, ''), '', 255, '') . Form::getButton("filter_set", "filter_set", Lang::t('_SEARCH', 'standard'), "search_b") . Form::getButton("filter_reset", "filter_reset", Lang::t('_RESET', 'standard'), "reset_b") . '</div> </div> </div>' . $form->closeForm()); if (isset($_GET['result'])) { switch ($_GET['result']) { case "ok": $out->add(getResultUi($lang->def('_OPERATION_SUCCESSFUL'))); break; case "err": $out->add(getErrorUi($lang->def('_OPERATION_FAILURE'))); break; case "err_del": $out->add(getErrorUi($lang->def('_OPERATION_FAILURE'))); break; } } $out->add($tb->getTable() . $tb->getNavBar($ini, $tot_certificate) . '</div>'); }
function forumsearchmessage() { checkPerm('view'); $search_arg = $_SESSION['forum']['search_arg']; require_once _base_ . '/lib/lib.table.php'; require_once _base_ . '/lib/lib.form.php'; $lang =& DoceboLanguage::createInstance('forum', 'lms'); $id_thread = importVar('idThread', true, 0); $ini_thread = importVar('ini_thread'); $sema_perm = checkPerm('sema', true); $moderate = checkPerm('moderate', true); $mod_perm = checkPerm('mod', true); $acl_man =& Docebo::user()->getAclManager(); $tb = new Table(Get::sett('visuItem'), $lang->def('_CAPTION_FORUM_MESSAGE'), $lang->def('_CAPTION_FORUM_MESSAGE')); $tb->initNavBar('ini', 'link'); $tb->setLink('index.php?modname=forum&op=searchmessage&idThread=' . $id_thread . '&ini_thread=' . $ini_thread); $ini = $tb->getSelectedElement(); $ini_page = $tb->getSelectedPage(); // Some info about forum and thread $thread_query = "\r\n\tSELECT idForum, title, num_post, locked, erased\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_forumthread\r\n\tWHERE idThread = '" . $id_thread . "'"; list($id_forum, $thread_title, $tot_message, $locked_t, $erased_t) = sql_fetch_row(sql_query($thread_query)); $forum_query = "\r\n\tSELECT title, locked\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_forum\r\n\tWHERE idForum = '" . $id_forum . "'"; list($forum_title, $locked_f) = sql_fetch_row(sql_query($forum_query)); ++$tot_message; //set as readed if needed if (isset($_SESSION['unreaded_forum'][$_SESSION['idCourse']][$id_forum][$id_thread])) { unset($_SESSION['unreaded_forum'][$_SESSION['idCourse']][$id_forum][$id_thread]); } if ($ini == 0 && !isset($_GET['result'])) { sql_query("\r\n\t\tUPDATE " . $GLOBALS['prefix_lms'] . "_forumthread\r\n\t\tSET num_view = num_view + 1\r\n\t\tWHERE idThread = '" . $id_thread . "'"); } $page_title = array('index.php?modname=forum&op=forum' => $lang->def('_FORUM'), 'index.php?modname=forum&op=search&ini=' . $ini_thread => $thread_title, $lang->def('_SEARCH_RESULT_FOR') . ' : ' . $search_arg); if ($erased_t && !$mod_perm && !$moderate) { $GLOBALS['page']->add(getTitleArea($page_title, 'forum') . '<div class="std_block">' . $lang->def('_CANNOTENTER') . '</div>', 'content'); return; } // Who have semantic evaluation $re_sema = sql_query("\r\n\tSELECT DISTINCT idmsg\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_forum_sema"); while (list($msg_sema) = sql_fetch_row($re_sema)) { $forum_sema[$msg_sema] = 1; } // Find post $messages = array(); $authors = array(); $authors_names = array(); $authors_info = array(); $re_message = sql_query("\r\n\tSELECT idMessage, posted, title, textof, attach, locked, author, modified_by, modified_by_on\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_forummessage\r\n\tWHERE idThread = '" . $id_thread . "'\r\n\tORDER BY posted\r\n\tLIMIT {$ini}, " . Get::sett('visuItem')); while ($record = mysql_fetch_assoc($re_message)) { $messages[$record['idMessage']] = $record; $authors[$record['author']] = $record['author']; if ($record['modified_by'] != 0) { $authors[$record['modified_by']] = $record['modified_by']; } } $authors_names =& $acl_man->getUsers($authors); $level_name = CourseLevel::getLevels(); // Retriving level and number of post of th authors $re_num_post = sql_query("\r\n\tSELECT u.idUser, u.level, COUNT(*)\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_forummessage AS m, " . $GLOBALS['prefix_lms'] . "_courseuser AS u\r\n\tWHERE u.idCourse = '" . (int) $_SESSION['idCourse'] . "' AND m.author = u.idUser AND m.author IN ( " . implode($authors, ',') . " )\r\n\tGROUP BY u.idUser, u.level"); while (list($id_u, $level_u, $num_post_a) = sql_fetch_row($re_num_post)) { $authors_info[$id_u] = array('num_post' => $num_post_a, 'level' => $level_name[$level_u]); } $type_h = array('forum_sender', 'forum_text'); $cont_h = array($lang->def('_AUTHOR'), $lang->def('_TEXTOF')); $tb->setColsStyle($type_h); $tb->addHead($cont_h); // Compose messagges display $path = $GLOBALS['where_files_relative'] . '/appCore/' . Get::sett('pathphoto'); while (list($id_message, $message_info) = each($messages)) { // sender info $m_author = $message_info['author']; if (isset($authors_names[$m_author]) && $authors_names[$m_author][ACL_INFO_AVATAR] != '') { $img_size = @getimagesize($path . $authors_names[$m_author][ACL_INFO_AVATAR]); } $sender = '<div class="forum_author">' . (isset($authors_names[$m_author]) ? $authors_names[$m_author][ACL_INFO_LASTNAME] . $authors_names[$m_author][ACL_INFO_FIRSTNAME] == '' ? $acl_man->relativeId($authors_names[$m_author][ACL_INFO_USERID]) : $authors_names[$m_author][ACL_INFO_LASTNAME] . ' ' . $authors_names[$m_author][ACL_INFO_FIRSTNAME] : $lang->def('_UNKNOWN_AUTHOR')) . '</div>' . '<div class="forum_level">' . $lang->def('_LEVEL') . ' : ' . $authors_info[$m_author]['level'] . '</div>' . (isset($authors_names[$m_author]) && $authors_names[$m_author][ACL_INFO_AVATAR] != '' ? '<img class="forum_avatar' . ($img_size[0] > 150 || $img_size[1] > 150 ? ' image_limit' : '') . '" src="' . $path . $authors_names[$m_author][ACL_INFO_AVATAR] . '" alt="' . $lang->def('_AVATAR') . '" />' : '') . '<div class="forum_numpost">' . $lang->def('_NUMPOST') . ' : ' . (isset($authors_info[$m_author]['num_post']) ? $authors_info[$m_author]['num_post'] : 0) . '</div>' . '<img src="' . getPathImage() . 'standard/identity.png" alt=">" /> ' . '<a href="index.php?modname=forum&op=viewprofile&idMessage=' . $id_message . '&ini=' . $ini_page . '&idThread=' . $id_thread . '">' . $lang->def('_VIEW_PROFILE') . '</a>'; // msg info $msgtext = ''; $msgtext .= '<div class="forum_post_posted">' . $lang->def('_DATE') . ' : ' . Format::date($message_info['posted']) . ' ( ' . loadDistance($message_info['posted']) . ' )' . '</div>'; if ($message_info['locked']) { $msgtext .= '<div class="forum_post_locked">' . $lang->def('_LOCKEDMESS') . '</div>'; } else { if ($message_info['attach'] != '') { $msgtext .= '<div class="forum_post_attach">' . '<a href="index.php?modname=forum&op=download&id=' . $id_message . '">' . $lang->def('_ATTACHMENT') . ' : ' . '<img src="' . getPathImage() . mimeDetect($message_info['attach']) . '" alt="' . $lang->def('_ATTACHMENT') . '" /></a>' . '</div>'; } $textof = str_replace('[quote]', '<blockquote class="forum_quote">', str_replace('[/quote]', '</blockquote>', $message_info['textof'])); $msgtext .= '<div class="forum_post_title">' . $lang->def('_SUBJECT') . ' : ' . ($search_arg !== '' ? eregi_replace($search_arg, '<span class="filter_evidence">' . $search_arg . '</span>', $message_info['title']) : $message_info['title']) . '</div>'; $msgtext .= '<div class="forum_post_text">' . ($search_arg !== '' ? eregi_replace($search_arg, '<span class="filter_evidence">' . $search_arg . '</span>', $textof) : $textof) . '</div>'; if ($message_info['modified_by'] != 0) { $modify_by = $message_info['modified_by']; $msgtext .= '<div class="forum_post_modified_by">' . $lang->def('_MODIFY_BY') . ' : ' . (isset($authors_names[$modify_by]) ? $authors_names[$modify_by][ACL_INFO_LASTNAME] . $authors_names[$modify_by][ACL_INFO_FIRSTNAME] == '' ? $acl_man->relativeId($authors_names[$modify_by][ACL_INFO_USERID]) : $authors_names[$modify_by][ACL_INFO_LASTNAME] . ' ' . $authors_names[$modify_by][ACL_INFO_FIRSTNAME] : $lang->def('_UNKNOWN_AUTHOR')) . ' ' . $lang->def('_ON') . ' : ' . Format::date($message_info['modified_by_on']) . '</div>'; } if (isset($authors_names[$m_author]) && $authors_names[$m_author][ACL_INFO_SIGNATURE] != '') { $msgtext .= '<div class="forum_post_sign_separator"></div>' . '<div class="forum_post_sign">' . $authors_names[$m_author][ACL_INFO_SIGNATURE] . '</div>'; } } $content = array($sender, $msgtext); $tb->addBody($content); // some action that you can do with this message $action = ''; if ($moderate || $mod_perm) { if ($message_info['locked']) { $action .= '<a href="index.php?modname=forum&op=moderatemessage&idMessage=' . $id_message . '&ini=' . $ini_page . '" ' . 'title="' . $lang->def('_DEMODERATE') . ' : ' . strip_tags($message_info['title']) . '">' . '<img src="' . getPathImage() . 'standard/demoderate.png" alt="' . $lang->def('_DEMODERATE') . ' : ' . strip_tags($message_info['title']) . '" /> ' . $lang->def('_DEMODERATE') . '</a> '; } else { $action .= '<a href="index.php?modname=forum&op=moderatemessage&idMessage=' . $id_message . '&ini=' . $ini_page . '" ' . 'title="' . $lang->def('_MODERATE') . ' : ' . strip_tags($message_info['title']) . '">' . '<img src="' . getPathImage() . 'standard/moderate.png" alt="' . $lang->def('_MODERATE') . ' : ' . strip_tags($message_info['title']) . '" /> ' . $lang->def('_MODERATE') . '</a> '; } } if (!$locked_t && !$locked_f || $mod_perm || $moderate) { $action .= '<a href="index.php?modname=forum&op=addmessage&idThread=' . $id_thread . '&idMessage=' . $id_message . '&ini=' . $ini_page . '" ' . 'title="' . $lang->def('_REPLY') . ' : ' . strip_tags($message_info['title']) . '">' . '<img src="' . getPathImage() . 'standard/reply.png" alt="' . $lang->def('_REPLY') . ' : ' . strip_tags($message_info['title']) . '" /> ' . $lang->def('_QUOTE') . '</a>'; } if ($moderate || $mod_perm || $m_author == getLogUserId()) { $action .= '<a href="index.php?modname=forum&op=modmessage&idMessage=' . $id_message . '&ini=' . $ini_page . '" ' . 'title="' . $lang->def('_MOD_MESSAGE') . ' : ' . strip_tags($message_info['title']) . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . ' : ' . strip_tags($message_info['title']) . '" /> ' . $lang->def('_MOD') . '</a>' . '<a href="index.php?modname=forum&op=delmessage&idMessage=' . $id_message . '&ini=' . $ini_page . '" ' . 'title="' . $lang->def('_DEL') . ' : ' . strip_tags($message_info['title']) . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . ' : ' . strip_tags($message_info['title']) . '" /> ' . $lang->def('_DEL') . '</a> '; } $tb->addBodyExpanded($action, 'forum_action'); } if (!$locked_t && !$locked_f || $mod_perm || $moderate) { $tb->addActionAdd('<a href="index.php?modname=forum&op=addmessage&idThread=' . $id_thread . '&ini=' . $ini_page . '" title="' . $lang->def('_REPLY') . '">' . '<img src="' . getPathImage() . 'standard/add.png" alt="' . $lang->def('_ADD') . '" /> ' . $lang->def('_REPLY') . '</a>'); } $GLOBALS['page']->add(getTitleArea($page_title, 'forum') . '<div class="std_block">' . Form::openForm('search_forum', 'index.php?modname=forum&op=search&idThread=' . $id_thread) . '<div class="quick_search_form">' . '<label for="search_arg">' . $lang->def('_SEARCH_LABEL') . '</label> ' . Form::getInputTextfield('search_t', 'search_arg', 'search_arg', $search_arg, $lang->def('_SEARCH'), 255, '') . '<input class="search_b" type="submit" id="search_button" name="search_button" value="' . $lang->def('_SEARCH') . '" />' . '</div>' . Form::closeForm(), 'content'); if ($moderate || $mod_perm) { $GLOBALS['page']->add('<div class="forum_action_top">' . '<a href="index.php?modname=forum&op=modstatusthread&idThread=' . $id_thread . '&ini=' . $ini_page . '">' . ($locked_t ? '<img src="' . getPathImage() . 'standard/msg_read.png" alt="' . $lang->def('_FREE') . '" /> ' . $lang->def('_FREETHREAD') : '<img src="' . getPathImage() . 'standard/locked.png" alt="' . $lang->def('_LOCKTHREAD') . '" /> ' . $lang->def('_LOCKTHREAD')) . '</a> ' . '<a href="index.php?modname=forum&op=changeerased&idThread=' . $id_thread . '&ini=' . $ini_page . '">' . ($erased_t ? '<img src="' . getPathImage() . 'standard/msg_read.png" alt="' . $lang->def('_UNERASE') . '" /> ' . $lang->def('_UNERASE') : '<img src="' . getPathImage() . 'standard/moderate.png" alt="' . $lang->def('_MODERATE') . '" /> ' . $lang->def('_MODERATE')) . '</a>' . '</div>', 'content'); } $GLOBALS['page']->add($tb->getTable(), 'content'); if ($moderate || $mod_perm) { $GLOBALS['page']->add('<div class="forum_action_bottom">' . '<a href="index.php?modname=forum&op=modstatusthread&idThread=' . $id_thread . '&ini=' . $ini_page . '">' . ($locked_t ? '<img src="' . getPathImage() . 'standard/msg_read.png" alt="' . $lang->def('_FREE') . '" /> ' . $lang->def('_FREETHREAD') : '<img src="' . getPathImage() . 'standard/locked.png" alt="' . $lang->def('_LOCKTHREAD') . '" /> ' . $lang->def('_LOCKTHREAD')) . '</a> ' . '<a href="index.php?modname=forum&op=changeerased&idThread=' . $id_thread . '&ini=' . $ini_page . '">' . ($erased_t ? '<img src="' . getPathImage() . 'standard/msg_read.png" alt="' . $lang->def('_UNERASE') . '" /> ' . $lang->def('_UNERASE') : '<img src="' . getPathImage() . 'standard/moderate.png" alt="' . $lang->def('_MODERATE') . '" /> ' . $lang->def('_MODERATE')) . '</a>' . '</div>', 'content'); } $GLOBALS['page']->add($tb->getNavBar($ini, $tot_message) . '</div>', 'content'); }
function wikiPageHistory($vis_item = FALSE) { require_once _base_ . '/lib/lib.table.php'; require_once $GLOBALS["where_framework"] . "/lib/lib.wiki_revision.php"; require_once _base_ . "/lib/lib.form.php"; $res = ""; $wiki_id = $this->getWikiId(); $page_code = $this->getPageCode(); $wiki_lang = $this->getWikiLanguage(); $page_info = $this->wikiManager->getPageInfo($wiki_id, $wiki_lang, $page_code); $wiki_lang = $this->getWikiLanguage(); $form = new Form(); $rev = new WikiRevisionManager(array($wiki_id, $page_info["page_id"], $wiki_lang)); if ($vis_item === FALSE) { $vis_item = Get::sett('visuItem'); } $table_caption = $this->lang->def("_HISTORY"); $table_summary = $this->lang->def("_HISTORY"); $um =& UrlManager::getInstance(); $tab = new Table($vis_item, $table_caption, $table_summary); $head = array($this->lang->def("_VERSION")); $head[] = $this->lang->def("_AUTHOR"); $head[] = $this->lang->def("_DATE"); $img = "<img src=\"" . getPathImage('fw') . "wiki/show.png\" alt=\"" . $this->lang->def("_ALT_VIEW_REVISION") . "\" "; $img .= "title=\"" . $this->lang->def("_ALT_VIEW_REVISION") . "\" />"; $head[] = " "; //$img; $img = "<img src=\"" . getPathImage('fw') . "standard/edit.png\" alt=\"" . $this->lang->def("_MOD") . "\" "; $img .= "title=\"" . $this->lang->def("_MOD") . "\" />"; $head[] = " "; //$img; $head_type = array("", "", "", "image", "image"); $tab->setColsStyle($head_type); $tab->addHead($head); $tab->initNavBar('ini', 'link'); $tab->setLink($um->getUrl()); $ini = $tab->getSelectedElement(); $data_info = $rev->getRevisionList($ini, $vis_item); $data_arr = $data_info["data_arr"]; $tot = count($data_arr); if ($tot != 0) { $user_arr = $data_info["user"]; } $db_tot = $data_info["data_tot"]; for ($i = 0; $i < $tot; $i++) { $rowcnt = array(); $version = $data_arr[$i]["version"]; //rc// $rowcnt[]=$form->getRadio("", "previous_ver_".$version, "previous_ver", $version); //rc// $rowcnt[]=$form->getRadio("", "current_ver_".$version, "current_ver", $version);; $rowcnt[] = $version; $user_idst = $data_arr[$i]["author"]; $rowcnt[] = $user_arr[$user_idst]; $rowcnt[] = Format::date($data_arr[$i]["rev_date"]); $img = "<img src=\"" . getPathImage('fw') . "wiki/show.png\" alt=\"" . $this->lang->def("_ALT_VIEW_REVISION") . "\" "; $img .= "title=\"" . $this->lang->def("_ALT_VIEW_REVISION") . "\" />"; $url = $um->getUrl("page=" . $page_code . "&version=" . $version); $rowcnt[] = "<a href=\"" . $url . "\">" . $img . "</a>\n"; $img = "<img src=\"" . getPathImage('fw') . "standard/edit.png\" alt=\"" . $this->lang->def("_MOD") . "\" "; $img .= "title=\"" . $this->lang->def("_MOD") . "\" />"; $url = $um->getUrl("op=edit&page=" . $page_code . "&version=" . $version); $rowcnt[] = "<a href=\"" . $url . "\">" . $img . "</a>\n"; $tab->addBody($rowcnt); } $url = $um->getUrl("op=history&page=" . $page_code); //rc// $res.=$form->openForm("main_form", $url); $tab->setLink($url); $res .= $tab->getTable() . $tab->getNavBar($ini, $db_tot); //rc// $res.=$form->openButtonSpace(); //rc// $res.=$form->getButton("compare", "compare", $this->lang->def("_COMPARE_SEL_VER")); //rc// $res.=$form->closeButtonSpace(); //rc// $res.=$form->closeForm(); return $res; }