/** * 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 fileList(&$url) { checkPerm('view'); require_once _base_ . '/lib/lib.tab.php'; require_once _base_ . '/lib/lib.table.php'; require_once _base_ . '/lib/lib.form.php'; $file_man = new MyFile(getLogUserId()); $tab_man = new TabView('myfiles', ''); $lang =& DoceboLanguage::createInstance('myfiles'); $areas = $file_man->getFilesAreas(); while (list($id_page, $area_name) = each($areas)) { $new_tab = new TabElemDefault($id_page, $lang->def($area_name), getPathImage('fw') . 'myfiles/' . $id_page . '.gif'); $tab_man->addTab($new_tab); } $tab_man->parseInput($_POST, $_SESSION); $active_tab = $tab_man->getActiveTab(); if (!$active_tab) { $active_tab = importVar('working_area', false, $file_man->getDefaultArea()); $tab_man->setActiveTab($active_tab); } $GLOBALS['page']->addStart(Form::openForm('tab_myfiles', $url->getUrl('op=myfiles')) . Form::getHidden('working_area', 'working_area', $active_tab) . $tab_man->printTabView_Begin('', false), 'content'); $GLOBALS['page']->addEnd($tab_man->printTabView_End() . Form::closeForm(), 'content'); $tb = new Table(0, $lang->def('_MYFILES_CAPTION'), $lang->def('_MYFILES_SUMMARY')); $cont_h = array($lang->def('_TITLE'), $lang->def('_FILE_POLICY'), '<img src="' . getPathImage() . 'standard/edit.png" title="' . $lang->def('_MOD') . '" alt="' . $lang->def('_MOD') . '" />', '<img src="' . getPathImage() . 'standard/delete.png" title="' . $lang->def('_REM_FILE') . '" alt="' . $lang->def('_DEL') . '" />'); $type_h = array('', 'image nowrap', 'image', 'image'); $tb->setColsStyle($type_h); $tb->addHead($cont_h); $re_files = $file_man->getFileList($active_tab, false, MYFILE_TITLE); while ($file_info = $file_man->fetch_row($re_files)) { $cont = array($file_info[MYFILE_TITLE]); switch ($file_info[MYFILE_POLICY]) { case MF_POLICY_FREE: $cont[] = $lang->def('_MF_POLICY_FREE'); break; case MF_POLICY_TEACHER: $cont[] = $lang->def('_MF_POLICY_TEACHER'); break; case MF_POLICY_FRIENDS: $cont[] = $lang->def('_MF_POLICY_FRIENDS'); break; case MF_POLICY_TEACHER_AND_FRIENDS: $cont[] = $lang->def('_MF_POLICY_TEACHER_AND_FRIENDS'); break; case MF_POLICY_NOONE: $cont[] = $lang->def('_MF_POLICY_NOONE'); break; } $cont[] = '<a href="' . $url->getUrl('op=modfiles&working_area=' . $active_tab . '&id_file=' . $file_info[MYFILE_ID_FILE]) . '">' . '<img src="' . getPathImage() . 'standard/edit.png" title="' . $lang->def('_MOD') . ' : ' . $file_info[MYFILE_TITLE] . '" alt="' . $lang->def('_MOD') . '" />' . '</a>'; $cont[] = '<a href="' . $url->getUrl('op=delfiles&id_file=' . $file_info[MYFILE_ID_FILE]) . '">' . '<img src="' . getPathImage() . 'standard/delete.png" title="' . $lang->def('_REM_FILE') . ' : ' . $file_info[MYFILE_TITLE] . '" alt="' . $lang->def('_DEL') . '" />' . '</a>'; $tb->addBody($cont); } $tb->addActionAdd('<p class="new_elem_link"><a href="' . $url->getUrl('op=modfiles&working_area=' . $active_tab) . '">' . $lang->def('_ADD_' . $active_tab) . '</a></p>'); $tb->addActionAdd('<p>' . '<a href="' . $url->getUrl('modname=profile&op=profile&id_user='******'&ap=view_files&type=' . $active_tab . '&from=1') . '">' . '<img src="' . getPathImage('fw') . 'myfiles/' . $active_tab . '.gif" title="' . $lang->def($active_tab) . '" alt="' . $lang->def('_VIEW_' . $active_tab) . '" />' . '</a>' . '<a href="' . $url->getUrl('modname=profile&op=profile&id_user='******'&ap=view_files&type=' . $active_tab . '&from=1') . '">' . $lang->def('_VIEW_' . $active_tab) . '</a></p>'); $GLOBALS['page']->add($tb->getTable(), 'content'); }
function reservation() { checkPerm('view'); require_once _base_ . '/lib/lib.tab.php'; require_once _base_ . '/lib/lib.urlmanager.php'; require_once _base_ . '/lib/lib.form.php'; require_once $GLOBALS['where_lms'] . '/lib/lib.course.php'; $mod_perm = checkPerm('mod', true); $lang =& DoceboLanguage::createInstance('reservation'); $um =& UrlManager::getInstance("reservation"); $out = $GLOBALS['page']; $out->setWorkingZone('content'); $man_res = new Man_Reservation(); $tab_man = new TabView('reservation', ''); $tab_events = new TabElemDefault('events', $lang->def('_RESERVATION_EVENTS')); $tab_my_events = new TabElemDefault('my_events', $lang->def('_RESERVATION_MY_EVENTS')); $tab_past_event = new TabElemDefault('past_events', $lang->def('_RESERVATION_PAST_EVENTS')); if ($mod_perm) { $tab_subscribed_user = new TabElemDefault('subscribed_user', $lang->def('_RESERVATION_SUBSCRIBED_USER')); } $tab_man->addTab($tab_events); $tab_man->addTab($tab_my_events); $tab_man->addTab($tab_past_event); if ($mod_perm) { $tab_man->addTab($tab_subscribed_user); } $tab_man->parseInput($_POST, $_SESSION); $active_tab = $tab_man->getActiveTab(); if ($active_tab != 'events' && $active_tab != 'my_events' && $active_tab != 'past_events' && $active_tab != 'subscribed_user') { $active_tab = importVar('active_tab', false, 'events'); $tab_man->setActiveTab($active_tab); } $out->add(getTitleArea(Lang::t('_RESERVATION', 'reservation')) . '<div class="std_block">', 'content'); $out->add(Form::openForm('tab_reservation', 'index.php?modname=reservation&op=reservation&confirm=1&ap=mod_profile&from=2') . $tab_man->printTabView_Begin('', false), 'content'); switch ($active_tab) { case 'events': events(); break; case 'my_events': myEvents(); break; case 'past_events': pastEvents(); break; case 'subscribed_user': subscribedUser(); break; } $out->add($tab_man->printTabView_End() . Form::closeForm(), 'content'); $out->add('</div>', 'content'); }
function &create_TabView($op) { global $_tab_op_map; $tv = new TabView('storage', 'index.php?modname=storage&op=display'); $lang =& DoceboLanguage::createInstance('storage', 'lms'); if (checkPerm('home', true, 'storage')) { $tv->addTab(new TabElemDefault('storage_home', $lang->def('_HOMEREPOROOTNAME'), getPathImage() . 'area_title/homerepo.gif')); } if (checkPerm('lesson', true, 'storage')) { $tv->addTab(new TabElemDefault('storage_course', $lang->def('_ORGROOTNAME'), getPathImage() . 'area_title/organizations.gif')); } if (checkPerm('public', true, 'storage')) { $tv->addTab(new TabElemDefault('storage_pubrepo', $lang->def('_PUBREPOROOTNAME'), getPathImage() . 'area_title/pubrepo.gif')); } $extra_data = load_state(); $tv->parseInput($_POST, $extra_data); if (isset($_tab_op_map[$op])) { $tv->setActiveTab($_tab_op_map[$op]); } return $tv; }
function adminManager_edit_menu() { checkPerm('view'); require_once _base_ . '/lib/lib.form.php'; require_once _base_ . '/lib/lib.tab.php'; require_once $GLOBALS['where_framework'] . '/lib/lib.adminmanager.php'; $lang =& DoceboLanguage::createInstance('adminrules', 'framework'); $aclManager =& Docebo::user()->getAclManager(); $adminidst = importVar('adminidst', true, 0); $out =& $GLOBALS['page']; $admin_manager = new AdminManager(); // perform other platforms login operation require_once _base_ . '/lib/lib.platform.php'; $pm =& PlatformManager::createInstance(); //prefetching tab------------------------------------------- $tabs = new TabView('admin_menu_tab_editing', 'index.php?modname=admin_manager&op=edit_menu&adminidst=' . $adminidst); $plat = $pm->getPlatformList(); $active_tab = importVar('tab', false, 'framework'); foreach ($plat as $code => $descr) { if (isset($_POST['tabelem_' . $code . '_status'])) { $active_tab = $code; } $tab = new TabElemDefault($code, $lang->def('_MENU_MANAGE_' . strtoupper($code)), getPathImage() . 'main_zone/' . $code . '.gif'); $tabs->addTab($tab); } $admin_menu =& $pm->getPlatformAdminMenuInstance($active_tab); $all_admin_permission =& $admin_manager->getAdminPermission($adminidst); // save if is it required if (isset($_POST['save_permission'])) { $re = $admin_menu->savePreferences($_POST, $adminidst, $all_admin_permission); $all_admin_permission =& $admin_manager->getAdminPermission($adminidst); } $tabs->setActiveTab($active_tab); $out->setWorkingZone('content'); $out->add(getTitleArea($lang->def('_ADMIN_MANAGMENT'), 'admin_managmer', $lang->def('_ADMIN_MANAGMENT')) . '<div class="std_block">' . $tabs->printTabView_Begin() . Form::openForm('admin_menu_editing', '') . Form::getHidden('adminidst', 'adminidst', $adminidst) . Form::getHidden('tab', 'tab', $active_tab) . ($admin_menu !== false ? $admin_menu->getPermissionUi($all_admin_permission, 'admin_menu_editing', 'admin_menu_editing') : '') . Form::openButtonSpace() . Form::getButton('save_permission', 'save_permission', $lang->def('_SAVE')) . Form::getButton('undo_pref', 'undo_pref', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm() . $tabs->printTabView_End() . '</div>'); }
function loadSelector() { require_once _base_ . '/lib/lib.tab.php'; require_once _base_ . '/lib/lib.form.php'; require_once _base_ . '/lib/lib.table.php'; $file_man = new MyFile(getLogUserId()); $tab_man = new TabView('myfiles', ''); $lang =& DoceboLanguage::createInstance('myfiles'); $areas = $file_man->getFilesAreas(); while (list($id_page, $area_name) = each($areas)) { $new_tab = new TabElemDefault($id_page, $lang->def($area_name), getPathImage('fw') . 'myfiles/' . $id_page . '.gif'); $tab_man->addTab($new_tab); } $this->parse(); $tab_man->parseInput($_POST, $_SESSION); $active_tab = $tab_man->getActiveTab(); if (!$active_tab) { $active_tab = importVar('working_area', true, $file_man->getDefaultArea()); $tab_man->setActiveTab($active_tab); } $tb = new Table(0, $lang->def('_MYFILES_CAPTION'), $lang->def('_MYFILES_SUMMARY')); $cont_h = array('<span class="access-only">' . $lang->def('_FILE_SELECTION') . '</span>', $lang->def('_TITLE') . '</label>'); $type_h = array('image', ''); $tb->setColsStyle($type_h); $tb->addHead($cont_h); $id_list = array(); $re_files = $file_man->getFileList($active_tab, false, MYFILE_TITLE); while ($file_info = $file_man->fetch_row($re_files)) { $id_file = $file_info[MYFILE_ID_FILE]; $id_list[$id_file] = $id_file; $cont = array(Form::getInputCheckbox('new_file_selected_' . $id_file, 'new_file_selected[' . $id_file . ']', $id_file, isset($this->current_selection[$id_file]), ''), '<label for="new_file_selected_' . $id_file . '">' . $file_info[MYFILE_TITLE] . '</label>'); $tb->addBody($cont); } // print selector $GLOBALS['page']->add(Form::getHidden('working_area', 'working_area', $active_tab) . Form::getHidden('old_selection', 'old_selection', urlencode(serialize($this->current_selection))) . Form::getHidden('displayed', 'displayed', urlencode(serialize($id_list))) . $tab_man->printTabView_Begin('', false) . $tb->getTable() . $tab_man->printTabView_End(), 'content'); }