hosting_package_handler_field_status.inc

Classes

Namesort descending Description
hosting_package_handler_field_status A handler for the Package status field.

File

package/includes/views/handlers/hosting_package_handler_field_status.inc
View source
  1. <?php
  2. /**
  3. * A handler for the Package status field.
  4. *
  5. * @ingroup views_field_handlers
  6. */
  7. class hosting_package_handler_field_status extends hosting_site_handler_field_status {
  8. /**
  9. * Constructor; calls to base object constructor.
  10. */
  11. function construct() {
  12. views_handler_field::construct();
  13. }
  14. function render($values) {
  15. $value = $values->{$this->field_alias};
  16. $output = $value ? t('Enabled') : t('Disabled');
  17. switch ($this->options['status_mode']) {
  18. case 'image':
  19. return "<span class='hosting-status hosting-status-icon'></span>";
  20. case 'text_image':
  21. return "<span class='hosting-status'>{$output}</span>";
  22. case 'class':
  23. return $value ? 'hosting-success' : 'hosting-info';
  24. }
  25. return $output;
  26. }
  27. }