[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/modules/profile/ -> profile-block.tpl.php (source)

   1  <?php
   2  // $Id: profile-block.tpl.php,v 1.2 2007/08/07 08:39:35 goba Exp $
   3  
   4  /**
   5   * @file profile-block.tpl.php
   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   * - $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 $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; ?>


Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7