private function __template($template, $default=null) { if($template instanceof OBM_Template) { return $template->render($this->locals, false); } elseif(is_string($template)) { $template = new OBM_Template($template, $this->module, $this->mode, $this->locals); return $template->render($this->locals); } elseif($default) { $template = new OBM_Template($default, $this->module, $this->mode, $this->locals); return $template->render($this->locals); } return false; }
$subTemplate['addressbooks'] = new OBM_Template('addressbooks'); //FIXME Erreur de droit } if($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') { foreach($subTemplate as $template) { $template->set('contacts', $contacts); $template->set('contact', $contact); $template->set('addressbooks', $addressbooks); $template->set('current', $current); echo $template->render(); } exit(); } else { contact_export_js_labels(); $template = new OBM_Template('main'); if(!$current['addressbook']) $current['addressbook'] = $addressbooks->getMyContacts()->id; if(!$contacts) $contacts = $addressbooks->searchContacts("addressbookId:$current[addressbook] -is:archive"); $template->set('searchpattern', $params['searchpattern']); $template->set('contactfilter', $params['contactfilter']); $template->set('contacts', $contacts); $template->set('contact', $contact); $template->set('addressbooks', $addressbooks); $template->set('current', $current); $template->set('searchfields', OBM_Contact::fieldsMap()); $template->set('customFields', OBM_Contact::getUserCategory()); //FIXME : Already set in some actions $template->set('fields', get_display_pref($GLOBALS['obm']['uid'], 'contact')); $template->set('template', $subTemplate); $display['detail'] = $template->render(); }