Now all modules are in core modules folder
This commit is contained in:
parent
5ba1cdfa0b
commit
05b6a91b0c
1907 changed files with 0 additions and 0 deletions
44
modules/views/handlers/views_handler_field_markup.inc
Normal file
44
modules/views/handlers/views_handler_field_markup.inc
Normal file
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* A handler to run a field through check_markup, using a companion
|
||||
* format field.
|
||||
*
|
||||
* - format: (REQUIRED) The field in this table used to control the format
|
||||
* such as the 'format' field in the node, which goes with the
|
||||
* 'body' field.
|
||||
*
|
||||
* @ingroup views_field_handlers
|
||||
*/
|
||||
class views_handler_field_markup extends views_handler_field {
|
||||
/**
|
||||
* Constructor; calls to base object constructor.
|
||||
*/
|
||||
function construct() {
|
||||
parent::construct();
|
||||
|
||||
$this->format = $this->definition['format'];
|
||||
|
||||
$this->additional_fields = array();
|
||||
if (!is_numeric($this->format)) {
|
||||
$this->additional_fields['format'] = array('field' => $this->format);
|
||||
}
|
||||
}
|
||||
|
||||
function render($values) {
|
||||
$value = $values->{$this->field_alias};
|
||||
$format = is_numeric($this->format) ? $this->format : $values->{$this->aliases['format']};
|
||||
if ($value) {
|
||||
$value = str_replace('<!--break-->', '', $value);
|
||||
return check_markup($value, $format, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
function element_type() {
|
||||
if (isset($this->definition['element type'])) {
|
||||
return $this->definition['element type'];
|
||||
}
|
||||
|
||||
return 'div';
|
||||
}
|
||||
}
|
Reference in a new issue