Esempio n. 1
0
    $field_id = $field->field_id;
} else {
    $field->load($field_id);
}
$module = new w2p_System_Module();
$module->load($module_id);
$ttl = $field_id ? 'Edit Custom Fields' : 'Add Custom Fields';
$ttl = $AppUI->_($ttl) . ' - ' . $AppUI->_($module->mod_name) . ' ' . $AppUI->_('Module');
$titleBlock = new w2p_Theme_TitleBlock($ttl, 'customfields.png', $m);
$titleBlock->addCrumb('?m=system', 'system admin');
$titleBlock->addCrumb('?m=system&u=customfields', 'custom fields');
$titleBlock->show();
$html_types = $field->getTypes();
$custom_fields = new w2p_Core_CustomFields($module->mod_name, 'addedit', null, 'edit');
if ($field_id) {
    $cf = $custom_fields->fieldWithId($field_id);
    if (is_object($cf)) {
        $field_name = $cf->fieldName();
        $field_description = $cf->fieldDescription();
        $field_htmltype = $cf->fieldHtmlType();
        $field_extratags = $cf->fieldExtraTags();
        $field_order = $cf->fieldOrder();
        $field_published = $cf->fieldPublished();
        if ($field_htmltype == 'select') {
            $select_options = new w2p_Core_CustomOptionList($field_id);
            $select_options->load();
            $select_items = $select_options->getOptions();
        }
    } else {
        //No such field exists with this ID
        $AppUI->setMsg('Couldnt load the Custom Field, It might have been deleted somehow.', UI_MSG_ERROR);