You are here

function skinr_panels_skinr_ui_element_title in Skinr 8.2

Same name and namespace in other branches
  1. 7.2 skinr_panels/skinr_panels.skinr.inc \skinr_panels_skinr_ui_element_title()

Implements hook_skinr_ui_element_title().

File

skinr_panels/skinr_panels.skinr.inc, line 161
Implements Skinr hooks for panels.module.

Code

function skinr_panels_skinr_ui_element_title($module, $element, $theme_name) {
  if ($module == 'panels') {
    list($hook, $uuid) = explode('__', $element);
    $did = _skinr_panels_display_from_uuid($uuid);
    if ($display = panels_load_display($did)) {
      $title = $display->title;
      if (!$title && module_exists('panels_node')) {
        $nid = db_query("SELECT nid FROM {panels_node} WHERE did = :did", array(
          ':did' => $did,
        ))
          ->fetchField();
        if ($node = node_load($nid)) {
          $title = $node->title;
        }
      }
      return t('Pane %pane on %panel', array(
        '%panel' => $title ? $title : t('display !did', array(
          '!did' => $did,
        )),
        '%pane' => $uuid,
      ));
    }
  }
}