annotate modules/profile/profile-block.tpl.php @ 1:c1f4ac30525a 6.0

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