HEX
Server: Apache
System: Linux webm010.cluster103.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: iestorre (46869)
PHP: 8.0.30
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/iestorre/www2/quotes/views_handler_field_quotes.inc
<?php
// $Id: views_handler_field_quotes.inc,v 1.1.2.1 2009/02/19 06:05:06 nancyw Exp $
/**
 * @file
 * Provide views data and handlers for quotes.module
 */

/**
 * Field handler to provide an embedded image.
 *
 * @ingroup views_field_handlers
 */
class views_handler_field_quotes extends views_handler_field {
  /**
   * Define options available for this field.
   */
  function option_definition() {
    $options = parent::option_definition();
    $options['author_link'] = array('default' => 'text');
    return $options;
  } /* */

  /**
   * Build option configuration form.
   */
  function options_form(&$form, &$form_state) {
    parent::options_form($form, $form_state);

    $form['author_link'] = array(
      '#title' => t('Show author as'),
      '#type' => 'radios',
      '#options' => array(
        'text' => 'Text',
        'author' => 'Link to quotes',
        ),
      '#default_value' => $this->options['author_link'],
    );
  } /* */

  /**
   * Render field output to the browser.
   */
  function render($values) {
//   drupal_set_message(print_r($values, true));
    $author = $values->{$this->field_alias};
    $type = $this->options['author_link'];
//   drupal_set_message("\$this->field_alias='$this->field_alias', author='$author', type='$type'.");

    switch ($type) {
      case 'author':
        return l($author, 'quotes/author/'. check_plain($author), array('attributes' => array('rel' => 'tag')));

      default:  // Also 'text'
        return check_plain($author);
    }
  }
} /* */