/[drupal]/contributions/modules/civinode/theme/template.php
ViewVC logotype

Contents of /contributions/modules/civinode/theme/template.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Thu Jun 21 04:41:00 2007 UTC (2 years, 5 months ago) by torenware
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-5
Changes since 1.1: +0 -0 lines
File MIME type: text/x-php
Checking Comm Init changes into head
1 <?php
2 // $Id$
3
4 //Test civicrm contact formatter
5 function phptemplate_crm_contact(&$contact, &$field) {
6 if (!civinode_check_init())
7 return;
8 $contact_id = $contact['contact_id'];
9 $pid = $field['default_profile_id'] ?
10 $field['default_profile_id'] :
11 civinode_get_default_profile_id(0);
12
13 $field_list = civinode_get_profile_field_list($pid, 'view');
14 $field_info = array();
15 //profiles name some fields using the location id, we want
16 //to strip this out:
17 foreach ($field_list as $node_field => $raw_field) {
18 $field_desc = civinode_get_field_info($pid, $raw_field, 'view');
19 $field_info[$node_field] = $field_desc;
20 }
21
22 $variables = array(
23 'contact' => $contact,
24 'cck_field' => $field,
25 'field_info' => $field_info,
26 'profile_id' => $pid,
27 );
28
29 return _phptemplate_callback('crm_contact', $variables, array('crm_contact_'. $pid));
30 }
31 //end of test code.

  ViewVC Help
Powered by ViewVC 1.1.2