function view_mode_page_delete_patterns in View Mode Page 8
Same name and namespace in other branches
- 8.2 view_mode_page.module \view_mode_page_delete_patterns()
- 7.2 view_mode_page.module \view_mode_page_delete_patterns()
- 7 view_mode_page.module \view_mode_page_delete_patterns()
Delete URL patterns from the database.
The query may be used with no arguments or with one or more arguments. Each argument increases the specificity of the delete process.
This does not necessarily effect the patterns saved in the menu_router table. It only removes the patterns from the View Mode Page table.
Parameters
string $content_type: The name of the content type that the pattern is used for.
string $view_mode: The name of the view mode.
string $pattern: The URL pattern that is used in the hook_menu() call.
1 call to view_mode_page_delete_patterns()
- view_mode_page_form_submit in ./
view_mode_page.module - Implements hook_form_submit().
File
- ./
view_mode_page.module, line 253 - View Mode Page module allows users to add a page for a specific view mode.
Code
function view_mode_page_delete_patterns($content_type = NULL, $view_mode = NULL, $pattern = NULL) {
$query = db_delete('view_mode_page');
if ($content_type) {
$query
->condition('content_type', $content_type, '=');
}
if ($view_mode) {
$query
->condition('view_mode', $view_mode, '=');
}
if ($pattern) {
$query
->condition('url_pattern', $pattern, '=');
}
$result = $query
->execute();
module_invoke_all('view_mode_page_patterns_deleted', $content_type, $view_mode, $pattern);
return $result;
}