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/modules/node_menu/node_menu_handler_field_link.inc
<?php
// $Id: node_menu_handler_field_link.inc,v 1.1.2.1 2009/04/10 11:52:56 develCuy Exp $

/**
 * Field handler for node menu link.
 */
class node_menu_handler_field_link extends views_handler_field {
  function option_definition() {
    $options = parent::option_definition();
    $options['link_text'] = array('default' => t('read more'));
    return $options;
  }

  /**
   * Provide link to node option
   */
  function options_form(&$form, &$form_state) {
    parent::options_form($form, $form_state);
    $form['link_text'] = array(
      '#title' => t('Custom link text'),
      '#type' => 'textfield',
      '#default_value' => $this->options['link_text'],
    );
  }
  
  /**
   * Render link to the path with a custom text.
   *
   * Data should be made XSS safe prior to calling this function.
   */
  function render_link($data, $values) {
    node_menu_nodeapi($values, 'prepare');
    return l($this->options['link_text'], $values->node_menu['link_path'], array('html' => TRUE));
  }

  function render($values) {
    return $this->render_link(check_plain($values->{$this->field_alias}), $values);
  }
}