From 6396d1b235694c38f40a878a0d3bb107fc5a2c80 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 5 Oct 2006 06:34:12 +0000 Subject: [PATCH] new application customfields for the other (non-infolog) apps. If the application field should generate a link, it has to be done in the application itself. --- admin/inc/class.customfields.inc.php | 33 ++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/admin/inc/class.customfields.inc.php b/admin/inc/class.customfields.inc.php index 103569a615..1b6ac184ae 100644 --- a/admin/inc/class.customfields.inc.php +++ b/admin/inc/class.customfields.inc.php @@ -25,12 +25,20 @@ { /** - * @var string $appname string appname of app which want to add / edit its customfields + * appname of app which want to add / edit its customfields + * + * @var string */ var $appname; /** - * @var array $cf_types array with allowd types of customfields + * Allowd types of customfields + * + * The additionally allowed app-names from the link-class, will be add by the edit-method only, + * as the link-class has to be called, which can NOT be instanciated by the constructor, as + * we get a loop in the instanciation. + * + * @var array */ var $cf_types = array( 'text' => 'Text', @@ -38,16 +46,17 @@ 'select' => 'Selectbox', 'radio' => 'Radiobutton', 'checkbox' => 'Checkbox', + 'link-entry' => 'Select entry', ); - /** - * @var $types2 array with userdefiened types e.g. type of infolog + * userdefiened types e.g. type of infolog + * + * @var array */ var $types2 = array(); var $content_types,$fields; - var $public_functions = array - ( + var $public_functions = array( 'edit' => True ); @@ -190,10 +199,16 @@ $readonlys['fields']["delete[]"] = True; //echo '

uicustomfields.edit(content =

'; print_r($content); echo "
\n"; //echo 'readonlys =
'; print_r($readonlys); echo "
\n"; - $this->tmpl->exec('admin.customfields.edit',$content,array( - 'type' => $this->cf_types, + $sel_options = array( 'type2' => $this->types2 + array('tmpl' => 'template'), - ),$readonlys,array( + ); + $GLOBALS['egw']->translation->add_app('etemplate'); + foreach($this->cf_types as $name => $label) $sel_options['type'][$name] = lang($label); + $link_types = ExecMethod('phpgwapi.bolink.app_list',''); + ksort($link_types); + foreach($link_types as $name => $label) $sel_options['type'][$name] = '- '.$label; + + $this->tmpl->exec('admin.customfields.edit',$content,$sel_options,$readonlys,array( 'fields' => $preserv_fields, 'appname' => $this->appname, 'referer' => $referer,