class views_handler_field_hosting_site_status in Hosting 6.2
A handler for the Site status field.
Hierarchy
- class \views_handler_field_hosting_site_status extends \views_handler_field
Expanded class hierarchy of views_handler_field_hosting_site_status
3 string references to 'views_handler_field_hosting_site_status'
- hosting_package_views_handlers in package/
views/ hosting_package.views.inc - Implementation of hook_views_handlers().
- hosting_platform_views_handlers in platform/
hosting_platform.views.inc - Implementation of hook_views_handlers().
- hosting_site_views_data in site/
views/ hosting_site.views.inc - Implements hook_views_data().
File
- site/
views/ views_handler_field_hosting_site_status.inc, line 8
View source
class views_handler_field_hosting_site_status extends views_handler_field {
/**
* Constructor; calls to base object constructor.
*/
function construct() {
parent::construct();
$this->additional_fields = array(
'verified',
);
}
function option_definition() {
$options = parent::option_definition();
$options['status_mode'] = array(
'default' => 'text',
);
return $options;
}
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
$form['status_mode'] = array(
'#type' => 'radios',
'#title' => t('Display mode'),
'#options' => array(
'text' => t('Text'),
'image' => t('Image'),
'text_image' => t('Text & Image'),
'class' => t('CSS class'),
),
'#default_value' => isset($this->options['status_mode']) ? $this->options['status_mode'] : 'text',
'#description' => t("Display mode of status values."),
);
}
function render($values) {
$value = $values->{$this->field_alias};
$output = _hosting_site_status($value);
switch ($this->options['status_mode']) {
case 'image':
return "<span class='hosting-status hosting-status-icon'></span>";
case 'text_image':
return "<span class='hosting-status'>{$output}</span>";
case 'class':
return _hosting_site_list_class($value, $values->{$this->aliases['verified']});
}
return $output;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
views_handler_field_hosting_site_status:: |
function | Constructor; calls to base object constructor. | 1 | |
views_handler_field_hosting_site_status:: |
function | |||
views_handler_field_hosting_site_status:: |
function | |||
views_handler_field_hosting_site_status:: |
function | 2 |