コード例 #1
0
ファイル: reservation.php プロジェクト: abhinay100/forma_app
 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&amp;op=reservation&amp;confirm=1&amp;ap=mod_profile&amp;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');
 }
コード例 #2
0
ファイル: myfiles.php プロジェクト: abhinay100/forma_app
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');
}
コード例 #3
0
ファイル: storage.php プロジェクト: abhinay100/forma_app
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;
}
コード例 #4
0
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&amp;op=edit_menu&amp;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>');
}
コード例 #5
0
ファイル: iotask.php プロジェクト: abhinay100/forma_app
/**
 * 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&amp;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());
}
コード例 #6
0
ファイル: orglib.php プロジェクト: abhinay100/forma_app
 function modifyItem($arrData, $idCourse = FALSE, $strips = false)
 {
     $folder = $this->getFolderById($arrData['idItem']);
     require_once _base_ . '/lib/lib.tab.php';
     $tv = new TabView('organization_properties', '#');
     $tv->addTab(new TabElemDefault('prereqisites', '', getPathImage() . 'standard/property.png'));
     $tv->addTab(new TabElemDefault('settings', '', getPathImage() . 'standard/property.png'));
     //$tv->addTab( new TabElemDefault( 'catalogation', '', getPathImage().'standard/edit.png' ) );
     $tv->parseInput($_POST, $_POST);
     $prerequisite = '';
     if ($tv->getActiveTab() === 'prereqisites') {
         if (isset($arrData['organization']['REPO_OP_SELECTITEM'])) {
             $prerequisite = implode(',', $arrData['organization']['REPO_OP_SELECTITEM']);
         }
     } else {
         $prerequisite = $arrData['prerequisites'];
     }
     // unmodifiable values
     $this->org_objectType = $folder->otherValues[REPOFIELDOBJECTTYPE];
     $this->org_idResource = $folder->otherValues[REPOFIELDIDRESOURCE];
     $this->org_idUser = $folder->otherValues[REPOFIELDIDUSER];
     $this->org_idAuthor = $folder->otherValues[REPOFIELDIDAUTHOR];
     $this->org_dateInsert = $folder->otherValues[REPOFIELDDATEINSERT];
     $this->org_title = isset($arrData['title']) ? $this->_strip($arrData['title'], $strips) : stripslashes($folder->otherValues[REPOFIELDTITLE]);
     $this->org_idCategory = isset($arrData['idCategory']) ? $arrData['idCategory'] : $folder->otherValues[REPOFIELDIDCATEGORY];
     $this->org_version = isset($arrData['version']) ? $arrData['version'] : $folder->otherValues[REPOFIELDVERSION];
     $this->org_difficult = isset($arrData['difficult']) ? $arrData['difficult'] : $folder->otherValues[REPOFIELDDIFFICULT];
     $this->org_description = isset($arrData['description']) ? $this->_strip($arrData['description'], $strips) : $folder->otherValues[REPOFIELDDESCRIPTION];
     $this->org_language = isset($arrData['language']) ? $this->_strip($arrData['language'], $strips) : $folder->otherValues[REPOFIELDLANGUAGE];
     $this->org_resource = isset($arrData['resource']) ? $this->_strip($arrData['resource'], $strips) : $folder->otherValues[REPOFIELDRESOURCE];
     $this->org_objective = isset($arrData['objective']) ? $this->_strip($arrData['objective'], $strips) : $folder->otherValues[REPOFIELDOBJECTIVE];
     if (isset($arrData['prerequisites'])) {
         $this->org_prerequisites = $this->makePrerequisites($arrData['idItem'], $prerequisite, $arrData['selfPrerequisites']);
     } else {
         $this->org_prerequisites = $folder->otherValues[ORGFIELDPREREQUISITES];
     }
     $this->org_isTerminator = isset($arrData['isTerminator']) ? $arrData['isTerminator'] : $folder->otherValues[ORGFIELDISTERMINATOR];
     $this->org_idParam = $folder->otherValues[ORGFIELDIDPARAM];
     $this->org_visible = isset($arrData['visibility']) ? $arrData['visibility'] : $folder->otherValues[ORGFIELDVISIBLE];
     if ($idCourse === FALSE) {
         $this->org_idCourse = $this->idCourse;
     } else {
         $this->org_idCourse = $idCourse;
     }
     if (isset($arrData['milestone'])) {
         $this->org_milestone = $arrData['milestone'];
         /* reset milestone */
         if ($this->org_milestone != '-' && $this->org_milestone != $folder->otherValues[ORGFIELDMILESTONE]) {
             $this->_resetMilestone($this->org_milestone, $this->org_idCourse);
         }
     } else {
         $this->org_milestone = $folder->otherValues[ORGFIELDMILESTONE];
     }
     $this->org_width = isset($arrData['obj_width']) ? $arrData['obj_width'] : $folder->otherValues[ORGFIELD_WIDTH];
     $this->org_height = isset($arrData['obj_height']) ? $arrData['obj_height'] : $folder->otherValues[ORGFIELD_HEIGHT];
     $arrData['publish_from'] = Format::dateDb($arrData['publish_from'], 'date');
     $arrData['publish_to'] = Format::dateDb($arrData['publish_to'], 'date');
     if ($arrData['publish_from'] > $arrData['publish_to'] && $arrData['publish_to'] != "") {
         $temp = $arrData['publish_from'];
         $arrData['publish_from'] = $arrData['publish_to'];
         $arrData['publish_to'] = $temp;
     }
     $this->org_publish_from = isset($arrData['publish_from']) ? $arrData['publish_from'] : $folder->otherValues[ORGFIELD_PUBLISHFROM];
     $this->org_publish_to = isset($arrData['publish_to']) ? $arrData['publish_to'] : $folder->otherValues[ORGFIELD_PUBLISHTO];
     $this->org_access = $folder->otherValues[ORGFIELD_ACCESS];
     $this->org_publish_for = isset($arrData['publish_for']) ? $arrData['publish_for'] : $folder->otherValues[ORGFIELD_PUBLISHFOR];
     $this->changeOtherData($folder);
     if (isset($arrData['accessGroups'])) {
         if ($arrData['accessGroups'] == '') {
             $arrGroups = array();
         } else {
             $arrGroups = unserialize(urldecode($arrData['accessGroups']));
         }
         if ($arrData['accessUsers'] == '') {
             $arrUsers = array();
         } else {
             $arrUsers = unserialize(urldecode($arrData['accessUsers']));
         }
         $this->setAccess($arrData['idItem'], $arrGroups, $arrUsers);
     }
     if ($this->org_objectType != '' && isset($arrData['customParam'])) {
         // ---- custom LO parameters
         $lo = createLO($this->org_objectType, $this->org_idResource, $this->org_idParam, array());
         $arrParamsInfo = $lo->getParamInfo();
         if ($arrParamsInfo !== FALSE) {
             require_once $GLOBALS['where_lms'] . '/lib/lib.param.php';
             while ($param = current($arrParamsInfo)) {
                 if (isset($arrData[$param['param_name']])) {
                     setLOParam($this->org_idParam, $param['param_name'], $arrData[$param['param_name']]);
                 }
                 next($arrParamsInfo);
             }
         }
     }
 }
コード例 #7
0
ファイル: lib.myfiles.php プロジェクト: abhinay100/forma_app
 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');
 }
コード例 #8
0
ファイル: HTMLTabs.php プロジェクト: que273/siremis
 /**
  * Render a URL for hide or show forms or in another case, go to URL specified in xml
  *
  * @param TabView $tabView
  * @return string javascript string to either show a EasyForm or load a different URL
  **/
 private function _renderURL($tabView)
 {
     if ($tabView->hasForms()) {
         $url = "javascript:ChangeTab(this, {$tabView->m_Name}_config)";
     } else {
         if ($tabView->m_URL) {
             $url = $tabView->m_URL;
         } else {
             $url = "javascript:Openbiz.Net.loadView('{$tabView->m_View}')";
         }
     }
     return $url;
 }