You are here

function _socialbase_get_visibility_icon in Open Social 8.5

Same name and namespace in other branches
  1. 8.9 themes/socialbase/socialbase.theme \_socialbase_get_visibility_icon()
  2. 8 themes/socialbase/socialbase.theme \_socialbase_get_visibility_icon()
  3. 8.2 themes/socialbase/socialbase.theme \_socialbase_get_visibility_icon()
  4. 8.3 themes/socialbase/socialbase.theme \_socialbase_get_visibility_icon()
  5. 8.4 themes/socialbase/socialbase.theme \_socialbase_get_visibility_icon()
  6. 8.6 themes/socialbase/socialbase.theme \_socialbase_get_visibility_icon()
  7. 8.7 themes/socialbase/socialbase.theme \_socialbase_get_visibility_icon()
  8. 8.8 themes/socialbase/socialbase.theme \_socialbase_get_visibility_icon()

Helper function to retrieve the icon string for a visibility title.

Parameters

string $title: The title for the icon.

Return value

string The icon connected to the title.

3 calls to _socialbase_get_visibility_icon()
FieldDropdown::preprocess in themes/socialbase/src/Plugin/Preprocess/FieldDropdown.php
Preprocess theme hook variables.
FormElementLabel::preprocessElement in themes/socialbase/src/Plugin/Preprocess/FormElementLabel.php
Preprocess the variables array if an element is present.
socialbase_preprocess_input in themes/socialbase/includes/input.inc
Implements hook_preprocess_input().

File

themes/socialbase/socialbase.theme, line 65
The primary PHP file for the Social base theme.

Code

function _socialbase_get_visibility_icon($title) {

  // Set the materialize icon.
  switch ($title) {
    case 'Community':
      $icon = 'community';
      break;
    case 'Recipient':
      $icon = 'community';
      break;
    case 'Group members':
      $icon = 'lock';
      break;
    default:
      $icon = strtolower(HtmlUtility::escape($title));
  }
  return $icon;
}