function getBoxContent() { $html = array(); if (!checkPerm('view_org_chart', true, 'directory', 'framework')) { return $html; } require_once _base_ . '/lib/lib.userselector.php'; $user_dir = new UserSelector(); $user_stats = $user_dir->getUsersStats(); $lang =& DoceboLanguage::createInstance('dashboard', 'framework'); if (Get::sett('welcome_use_feed') == 'on') { require_once _base_ . '/lib/lib.fsock_wrapper.php'; $fp = new Fsock(); $released_version = $fp->send_request('http://www.formalms.org/versions/release.txt'); if (!$fp) { $released_version = '<strong class="old_release">' . $lang->def('_UNKNOWN_RELEASE') . '</strong>'; } else { if ($released_version == false) { $released_version = '<strong class="ok_release">' . $lang->def('_UNKNOWN_RELEASE') . '</strong>'; } if ($released_version == Get::sett('core_version')) { $released_version = '<strong class="ok_release">' . $released_version . '</strong>'; } else { $released_version = '<strong class="old_release">' . $released_version . ' (' . $lang->def('_NEW_RELEASE_AVAILABLE') . ')</strong>'; } } } $html[] = '<h2 class="inline">' . $lang->def('_USERS_PANEL') . '</h2>' . '<p>' . $lang->def('_TOTAL_USER') . ': <b>' . ($user_stats['all'] - 1) . '</b>;<br />' . $lang->def('_SUSPENDED') . ': <b>' . $user_stats['suspended'] . '</b>;<br />' . (checkPerm('approve_waiting_user', true, 'directory', 'framework') ? $lang->def('_WAITING_USERS') . ': <b>' . $user_stats['waiting'] . '</b>;' : '') . '</p><p>' . $lang->def('_SUPERADMIN_USER') . ': <b>' . $user_stats['superadmin'] . '</b>;<br />' . $lang->def('_ADMIN_USER') . ': <b>' . $user_stats['admin'] . '</b>;<br />' . $lang->def('_PUBLIC_ADMIN_USER') . ': <b>' . $user_stats['public_admin'] . '</b>;' . '</p><p>' . $lang->def('_REG_TODAY') . ': <b>' . $user_stats['register_today'] . '</b>;<br />' . $lang->def('_REG_YESTERDAY') . ': <b>' . $user_stats['register_yesterday'] . '</b>;<br />' . $lang->def('_REG_LASTSEVENDAYS') . ': <b>' . $user_stats['register_7d'] . '</b>;' . '</p><p>' . $lang->def('_INACTIVE_USER') . ': <b>' . $user_stats['inactive_30d'] . '</b>;<br />' . $lang->def('_ONLINE_USER') . ': <b>' . $user_stats['now_online'] . '</b>;' . '</p><p>' . $lang->def('_CORE_VERSION') . ': <b>' . Get::sett('core_version') . '</b>;<br />' . (Get::sett('welcome_use_feed') == 'on' ? $lang->def('_LAST_RELEASED') . ': ' . $released_version . ';' : '') . '</p>'; return $html; }
/** * Main UI of iotask module. Connectors, Connections and Tasks * in one tabbed window * @param Module $module a reference to the iotask module * @param string $op the op code **/ function ioTask_UITab(&$module, $op) { checkPerm('view'); require_once _base_ . '/lib/lib.tab.php'; $tv = new TabView('iotask_ui', '#'); $lang =& DoceboLanguage::createInstance('iotask', 'framework'); $tv->addTab(new TabElemDefault('connectors', $lang->def('_CONNECTORS'), getPathImage() . 'iotask/connector.gif')); $tv->addTab(new TabElemDefault('connections', $lang->def('_CONNECTIONS'), getPathImage() . 'iotask/connection.gif')); $tv->addTab(new TabElemDefault('tasks', $lang->def('_TASKS'), getPathImage() . 'iotask/task.gif')); $tv->parseInput($_POST, $_POST); if (isset($_GET['gotab'])) { $tv->setActiveTab($_GET['gotab']); } elseif ($tv->getActiveTab() == '') { $tv->setActiveTab('connections'); } require_once _base_ . '/lib/lib.form.php'; $form = new Form(); $GLOBALS['page']->add($form->openForm('iotask_ui', 'index.php?modname=iotask&op=display')); $GLOBALS['page']->add($form->getHidden($tv->_getStateId(), $tv->_getStateId(), $tv->getActiveTab())); $GLOBALS['page']->add($tv->printTabView_Begin("", FALSE)); switch ($tv->getActiveTab()) { case 'connectors': ioTask_UIConnectorsList($module); break; case 'connections': ioTask_UIConnectionsList($module); break; case 'tasks': ioTask_UITaskList($module); break; } $GLOBALS['page']->add($tv->printTabView_End()); $GLOBALS['page']->add($form->closeForm()); }
function server_info() { $lang =& DoceboLanguage::createInstance('configuration', 'framework'); $php_conf = ini_get_all(); $intest = '<div>' . '<div class="label_effect">'; $html = '<div class="conf_line_title">' . $lang->def('_SERVERINFO') . '</div>' . config_line($lang->def('_SERVER_ADDR'), $_SERVER['SERVER_ADDR']) . config_line($lang->def('_SERVER_PORT'), $_SERVER['SERVER_PORT']) . config_line($lang->def('_SERVER_NAME'), $_SERVER['SERVER_NAME']) . config_line($lang->def('_SERVER_ADMIN'), $_SERVER['SERVER_ADMIN']) . config_line($lang->def('_SERVER_SOFTWARE'), $_SERVER['SERVER_SOFTWARE']) . '<br />' . '<div class="conf_line_title">' . $lang->def('_SERVER_MYSQL') . '</div>' . config_line($lang->def('_MYSQL_VERS'), mysql_get_server_info()) . '<br />' . '<div class="conf_line_title">' . $lang->def('_PHPINFO') . '</div>' . config_line($lang->def('_PHPVERSION'), phpversion()) . config_line($lang->def('_SAFEMODE'), $php_conf['safe_mode']['local_value'] ? $lang->def('_ON') : $lang->def('_OFF')) . config_line($lang->def('_REGISTER_GLOBAL'), $php_conf['register_globals']['local_value'] ? $lang->def('_ON') : $lang->def('_OFF')) . config_line($lang->def('_MAGIC_QUOTES_GPC'), $php_conf['magic_quotes_gpc']['local_value'] ? $lang->def('_ON') : $lang->def('_OFF')) . config_line($lang->def('_UPLOAD_MAX_FILESIZE'), $php_conf['upload_max_filesize']['local_value']) . config_line($lang->def('_POST_MAX_SIZE'), $php_conf['post_max_size']['local_value']) . config_line($lang->def('_MAX_EXECUTION_TIME'), $php_conf['max_execution_time']['local_value'] . 's') . config_line($lang->def('_LDAP'), extension_loaded('ldap') ? $lang->def('_ON') : '<span class="font_red">' . $lang->def('_OFF') . ' ' . $lang->def('_USEFULL_ONLY_IF') . '</span>') . config_line($lang->def('_PHP_TIMEZONE'), @date_default_timezone_get()); if (version_compare(phpversion(), "5.0.0") == -1) { $html .= config_line($lang->def('_DOMXML'), extension_loaded('domxml') ? $lang->def('_ON') : '<span class="font_red">' . $lang->def('_OFF') . ' (' . $lang->def('_NOTSCORM') . ')</span>'); } if (version_compare(phpversion(), "5.2.0", ">")) { $html .= config_line($lang->def('_ALLOW_URL_INCLUDE'), $php_conf['allow_url_include']['local_value'] ? '<span class="font_red">' . $lang->def('_ON') . '</span>' : $lang->def('_OFF')); } if (Get::cfg('uploadType') == 'ftp') { if (function_exists("ftp_connect")) { require_once _base_ . '/lib/lib.upload.php'; $re_con = sl_open_fileoperations(); $html .= config_line($lang->def('_UPLOADFTP'), $re_con ? $lang->def('_FTPOK') : '<span class="font_red">' . $lang->def('_FTPERR') . '</span>'); if ($re_con) { sl_close_fileoperations(); } } else { $html .= config_line($lang->def('_UPLOADFTP'), '<span class="font_red">' . $lang->def('_FTPERR') . '</span>'); } } $html .= '<div class="nofloat"></div><br />'; return $html; }
function edithtml() { checkPerm('mod'); require_once _base_ . '/lib/lib.form.php'; $query = "\r\n\tSELECT textof\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_htmlfront \r\n\tWHERE id_course = '" . $_SESSION['idCourse'] . "'"; $re_htmlfront = sql_query($query); $error = false; if (isset($_POST['save'])) { if (mysql_num_rows($re_htmlfront) > 0) { $upd_query = "\r\n\t\t\tUPDATE " . $GLOBALS['prefix_lms'] . "_htmlfront \r\n\t\t\tSET textof = '" . $_POST['description'] . "'\r\n\t\t\tWHERE id_course = '" . $_SESSION['idCourse'] . "'"; $re = sql_query($upd_query); } else { $ins_query = "\r\n\t\t\tINSERT INTO " . $GLOBALS['prefix_lms'] . "_htmlfront \r\n\t\t\t( id_course, textof) VALUES \r\n\t\t\t( \t'" . $_SESSION['idCourse'] . "',\r\n\t\t\t\t'" . $_POST['description'] . "' )"; $re = sql_query($ins_query); } if ($re) { Util::jump_to('index.php?modname=htmlfront&op=showhtml&saveok=1'); } else { $error = true; } } $lang =& DoceboLanguage::createInstance('htmlfront', 'lms'); list($textof) = sql_fetch_row($re_htmlfront); $title_page = array('index.php?modname=htmlfront&op=showhtml' => $lang->def('_HTMLFRONT'), $lang->def('_MOD')); $GLOBALS['page']->add(getTitleArea($title_page, 'htmlfront') . '<div class="std_block">' . getBackUi('index.php?modname=htmlfront&op=showhtml', $lang->def('_BACK')) . ($error ? getErrorUi($lang->def('_ERROR_IN_SAVE')) : '') . Form::openForm('formnotes', 'index.php?modname=htmlfront&op=edithtml') . Form::openElementSpace() . Form::getTextarea($lang->def('_TEXTOF'), 'description', 'description', importVar('description', false, $textof)) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('save', 'save', $lang->def('_SAVE')) . Form::getButton('undo', 'undo', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content'); }
function setupJs($tags_id, $private_tags = '') { if (!$this->_use_tag) { return ''; } $lang =& DoceboLanguage::createInstance('tags', 'framework'); $this->tags_id = $tags_id; YuiLib::load(array('autocomplete' => 'autocomplete-min.js', 'selector' => 'selector-beta-min.js'), array('assets/skins/sam' => 'autocomplete.css')); Util::get_js(Get::rel_path('adm') . '/lib/lib.tags.js', true, true); // setup some thing that we need in the tag editor $GLOBALS['page']->add('<script type="text/javascript">' . "\n" . 'var tag_params ={ resource_type: "' . $this->resource_type . '", addr: "' . $GLOBALS['where_framework_relative'] . '/ajax.adm_server.php", query_append: "file=tags", query:"' . $tags_id . '", private_query:"' . $private_tags . '", popular_tags: "' . addslashes(implode(', ', $this->getPopularTag())) . '", user_tags: "' . addslashes(implode(', ', $this->getUserPopularTag(getLogUserId()))) . '", lang: { tags: "' . addslashes($lang->def("_TAGS")) . '", tips: "' . addslashes($lang->def("_TAGS_TIPS")) . '", popular_tags: "' . addslashes($lang->def("_POPULAR")) . '", user_tags: "' . addslashes($lang->def("_YOURS")) . '", save: "' . addslashes($lang->def("_SAVE")) . '", undo: "' . addslashes($lang->def("_UNDO")) . '", add_tags: "' . addslashes($lang->def("_ADD_TAGS")) . '", update_tags: "' . addslashes($lang->def("_MOD")) . '" } };' . "\n" . '</script>', 'scripts'); }
function Test_Charts($idTest, $idUser) { //check ids if ((int) $idTest <= 0 || (int) $idUser <= 0) { return false; } $this->idTest = (int) $idTest; $this->idUser = (int) $idUser; //set params $this->fontPath = $GLOBALS['where_framework_relative'] . '/addons/pchart/Fonts/'; $this->imagePath = $GLOBALS['where_files_relative'] . '/tmp/'; $this->valid = true; $this->lang =& DoceboLanguage::createInstance('test', 'lms'); $this->_setTestInfo(); $this->table = new TypeOne(); //set rendering properties $this->settings = new stdClass(); $this->settings->width = 800; $this->settings->height = 400; $this->settings->roundThreshold = 2; $this->settings->roundRadius = 10; $this->settings->horizontalDistance = 50; $this->settings->verticalDistance = 30; $this->settings->lineWidth = 4; $this->settings->legendWidth = 200; $this->settings->bgColor = array(230, 230, 230); //R, G, B $this->settings->graphColor = array(255, 255, 255); $this->settings->scaleColor = array(150, 150, 150); $this->settings->lineColor = array(230, 230, 230); $this->settings->tresholdColor = array(143, 55, 72); $this->settings->legendColor = array(255, 255, 255); $this->settings->titleColor = array(50, 50, 50); return true; }
function adminConf() { require_once _base_ . '/lib/lib.form.php'; $lang =& DoceboLanguage::createInstance('admin_config', 'scs'); $out =& $GLOBALS['page']; $out->setWorkingZone('content'); $out->add(getTitleArea($lang->def('_ADMIN_CONF'), 'admin_conf') . '<div class="std_block">'); if (isset($_POST['save'])) { $query_update = "UPDATE " . $GLOBALS['prefix_scs'] . "_rules_admin SET "; if (isset($_POST['rules'])) { while (list($var_name, $new_value) = each($_POST['rules'])) { $query_update .= " {$var_name} = '" . $new_value . "',"; } $re = sql_query(substr($query_update, 0, -1)); } if ($re) { $out->add(getResultUi($lang->def('_MOD_OK'))); } else { $out->add(getErrorUi($lang->def('_MOD_ERR'))); } } $query_rules_admin = "\r\n\tSELECT server_status, \r\n\t\tenable_recording_function, enable_advice_insert, enable_write, enable_chat_recording, \r\n\t\tenable_private_subroom, enable_public_subroom, \r\n\t\tenable_drawboard_watch, enable_drawboard_write, \r\n\t\tenable_audio, enable_webcam, enable_stream_watch, enable_strem_write, enable_remote_desktop \r\n\tFROM " . $GLOBALS['prefix_scs'] . "_rules_admin"; $re_rules_admin = sql_query($query_rules_admin); $rules = mysql_fetch_array($re_rules_admin); $out->add(Form::openForm('rules_admin', 'index.php?modname=admin_configuration&op=conf') . Form::openElementSpace() . Form::getOpenCombo($lang->def('_SERVER_STATUS')) . Form::getInputRadio('rules_server_status_yes', 'rules[server_status]', 'yes', $rules['server_status'] == 'yes', '') . ' ' . Form::getLabel('', $lang->def('_YES'), 'label_padded') . ' ' . Form::getInputRadio('rules_server_status_no', 'rules[server_status]', 'no', $rules['server_status'] == 'no', '') . ' ' . Form::getLabel('', $lang->def('_NO'), 'label_padded') . ' ' . Form::getCloseCombo() . maskMultiple('enable_recording_function', $rules['enable_recording_function']) . maskMultiple('enable_advice_insert', $rules['enable_advice_insert']) . maskMultiple('enable_write', $rules['enable_write']) . maskMultiple('enable_chat_recording', $rules['enable_chat_recording']) . maskMultiple('enable_private_subroom', $rules['enable_private_subroom']) . maskMultiple('enable_public_subroom', $rules['enable_public_subroom']) . maskMultiple('enable_drawboard_watch', $rules['enable_drawboard_watch']) . maskMultiple('enable_drawboard_write', $rules['enable_drawboard_write']) . maskMultiple('enable_audio', $rules['enable_audio']) . maskMultiple('enable_webcam', $rules['enable_webcam']) . maskMultiple('enable_stream_watch', $rules['enable_stream_watch']) . maskMultiple('enable_strem_write', $rules['enable_strem_write']) . maskMultiple('enable_remote_desktop', $rules['enable_remote_desktop']) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('save', 'save', $lang->def('_SAVE')) . Form::getButton('undo', 'undo', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm()); $out->add('</div>'); }
function tagslist() { require_once _base_ . '/lib/lib.table.php'; require_once $GLOBALS['where_framework'] . '/lib/lib.tags.php'; $lang =& DoceboLanguage::createInstance('tags', 'framework'); $id_tag = Get::req('id_tag', DOTY_INT, 0); $tag_name = Get::req('tag', DOTY_STRING, ''); $filter = Get::req('filter', DOTY_STRING, ''); $nav_bar = new NavBar('ini', Get::sett('visuItem'), 0); $nav_bar->setLink('index.php?modname=tags&op=tags&id_tag=' . $id_tag); $ini = $nav_bar->getSelectedElement(); $tags = new Tags('*'); $resources = $tags->getResourceByTags($id_tag, false, false, $ini, Get::sett('visuItem')); $GLOBALS['page']->add(getTitleArea(array($lang->def('_TAGS')), 'tags') . '<div class="std_block">' . '<div class="tag_list">', 'content'); while (list(, $res) = each($resources['list'])) { $link = $res['permalink']; $delim = strpos($link, '?') === false ? '?' : '&'; if (strpos($link, '#') === false) { $link = $link . $delim . 'sop=setcourse&sop_idc=' . $res['id_course']; } else { $link = str_replace('#', $delim . 'sop=setcourse&sop_idc=' . $res['id_course'] . '#', $link); } $GLOBALS['page']->add('' . '<h2>' . '<a href="' . $link . '">' . $res['title'] . '</a>' . '</h2>' . '<p>' . $res['sample_text'] . '</p>' . '<div class="tag_cloud">' . '<span>' . $lang->def('_TAGS') . ' : </span>' . '<ul><li>' . implode('</li><li>', $res['related_tags']) . '</li></ul>' . '</div>' . '<br />', 'content'); } $GLOBALS['page']->add('</div>' . $nav_bar->getNavBar($ini, $resources['count']) . '</div>', 'content'); }
function select_permission() { checkPerm('view'); require_once $GLOBALS['where_lms'] . '/lib/lib.middlearea.php'; require_once _base_ . '/lib/lib.userselector.php'; require_once _base_ . '/lib/lib.form.php'; $lang =& DoceboLanguage::createInstance('middlearea', 'lms'); $obj_index = importVar('obj_index', false, ''); // first step load selector $man_ma = new Man_MiddleArea(); $acl_manager = new DoceboACLManager(); $user_select = new UserSelector(); $user_select->show_user_selector = TRUE; $user_select->show_group_selector = TRUE; $user_select->show_orgchart_selector = TRUE; $user_select->show_orgchart_simple_selector = false; //$user_select->multi_choice = TRUE; // try to load previous saved if (isset($_GET['load'])) { $selected = $man_ma->getObjIdstList($obj_index); if (is_array($selected)) { $user_select->resetSelection($selected); } } if (isset($_POST['okselector'])) { $selected = $user_select->getSelection($_POST); $re = $man_ma->setObjIdstList($obj_index, $selected); Util::jump_to('index.php?modname=middlearea&op=view_area&result=' . ($re ? 'ok' : 'err')); } cout(getTitleArea(array('index.php?modname=middlearea&op=view_area' => $lang->def('_MIDDLE_AREA'), Lang::t('_VIEW_PERMISSION', 'standard')), 'middlearea') . '<div class="std_block">'); $user_select->addFormInfo(Form::getHidden('obj_index', 'obj_index', $obj_index)); $user_select->loadSelector('index.php?modname=middlearea&op=select_permission', false, false, true); cout('</div>'); }
function loadFormAction(&$tree, $op) { require_once _base_ . '/lib/lib.form.php'; require_once dirname(__FILE__) . '/tree.org_chart.php'; $lang =& DoceboLanguage::createInstance('organization_chart', 'framework'); $out =& $GLOBALS['page']; $out->add('<link href="templates/standard/style/base-old-treeview.css" rel="stylesheet" type="text/css">', 'page_head'); $out->setWorkingZone('content'); $out->add(getTitleArea($lang->def('_ORG_CHART'), 'org_chart') . '<div class="std_block">' . Form::openForm('org_chart', 'index.php?modname=org_chart&op=org_chart')); switch ($op) { case 'newfolder': $out->add($tree->loadNewFolder()); break; case 'deletefolder': $out->add($tree->loadDeleteFolder()); break; case 'renamefolder': $out->add($tree->loadRenameFolder()); break; case 'movefolder': $out->add($tree->loadMoveFolder()); break; case 'assign_field': $out->add($tree->loadAssignField()); break; } $out->add(Form::closeForm() . '</div>'); }
function &get_lang() { if ($this->lang === NULL) { //require_once(_i18n_.'/lib.lang.php'); $this->lang =& DoceboLanguage::createInstance('iotask', 'framework'); } return $this->lang; }
function getSubstitutionTags() { $lang =& DoceboLanguage::createInstance('certificate', 'lms'); $subs = array(); $subs['[today]'] = $lang->def('_COURSE_TODAY'); $subs['[year]'] = $lang->def('_COURSE_YEAR'); return $subs; }
function getFbRegisterBox() { $res = ''; $lang =& DoceboLanguage::createInstance('login', 'cms'); $res = '<div class="container-feedback"><span class="ico-sprite fd_info"><span></span></span> <b>' . $lang->def('_REGISTER_WITH_FACEBOOK') . '</b>: <a href="index.php?modname=login&op=reg_with_fb">' . Get::img('social/bt_fConnect.png', $lang->def('_REGISTER_WITH_FACEBOOK')) . '</a></div>'; return $res; }
function moditem($object_item) { //checkPerm('view', false, 'storage'); require_once _base_ . '/lib/lib.form.php'; $lang =& DoceboLanguage::createInstance('item'); $back_coded = htmlentities(urlencode($object_item->back_url)); list($title, $description) = sql_fetch_row(sql_query("\r\n\tSELECT title, description \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_materials_lesson \r\n\tWHERE author = " . getLogUserId() . " AND idLesson = '" . $object_item->getId() . "'")); $GLOBALS['page']->add(getTitleArea($lang->def('_SECTIONNAME_ITEM'), 'item') . '<div class="std_block">' . getBackUi(Util::str_replace_once('&', '&', $object_item->back_url) . '&mod_result=0', $lang->def('_BACK')) . Form::openForm('itemform', 'index.php?modname=item&op=upitem', 'std_form', 'post', 'multipart/form-data') . Form::openElementSpace() . Form::getHidden('idItem', 'idItem', $object_item->getId()) . Form::getHidden('back_url', 'back_url', htmlentities(urlencode($object_item->back_url))) . Form::getTextfield($lang->def('_TITLE'), 'title', 'title', 100, $title) . Form::getFilefield($lang->def('_FILE_MOD'), 'file', 'attach') . Form::getTextarea($lang->def('_DESCRIPTION'), 'description', 'description', $description) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('additem', 'additem', $lang->def('_SAVE')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content'); }
function getReportNameById($id) { $qry = "SELECT filter_name, author FROM %lms_report_filter WHERE id_filter={$id}"; $row = sql_fetch_row(sql_query($qry)); if ($row[1]) { return $row[0]; } else { $lang =& DoceboLanguage::createInstance('report', 'framework'); return $lang->def($row[0]); } }
function getPermissionUi($form_name, $perm) { require_once _base_ . '/lib/lib.table.php'; $lang =& DoceboLanguage::createInstance('manmenu'); $lang_perm =& DoceboLanguage::createInstance('permission'); $tokens = $this->getAllToken(); $levels = CourseLevel::getLevels(); $tb = new Table(0, $lang->def('_VIEW_PERMISSION'), $lang->def('_EDIT_SETTINGS')); $c_head = array($lang->def('_LEVELS')); $t_head = array(''); foreach ($tokens as $k => $token) { if ($token['code'] != 'view') { if (isset($token['image'])) { $c_head[] = '<img src="' . getPathImage() . $token['image'] . '" alt="' . $lang_perm->def($token['name']) . '"' . ' title="' . $lang_perm->def($token['name']) . '" />'; } else { $c_head[] = $lang_perm->def($token['name']); } $t_head[] = 'image'; } } if (count($tokens) > 1) { $c_head[] = '<img src="' . getPathImage() . 'standard/checkall.png" alt="' . $lang->def('_CHECKALL') . '" />'; $c_head[] = '<img src="' . getPathImage() . 'standard/uncheckall.png" alt="' . $lang->def('_UNCHECKALL') . '" />'; $t_head[] = 'image'; $t_head[] = 'image'; } $tb->setColsStyle($t_head); $tb->addHead($c_head); while (list($lv, $levelname) = each($levels)) { $c_body = array($levelname); foreach ($tokens as $k => $token) { if ($token['code'] != 'view') { $c_body[] = '<input class="check" type="checkbox" ' . 'id="perm_' . $lv . '_' . $token['code'] . '" ' . 'name="perm[' . $lv . '][' . $token['code'] . ']" value="1"' . (isset($perm[$lv][$token['code']]) ? ' checked="checked"' : '') . ' />' . '<label class="access-only" for="perm_' . $lv . '_' . $token['code'] . '">' . $lang_perm->def($token['name']) . '</label>' . "\n"; } } if (count($tokens) > 1) { $c_body[] = '<img class="handover"' . ' onclick="checkall(\'' . $form_name . '\', \'perm[' . $lv . ']\', true); return false;"' . ' src="' . getPathImage() . 'standard/checkall.png" alt="' . $lang->def('_CHECKALL') . '" />'; $c_body[] = '<img class="handover"' . ' onclick="checkall(\'' . $form_name . '\', \'perm[' . $lv . ']\', false); return false;"' . ' src="' . getPathImage() . 'standard/uncheckall.png" alt="' . $lang->def('_UNCHECKALL') . '" />'; } $tb->addBody($c_body); } $c_select_all = array(''); foreach ($tokens as $k => $token) { if ($token['code'] != 'view') { $c_select_all[] = '<img class="handover"' . ' onclick="checkall_fromback(\'' . $form_name . '\', \'[' . $token['code'] . ']\', true); return false;"' . ' src="' . getPathImage() . 'standard/checkall.png" alt="' . $lang->def('_CHECKALL') . '" />' . '<img class="handover"' . ' onclick="checkall_fromback(\'' . $form_name . '\', \'[' . $token['code'] . ']\', false); return false;"' . ' src="' . getPathImage() . 'standard/uncheckall.png" alt="' . $lang->def('_UNCHECKALL') . '" />'; } } if (count($tokens) > 1) { $c_select_all[] = ''; $c_select_all[] = ''; } $tb->addBody($c_select_all); return $tb->getTable(); }
/** * This function create the initialization data needed to load the tree and the markup * @return array 'js' -> the js used to setup the tree, 'html' => thd html markup needed for the tree */ function get($domready = true, $tags = true, $global = false) { $lang =& DoceboLanguage::createInstance('organization_chart', 'framework'); $lang =& DoceboLanguage::createInstance('treeview', 'framework'); if (!$this->root_name) { $this->root_name = $lang->def('_CATEGORY'); } $out = array(); $out['js'] = ($tags ? '<script type="text/javascript">' . "\n" : '') . (is_string($global) ? 'var ' . $global . ';' : "") . 'var _lang_tree = {' . '_SAVE: "' . $lang->def('_SAVE') . '",' . '_CONFIRM: "' . $lang->def('_CONFIRM') . '",' . '_UNDO: "' . $lang->def('_UNDO') . '",' . '_AREYOUSURE: "' . $lang->def('_AREYOUSURE') . '",' . '_NAME: "' . $lang->def('_NAME') . '",' . '_ADD: "' . $lang->def('_ADD') . '",' . '_MOD: "' . $lang->def('_MOD') . '",' . '_DEL: "' . $lang->def('_DEL') . '",' . '_YES: "' . $lang->def('_YES') . '",' . '_NO: "' . $lang->def('_NO') . '",' . '_INHERIT: "' . $lang->def('_ORG_CHART_INHERIT', 'organization_chart') . '",' . '_ROOT: "' . $this->root_name . '",' . '_NEW_FOLDER: "' . $lang->def('_NEW_FOLDER') . '",' . '_DEL: "' . $lang->def('_DEL') . '",' . '_AJAX_FAILURE: "' . $lang->def('_DEL') . '"' . ' };' . "\n\n" . ($domready ? ' YAHOO.util.Event.onDOMReady(function(e) {' : '') . 'var BaseTree = new CourseCategoryTree("' . $this->id . '", {' . "\n" . ' tree_id: "' . $this->id . '",' . "\n" . ' request_url: "' . $this->ajax_url . '",' . "\n" . ' selector_columns_type: "' . $this->sel_columns . '",' . "\n" . ' use_form_input: ' . ($this->use_form_input ? 'true' : 'false') . ',' . "\n" . ' draggable_nodes: ' . ($this->draggable_nodes ? 'true' : 'false') . ',' . "\n" . ' use_context_menu: ' . ($this->use_context_menu ? 'true' : 'false') . ',' . "\n" . ' langs: _lang_tree,' . "\n" . ' initial_selection: [' . $this->formatInitialSelection() . ']' . "\n" . ' }' . "\n" . '); ' . (is_string($global) ? $global . '=BaseTree; ' : "") . ($domready ? '} );' : '') . ($tags ? '</script>' : ''); $out['html'] = '<div class="tree_container">' . '<div class="folder_status_message"><div id="' . $this->id . '_status"></div></div>' . '<div class="folder_tree" id="' . $this->id . '"></div>' . ($this->use_form_input ? '<input type="hidden" id="' . $this->id . '_input" name="' . $this->id . '_input" />' : '') . '</div>'; return $out; }
public function __construct() { $this->course_table = $GLOBALS['prefix_lms'] . '_course'; $this->subscribe_table = $GLOBALS['prefix_lms'] . '_courseuser'; $this->user_table = $GLOBALS['prefix_fw'] . '_user'; $this->db = DbConn::getInstance(); $this->acl_man = $acl_man =& Docebo::user()->getAclManager(); $this->lang =& DoceboLanguage::CreateInstance('levels', 'lms'); $this->lang =& DoceboLanguage::CreateInstance('subscribe', 'lms'); $this->array_user_status = array(_CUS_WAITING_LIST => $this->lang->def('_WAITING_USERS'), _CUS_CONFIRMED => $this->lang->def('_USER_STATUS_CONFIRMED'), _CUS_SUBSCRIBED => $this->lang->def('_USER_STATUS_SUBS'), _CUS_BEGIN => $this->lang->def('_USER_STATUS_BEGIN'), _CUS_END => $this->lang->def('_USER_STATUS_END'), _CUS_SUSPEND => $this->lang->def('_USER_STATUS_SUSPEND'), _CUS_OVERBOOKING => $this->lang->def('_USER_STATUS_OVERBOOKING')); $this->array_user_level = array(1 => $this->lang->def('_LEVEL_1', 'levels', 'lms'), 2 => $this->lang->def('_LEVEL_2', 'levels', 'lms'), 3 => $this->lang->def('_LEVEL_3', 'levels', 'lms'), 4 => $this->lang->def('_LEVEL_4', 'levels', 'lms'), 5 => $this->lang->def('_LEVEL_5', 'levels', 'lms'), 6 => $this->lang->def('_LEVEL_6', 'levels', 'lms'), 7 => $this->lang->def('_LEVEL_7', 'levels', 'lms')); }
function getNodeOptions($id_category, $is_leaf) { $lang =& DoceboLanguage::CreateInstance('course', 'lms'); $node_options = array(); $node_options[] = array('id' => 'mod_' . $id_category, 'command' => 'modify', 'icon' => 'standard/edit.png', 'alt' => $lang->def('_MOD')); if ($is_leaf) { $node_options[] = array('id' => 'del_' . $id_category, 'command' => 'delete', 'icon' => 'standard/delete.png', 'alt' => $lang->def('_DEL')); } else { $node_options[] = array('id' => 'del_' . $id_category, 'command' => false, 'icon' => 'blank.png'); } return $node_options; }
function sys_forum($platform, $key1, $key2 = 0, $key3 = NULL) { $this->out =& $GLOBALS["page"]; $this->lang =& DoceboLanguage::createInstance('sysforum', $platform); if ($key1 == "") { echo "error: The thread key couldn't be null<br />\n"; } else { $this->tk[1] = $key1; $this->tk[2] = $key2; $this->tk[3] = $key3; $this->url = $this->get_current_url(); } }
function loadExtraMenu() { $lang =& DoceboLanguage::createInstance('forum'); $line = '<div class="legend_line">'; echo $line . '<img src="' . getPathImage() . 'standard/add.png" /> ' . $lang->def('_REPLY') . '</div>' . $line . '<img src="' . getPathImage() . 'standard/edit.png" /> ' . $lang->def('_MOD') . '</div>' . $line . '<img src="' . getPathImage() . '/forum/free.gif" /> ' . $lang->def('_FORUMOPEN') . '</div>' . $line . '<img src="' . getPathImage() . '/forum/locked.gif" /> ' . $lang->def('_FORUMCLOSED') . '</div>'; if (checkPerm('mod', true)) { $line . '<img src="' . getPathImage() . 'forum/erase.gif" /> ' . $lang->def('_DEL') . '</div>'; $line . '<img src="' . getPathImage() . 'forum/unerase.gif" /> ' . $lang->def('_RESTOREINSERT') . '</div>'; } if (checkPerm('del', true)) { $line . '<img src="' . getPathImage() . 'standard/delete.png" /> ' . $lang->def('_DEL') . '</div>'; } }
function connect() { require_once _adm_ . '/lib/lib.field.php'; require_once _base_ . '/lib/lib.eventmanager.php'; // Load language for fields names $lang_dir =& DoceboLanguage::createInstance('admin_directory', 'framework'); $acl =& Docebo::user()->getACL(); $acl_manager = Docebo::user()->getAclManager(); $this->fl = new FieldList(); $this->idst_group = $acl_manager->getGroupST('oc_' . (int) $this->tree); $this->idst_desc = $acl_manager->getGroupST('ocd_' . (int) $this->tree); $this->arr_fields = $this->fl->getAllFields(); $this->cols_descriptor = NULL; if ($this->dbconn === NULL) { $this->last_error = Lang::t('_ORG_IMPORT_ERR_DBCONNISNULL'); return FALSE; } $query = "SHOW FIELDS FROM " . $GLOBALS['prefix_fw'] . "_user"; $rs = sql_query($query, $this->dbconn); if ($rs === FALSE) { $this->last_error = Lang::t('_ORG_IMPORT_ERR_ERRORONQUERY') . $query . ' [' . mysql_error($this->dbconn) . ']'; return FALSE; } $this->cols_descriptor = array(); while ($field_info = mysql_fetch_array($rs)) { if (!in_array($field_info['Field'], $this->ignore_cols)) { $mandatory = in_array($field_info['Field'], $this->mandatory_cols); if (isset($this->default_cols[$field_info['Field']])) { $this->cols_descriptor[] = array(DOCEBOIMPORT_COLNAME => $lang_dir->def('_DIRECTORY_FILTER_' . $field_info['Field']), DOCEBOIMPORT_COLID => $field_info['Field'], DOCEBOIMPORT_COLMANDATORY => $mandatory, DOCEBOIMPORT_DATATYPE => $field_info['Type'], DOCEBOIMPORT_DEFAULT => $this->default_cols[$field_info['Field']]); } else { $this->cols_descriptor[] = array(DOCEBOIMPORT_COLNAME => $lang_dir->def('_DIRECTORY_FILTER_' . $field_info['Field']), DOCEBOIMPORT_COLID => $field_info['Field'], DOCEBOIMPORT_COLMANDATORY => $mandatory, DOCEBOIMPORT_DATATYPE => $field_info['Type']); } } } $this->cols_descriptor[] = array(DOCEBOIMPORT_COLNAME => Lang::t('_FOLDER_NAME', 'standard'), DOCEBOIMPORT_COLID => 'tree_name', DOCEBOIMPORT_COLMANDATORY => false, DOCEBOIMPORT_DATATYPE => 'text'); mysql_free_result($rs); foreach ($this->arr_fields as $field_id => $field_info) { if (in_array($field_info[FIELD_INFO_TYPE], $this->valid_filed_type)) { $this->cols_descriptor[] = array(DOCEBOIMPORT_COLNAME => $field_info[FIELD_INFO_TRANSLATION], DOCEBOIMPORT_COLID => $field_id, DOCEBOIMPORT_COLMANDATORY => FALSE, DOCEBOIMPORT_DATATYPE => 'text', DOCEBOIMPORT_DEFAULT => false); } } $this->userlevel = $acl_manager->getGroupST(ADMIN_GROUP_USER); $idst_oc = $acl_manager->getGroup(false, '/oc_0'); $this->idst_oc = $idst_oc[ACL_INFO_IDST]; $idst_ocd = $acl_manager->getGroup(false, '/ocd_0'); $this->idst_ocd = $idst_ocd[ACL_INFO_IDST]; // cache orgchart $um = new UsermanagementAdm(); $this->orgchart = $um->getAllFolders('both', $this->tree != 0 ? $this->tree : false); return TRUE; }
function getBoxContent() { $html = ''; if (!checkPerm('view', true, 'course', 'lms')) { return $html; } require_once $GLOBALS['where_lms'] . '/lib/lib.course_managment.php'; $course_man = new AdminCourseManagment(); $course_stats = $course_man->getCoursesStats(); $lang =& DoceboLanguage::createInstance('dashboard', 'framework'); $html = array(); $html[] = '<h2 class="inline">' . $lang->def('_COURSES_PANEL') . '</h2>' . '<p>' . $lang->def('_TOTAL_COURSE') . ': <b>' . $course_stats['total'] . '</b>;<br />' . $lang->def('_ACTIVE_COURSE') . ': <b>' . $course_stats['active'] . '</b>;' . '</p><p>' . $lang->def('_ACTIVE_SEVEN_COURSE') . ': <b>' . $course_stats['active_seven'] . '</b>;<br />' . $lang->def('_DEACTIVE_SEVEN_COURSE') . ': <b>' . $course_stats['deactive_seven'] . '</b>;' . '</p><p>' . $lang->def('_TOTAL_SUBSCRIPTION') . ': <b>' . $course_stats['user_subscription'] . '</b>;<br />' . (checkPerm('moderate', true, 'course', 'lms') ? $lang->def('_WAITING_SUBSCRIPTION') . ': <b>' . $course_stats['user_waiting'] . '</b>;' : '') . '</p>'; return $html; }
function edit($back_poll) { $lang =& DoceboLanguage::createInstance('poll'); require_once _base_ . '/lib/lib.form.php'; $url_encode = htmlentities(urlencode($back_poll)); if (isset($_POST['add_question'])) { if (!sql_query("\r\n\t\t\tUPDATE " . $GLOBALS['prefix_lms'] . "_pollquest \r\n\t\t\tSET title_quest = '" . $_POST['title_quest'] . "' \r\n\t\t\tWHERE id_quest = '" . $this->id . "'")) { errorCommunication($lang->def('_ERR_INS_QUEST') . getBackUi('index.php?modname=question_poll&op=edit&type_quest=' . $this->getQuestionType() . '&id_quest=' . $this->id . '&back_poll=' . $url_encode, $lang->def('_BACK'))); } Util::jump_to('' . $back_poll); } list($title_quest) = sql_fetch_row(sql_query("\r\n\t\tSELECT title_quest \r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_pollquest \r\n\t\tWHERE id_quest = '" . $this->id . "'")); $GLOBALS['page']->add(getTitleArea($lang->def('_POLL_SECTION'), 'poll') . '<div class="std_block">' . getBackUi(Util::str_replace_once('&', '&', $back_poll), $lang->def('_BACK')) . '<div class="title_big">' . $lang->def('_QUEST_ACRN_' . strtoupper($this->getQuestionType())) . ' - ' . $lang->def('_QUEST_' . strtoupper($this->getQuestionType())) . '</div><br />' . Form::openForm('form_mod_quest', 'index.php?modname=question_poll&op=edit') . Form::openElementSpace() . Form::getHidden('type_quest', 'type_quest', $this->getQuestionType()) . Form::getHidden('id_quest', 'id_quest', $this->id) . Form::getHidden('back_poll', 'back_poll', $url_encode) . Form::getTextarea($lang->def('_POLL_QUEST_TITLE'), 'title_quest', 'title_quest', $title_quest) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('add_question', 'add_question', $lang->def('_SAVE')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content'); }
function regset_editregion($region_id = FALSE) { checkPerm('view'); // [TODO] check write permissions require_once _base_ . '/lib/lib.form.php'; $out =& $GLOBALS['page']; $lang =& DoceboLanguage::createInstance('admin_regset', 'framework'); $form = new Form(); $out->setWorkingZone("content"); $out->add(getTitleArea($lang->def("_REGIONAL_SETTINGS"), "regset")); $out->add("<div class=\"std_block\">\n"); if ($region_id == "") { $region_id = FALSE; } $data = array(); if ($region_id === FALSE) { // Add $out->add($form->openForm("regset_form", "index.php?modname=regional_settings&op=insnew")); $submit_lbl = $lang->def("_INSERT"); $data["region_id"] = $lang->def("_REGION_CODE"); $data["region_desc"] = $lang->def("_DESCRIPTION"); $data["browsercode"] = $lang->def("_BROWSER_CODE"); } else { // Edit $out->add($form->openForm("regset_form", "index.php?modname=regional_settings&op=updregion")); $regset = new RegionalSettingsManager(); $data = $regset->getRegionSettings($region_id); $data["region_id"] = $region_id; $data["region_desc"] = $regset->getRegionInfo($region_id, "description"); $data["browsercode"] = $regset->getRegionInfo($region_id, "browsercode"); $submit_lbl = $lang->def("_MOD"); } $out->add($form->openElementSpace()); $out->add($form->getTextfield($lang->def("_REGION_CODE"), "region_id", "region_id", 100, $data["region_id"])); $out->add($form->getTextfield($lang->def("_DESCRIPTION"), "region_desc", "region_desc", 255, $data["region_desc"])); $out->add($form->getTextfield($lang->def("_BROWSER_CODE"), "browsercode", "browsercode", 255, $data["browsercode"])); displaySettingFields($out, $lang, $form, $data); if ($region_id !== FALSE) { $out->add($form->getHidden("old_region_id", "old_region_id", $region_id)); } $out->add($form->closeElementSpace()); $out->add($form->openButtonSpace()); $out->add($form->getButton('save', 'save', $submit_lbl)); $out->add($form->getButton('undo', 'undo', $lang->def('_UNDO'))); $out->add($form->closeButtonSpace()); //"<br /><br /><input class=\"button\" type=\"submit\" value=\"".$submit_lbl."\" />\n"); $out->add($form->closeForm()); $out->add("</div>\n"); }
function loadNewsBlock() { $lang = DoceboLanguage::createInstance('login'); $textQuery = "\r\n\tSELECT idNews, publish_date, title, short_desc \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_news \r\n\tWHERE language = '" . getLanguage() . "'\r\n\tORDER BY important DESC, publish_date DESC"; $result = sql_query($textQuery); $html = '<div class="home_news_block">' . '<h1>' . $lang->def('_NEWS') . '</h1>'; while (list($idNews, $publish_date, $title, $short_desc) = sql_fetch_row($result)) { $html .= '<h2>' . '<a href="index.php?modname=login&op=readnews&idNews=' . $idNews . '">' . $title . '</a></h2>' . '<p><span class="news_data">' . $lang->def('_DATE') . ' ' . Format::date($publish_date, 'date') . ': </span>' . $short_desc . '</p>'; } if (mysql_num_rows($result) == 0) { $html .= $lang->def('_NO_CONTENT'); } $html .= '</div>'; return $html; }
public function __construct() { require_once _lms_ . '/lib/lib.subscribe.php'; $this->date_table = $GLOBALS['prefix_lms'] . '_course_date'; $this->day_date_table = $GLOBALS['prefix_lms'] . '_course_date_day'; $this->user_date_table = $GLOBALS['prefix_lms'] . '_course_date_user'; $this->presence_date_table = $GLOBALS['prefix_lms'] . '_course_date_presence'; $this->classroom_table = $GLOBALS['prefix_lms'] . '_classroom'; $this->location_table = $GLOBALS['prefix_lms'] . '_class_location'; $this->course_table = $GLOBALS['prefix_lms'] . '_course'; $this->courseuser_table = $GLOBALS['prefix_lms'] . '_courseuser'; $this->user_table = $GLOBALS['prefix_fw'] . '_user'; $this->lang =& DoceboLanguage::CreateInstance('admin_date', 'lms'); $this->acl_man = $acl_man =& Docebo::user()->getAclManager(); $this->subscribe_man = new CourseSubscribe_Manager(); }
function getLmsLangFlags() { $lang =& DoceboLanguage::createInstance('blind_navigation'); $blind_link = "<li><a href=\"#lang_box\">" . $lang->def("_LANG_SELECT") . "</a></li>"; $GLOBALS["page"]->add($blind_link, "blind_navigation"); $all_lang = Docebo::langManager()->getAllLangCode(); if (!is_array($all_lang)) { return ''; } $res = '<ul id="lang_box">'; foreach ($all_lang as $k => $lang_code) { $res .= '<a href="index.php?sop=changelang&new_lang=' . $lang_code . '" title="' . $lang_code . '">' . '<img src="' . getPathImage('fw') . 'language/' . $lang_code . '.png" alt="' . $lang_code . '" /></a>'; } $res .= '</ul>'; return $res; }
/** * **/ function initialize() { require_once $GLOBALS['where_lms'] . '/modules/homerepo/homerepo.php'; $ready = FALSE; $this->lang =& DoceboLanguage::createInstance('homerepo', 'lms'); if (isset($_GET['shr']) && FALSE) { // reload from previously saved session require_once $GLOBALS['where_framework'] . '/lib/lib.sessionsave.php'; $saveObj = new Session_Save(); $saveName = $_GET['shr']; if ($saveObj->nameExists($saveName)) { $this->treeView =& $saveObj->load($saveName); $this->repoDb =& $this->treeView->tdb; $ready = TRUE; $saveObj->delete($saveName); $this->treeView->extendedParsing($_POST, $_POST, $_POST); $this->treeView->refreshTree(); } } if (!$ready) { // contruct and initialize TreeView to manage public repository $this->repoDb = new HomerepoDirDb($GLOBALS['prefix_lms'] . '_homerepo', getLogUserId()); /* TODO: ACL if( !funAccess('pubrepoedit','MOD', TRUE, 'pubrepo' ) ) { $repoDb->setFilterVisibility( TRUE ); $repoDb->setFilterAccess( getLogUserId() ); }*/ $this->treeView = new RepoTreeView($this->repoDb, 'homerepo', Lang::t('_HOMEREPOROOTNAME', 'storage', 'lms')); $this->treeView->mod_name = 'homerepo'; require_once $GLOBALS['where_framework'] . '/lib/lib.sessionsave.php'; $saveObj = new Session_Save(); $saveName = 'homerepo' . getLogUserId(); if ($saveObj->nameExists($saveName)) { $this->treeView->setState($saveObj->load($saveName)); $ready = TRUE; $saveObj->delete($saveName); //$this->treeView->extendedParsing( $_POST, $_POST, $_POST); $this->treeView->parsePositionData($_POST, $_POST, $_POST); $this->treeView->refreshTree(); } else { $this->treeView->parsePositionData($_POST, $_POST, $_POST); } } if ($this->select_destination) { $this->treeView->setOption(REPOOPTSHOWONLYFOLDER, TRUE); } }
function getSubstitutionTags() { $lang =& DoceboLanguage::createInstance('certificate', 'lms'); $subs = array(); $subs['[display_name]'] = $lang->def('_DISPLAY_NAME'); $subs['[username]'] = $lang->def('_USERNAME'); $subs['[firstname]'] = $lang->def('_FIRSTNAME'); $subs['[lastname]'] = $lang->def('_LASTNAME'); //variable fields require_once $GLOBALS['where_framework'] . '/lib/lib.field.php'; $temp = new FieldList(); $fields = $temp->getFlatAllFields(); foreach ($fields as $key => $value) { $subs['[userfield_' . $key . ']'] = $lang->def('_USERFIELD') . ' "' . $value . '"'; } return $subs; }