Commit 8905b6d0 authored by profix898's avatar profix898

- bugfix: move admin sidebar doesnt work for plugins page (#195879)

parent e6eb5e28
......@@ -421,15 +421,16 @@ function gallery_page() {
}
// Hack to get the admin sidebar
if (variable_get('gallery_move_admin_sidebar_to_block', 0)) {
if (preg_match("/^(.*<td id=\"gsSidebarCol\">)(.*?)(<\/td>.*?)$/s", $result['bodyHtml'], $match)) {
// New body
$result['bodyHtml'] = $match[1] . $match[3];
// Insert admin sidebar in $result['sidebarBlocksHtml']
list($result['bodyHtml'], $suffix) = explode('<td id="gsSidebarCol">', $result['bodyHtml']);
if ($suffix) {
list($sidebar, $suffix) = explode('</td>', $suffix, 2);
$result['bodyHtml'] .= '<td></td>'. $suffix;
// Insert admin $sidebar in $result['sidebarBlocksHtml']
if (empty($result['sidebarBlocksHtml'][1])) {
$result['sidebarBlocksHtml'][1] = $match[2];
}
$result['sidebarBlocksHtml'][1] = $sidebar;
}
else {
$result['sidebarBlocksHtml'][] = $match[2];
$result['sidebarBlocksHtml'][] = $sidebar;
}
}
}
......
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