public function init()
 {
     parent::init();
     require_once _base_ . '/lib/lib.json.php';
     $this->db = DbConn::getInstance();
     $this->model = new GroupmanagementAdm();
     $this->json = new Services_JSON();
     $this->permissions = array('view' => checkPerm('view', true, 'groupmanagement'), 'add' => checkPerm('add', true, 'groupmanagement'), 'mod' => checkPerm('mod', true, 'groupmanagement'), 'del' => checkPerm('del', true, 'groupmanagement'), 'associate_user' => checkPerm('associate_user', true, 'groupmanagement'));
 }
Ejemplo n.º 2
0
 /**
  * function del
  * @param int $id contains the resource id
  * @param string $back_url contains the back url (not used yet)
  * @return false if fail, else return the id lo
  **/
 function del($id, $back_url = NULL)
 {
     checkPerm('view', false, 'storage');
     unset($_SESSION['last_error']);
     //finding quest
     $reQuest = sql_query("\r\n\t\tSELECT q.id_quest, q.type_quest, t.type_file, t.type_class \r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_pollquest AS q JOIN " . $GLOBALS['prefix_lms'] . "_quest_type_poll AS t \r\n\t\tWHERE q.id_poll = '" . $id . "' AND q.type_quest = t.type_quest");
     if (!mysql_num_rows($reQuest)) {
         return true;
     }
     //deleting answer
     while (list($id_quest, $type_quest, $type_file, $type_class) = sql_fetch_row($reQuest)) {
         require_once $GLOBALS['where_lms'] . '/modules/question_poll/' . $type_file;
         $quest_obj = eval("return new {$type_class}( {$id_quest} );");
         if (!$quest_obj->del()) {
             $_SESSION['last_error'] = Lang::t('_OPERATION_FAILURE');
             return false;
         }
     }
     if (!sql_query("DELETE FROM " . $GLOBALS['prefix_lms'] . "_polltrack WHERE id_poll = '" . $id . "'")) {
         $_SESSION['last_error'] = Lang::t('_OPERATION_FAILURE');
         return false;
     }
     if (!sql_query("DELETE FROM " . $GLOBALS['prefix_lms'] . "_pollquest WHERE id_poll = '" . $id . "'")) {
         $_SESSION['last_error'] = Lang::t('_OPERATION_FAILURE');
         return false;
     }
     if (!sql_query("DELETE FROM " . $GLOBALS['prefix_lms'] . "_poll WHERE id_poll = '" . $id . "'")) {
         $_SESSION['last_error'] = Lang::t('_OPERATION_FAILUREPOLL');
         return false;
     }
     return $id;
 }
Ejemplo n.º 3
0
function &create_activeTab(&$tv)
{
    switch ($tv->getActiveTab()) {
        case 'storage_home':
            if (checkPerm('home', true, 'storage')) {
                $repo = createModule('homerepo');
            }
            break;
        case 'storage_pubrepo':
            if (checkPerm('public', true, 'storage')) {
                $repo = createModule('pubrepo');
            }
            break;
        case 'storage_course':
        default:
            if (checkPerm('lesson', true, 'storage')) {
                $tv->setActiveTab('storage_course');
                $repo = createModule('organization');
            } elseif (checkPerm('home', true, 'storage')) {
                $tv->setActiveTab('storage_home');
                $repo = createModule('homerepo');
            } elseif (checkPerm('public', true, 'storage')) {
                $tv->setActiveTab('storage_pubrepo');
                $repo = createModule('pubrepo');
            } else {
                $tv->setActiveTab('storage_course');
                $repo = createModule('organization');
            }
            break;
    }
    return $repo;
}
Ejemplo n.º 4
0
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&amp;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&amp;op=select_permission', false, false, true);
    cout('</div>');
}
 public function init()
 {
     parent::init();
     $this->json = new Services_JSON();
     $this->model = new LocationAlms();
     $this->perm = array('view' => checkPerm('view', true, 'location', 'lms'), 'mod' => checkPerm('mod', true, 'location', 'lms'));
 }
 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;
 }
Ejemplo n.º 7
0
function drawCalendar()
{
    checkPerm('view');
    $size = importVar('size', false, 'max');
    $width = "90%";
    if ($size == "min") {
        $width = "200px";
    }
    addCss('calendar_' . $size);
    YuiLib::load('base,dragdrop');
    Util::get_js(Get::rel_path('lms') . '/modules/calendar/calendar.js', true, true);
    Util::get_js(Get::rel_path('lms') . '/modules/calendar/calendar_helper.js', true, true);
    //permissions = permissions granted to the logged user according to his/her level and role
    //	2 => can create/delete/modify all events
    //	1 => can create/delete/modify only own events
    //	0 => can view only
    $permissions = 0;
    if (checkPerm('mod', true)) {
        $permissions = 2;
    } elseif (checkPerm('personal', true)) {
        $permissions = 1;
    }
    //mode="edit" => events can be added and edited according to given permissions
    //mode="view" => events can only be viewed regardless the permissions
    $GLOBALS['page']->add('<script type="text/javascript">' . '	setup_cal(	null, ' . '\'lms\', ' . '\'lms\', ' . '\'edit\', ' . '\'' . $permissions . '\', ' . '\'' . Docebo::user()->getIdSt() . '\' ' . ');' . '</script>', 'page_head');
    $GLOBALS['page']->add("\n" . getTitleArea(Lang::t('_CALENDAR', 'calendar'), 'calendar') . '<div class="std_block">' . '<div id="displayCalendar" style="clear: both; width:' . $width . '"></div>' . '<div class="nofloat"></div>' . '</div>', 'content');
}
Ejemplo n.º 8
0
 public function init()
 {
     parent::init();
     $this->json = new Services_JSON();
     $this->model = new LangAdm();
     $this->perm = array('view' => checkPerm('view', true, 'lang', 'framework'), 'mod' => checkPerm('mod', true, 'lang', 'framework'));
 }
Ejemplo n.º 9
0
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&amp;op=showhtml&amp;saveok=1');
        } else {
            $error = true;
        }
    }
    $lang =& DoceboLanguage::createInstance('htmlfront', 'lms');
    list($textof) = sql_fetch_row($re_htmlfront);
    $title_page = array('index.php?modname=htmlfront&amp;op=showhtml' => $lang->def('_HTMLFRONT'), $lang->def('_MOD'));
    $GLOBALS['page']->add(getTitleArea($title_page, 'htmlfront') . '<div class="std_block">' . getBackUi('index.php?modname=htmlfront&amp;op=showhtml', $lang->def('_BACK')) . ($error ? getErrorUi($lang->def('_ERROR_IN_SAVE')) : '') . Form::openForm('formnotes', 'index.php?modname=htmlfront&amp;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');
}
Ejemplo n.º 10
0
 function uppage()
 {
     checkPerm('view', false, 'storage');
     $back_url = urldecode($_POST['back_url']);
     $insert_query = "\r\n\tUPDATE " . $GLOBALS['prefix_lms'] . "_htmlpage\r\n\tSET title = '" . (trim($_POST['title']) == '' ? Lang::t('_NOTITLE', 'htmlpage', 'lms') : $_POST['title']) . "',\r\n\t\ttextof = '" . $_POST['textof'] . "'\r\n\tWHERE idPage = '" . (int) $_POST['idPage'] . "'";
     if (!sql_query($insert_query)) {
         $_SESSION['last_error'] = Lang::t('_OPERATION_FAILURE', 'htmlpage', 'lms');
         Util::jump_to($back_url . '&mod_result=0');
     }
     if ($_FILES) {
         $n = 0;
         foreach ($_FILES as $_FILE) {
             $n++;
             $file = save_file($_FILE);
             if ($file) {
                 $insert_query = "INSERT INTO " . $GLOBALS['prefix_lms'] . "_htmlpage_attachment SET file = '" . $file . "', title = '" . trim($_FILE['name']) . "', idpage = " . (int) $_POST['idPage'];
                 sql_query($insert_query);
             }
         }
     }
     if ($_POST['iddelattachment'] != '') {
         $ids = explode(';', $_POST['iddelattachment']);
         foreach ($ids as $id) {
             if ($id) {
                 $query = "DELETE FROM learning_htmlpage_attachment WHERE id = " . $id;
                 mysql_query($query);
             }
         }
     }
     require_once $GLOBALS['where_lms'] . '/class.module/track.object.php';
     Track_Object::updateObjectTitle($_POST['idPage'], 'htmlpage', $_POST['title']);
     Util::jump_to($back_url . '&id_lo=' . $_POST['idPage'] . '&mod_result=1');
 }
Ejemplo n.º 11
0
function addquest(&$url)
{
    checkPerm('view', false, 'storage');
    $lang =& DoceboLanguage::createInstance('test');
    $type_quest = Get::pReq('add_test_quest', DOTY_STRING, 'choice');
    require_once _lms_ . '/modules/question/question.php';
    quest_create($type_quest, 0, $url->getUrl());
}
 public function init()
 {
     parent::init();
     require_once _base_ . '/lib/lib.json.php';
     $this->json = new Services_JSON();
     $this->model = new QuestcategoryAlms();
     $this->permissions = array('view' => checkPerm('view', true, 'questcategory', 'lms'), 'add' => true, 'mod' => checkPerm('mod', true, 'questcategory', 'lms'), 'del' => true);
 }
 public function init()
 {
     parent::init();
     require_once _base_ . '/lib/lib.json.php';
     $this->model = new CommunicationAlms();
     $this->json = new Services_JSON();
     $this->permissions = array('view' => checkPerm('view', true, 'communication', 'lms'), 'add' => checkPerm('mod', true, 'communication', 'lms'), 'mod' => checkPerm('mod', true, 'communication', 'lms'), 'del' => checkPerm('mod', true, 'communication', 'lms'), 'subscribe' => checkPerm('subscribe', true, 'course', 'lms'), 'add_category' => checkPerm('mod', true, 'communication', 'lms'), 'mod_category' => checkPerm('mod', true, 'communication', 'lms'), 'del_category' => checkPerm('mod', true, 'communication', 'lms'));
 }
 public function init()
 {
     parent::init();
     require_once _base_ . '/lib/lib.json.php';
     $this->json = new Services_JSON();
     $this->model = new FunctionalrolesAdm();
     $this->permissions = array('view' => checkPerm('view', true, 'functionalroles'), 'add' => checkPerm('mod', true, 'functionalroles'), 'mod' => checkPerm('mod', true, 'functionalroles'), 'del' => checkPerm('mod', true, 'functionalroles'), 'associate_user' => checkPerm('associate_user', true, 'functionalroles'));
 }
 public function init()
 {
     parent::init();
     require_once _base_ . '/lib/lib.json.php';
     $this->json = new Services_JSON();
     $this->model = new TimeperiodsAlms();
     $this->permissions = array('view' => checkPerm('view', true, 'timeperiods', 'lms'), 'add' => checkPerm('mod', true, 'timeperiods', 'lms'), 'mod' => checkPerm('mod', true, 'timeperiods', 'lms'), 'del' => checkPerm('mod', true, 'timeperiods', 'lms'));
 }
Ejemplo n.º 16
0
 public function init()
 {
     parent::init();
     require_once _base_ . '/lib/lib.json.php';
     //Util::get_css();
     $this->model = new KbAlms();
     $this->json = new Services_JSON();
     $this->permissions = array('view' => checkPerm('view', true, 'kb'), 'add' => checkPerm('mod', true, 'kb'), 'mod' => checkPerm('mod', true, 'kb'), 'del' => checkPerm('mod', true, 'kb'));
 }
 public function init()
 {
     parent::init();
     require_once _base_ . '/lib/lib.json.php';
     $this->db = DbConn::getInstance();
     $this->model = new PrivacypolicyAdm();
     $this->json = new Services_JSON();
     $this->permissions = array('view' => checkPerm('view', true, 'privacypolicy'), 'add' => checkPerm('mod', true, 'privacypolicy'), 'mod' => checkPerm('mod', true, 'privacypolicy'), 'del' => checkPerm('del', true, 'privacypolicy'));
 }
 public function init()
 {
     parent::init();
     require_once _base_ . '/lib/lib.json.php';
     $this->model = new AdminmanagerAdm();
     $this->json = new Services_JSON();
     $this->acl_man =& Docebo::user()->getAclManager();
     $this->permissions = array('view' => checkPerm('view', true, 'adminmanager'), 'assign_profile' => checkPerm('mod', true, 'adminmanager'), 'assign_users' => checkPerm('mod', true, 'adminmanager'), 'assign_courses' => checkPerm('mod', true, 'adminmanager'));
 }
Ejemplo n.º 19
0
 public function init()
 {
     parent::init();
     if (!defined("CORE")) {
         checkRole('/framework/admin/' . $this->_mvc_name . '/view', false);
     } else {
         checkPerm('view', false, $this->_mvc_name, 'framework');
     }
 }
Ejemplo n.º 20
0
 public function init()
 {
     parent::init();
     require_once _base_ . '/lib/lib.json.php';
     $this->json = new Services_JSON();
     $this->acl_man =& Docebo::user()->getAclManager();
     $this->model = new LabelAlms();
     $this->permissions = array('view' => checkPerm('view', true, 'label', 'lms'), 'add' => true, 'mod' => true, 'del' => true);
 }
 public function init()
 {
     parent::init();
     require_once _base_ . '/lib/lib.json.php';
     $this->json = new Services_JSON();
     $this->model = new CompetencesAdm();
     $this->base_link_course = 'alms/course';
     $this->base_link_competence = 'adm/competences';
     $this->permissions = array('view' => checkPerm('view', true, 'competences'), 'add' => checkPerm('mod', true, 'competences'), 'mod' => checkPerm('mod', true, 'competences'), 'del' => checkPerm('mod', true, 'competences'), 'associate_user' => checkPerm('associate_user', true, 'competences'));
 }
 public function init()
 {
     require_once _base_ . '/lib/lib.json.php';
     $this->model = new UsermanagementAdm();
     $this->json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
     $this->numVarFields = 3;
     $this->sessionPrefix = 'pusermanagement';
     $this->permissions = array('view' => checkPerm('view', true, 'pusermanagement', 'lms'), 'view_user' => checkPerm('view', true, 'pusermanagement', 'lms'), 'add_user' => checkPerm('add', true, 'pusermanagement', 'lms'), 'mod_user' => checkPerm('mod', true, 'pusermanagement', 'lms'), 'del_user' => checkPerm('del', true, 'pusermanagement', 'lms'), 'approve_waiting_user' => checkPerm('approve_waiting_user', true, 'pusermanagement', 'lms'), 'view_org' => checkPerm('view', true, 'pusermanagement', 'lms'), 'add_org' => false, 'mod_org' => false, 'del_org' => false, 'associate_user' => checkPerm('mod', true, 'pusermanagement', 'lms'));
     $this->_mvc_name = 'usermanagement';
 }
Ejemplo n.º 23
0
/**
 * @param 	int $idMain if passed return the first voice of the relative menu
 *
 * @return 	array 	with three element modulename and op that contains the first accessible menu element 
 *					indicate in idMain  array( [idMain], [modulename], [op] )
 **/
function firstPage($idMain = false)
{
    $query_main = "\r\n\tSELECT module.idModule, main.idMain, module.module_name, module.default_op, module.token_associated \r\n\tFROM ( " . $GLOBALS['prefix_lms'] . "_menucourse_main AS main JOIN\r\n\t\t" . $GLOBALS['prefix_lms'] . "_menucourse_under AS un ) JOIN\r\n\t\t" . $GLOBALS['prefix_lms'] . "_module AS module\r\n\tWHERE main.idMain = un.idMain AND un.idModule = module.idModule \r\n\t\tAND main.idCourse = '" . (int) $_SESSION['idCourse'] . "'\r\n\t\tAND un.idCourse = '" . (int) $_SESSION['idCourse'] . "'\r\n\t\t" . ($idMain !== false ? " AND main.idMain='" . $idMain . "' " : '') . "\r\n\tORDER BY main.sequence, un.sequence";
    $re_main = sql_query($query_main);
    while (list($id_module, $main, $module_name, $default_op, $token) = sql_fetch_row($re_main)) {
        if (checkPerm($token, true, $module_name)) {
            return array('idModule' => $id_module, 'idMain' => $main, 'modulename' => $module_name, 'op' => $default_op);
        }
    }
}
 public function init()
 {
     checkPerm('mod', false, 'pcourse', 'lms');
     require_once _base_ . '/lib/lib.json.php';
     $this->json = new Services_JSON();
     $this->model = new CompetencesAdm();
     $this->base_link_course = 'lms/pcourse';
     $this->base_link_competence = 'lms/pcompetences';
     $this->permissions = array('view' => checkPerm('mod', true, 'pcourse'), 'add' => false, 'mod' => false, 'del' => false, 'associate_user' => false);
     $this->_mvc_name = 'competences';
 }
Ejemplo n.º 25
0
 /**
  * function del
  * @param int $id contains the resource id
  * @param string $back_url contains the back url (not used yet)
  * @return false if fail, else return the id lo
  **/
 function del($id, $back_url = NULL)
 {
     checkPerm('view', false, 'storage');
     if (!sql_query("\r\n\t\tDELETE FROM " . $GLOBALS['prefix_lms'] . "_link \r\n\t\tWHERE idCategory = '" . $id . "'")) {
         return false;
     }
     if (!sql_query("\r\n\t\tDELETE FROM " . $GLOBALS['prefix_lms'] . "_link_cat \r\n\t\tWHERE idCategory = '" . $id . "'")) {
         return false;
     }
     return $id;
 }
Ejemplo n.º 26
0
 public function init()
 {
     checkPerm('view', false, 'course', 'lms');
     require_once _base_ . '/lib/lib.json.php';
     $this->json = new Services_JSON();
     $this->acl_man =& Docebo::user()->getAclManager();
     $this->base_link_course = 'alms/course';
     $this->base_link_edition = 'alms/edition';
     $this->base_link_subscription = 'alms/subscription';
     $this->permissions = array('view' => checkPerm('view', true, 'course', 'lms'), 'add' => checkPerm('add', true, 'course', 'lms'), 'mod' => checkPerm('mod', true, 'course', 'lms'), 'del' => checkPerm('del', true, 'course', 'lms'), 'moderate' => checkPerm('moderate', true, 'course', 'lms'), 'subscribe' => checkPerm('subscribe', true, 'course', 'lms'));
 }
Ejemplo n.º 27
0
 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>';
     }
 }
Ejemplo n.º 28
0
 /**
  * @return	mixed	a list of the first level menu
  *					[id] (	[link]
  *							[image]
  *						 	[name]  )
  * @access public
  */
 function getLevelOne()
 {
     $lang =& DoceboLanguage::createInstance('menu', $this->platform);
     $query_under = "\r\n\t\tSELECT tab.idMenu, menu.module_name, menu.associated_token, tab.name, tab.image, tab.collapse, menu.of_platform\r\n\t\tFROM " . $this->table_level_one . " AS tab JOIN " . $this->table_level_two . " AS menu\r\n\t\tWHERE tab.idMenu = menu.idMenu\r\n\t\tORDER BY tab.sequence";
     $re_under = sql_query($query_under);
     $menu = array();
     while (list($id_main, $module_name, $token, $name, $image, $collapse, $of_platform) = sql_fetch_row($re_under)) {
         if (!isset($menu[$id_main]) && checkPerm($token, true, $module_name, $of_platform === NULL ? $this->platform : $of_platform)) {
             $menu[$id_main] = array('link' => 'index.php?op=change_main&new_main=' . $id_main . '&of_platform=' . ($of_platform === NULL ? $this->platform : $of_platform), 'name' => $name != '' ? $lang->def($name) : '', 'image' => 'area_title/' . $image, 'collapse' => $collapse == 'true' ? true : false, 'of_platform' => $of_platform === NULL ? $this->platform : $of_platform);
         }
     }
     return $menu;
 }
Ejemplo n.º 29
0
 /**
  * function del
  * @param int $id contains the resource id
  * @param string $back_url contains the back url (not used yet)
  * @return false if fail, else return the id lo
  **/
 function del($id, $back_url = NULL)
 {
     checkPerm('view', false, 'storage');
     unset($_SESSION['last_error']);
     if (!sql_query("DELETE FROM " . $GLOBALS['prefix_lms'] . "_glossaryterm WHERE idGlossary='" . $id . "'")) {
         $_SESSION['last_error'] = _OPERATION_FAILURE;
         return false;
     } elseif (!sql_query("DELETE FROM " . $GLOBALS['prefix_lms'] . "_glossary WHERE idGlossary = '" . (int) $id . "'")) {
         $_SESSION['last_error'] = _OPERATION_FAILURE;
         return false;
     }
     return $id;
 }
Ejemplo n.º 30
0
function field_del($type_field, $id_common, $back)
{
    checkPerm('del', false, 'field_manager');
    $re_quest = sql_query("\r\n\tSELECT type_file, type_class \r\n\tFROM " . $GLOBALS['prefix_fw'] . "_field_type \r\n\tWHERE type_field = '" . $type_field . "'");
    if (!mysql_num_rows($re_quest)) {
        return;
    }
    list($type_file, $type_class) = sql_fetch_row($re_quest);
    require_once $GLOBALS['where_framework'] . '/modules/field/' . $type_file;
    $quest_obj = new $type_class($id_common);
    $quest_obj->setUrl('index.php?modname=field&amp;op=manage&amp;fo=del');
    $quest_obj->del($back);
}