本文整理汇总了PHP中learnpath::upload_image方法的典型用法代码示例。如果您正苦于以下问题:PHP learnpath::upload_image方法的具体用法?PHP learnpath::upload_image怎么用?PHP learnpath::upload_image使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类learnpath
的用法示例。
在下文中一共展示了learnpath::upload_image方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ExtraFieldValue
$expired_on = $_REQUEST['expired_on'];
} else {
$expired_on = null;
}
$learnPath->setCategoryId($_REQUEST['category_id']);
$learnPath->set_modified_on();
$learnPath->set_publicated_on($publicated_on);
$learnPath->set_expired_on($expired_on);
if (isset($_REQUEST['remove_picture']) && $_REQUEST['remove_picture']) {
$learnPath->delete_lp_image();
}
$extraFieldValue = new ExtraFieldValue('lp');
$params = array('lp_id' => $learnPath->id);
$extraFieldValue->saveFieldValues($_REQUEST);
if ($_FILES['lp_preview_image']['size'] > 0) {
$learnPath->upload_image($_FILES['lp_preview_image']);
}
if (api_get_setting('search.search_enabled') === 'true') {
require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php';
$specific_fields = get_specific_field_list();
foreach ($specific_fields as $specific_field) {
$learnPath->set_terms_by_prefix($_REQUEST[$specific_field['code']], $specific_field['code']);
$new_values = explode(',', trim($_REQUEST[$specific_field['code']]));
if (!empty($new_values)) {
array_walk($new_values, 'trim');
delete_all_specific_field_value(api_get_course_id(), $specific_field['id'], TOOL_LEARNPATH, $learnPath->lp_id);
foreach ($new_values as $value) {
if (!empty($value)) {
add_specific_field_value($specific_field['id'], api_get_course_id(), TOOL_LEARNPATH, $learnPath->lp_id, $value);
}
}