|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /domains/afglcweb/ny/sites/all/modules/views/modules/node/ |
Upload File : |
<?php
// $Id:
/**
* Field handler to present the path to the node.
*/
class views_handler_field_node_path extends views_handler_field {
function option_definition() {
$options = parent::option_definition();
$options['absolute'] = array('default' => FALSE);
return $options;
}
function construct() {
parent::construct();
$this->additional_fields['nid'] = 'nid';
}
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
$form['absolute'] = array(
'#type' => 'checkbox',
'#title' => t('Use absolute link (begins with "http://")'),
'#default_value' => $this->options['absolute'],
'#description' => t('If you want to use this as in "output this field as link" in "link path", you must enable this option.'),
);
}
function query() {
$this->ensure_my_table();
$this->add_additional_fields();
}
function render($values) {
$nid = $values->{$this->aliases['nid']};
return url("node/$nid", array('absolute' => $this->options['absolute']));
}
}