本文整理汇总了PHP中DynamicField::addField方法的典型用法代码示例。如果您正苦于以下问题:PHP DynamicField::addField方法的具体用法?PHP DynamicField::addField怎么用?PHP DynamicField::addField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DynamicField
的用法示例。
在下文中一共展示了DynamicField::addField方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CustomFieldsTableSchema
$custom_fields_table_schema = new CustomFieldsTableSchema($custom_table_name);
if (!CustomFieldsTableSchema::custom_table_exists($custom_table_name)) {
$custom_fields_table_schema->create_table();
}
$column_name = $fields_meta_data->name;
$field_label = $fields_meta_data->label;
$data_type = $fields_meta_data->data_type;
$max_size = $fields_meta_data->max_size;
$required = $fields_meta_data->required_option;
$default_value = $fields_meta_data->default_value;
$module_dir = $fields_meta_data->custom_module;
if ($new_field) {
$custom_fields_table_schema->add_column($column_name, $data_type, $required, $default_value);
$class_name = $beanList[$fields_meta_data->custom_module];
$custom_field = new DynamicField($fields_meta_data->custom_module);
require_once "modules/{$module_dir}/{$class_name}.php";
$sugarbean_module = new $class_name();
$custom_field->setup($sugarbean_module);
$custom_field->addField($field_label, $data_type, $max_size, 'optional', $default_value, '', '');
}
if (isset($_REQUEST['form'])) {
// we are doing the save from a popup window
echo '<script>opener.window.location.reload();self.close();</script>';
die;
} else {
// need to refresh the page properly
$return_module = empty($_REQUEST['return_module']) ? 'EditCustomFields' : $_REQUEST['return_module'];
$return_action = empty($_REQUEST['return_action']) ? 'index' : $_REQUEST['return_action'];
$return_module_select = empty($_REQUEST['return_module_select']) ? 0 : $_REQUEST['return_module_select'];
header("Location: index.php?action={$return_action}&module={$return_module}&module_select={$return_module_select}");
}
示例2: DynamicField
********************************************************************************/
require_once 'modules/DynamicFields/DynamicField.php';
$module = $_REQUEST['module_name'];
$custom_fields = new DynamicField($module);
if (!empty($module)) {
$class_name = $beanList[$module];
$class_file = $class_name;
if ($class_file == 'aCase') {
$class_file = 'Case';
}
require_once "modules/{$module}/{$class_file}.php";
$mod = new $class_name();
$custom_fields->setup($mod);
} else {
echo "\nNo Module Included Could Not Save";
}
$name = $_REQUEST['field_label'];
$options = '';
if ($_REQUEST['field_type'] == 'enum') {
$options = $_REQUEST['options'];
}
$default_value = '';
$custom_fields->addField($name, $name, $_REQUEST['field_type'], '255', 'optional', $default_value, $options, '', '');
$html = $custom_fields->getFieldHTML($name, $_REQUEST['file_type']);
set_register_value('dyn_layout', 'field_counter', $_REQUEST['field_count']);
$label = $custom_fields->getFieldLabelHTML($name, $_REQUEST['field_type']);
require_once 'modules/DynamicLayout/AddField.php';
$af = new AddField();
$af->add_field($name, $html, $label, 'window.opener.');
echo $af->get_script('window.opener.');
echo "\n<script>window.close();</script>";
示例3: array
$default_value = $_REQUEST['default_value'];
}
$audit_value = 0;
if (isset($_REQUEST['audited'])) {
$audit_value = 1;
}
$mass_update = 0;
if (isset($_REQUEST['mass_update'])) {
$mass_update = 1;
}
$id = '';
if (isset($_REQUEST['id'])) {
$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, $_REQUEST['duplicate_merge']);
} else {
$custom_fields->updateField($id, array('max_size' => $max_size, 'required_option' => $required_opt, 'default_value' => $default_value, 'audited' => $audit_value, 'mass_update' => $mass_update, 'duplicate_merge' => $_REQUEST['duplicate_merge']));
}
if ($_REQUEST['style'] == 'popup') {
$name = $_REQUEST['name'];
$html = $custom_fields->getFieldHTML($name, $_REQUEST['file_type']);
set_register_value('dyn_layout', 'field_counter', $_REQUEST['field_count']);
$label = $custom_fields->getFieldLabelHTML($name, $_REQUEST['data_type']);
require_once 'modules/DynamicLayout/AddField.php';
$af = new AddField();
$af->add_field($name, $html, $label, 'window.opener.');
echo $af->get_script('window.opener.');
echo "\n<script>window.close();</script>";
} else {
header("Location: index.php?action=index&module=EditCustomFields&module_name=" . $_REQUEST['module_name']);