You are here

public static function LingotekConfigSet::getTitleBySetId in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.6 lib/Drupal/lingotek/LingotekConfigSet.php \LingotekConfigSet::getTitleBySetId()

Return the title for the given set id

Return value

string The title of the current set

2 calls to LingotekConfigSet::getTitleBySetId()
LingotekConfigSet::getTitle in lib/Drupal/lingotek/LingotekConfigSet.php
Return the title for the current set
lingotek_bulk_grid_parse_config_data in ./lingotek.config.inc

File

lib/Drupal/lingotek/LingotekConfigSet.php, line 143
Defines LingotekConfigSet.

Class

LingotekConfigSet
A class wrapper for Lingotek-specific behavior on ConfigSets.

Code

public static function getTitleBySetId($set_id) {
  $textgroup = db_select('lingotek_config_metadata', 'l')
    ->fields('l', array(
    'value',
  ))
    ->condition('id', $set_id)
    ->condition('config_key', 'textgroup')
    ->execute()
    ->fetchField();
  $all_from_group = db_select('lingotek_config_metadata', 'l')
    ->fields('l', array(
    'id',
  ))
    ->condition('config_key', 'textgroup')
    ->condition('value', $textgroup)
    ->orderBy('id')
    ->execute()
    ->fetchCol();
  $num_in_group = array_search($set_id, $all_from_group);
  $textgroup = $textgroup == 'default' ? 'Built-in Interface' : $textgroup;
  return ucfirst($textgroup) . ' ' . (1 + $num_in_group);
}