本文整理汇总了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');
示例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');