| 1 |
<?php
|
| 2 |
// $Id: profile-block.tpl.php,v 1.3 2008/10/13 12:31:42 dries Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* Default theme implementation for displaying a users profile within a
|
| 7 |
* block. It only shows in relation to a node displayed as a full page.
|
| 8 |
*
|
| 9 |
* Available variables:
|
| 10 |
* - $user_picture: Image configured for the account linking to the users page.
|
| 11 |
* - $profile: Keyed array of all profile fields that have a value.
|
| 12 |
*
|
| 13 |
* Each $field in $profile contains:
|
| 14 |
* - $field->title: Title of the profile field.
|
| 15 |
* - $field->value: Value of the profile field.
|
| 16 |
* - $field->type: Type of the profile field, i.e., checkbox, textfield,
|
| 17 |
* textarea, selection, list, url or date.
|
| 18 |
*
|
| 19 |
* Since $profile is keyed, a direct print of the field is possible. Not
|
| 20 |
* all accounts may have a value for a profile so do a check first. If a field
|
| 21 |
* of "last_name" was set for the site, the following can be used.
|
| 22 |
*
|
| 23 |
* <?php if (isset($profile['last_name'])): ?>
|
| 24 |
* <div class="field last-name">
|
| 25 |
* <?php print $profile['last_name']->title; ?>:<br />
|
| 26 |
* <?php print $profile['last_name']->value; ?>
|
| 27 |
* </div>
|
| 28 |
* <?php endif; ?>
|
| 29 |
*
|
| 30 |
* @see template_preprocess_profile_block()
|
| 31 |
*/
|
| 32 |
?>
|
| 33 |
<?php print $user_picture; ?>
|
| 34 |
|
| 35 |
<?php foreach ($profile as $field) : ?>
|
| 36 |
<p>
|
| 37 |
<?php if ($field->type != 'checkbox') : ?>
|
| 38 |
<strong><?php print $field->title; ?></strong><br />
|
| 39 |
<?php endif; ?>
|
| 40 |
<?php print $field->value; ?>
|
| 41 |
</p>
|
| 42 |
<?php endforeach; ?>
|