diff --git a/admin/inc/class.customfields.inc.php b/admin/inc/class.customfields.inc.php index 98f5c419e4..1a0aa36337 100644 --- a/admin/inc/class.customfields.inc.php +++ b/admin/inc/class.customfields.inc.php @@ -64,6 +64,29 @@ class customfields */ var $tmpl; + /** + * @var Description of the options or value format for each cf_type + */ + public static $type_option_help = array( + 'select' => 'each value is a line like id[=label], or use @<path> to read options from a file', + 'radio' => 'each value is a line like id[=label], or use @<path> to read options from a file', + 'button' => 'each value is a line like label=[javascript]' + ); + + /** + * Custom fields can also have length and rows set, but these are't used for all types + * If not set to true here, the field will be disabled when selecting the type + */ + public static $type_attribute_flags = array( + 'text' => array('cf_len' => true, 'cf_rows' => true), + 'float' => array('cf_len' => true, 'cf_rows' => true), + 'select' => array('cf_len' => false, 'cf_rows' => true), + 'date' => array('cf_len' => true, 'cf_rows' => false), + 'date-time' => array('cf_len' => true, 'cf_rows' => false), + 'select-account' => array('cf_len' => false, 'cf_rows' => true), + 'htmlarea' => array('cf_len' => true, 'cf_rows' => true), + ); + /** * Constructor * @@ -373,6 +396,11 @@ class customfields $content['no_types'] = true; } + // Include type-specific value help + $content['options'] = lang(self::$type_option_help); + $content['statustext'] = $content['options'][$content['cf_type']]; + $content['attributes'] = self::$type_attribute_flags; + $this->tmpl->exec('admin.customfields.edit',$content,$sel_options,$readonlys,array( 'cf_id' => $cf_id, 'cf_app' => $this->appname, diff --git a/admin/templates/default/app.css b/admin/templates/default/app.css index ebbc0e8dc7..7e050015e0 100644 --- a/admin/templates/default/app.css +++ b/admin/templates/default/app.css @@ -81,4 +81,10 @@ td.admin_userAgent span { #admin-customfields_admin-customfields-types + table { max-height: 300px; overflow: auto; +} +#admin-customfield_edit tr:not([class]) td { + padding: 5px 0px; +} +#admin-customfield_edit .attributes .et2_label,#admin-customfield_edit .attributes input { + margin-right: 1em; } \ No newline at end of file diff --git a/admin/templates/default/customfield_edit.xet b/admin/templates/default/customfield_edit.xet index 248910b289..7c249bb0f4 100644 --- a/admin/templates/default/customfield_edit.xet +++ b/admin/templates/default/customfield_edit.xet @@ -6,7 +6,7 @@ - + @@ -17,43 +17,40 @@ - - + + - - + - - + + - - - + - + - + - + - + - +