本文整理汇总了PHP中CustomFields::update方法的典型用法代码示例。如果您正苦于以下问题:PHP CustomFields::update方法的具体用法?PHP CustomFields::update怎么用?PHP CustomFields::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CustomFields
的用法示例。
在下文中一共展示了CustomFields::update方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dpGetParam
*/
require_once $AppUI->getSystemClass('CustomFields');
$edit_field_id = dpGetParam($_POST, "field_id", NULL);
if ($edit_field_id != NULL) {
$edit_module = dpGetParam($_POST, "module", NULL);
$field_name = dpGetParam($_POST, "field_name", NULL);
$field_description = db_escape(dpGetParam($_POST, "field_description", NULL));
$field_htmltype = dpGetParam($_POST, "field_htmltype", NULL);
$field_datatype = dpGetParam($_POST, "field_datatype", "alpha");
$field_extratags = db_escape(dpGetParam($_POST, "field_extratags", NULL));
$list_select_items = dpGetParam($_POST, "select_items", NULL);
$custom_fields = new CustomFields(strtolower($edit_module), 'addedit', null, null);
if ($edit_field_id == 0) {
$fid = $custom_fields->add($field_name, $field_description, $field_htmltype, $field_datatype, $field_extratags, $msg);
} else {
$fid = $custom_fields->update($edit_field_id, $field_name, $field_description, $field_htmltype, $field_datatype, $field_extratags, $msg);
}
// Add or Update a Custom Field
if ($msg) {
$AppUI->setMsg($AppUI->_('Error adding custom field:') . $msg, UI_MSG_ALERT, true);
} else {
if ($field_htmltype == "select") {
$opts = new CustomOptionList($fid);
$opts->setOptions($list_select_items);
if ($edit_field_id == 0) {
$o_msg = $opts->store();
} else {
// To update each list would be a lot more complex than rewriting it
// So it is, but it is needed in order for it to work properly. (Pedro A. Bug 1163)
$o_msg = $opts->store();
}