Commit c65c6440 authored by alexpott's avatar alexpott
Browse files

Issue #2011998 by David_Rothstein: String-parsing in hook_custom_theme()...

Issue #2011998 by David_Rothstein: String-parsing in hook_custom_theme() should be replaced with theme callbacks (for now).
parent bf2c404e
......@@ -6,16 +6,17 @@
*/
/**
* Implements hook_custom_theme().
*
* @todo Add an event subscriber to the Ajax system to automatically set the
* base page theme for all Ajax requests, and then remove this one off.
* See http://drupal.org/node/1954892.
* Implements hook_menu().
*/
function contextual_custom_theme() {
if (substr(current_path(), 0, 11) === 'contextual/') {
return ajax_base_page_theme();
}
function contextual_menu() {
// @todo Remove this menu item in http://drupal.org/node/1954892 when theme
// callbacks are replaced with something else.
$items['contextual/render'] = array(
'route_name' => 'contextual_render',
'theme callback' => 'ajax_base_page_theme',
);
return $items;
}
/**
......
......@@ -16,15 +16,21 @@
use Drupal\Component\Utility\NestedArray;
/**
* Implements hook_custom_theme().
*
* @todo Add an event subscriber to the Ajax system to automatically set the
* base page theme for all Ajax requests, and then remove this one off.
* Implements hook_menu().
*/
function edit_custom_theme() {
if (substr(current_path(), 0, 5) === 'edit/') {
return ajax_base_page_theme();
}
function edit_menu() {
// @todo Remove these menu items in http://drupal.org/node/1954892 when theme
// callbacks are replaced with something else.
$items['edit/metadata'] = array(
'route_name' => 'edit_metadata',
'theme callback' => 'ajax_base_page_theme',
);
$items['edit/form/%/%/%/%/%'] = array(
'route_name' => 'edit_field_form',
'theme callback' => 'ajax_base_page_theme',
);
return $items;
}
/**
......
......@@ -108,15 +108,17 @@ function editor_library_info() {
}
/**
* Implements hook_custom_theme().
*
* @todo Add an event subscriber to the Ajax system to automatically set the
* base page theme for all Ajax requests, and then remove this one off.
* Implements hook_menu().
*/
function editor_custom_theme() {
if (substr(current_path(), 0, 7) === 'editor/') {
return ajax_base_page_theme();
}
function editor_menu() {
// @todo Remove this menu item in http://drupal.org/node/1954892 when theme
// callbacks are replaced with something else.
$items['editor/%/%/%/%/%'] = array(
'route_name' => 'editor_field_untransformed_text',
'theme callback' => 'ajax_base_page_theme',
);
return $items;
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment