예제 #1
0
}
$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']);
}
예제 #2
0
$ext4 = !empty($_REQUEST['ext4']) ? $_REQUEST['ext4'] : '';
$help = !empty($_REQUEST['help']) ? $_REQUEST['help'] : '';
$max_size = !empty($_REQUEST['max_size']) ? $_REQUEST['max_size'] : '';
$default_value = !empty($_REQUEST['default_value']) ? $_REQUEST['default_value'] : '';
$audit_value = !empty($_REQUEST['audited']) ? 1 : 0;
$mass_update = !empty($_REQUEST['mass_update']) ? 1 : 0;
$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'];