michitux / dokuwiki-plugin-move

Move and rename pages and namespaces whilst maintaining the links
http://www.dokuwiki.org/plugin:move
GNU General Public License v2.0
40 stars 20 forks source link

Failed to handle action: plugin_move #263

Closed LouisOuellet closed 8 months ago

LouisOuellet commented 9 months ago

Hi, Been working on Writr. I updated all the menus to the new menu system. It seems the menu item for this plugin is not functioning properly. Maybe you can help me out.

Notes on my environment. Using MAMP PRO (Apache and PHP 8.1) and Dokuwiki "Jack Jackrum".

Here is the code for the new menu:

<?php $items = (new \dokuwiki\Menu\PageMenu())->getItems();
foreach($items as $item) {
    echo '<li>'
        .'<a href="'.$item->getLink().'" class="action '.strtolower($item->getType()).'" title="'.$item->getTitle().'">'
        .'<span class="icon"></span>'
        .'<span class="a11y">'.$item->getLabel().'</span>'
        .'</a></li>';
} ?>

Posted some screenshots of the issue here : GitHub Repo

Ideally, I would like to style it the same way I did with the addnewpage plugin. Screenshot

Here is how I was able to implement that one:

<?php if (!$conf['useacl'] || ($conf['useacl'] && $INFO['perm'] >= 4)): ?>
    <?php $instructions = p_get_instructions('{{'.tpl_getConf('defaultAddNewPage').'}}');
    if(count($instructions) <= 3) {
        $render = p_render('xhtml',$instructions,$info);
        echo '<li>'
            .'<a href="#" class="action AddNewPage" title="'.tpl_getLang('AddNewPage').'">'
            .'<span class="icon"></span>'
            .'<span class="a11y">'.tpl_getLang('AddNewPage').'</span>'
            .'</a>'
            .$render
            .'</li>';
    } ?>
<?php endif ?>

You can review the code here : main.php

thejulian commented 8 months ago

+1 need this disabled plugin for now. Running Dokuwiki Kaos with Writr template.

LouisOuellet commented 8 months ago

Was able to fix by using the attributes instead.

<?php $items = (new \dokuwiki\Menu\PageMenu())->getItems();
foreach($items as $item) {
    $attributes = $item->getLinkAttributes();
    $html = '<li><a';
    foreach($attributes as $key => $value) {
        $html .= ' '.$key.'="'.$value.'"';
    }
    $html .= '><span class="icon"></span>'
        .'<span class="a11y">'.$item->getLabel().'</span>'
        .'</a></li>';
    echo $html;
} ?>