You are here

function opigno_context_get_title_from_scheme in Opigno 7.0

File

modules/opigno_context/opigno_context.module, line 68
Contains all hook_implementations and module specific API.

Code

function opigno_context_get_title_from_scheme($scheme, $url = NULL) {
  $routers = menu_get_router();
  $router = $routers[$scheme];
  if ($router['title callback'] == 't' && !empty($router['title'])) {
    return locale($router['title']);
  }
  elseif ($router['title callback'] && $router['title arguments'] && isset($url)) {
    $args = array();
    $split = explode('/', $url);
    foreach ($router['title arguments'] as $i) {
      if (isset($split[$i])) {
        if (isset($router['_load_functions'][$i])) {
          $args[] = call_user_func($router['_load_functions'][$i], $split[$i]);
        }
        else {
          $args[] = $split[$i];
        }
      }
      else {
        $args[] = 0;
      }
    }
    return call_user_func_array($router['title callback'], $args);
  }
  elseif ($router['page callback'] == 'views_page') {
    $cache = cache_get('ctools_export:views_view:og_ressource_pages', 'cache_views');
    dpm($cache);
  }
}