本文整理匯總了PHP中learnpath::set_terms_by_prefix方法的典型用法代碼示例。如果您正苦於以下問題:PHP learnpath::set_terms_by_prefix方法的具體用法?PHP learnpath::set_terms_by_prefix怎麽用?PHP learnpath::set_terms_by_prefix使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類learnpath
的用法示例。
在下文中一共展示了learnpath::set_terms_by_prefix方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: ExtraFieldValue
$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);
}
}
}
}
}
$learnPath->updateCurrentLpFromSession();
$url = api_get_self() . '?action=add_item&type=step&lp_id=' . intval($learnPath->lp_id) . '&' . api_get_cidreq();
header('Location: ' . $url);