You are here

function view_mode_page_get_patterns in View Mode Page 7

Same name and namespace in other branches
  1. 8 view_mode_page.module \view_mode_page_get_patterns()
  2. 8.2 view_mode_page.module \view_mode_page_get_patterns()
  3. 7.2 view_mode_page.module \view_mode_page_get_patterns()

Get URL patterns.

Parameters

string $content_type: Optional limit to a specific content type.

string $view_mode: Optionally limit to a specific view_mode.

2 calls to view_mode_page_get_patterns()
view_mode_page_form_alter in ./view_mode_page.module
Implements hook_page_alter().
view_mode_page_menu_alter in ./view_mode_page.module
Implements hook_menu_alter().

File

./view_mode_page.module, line 275
View Mode Page module allows users to add a page for a specific view mode.

Code

function view_mode_page_get_patterns($content_type = NULL, $view_mode = NULL) {
  $query = db_select('view_mode_page');
  $query
    ->fields('view_mode_page');
  if ($content_type) {
    $query
      ->condition('content_type', $content_type, '=');
  }
  if ($view_mode) {
    $query
      ->condition('view_mode', $view_mode, '=');
  }
  $results = $query
    ->execute()
    ->fetchAll();
  $results = module_invoke_all('view_mode_page_get_patterns', $results, $content_type, $view_mode);
  return $results;
}