From e763d692c988e5ef7c324dbc787bc2c1b171b06b Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Wed, 10 Feb 2010 14:27:14 +0000 Subject: [PATCH] make sure the default type for addressbook is found if there is no entry in egw_config --- addressbook/inc/class.addressbook_hooks.inc.php | 1 + admin/inc/class.customfields.inc.php | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/addressbook/inc/class.addressbook_hooks.inc.php b/addressbook/inc/class.addressbook_hooks.inc.php index ba95778ebe..49505795b8 100644 --- a/addressbook/inc/class.addressbook_hooks.inc.php +++ b/addressbook/inc/class.addressbook_hooks.inc.php @@ -320,6 +320,7 @@ class addressbook_hooks 'add_id' => 'link_id', 'add_popup' => '850x440', 'file_access'=> 'addressbook.addressbook_bo.file_access', + 'default_types' => array('n' => array('name' => 'contact', 'options' => array('icon' => 'navbar.png','template' => 'addressbook.edit'))), ); } diff --git a/admin/inc/class.customfields.inc.php b/admin/inc/class.customfields.inc.php index 93b70644cf..6ecd30db46 100644 --- a/admin/inc/class.customfields.inc.php +++ b/admin/inc/class.customfields.inc.php @@ -79,13 +79,21 @@ class customfields $this->fields = config::get_customfields($this->appname,true); $this->tmpl->read('admin.customfields'); - if($this->manage_content_types) $this->content_types = $this->get_content_types(); + if($this->manage_content_types) + { + $this->content_types = config::get_content_types($this->appname); + if (count($this->content_types)==0) + { + // if you define your default types of your app with the search_link hook, they are available here, if no types were found + $this->content_types = (array)egw_link::get_registry($this->appname,'default_types'); + //error_log( array2string($this->content_types)); + } + } else { $this->tmpl->children[0]['data'][2]['A']['disabled'] = true; $this->tmpl->children[0]['data'][3]['A']['disabled'] = true; } - if (is_array($content)) { //echo '
'; print_r($content); echo "
\n"; @@ -153,7 +161,6 @@ class customfields $content['content_types']['non_deletable'] = true; } } - //echo 'customfields=
'; print_r($this->fields); echo "
\n"; $content['fields'] = array('use_private' => $content['use_private']); $n = 0;