views_handler_field_custom.inc in Views (for Drupal 7) 7.3
Definition of views_handler_field_custom.
File
handlers/views_handler_field_custom.inc
View source
<?php
class views_handler_field_custom extends views_handler_field {
public function query() {
}
public function option_definition() {
$options = parent::option_definition();
$options['alter']['contains']['alter_text'] = array(
'default' => TRUE,
'bool' => TRUE,
);
$options['hide_alter_empty'] = array(
'default' => FALSE,
'bool' => TRUE,
);
return $options;
}
public function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
unset($form['alter']['alter_text']);
unset($form['alter']['text']['#dependency']);
unset($form['alter']['text']['#process']);
unset($form['alter']['help']['#dependency']);
unset($form['alter']['help']['#process']);
$form['#pre_render'][] = 'views_handler_field_custom_pre_render_move_text';
}
public function render($values) {
return $this->options['alter']['text'];
}
}
function views_handler_field_custom_pre_render_move_text($form) {
$form['text'] = $form['alter']['text'];
$form['help'] = $form['alter']['help'];
unset($form['alter']['text']);
unset($form['alter']['help']);
return $form;
}