class views_handler_field_system_info_scripts in Views System 6.2
Same name and namespace in other branches
- 6.3 views/handlers/views_handler_field_system_info_scripts.inc \views_handler_field_system_info_scripts
- 7.3 views/handlers/views_handler_field_system_info_scripts.inc \views_handler_field_system_info_scripts
Provides display options and renders the scripts field of the system item.
Hierarchy
- class \views_handler_field_system_info_scripts extends \views_handler_field_prerender_list
Expanded class hierarchy of views_handler_field_system_info_scripts
1 string reference to 'views_handler_field_system_info_scripts'
- views_system_views_data in views/
views_system.views.inc - Implementation of hook_views_data().
File
- views/
handlers/ views_handler_field_system_info_scripts.inc, line 14 - Views field handler for the views_system module.
View source
class views_handler_field_system_info_scripts extends views_handler_field_prerender_list {
function pre_render($values) {
foreach ($values as $value) {
$info = unserialize($value->{$this->field_alias});
if (isset($info['scripts'])) {
$field = $value->{$this->field_alias};
$this->items[$field] = array();
foreach ($info['scripts'] as $script) {
$this->items[$field][] = array(
'script' => $script,
);
}
}
}
}
function render_item($count, $item) {
return $item['script'];
}
function document_self_tokens(&$tokens) {
$tokens['[' . $this->options['id'] . '-script' . ']'] = t('The Javascript file of the theme.');
}
function add_self_tokens(&$tokens, $item) {
$tokens['[' . $this->options['id'] . '-script' . ']'] = $item['script'];
}
}