Skip to content

Commit

Permalink
reformatting, cleanup addStylesForSkins handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Klap-in committed Jan 4, 2024
1 parent c573654 commit eb57a9c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private function makeNodes(&$data, $indexLatestParsedItem, $previousLevel, &$nod
$node['folder'] = true;
// let php create url (considering rewriting etc)
$node['url'] = $item['hns'] === false ? false : wl($item['hns']);
if(!$item['hnsExists']) {
if (!$item['hnsExists']) {
//change link color
$node['hnsNotExisting'] = true;
}
Expand Down
24 changes: 7 additions & 17 deletions action.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function register(EventHandler $controller)
$controller->register_hook('TPL_CONTENT_DISPLAY', 'BEFORE', $this, 'showSortNumberAtTopOfPage');
}
$controller->register_hook('AJAX_CALL_UNKNOWN', 'BEFORE', $this, 'ajaxCalls');
$controller->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this, 'addStylesForUsedThemes');
$controller->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this, 'addStylesForSkins');
}

/**
Expand Down Expand Up @@ -535,24 +535,14 @@ private function printIndex($ns)
*
* @param Event $event
*/
public function addStylesForUsedThemes(Event $event)
public function addStylesForSkins(Event $event)
{
global $ID;

if (($themes = p_get_metadata($ID, 'indexmenu usedthemes')) !== null) { //METADATA_RENDER_UNLIMITED
$themes = array_keys($themes);
} else {
$themes = [];
}

//TODO works only on the main pages (where we can get its $ID) sidebars and other included pages we miss here
// foreach ($themes as $theme) {
// $event->data["link"][] = [
// "type" => "text/css",
// "rel" => "stylesheet",
// "href" => DOKU_BASE . "lib/plugins/indexmenu/scripts/fancytree/skin-$theme/ui.fancytree.min.css"
// ];
// }
// $event->data["link"][] = [
// "type" => "text/css",
// "rel" => "stylesheet",
// "href" => DOKU_BASE . "lib/plugins/indexmenu/scripts/fancytree/... etc etc"
// ];

// $event->data["link"][] = [
// "type" => "text/css",
Expand Down

0 comments on commit eb57a9c

Please sign in to comment.