当前位置: 首页>>代码示例>>PHP>>正文


PHP api_is_global_platform_admin函数代码示例

本文整理汇总了PHP中api_is_global_platform_admin函数的典型用法代码示例。如果您正苦于以下问题:PHP api_is_global_platform_admin函数的具体用法?PHP api_is_global_platform_admin怎么用?PHP api_is_global_platform_admin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了api_is_global_platform_admin函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_lang

$blocks['sessions']['items'] = $items;
$blocks['sessions']['extra'] = null;
/* Settings */
if (api_is_platform_admin()) {
    $blocks['settings']['icon'] = Display::return_icon('settings.png', get_lang('System'), array(), ICON_SIZE_MEDIUM, false);
    $blocks['settings']['label'] = api_ucfirst(get_lang('System'));
    $blocks['settings']['class'] = 'block-admin-settings';
    $items = array();
    $items[] = array('url' => 'special_exports.php', 'label' => get_lang('SpecialExports'));
    $items[] = array('url' => 'system_status.php', 'label' => get_lang('SystemStatus'));
    if (is_dir(api_get_path(SYS_TEST_PATH) . 'datafiller/')) {
        $items[] = array('url' => 'filler.php', 'label' => get_lang('DataFiller'));
    }
    $items[] = array('url' => 'archive_cleanup.php', 'label' => get_lang('ArchiveDirCleanup'));
    $items[] = array('url' => 'resource_sequence.php', 'label' => get_lang('ResourcesSequencing'));
    if (isset($_configuration['db_manager_enabled']) && $_configuration['db_manager_enabled'] == true && api_is_global_platform_admin()) {
        $host = $_configuration['db_host'];
        $username = $_configuration['db_user'];
        $databaseName = $_configuration['main_database'];
        $items[] = array('url' => "db.php?username={$username}&db={$databaseName}&server={$host}", 'label' => get_lang('Database Manager'));
    }
    $blocks['settings']['items'] = $items;
    $blocks['settings']['extra'] = null;
    $blocks['settings']['search_form'] = null;
    // Skills
    if (api_get_setting('allow_skills_tool') == 'true') {
        $blocks['skills']['icon'] = Display::return_icon('logo.png', get_lang('Skills'), array(), ICON_SIZE_MEDIUM, false);
        $blocks['skills']['label'] = get_lang('Skills');
        $blocks['skills']['class'] = 'block-admin-skills';
        $items = array();
        //$items[] = array('url'=>'skills.php',           'label' => get_lang('SkillsTree'));
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:index.php

示例2: modify_filter

/**
 * Build the modify-column of the table
 * @param int $user_id The user id
 * @return string Some HTML-code
 */
function modify_filter($user_id)
{
    global $origin, $_course, $is_allowed_to_track, $charset, $course_info;
    $current_user_id = api_get_user_id();
    $result = "";
    if ($is_allowed_to_track) {
        $result .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'mySpace/myStudents.php?' . api_get_cidreq() . '&student=' . $user_id . '&amp;details=true&amp;course=' . $_course['id'] . '&amp;origin=user_course&amp;id_session=' . api_get_session_id() . '" title="' . get_lang('Tracking') . '"  >
		' . Display::return_icon('stats.png', get_lang('Tracking')) . '</a>';
    }
    //if platform admin, show the login_as icon (this drastically shortens
    // time taken by support to test things out)
    if (api_is_platform_admin()) {
        // If not forbidden globally
        if (empty($_configuration['login_as_forbidden_globally'])) {
            // If global admin, authorize, otherwise check db setting allows it
            if (api_is_global_platform_admin() or api_get_setting('login_as_allowed') === 'true') {
                $result .= ' <a href="' . api_get_path(WEB_CODE_PATH) . 'admin/user_list.php?action=login_as&amp;user_id=' . $user_id . '&amp;sec_token=' . $_SESSION['sec_token'] . '">' . Display::return_icon('login_as.gif', get_lang('LoginAs')) . '</a>&nbsp;&nbsp;';
            }
        }
    }
    if (api_is_allowed_to_edit(null, true)) {
        // edit
        $result .= '<a href="userInfo.php?' . api_get_cidreq() . '&origin=' . $origin . '&amp;editMainUserInfo=' . $user_id . '" title="' . get_lang('Edit') . '" >' . Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . '</a>&nbsp;';
        if (api_get_setting('allow_user_course_subscription_by_course_admin') == 'true' or api_is_platform_admin()) {
            // unregister
            if ($user_id != $current_user_id) {
                $result .= '<a class="btn btn-small btn-danger" href="' . api_get_self() . '?' . api_get_cidreq() . '&unregister=yes&amp;user_id=' . $user_id . '" title="' . get_lang('Unreg') . ' " onclick="javascript:if(!confirm(\'' . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)) . '\')) return false;">' . get_lang('Unreg') . '</a>&nbsp;';
            } else {
                //$result .= Display::return_icon('unsubscribe_course_na.png', get_lang('Unreg'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
            }
        }
    } else {
        //Show buttons for unsubscribe
        if ($course_info['unsubscribe'] == 1) {
            if ($user_id == $current_user_id) {
                $result .= '<a class="btn btn-small btn-danger" href="' . api_get_self() . '?' . api_get_cidreq() . '&unregister=yes&amp;user_id=' . $user_id . '" title="' . get_lang('Unreg') . ' " onclick="javascript:if(!confirm(\'' . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)) . '\')) return false;">' . get_lang('Unreg') . '</a>&nbsp;';
            }
        }
    }
    return $result;
}
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:46,代码来源:user.php

示例3: api_protect_admin_script

<?php

/* For licensing terms, see /license.txt */
/**
 * Responses to AJAX calls
 */
//require_once '../global.inc.php';
\Chamilo\CoreBundle\Framework\Container::$legacyTemplate = 'layout_empty.html.twig';
api_protect_admin_script();
$action = isset($_REQUEST['a']) ? $_REQUEST['a'] : null;
switch ($action) {
    case 'update_changeable_setting':
        $url_id = api_get_current_access_url_id();
        if (api_is_global_platform_admin() && $url_id == 1) {
            if (isset($_GET['id']) && !empty($_GET['id'])) {
                $params = array('variable = ? ' => array($_GET['id']));
                $data = api_get_settings_params($params);
                if (!empty($data)) {
                    foreach ($data as $item) {
                        $params = array('id' => $item['id'], 'access_url_changeable' => $_GET['changeable']);
                        api_set_setting_simple($params);
                    }
                }
                echo '1';
            }
        }
        break;
    case 'version':
        echo version_check();
        break;
    case 'get_extra_content':
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:admin.ajax.php

示例4: api_protect_global_admin_script

/**
 * Function used to protect a global admin script.
 * The function blocks access when the user has no global platform admin rights.
 * See also the api_is_global_platform_admin() function wich defines who's a "global" admin
 *
 * @author Julio Montoya
 */
function api_protect_global_admin_script()
{
    if (!api_is_global_platform_admin()) {
        api_not_allowed();
        return false;
    }
    return true;
}
开发者ID:feroli1000,项目名称:chamilo-lms,代码行数:15,代码来源:api.lib.php

示例5: generate_settings_form

 $form = generate_settings_form($settings, $settings_by_access_list);
 $message = array();
 if ($form->validate()) {
     $values = $form->exportValues();
     $mark_all = false;
     $un_mark_all = false;
     if (api_is_multiple_url_enabled()) {
         if (isset($values['buttons_in_action_right']) && isset($values['buttons_in_action_right']['mark_all'])) {
             $mark_all = true;
         }
         if (isset($values['buttons_in_action_right']) && isset($values['buttons_in_action_right']['unmark_all'])) {
             $un_mark_all = true;
         }
     }
     if ($mark_all || $un_mark_all) {
         if (api_is_global_platform_admin()) {
             $locked_settings = api_get_locked_settings();
             foreach ($values as $key => $value) {
                 if (!in_array($key, $locked_settings)) {
                     $changeable = 0;
                     if ($mark_all) {
                         $changeable = 1;
                     }
                     $params = array('variable = ?' => array($key));
                     $data = api_get_settings_params($params);
                     if (!empty($data)) {
                         foreach ($data as $item) {
                             $params = array('id' => $item['id'], 'access_url_changeable' => $changeable);
                             api_set_setting_simple($params);
                         }
                     }
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:settings.php

示例6: modify_filter

/**
 * Build the modify-column of the table
 * @param   int     The user id
 * @param   string  URL params to add to table links
 * @param   array   Row of elements to alter
 * @return string Some HTML-code with modify-buttons
 */
function modify_filter($user_id, $url_params, $row)
{
    global $_admins_list, $delete_user_available, $app;
    $is_admin = false;
    $userId = api_get_user_id();
    if (is_array($_admins_list)) {
        $is_admin = in_array($user_id, $_admins_list);
    }
    $statusname = api_get_status_langvars();
    $user_is_anonymous = false;
    $current_user_status_label = $row['7'];
    if ($current_user_status_label == $statusname[ANONYMOUS]) {
        $user_is_anonymous = true;
    }
    $result = '';
    if (!$user_is_anonymous) {
        $icon = Display::return_icon('course.png', get_lang('Courses'), array('onmouseout' => 'clear_course_list (\'div_' . $user_id . '\')'));
        $result .= '<a href="javascript:void(0)" onclick="load_course_list(\'div_' . $user_id . '\',' . $user_id . ')" >
			        ' . $icon . '
					<div class="blackboard_hide" id="div_' . $user_id . '">&nbsp;&nbsp;</div>
					</a>';
        $icon = Display::return_icon('session.png', get_lang('Sessions'), array('onmouseout' => 'clear_session_list (\'div_s_' . $user_id . '\')'));
        $result .= '<a href="javascript:void(0)" onclick="load_session_list(\'div_s_' . $user_id . '\',' . $user_id . ')" >
					' . $icon . '
					<div class="blackboard_hide" id="div_s_' . $user_id . '">&nbsp;&nbsp;</div>
					</a>';
    } else {
        $result .= Display::return_icon('course_na.png', get_lang('Courses')) . '&nbsp;&nbsp;';
        $result .= Display::return_icon('course_na.png', get_lang('Sessions')) . '&nbsp;&nbsp;';
    }
    if (api_is_platform_admin()) {
        if (!$user_is_anonymous) {
            $result .= '<a href="user_information.php?user_id=' . $user_id . '">' . Display::return_icon('synthese_view.gif', get_lang('Info')) . '</a>&nbsp;&nbsp;';
        } else {
            $result .= Display::return_icon('synthese_view_na.gif', get_lang('Info')) . '&nbsp;&nbsp;';
        }
    }
    //only allow platform admins to login_as, or session admins only for
    // students (not teachers nor other admins), and only if all options
    // match to say this user has the permission to do so
    // $_configuration['login_as_forbidden_globally'], defined in
    // configuration.php, is the master key to these conditions
    global $_configuration;
    if (empty($_configuration['login_as_forbidden_globally']) && (api_is_global_platform_admin() || api_get_setting('login_as_allowed') === 'true' && (api_is_platform_admin() || api_is_session_admin() && $current_user_status_label == $statusname[STUDENT]))) {
        if (!$user_is_anonymous) {
            if ($app['security']->isGranted('ROLE_GLOBAL_ADMIN')) {
                // everything looks good, show "login as" link
                if ($user_id != $userId) {
                    $result .= '<a href="' . api_get_path(WEB_PUBLIC_PATH) . '?_switch_user=' . $row[5] . '">' . Display::return_icon('login_as.gif', get_lang('LoginAs')) . '</a>&nbsp;&nbsp;';
                } else {
                    $result .= Display::return_icon('login_as_na.gif', get_lang('LoginAs')) . '&nbsp;&nbsp;';
                }
            } else {
                // if this user in particular can't be edited, show disabled
                $result .= Display::return_icon('login_as_na.gif', get_lang('LoginAs')) . '&nbsp;&nbsp;';
            }
        } else {
            // if anonymous user but other users show the option, show disabled
            $result .= Display::return_icon('login_as_na.gif', get_lang('LoginAs')) . '&nbsp;&nbsp;';
        }
    }
    // Else don't show anything, because the option is not available at all
    //$result .= Display::url('<i class="icon-key icon-large"></i>', 'roles');
    if ($current_user_status_label != $statusname[STUDENT]) {
        $result .= Display::return_icon('statistics_na.gif', get_lang('Reporting')) . '&nbsp;&nbsp;';
    } else {
        $result .= '<a href="../mySpace/myStudents.php?student=' . $user_id . '">' . Display::return_icon('statistics.gif', get_lang('Reporting')) . '</a>&nbsp;&nbsp;';
    }
    if (api_is_platform_admin(true)) {
        if (!$user_is_anonymous && api_global_admin_can_edit_admin($user_id, null, true)) {
            $result .= '<a href="user_edit.php?user_id=' . $user_id . '">' . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>&nbsp;';
        } else {
            $result .= Display::return_icon('edit_na.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>&nbsp;';
        }
    }
    if ($is_admin) {
        $result .= Display::return_icon('admin_star.png', get_lang('IsAdministrator'), array('width' => ICON_SIZE_SMALL, 'heigth' => ICON_SIZE_SMALL));
    } else {
        $result .= Display::return_icon('admin_star_na.png', get_lang('IsNotAdministrator'));
    }
    // actions for assigning sessions, courses or users
    if (api_is_session_admin()) {
        /*if ($row[0] == api_get_user_id()) {
        			$result .= '<a href="dashboard_add_sessions_to_user.php?user='.$user_id.'">'.Display::return_icon('view_more_stats.gif', get_lang('AssignSessions')).'</a>&nbsp;&nbsp;';
        		}*/
    } else {
        if ($current_user_status_label == $statusname[DRH] || UserManager::is_admin($user_id)) {
            $result .= '<a href="dashboard_add_users_to_user.php?user=' . $user_id . '">' . Display::return_icon('user_subscribe_course.png', get_lang('AssignUsers'), '', ICON_SIZE_SMALL) . '</a>';
            $result .= '<a href="dashboard_add_courses_to_user.php?user=' . $user_id . '">' . Display::return_icon('course_add.gif', get_lang('AssignCourses')) . '</a>&nbsp;&nbsp;';
            $result .= '<a href="dashboard_add_sessions_to_user.php?user=' . $user_id . '">' . Display::return_icon('view_more_stats.gif', get_lang('AssignSessions')) . '</a>&nbsp;&nbsp;';
        } else {
            if ($current_user_status_label == $statusname[SESSIONADMIN]) {
                $result .= '<a href="dashboard_add_sessions_to_user.php?user=' . $user_id . '">' . Display::return_icon('view_more_stats.gif', get_lang('AssignSessions')) . '</a>&nbsp;&nbsp;';
//.........这里部分代码省略.........
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:101,代码来源:user_list.php

示例7: generate_settings_form

function generate_settings_form($settings, $settings_by_access_list)
{
    global $_configuration, $settings_to_avoid, $convert_byte_to_mega_list;
    $table_settings_current = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
    $form = new FormValidator('settings', 'post', 'settings.php?category=' . Security::remove_XSS($_GET['category']));
    $form->addElement('hidden', 'search_field', !empty($_GET['search_field']) ? Security::remove_XSS($_GET['search_field']) : null);
    $url_id = api_get_current_access_url_id();
    if (!empty($_configuration['multiple_access_urls']) && api_is_global_platform_admin() && $url_id == 1) {
        $group = array();
        $group[] = $form->createElement('button', 'mark_all', get_lang('MarkAll'));
        $group[] = $form->createElement('button', 'unmark_all', get_lang('UnmarkAll'));
        $form->addGroup($group, 'buttons_in_action_right');
    }
    $default_values = array();
    $url_info = api_get_access_url($url_id);
    $i = 0;
    foreach ($settings as $row) {
        if (in_array($row['variable'], array_keys($settings_to_avoid))) {
            continue;
        }
        if (!empty($_configuration['multiple_access_urls'])) {
            if (api_is_global_platform_admin()) {
                if ($row['access_url_locked'] == 0) {
                    if ($url_id == 1) {
                        if ($row['access_url_changeable'] == '1') {
                            $form->addElement('html', '<div style="float: right;"><a class="share_this_setting" data_status = "0"  data_to_send = "' . $row['variable'] . '" href="javascript:void(0);">' . Display::return_icon('shared_setting.png', get_lang('ChangeSharedSetting')) . '</a></div>');
                        } else {
                            $form->addElement('html', '<div style="float: right;"><a class="share_this_setting" data_status = "1" data_to_send = "' . $row['variable'] . '" href="javascript:void(0);">' . Display::return_icon('shared_setting_na.png', get_lang('ChangeSharedSetting')) . '</a></div>');
                        }
                    } else {
                        if ($row['access_url_changeable'] == '1') {
                            $form->addElement('html', '<div style="float: right;">' . Display::return_icon('shared_setting.png', get_lang('ChangeSharedSetting')) . '</div>');
                        } else {
                            $form->addElement('html', '<div style="float: right;">' . Display::return_icon('shared_setting_na.png', get_lang('ChangeSharedSetting')) . '</div>');
                        }
                    }
                }
            }
        }
        $hideme = array();
        $hide_element = false;
        if ($_configuration['access_url'] != 1) {
            if ($row['access_url_changeable'] == 0) {
                // We hide the element in other cases (checkbox, radiobutton) we 'freeze' the element.
                $hide_element = true;
                $hideme = array('disabled');
            } elseif ($url_info['active'] == 1) {
                // We show the elements.
                if (empty($row['variable'])) {
                    $row['variable'] = 0;
                }
                if (empty($row['subkey'])) {
                    $row['subkey'] = 0;
                }
                if (empty($row['category'])) {
                    $row['category'] = 0;
                }
                if (is_array($settings_by_access_list[$row['variable']][$row['subkey']][$row['category']])) {
                    // We are sure that the other site have a selected value.
                    if ($settings_by_access_list[$row['variable']][$row['subkey']][$row['category']]['selected_value'] != '') {
                        $row['selected_value'] = $settings_by_access_list[$row['variable']][$row['subkey']][$row['category']]['selected_value'];
                    }
                }
                // There is no else{} statement because we load the default $row['selected_value'] of the main Chamilo site.
            }
        }
        switch ($row['type']) {
            case 'textfield':
                if (in_array($row['variable'], $convert_byte_to_mega_list)) {
                    $form->addElement('text', $row['variable'], array(get_lang($row['title']), get_lang($row['comment']), get_lang('MB')), array('maxlength' => '8'));
                    $form->applyFilter($row['variable'], 'html_filter');
                    $default_values[$row['variable']] = round($row['selected_value'] / 1024 / 1024, 1);
                } elseif ($row['variable'] == 'account_valid_duration') {
                    $form->addElement('text', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])), array('maxlength' => '5'));
                    $form->applyFilter($row['variable'], 'html_filter');
                    $default_values[$row['variable']] = $row['selected_value'];
                    // For platform character set selection: Conversion of the textfield to a select box with valid values.
                } elseif ($row['variable'] == 'platform_charset') {
                    continue;
                } else {
                    $hideme['class'] = 'col-md-4';
                    $form->addElement('text', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])), $hideme);
                    $form->applyFilter($row['variable'], 'html_filter');
                    $default_values[$row['variable']] = $row['selected_value'];
                }
                break;
            case 'textarea':
                if ($row['variable'] == 'header_extra_content') {
                    $file = api_get_path(SYS_PATH) . api_get_home_path() . 'header_extra_content.txt';
                    $value = '';
                    if (file_exists($file)) {
                        $value = file_get_contents($file);
                    }
                    $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])), array('rows' => '10'), $hideme);
                    $default_values[$row['variable']] = $value;
                } elseif ($row['variable'] == 'footer_extra_content') {
                    $file = api_get_path(SYS_PATH) . api_get_home_path() . 'footer_extra_content.txt';
                    $value = '';
                    if (file_exists($file)) {
                        $value = file_get_contents($file);
//.........这里部分代码省略.........
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:101,代码来源:settings.lib.php

示例8: api_get_status_langvars

            if (CourseManager::get_user_in_course_status($_GET['user_id'], $_GET['courseId']) == STUDENT) {
                CourseManager::unsubscribe_user($_GET['user_id'], $_GET['courseId']);
                Display::display_normal_message(get_lang('UserUnsubscribed'));
            } else {
                Display::display_error_message(get_lang('CannotUnsubscribeUserFromCourse'));
            }
            break;
    }
}
//only allow platform admins to login_as, or session admins only for students
// (not teachers nor other admins), and only if all options confirm it
// $_configuration['login_as_forbidden_globally'], defined in configuration.php,
// is the master key to these conditions
$statusname = api_get_status_langvars();
$login_as_icon = '';
if (empty($_configuration['login_as_forbidden_globally']) && (api_is_global_platform_admin() || api_get_setting('login_as_allowed') === 'true' && (api_is_platform_admin() || api_is_session_admin() && (api_is_session_admin() && $row['6'] == $statusname[STUDENT])))) {
    $login_as_icon = '<a href="' . api_get_path(WEB_CODE_PATH) . 'admin/user_list.php?action=login_as&amp;user_id=' . $user['user_id'] . '&amp;sec_token=' . $_SESSION['sec_token'] . '">' . Display::return_icon('login_as.gif', get_lang('LoginAs')) . '</a>';
}
echo '<div class="actions"><a href="' . api_get_path(WEB_CODE_PATH) . 'mySpace/myStudents.php?student=' . intval($_GET['user_id']) . '" title="' . get_lang('Reporting') . '">' . Display::return_icon('statistics.png', get_lang('Reporting'), '', ICON_SIZE_MEDIUM) . '</a>' . $login_as_icon . '</div>';
echo Display::page_header($tool_name);
//getting the user image
$sysdir_array = UserManager::get_user_picture_path_by_id($user['user_id'], 'system', false, true);
$sysdir = $sysdir_array['dir'];
$webdir_array = UserManager::get_user_picture_path_by_id($user['user_id'], 'web', false, true);
$webdir = $webdir_array['dir'];
$fullurl = $webdir . $webdir_array['file'];
$system_image_path = $sysdir . $webdir_array['file'];
list($width, $height, $type, $attr) = @getimagesize($system_image_path);
$resizing = $height > 200 ? 'height="200"' : '';
$height += 30;
$width += 30;
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:user_information.php

示例9: loadAdminMenu

 /**
  * Move in template.lib
  */
 private function loadAdminMenu()
 {
     $template = $this->get('template');
     // Access restrictions.
     api_protect_admin_script(true);
     // @todo fix register/check version
     $message = null;
     if (!empty($_POST['Register'])) {
         register_site();
         $message = \Display::return_message(get_lang('VersionCheckEnabled'), 'confirmation');
     }
     $blocks = array();
     $adminUrl = api_get_path(WEB_CODE_PATH) . 'admin/';
     /* Users */
     $blocks['users']['icon'] = \Display::return_icon('members.gif', get_lang('Users'), array(), ICON_SIZE_SMALL, false);
     $blocks['users']['label'] = api_ucfirst(get_lang('Users'));
     if (api_is_platform_admin()) {
         $search_form = $this->getSearchForm($adminUrl . 'user_list.php')->return_form();
         $blocks['users']['search_form'] = $search_form;
         $items = array(array('url' => $adminUrl . 'user_list.php', 'label' => get_lang('UserList')), array('url' => $adminUrl . 'user_add.php', 'label' => get_lang('AddUsers')), array('url' => $adminUrl . 'user_export.php', 'label' => get_lang('ExportUserListXMLCSV')), array('url' => $adminUrl . 'user_import.php', 'label' => get_lang('ImportUserListXMLCSV')));
         if (isset($extAuthSource) && isset($extAuthSource['ldap']) && count($extAuthSource['ldap']) > 0) {
             $items[] = array('url' => $adminUrl . 'ldap_users_list.php', 'label' => get_lang('ImportLDAPUsersIntoPlatform'));
         }
         $items[] = array('url' => $adminUrl . 'extra_fields.php?type=user', 'label' => get_lang('ManageUserFields'));
         $items[] = array('url' => api_get_path(WEB_PUBLIC_PATH) . 'admin/administrator/roles', 'label' => get_lang('Roles'));
     } else {
         $items = array(array('url' => $adminUrl . 'user_list.php', 'label' => get_lang('UserList')), array('url' => $adminUrl . 'user_add.php', 'label' => get_lang('AddUsers')), array('url' => $adminUrl . 'user_import.php', 'label' => get_lang('ImportUserListXMLCSV')));
     }
     $blocks['users']['items'] = $items;
     $blocks['users']['extra'] = null;
     if (api_is_platform_admin()) {
         /* Courses */
         $blocks['courses']['icon'] = \Display::return_icon('course.gif', get_lang('Courses'), array(), ICON_SIZE_MEDIUM, false);
         $blocks['courses']['label'] = api_ucfirst(get_lang('Courses'));
         $search_form = $this->getSearchForm($adminUrl . 'course_list.php')->return_form();
         $blocks['courses']['search_form'] = $search_form;
         $items = array();
         $items[] = array('url' => $adminUrl . 'course_list.php', 'label' => get_lang('CourseList'));
         if (api_get_setting('course_validation') != 'true') {
             $items[] = array('url' => $adminUrl . 'course_add.php', 'label' => get_lang('AddCourse'));
         } else {
             $items[] = array('url' => $adminUrl . 'course_request_review.php', 'label' => get_lang('ReviewCourseRequests'));
             $items[] = array('url' => $adminUrl . 'course_request_accepted.php', 'label' => get_lang('AcceptedCourseRequests'));
             $items[] = array('url' => $adminUrl . 'course_request_rejected.php', 'label' => get_lang('RejectedCourseRequests'));
         }
         $items[] = array('url' => $adminUrl . 'course_export.php', 'label' => get_lang('ExportCourses'));
         $items[] = array('url' => $adminUrl . 'course_import.php', 'label' => get_lang('ImportCourses'));
         $items[] = array('url' => $adminUrl . 'course_category.php', 'label' => get_lang('AdminCategories'));
         $items[] = array('url' => $adminUrl . 'subscribe_user2course.php', 'label' => get_lang('AddUsersToACourse'));
         $items[] = array('url' => $adminUrl . 'course_user_import.php', 'label' => get_lang('ImportUsersToACourse'));
         $items[] = array('url' => $adminUrl . 'extra_fields.php?type=course', 'label' => get_lang('ManageCourseFields'));
         $items[] = array('url' => $adminUrl . 'extra_fields.php?type=question', 'label' => get_lang('ManageQuestionFields'));
         if (api_get_setting('gradebook_enable_grade_model') == 'true') {
             $items[] = array('url' => $adminUrl . 'grade_models.php', 'label' => get_lang('GradeModel'));
         }
         if (isset($extAuthSource) && isset($extAuthSource['ldap']) && count($extAuthSource['ldap']) > 0) {
             $items[] = array('url' => $adminUrl . 'ldap_import_students.php', 'label' => get_lang('ImportLDAPUsersIntoCourse'));
         }
         $blocks['courses']['items'] = $items;
         $blocks['courses']['extra'] = null;
         /* Platform */
         $blocks['platform']['icon'] = \Display::return_icon('platform.png', get_lang('Platform'), array(), ICON_SIZE_MEDIUM, false);
         $blocks['platform']['label'] = api_ucfirst(get_lang('Platform'));
         $form = $this->getSearchForm($adminUrl . 'settings.php');
         $form->addElement('hidden', 'category', 'search_setting');
         $search_form = $form->return_form();
         $blocks['platform']['search_form'] = $search_form;
         $items = array();
         $items[] = array('url' => $adminUrl . 'settings.php', 'label' => get_lang('PlatformConfigSettings'));
         $items[] = array('url' => $adminUrl . 'settings.php?category=Plugins', 'label' => get_lang('Plugins'));
         $items[] = array('url' => $adminUrl . 'settings.php?category=Regions', 'label' => get_lang('Regions'));
         $items[] = array('url' => $adminUrl . 'system_announcements.php', 'label' => get_lang('SystemAnnouncements'));
         $items[] = array('url' => api_get_path(WEB_CODE_PATH) . 'calendar/agenda_js.php?type=admin', 'label' => get_lang('GlobalAgenda'));
         $items[] = array('url' => $adminUrl . 'configure_homepage.php', 'label' => get_lang('ConfigureHomePage'));
         $items[] = array('url' => $adminUrl . 'configure_inscription.php', 'label' => get_lang('ConfigureInscription'));
         $items[] = array('url' => $adminUrl . 'statistics/index.php', 'label' => get_lang('Statistics'));
         $items[] = array('url' => api_get_path(WEB_CODE_PATH) . 'mySpace/company_reports.php', 'label' => get_lang('Reports'));
         /* Event settings */
         if (api_get_setting('activate_email_template') == 'true') {
             $items[] = array('url' => $adminUrl . 'event_controller.php?action=listing', 'label' => get_lang('EventMessageManagement'));
         }
         if (api_get_multiple_access_url()) {
             if (api_is_global_platform_admin()) {
                 $items[] = array('url' => $adminUrl . 'access_urls.php', 'label' => get_lang('ConfigureMultipleAccessURLs'));
             }
         }
         if (api_get_setting('allow_reservation') == 'true') {
             //$items[] = array('url' => $adminUrl.'../reservation/m_category.php', 	'label' => get_lang('BookingSystem'));
         }
         if (api_get_setting('allow_terms_conditions') == 'true') {
             $items[] = array('url' => $adminUrl . 'legal_add.php', 'label' => get_lang('TermsAndConditions'));
         }
         $blocks['platform']['items'] = $items;
         $blocks['platform']['extra'] = null;
     }
     /* Sessions */
     $blocks['sessions']['icon'] = \Display::return_icon('session.png', get_lang('Sessions'), array(), ICON_SIZE_SMALL, false);
//.........这里部分代码省略.........
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:101,代码来源:AdminController.php

示例10: get_lang

        if ($key == CAS_AUTH_SOURCE && api_get_setting('cas_activate') === 'true' || $key != CAS_AUTH_SOURCE) {
            $auth_sources[$key] = $key;
            $nb_ext_auth_source_added++;
        }
    }
    if ($nb_ext_auth_source_added > 0) {
        // @todo check the radio button for external authentification and select the external authentification in the menu
        $group[] = $form->createElement('radio', 'reset_password', null, get_lang('ExternalAuthentication') . ' ', 3);
        $group[] = $form->createElement('select', 'auth_source', null, $auth_sources);
        $group[] = $form->createElement('static', '', '', '<br />');
        $form->addGroup($group, 'password', null, '', false);
    }
}
$form->addElement('radio', 'reset_password', null, get_lang('AutoGeneratePassword'), 1);
// before giving the form to reset the password, check the corresponding param
if (api_is_global_platform_admin() or api_get_setting('admins_can_set_users_pass') === 'true') {
    $group = array();
    $group[] = $form->createElement('radio', 'reset_password', null, null, 2);
    $group[] = $form->createElement('password', 'password', null, array('onkeydown' => 'javascript: password_switch_radio_button();'));
    $form->addGroup($group, 'password', null, '', false);
}
// Status.
$status = api_get_user_roles();
unset($status[ANONYMOUS]);
$form->addElement('select', 'status', get_lang('Profile'), $status, array('id' => 'status_select', 'onchange' => 'javascript: display_drh_list();', 'class' => 'chzn-select'));
$display = isset($user_data['status']) && ($user_data['status'] == STUDENT || isset($_POST['status']) && $_POST['status'] == STUDENT) ? 'block' : 'none';
/*
$form->addElement('html', '<div id="drh_list" style="display:'.$display.';">');
$drh_select = $form->addElement('select', 'hr_dept_id', get_lang('Drh'), array(), 'id="drh_select"');
$drh_list = UserManager :: get_user_list(array('status' => DRH), api_sort_by_first_name() ? array('firstname', 'lastname') : array('lastname', 'firstname'));
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:30,代码来源:user_edit.php


注:本文中的api_is_global_platform_admin函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。