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


PHP CourseManager::update_course_picture方法代码示例

本文整理汇总了PHP中CourseManager::update_course_picture方法的典型用法代码示例。如果您正苦于以下问题:PHP CourseManager::update_course_picture方法的具体用法?PHP CourseManager::update_course_picture怎么用?PHP CourseManager::update_course_picture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CourseManager的用法示例。


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

示例1: foreach

$values['activate_legal'] = $all_course_information['activate_legal'];
$courseSettings = CourseManager::getCourseSettingVariables($appPlugin);
foreach ($courseSettings as $setting) {
    $result = api_get_course_setting($setting);
    if ($result != '-1') {
        $values[$setting] = $result;
    }
}
$form->setDefaults($values);
// Validate form
if ($form->validate() && is_settings_editable()) {
    $updateValues = $form->exportValues();
    // update course picture
    $picture = $_FILES['picture'];
    if (!empty($picture['name'])) {
        $picture_uri = CourseManager::update_course_picture($course_code, $picture['name'], $picture['tmp_name'], $updateValues['cropResult']);
    }
    $visibility = $updateValues['visibility'];
    $deletePicture = isset($updateValues['delete_picture']) ? $updateValues['delete_picture'] : '';
    if ($deletePicture) {
        CourseManager::deleteCoursePicture($course_code);
    }
    global $_configuration;
    $urlId = api_get_current_access_url_id();
    if (isset($_configuration[$urlId]) && isset($_configuration[$urlId]['hosting_limit_active_courses']) && $_configuration[$urlId]['hosting_limit_active_courses'] > 0) {
        $courseInfo = api_get_course_info_by_id($courseId);
        // Check if
        if ($courseInfo['visibility'] == COURSE_VISIBILITY_HIDDEN && $visibility != $courseInfo['visibility']) {
            $num = CourseManager::countActiveCourses($urlId);
            if ($num >= $_configuration[$urlId]['hosting_limit_active_courses']) {
                api_warn_hosting_contact('hosting_limit_active_courses');
开发者ID:daffef,项目名称:chamilo-lms,代码行数:31,代码来源:infocours.php

示例2: api_get_person_name

    }
    $a_profs[api_get_person_name($s_firstname, $s_lastname)] = api_get_person_name($s_lastname, $s_firstname) . ' (' . $s_username . ')';
}
$categories = getCategoriesCanBeAddedInCourse($_course['categoryCode']);
$linebreak = '<div class="row"><div class="label"></div><div class="formw" style="border-bottom:1px dashed grey"></div></div>';
// Build the form
$form = new FormValidator('update_course', 'post', api_get_self() . '?' . api_get_cidreq());
// COURSE SETTINGS
$form->addElement('html', '<div><h3>' . Display::return_icon('settings.png', Security::remove_XSS(get_lang('CourseSettings')), '', ICON_SIZE_SMALL) . ' ' . Security::remove_XSS(get_lang('CourseSettings')) . '</h3><div>');
$image_html = '';
// Sending image
if ($form->validate() && is_settings_editable()) {
    // update course picture
    $picture = $_FILES['picture'];
    if (!empty($picture['name'])) {
        $picture_uri = CourseManager::update_course_picture($course_code, $picture['name'], $picture['tmp_name']);
    }
}
// Display course picture
$course_path = api_get_path(SYS_COURSE_PATH) . $currentCourseRepository;
// course path
if (file_exists($course_path . '/course-pic85x85.png')) {
    $course_web_path = api_get_path(WEB_COURSE_PATH) . $currentCourseRepository;
    // course web path
    $course_medium_image = $course_web_path . '/course-pic85x85.png?' . rand(1, 1000);
    // redimensioned image 85x85
    $image_html = '<div class="row"><div class="formw"><img src="' . $course_medium_image . '" /></div></div>';
}
$form->addElement('html', $image_html);
$form->add_textfield('title', get_lang('Title'), true, array('class' => 'span6'));
$form->applyFilter('title', 'html_filter');
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:infocours.php


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