本文整理汇总了PHP中DynamicField::getField方法的典型用法代码示例。如果您正苦于以下问题:PHP DynamicField::getField方法的具体用法?PHP DynamicField::getField怎么用?PHP DynamicField::getField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DynamicField
的用法示例。
在下文中一共展示了DynamicField::getField方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
/**
* Delete field
*
* @param DynamicField $df
*/
public function delete($df)
{
$fieldId = null;
if ($df instanceof DynamicField) {
$fieldId = $df->getFieldWidget($df->module, $this->id_name);
} elseif ($df instanceof MBModule) {
$fieldId = $df->getField($this->id_name);
} else {
$GLOBALS['log']->fatal('Unsupported DynamicField type');
}
// the field may have already been deleted
if ($fieldId) {
$this->deleteIdLabel($fieldId, $df);
$fieldId->delete($df);
}
parent::delete($df);
}
示例2: delete
/**
* Delete field
*
* @param DynamicField $df
*/
public function delete($df)
{
if ($df instanceof DynamicField) {
$fieldId = $df->getFieldWidget($df->module, $this->id_name);
} elseif ($df instanceof MBModule) {
$fieldId = $df->getField($this->id_name);
} else {
Log::fatal('Unsupported DynamicField type');
}
$this->deleteIdLabel($fieldId, $df);
$fieldId->delete($df);
parent::delete($df);
}
示例3: array
$required_opt = !empty($_REQUEST['required_option']) ? 'required' : 'optional';
$id = !empty($_REQUEST['id']) ? $_REQUEST['id'] : '';
if (empty($id)) {
$custom_fields->addField($_REQUEST['name'], $label, $_REQUEST['data_type'], $max_size, $required_opt, $default_value, $ext1, $ext2, $ext3, $audit_value, $mass_update, $ext4, $help, $_REQUEST['duplicate_merge']);
} else {
$values = array('max_size' => $max_size, 'required_option' => $required_opt, 'default_value' => $default_value, 'audited' => $audit_value, 'mass_update' => $mass_update, 'ext4' => $ext4, 'help' => $help, 'duplicate_merge' => $_REQUEST['duplicate_merge']);
if (!empty($ext1)) {
$values['ext1'] = $ext1;
}
$custom_fields->updateField($id, $values);
}
if (!empty($_REQUEST['popup'])) {
ob_clean();
$name = $custom_fields->getDBName($_REQUEST['name']);
$files = StudioParser::getFiles($module);
$view = StudioParser::getFileType($files[$_SESSION['studio']['selectedFileId']]['type']);
$custom_fields->avail_fields = array();
$custom_fields->getAvailableFields(true);
$field = $custom_fields->getField($name);
$custom_fields->bean->field_defs[$name] = $field->get_field_def();
$custom_fields->bean->field_defs[$name]['type'] = $custom_fields->bean->field_defs[$name]['custom_type'];
$html = $custom_fields->getAllBeanFieldsView($view, 'html');
$html = $html[$name];
$string = '[NAME]' . $name . '[TYPE]' . $html['fieldType'] . '[LABEL]' . translate(str_replace(array('{', '}', 'MOD.', 'mod.', 'APP.', 'app.'), '', $html['label']), $module);
$string .= '[DATA]' . $html['html'];
echo str_replace(array('{', '}', 'MOD.', 'mod.', 'APP.', 'app.'), '', $string);
sugar_cleanup(true);
} else {
header("Location: index.php?module=Studio&action=wizard&wizard=EditCustomFieldsWizard&option=ViewCustomFields");
sugar_cleanup(true);
}