Comments (4)
I thought i would take a stab at this, and I've gotten pretty close.
I started out by downloading the following plugin to see how they were doing it:
https://www.dokuwiki.org/plugin:dw2pdf
Then I grabbed an icon and overlayed it on theirs
Used an icon from http://icons8.com/icons/#!/1878/rename
Then made the following changes to your plugin:
Add style.css
to root:
/**
* mode move_rename pagetool icon
*/
#dokuwiki__pagetools ul li a.move_rename {
background-position: right 0;
}
#dokuwiki__pagetools ul li a.move_rename:before {
content: url(pagetools-moverename-sprite.png);
margin-top: 0;
}
#dokuwiki__pagetools:hover ul li a.move_rename,
#dokuwiki__pagetools ul li a.move_rename:focus,
#dokuwiki__pagetools ul li a.move_rename:active {
background-image: url(pagetools-moverename-sprite.png);
}
#dokuwiki__pagetools ul li a.move_rename:hover,
#dokuwiki__pagetools ul li a.move_rename:active,
#dokuwiki__pagetools ul li a.move_rename:focus {
background-position: right -45px;
}
Add to the bottom of lang/en/lang.php
:
// Page Tools
$lang['move_button'] = 'Move/Rename';
Add to action.php
around line 25
in register
function:
$controller->register_hook('TEMPLATE_PAGETOOLS_DISPLAY', 'BEFORE', $this, 'addbutton', array());
$controller->register_hook('ACTION_ACT_PREPROCESS', 'BEFORE', $this, 'handle_moverenamebutton', array());
Add to action.php
somewhere in the file:
/**
* Handle when user clicks on move rename button
*
* @param Doku_Event $event
* @param array $param
* @return bool
*/
public function handle_moverenamebutton(&$event, $param) {
global $ACT;
global $REV;
global $ID;
global $INPUT, $conf;
// our event?
if($ACT != 'move_rename') return false;
// check user's rights
if(auth_quickaclcheck($ID) < AUTH_READ) return false;
//$list[0] = $ID;
//$title = p_get_first_heading($ID);
}
/**
* Add 'move rename'-button to pagetools
*
* @param Doku_Event $event
* @param mixed $param not defined
*/
public function addbutton(&$event, $param) {
global $ID, $REV;
//if($this->getConf('showexportbutton') && $event->data['view'] == 'main') {
$params = array('do' => 'move_rename');
if($REV) $params['rev'] = $REV;
// insert button at position before last (up to top)
$event->data['items'] = array_slice($event->data['items'], 0, -1, true) +
array('move_rename' =>
'<li>'
. '<a href=' . wl($ID, $params) . ' class="action move_rename" rel="nofollow" title="' . $this->getLang('move_button') . '">'
. '<span>' . $this->getLang('move_button') . '</span>'
. '</a>'
. '</li>'
) +
array_slice($event->data['items'], -1, 1, true);
//}
}
My issue is that when you click the link you get the following message Command unknown: move_rename
. I tried linking directly to the page doku.php?id=proxy_request_service&do=admin&page=move
, but that doesn't pick up what page they were on, so I think that's risky.
Do you know how I can register that move_rename
action, or how to link directly to the page and have it fill in the proper page?
I would be happy to do a pr once I get this working.
from dokuwiki-plugin-move.
Well, I changed the url to doku.php?id='.$ID.'&do=admin&page=move
and that seems to work
from dokuwiki-plugin-move.
The new version of the move plugin which has been released today supports this directly at least for the dokuwiki template.
from dokuwiki-plugin-move.
This is now a configuration option in the move plugin.
from dokuwiki-plugin-move.
Related Issues (20)
- Content of data files for pages changed by the move plugin
- Feature Request: Redirections to moved page HOT 1
- Found these errors in the log file
- Move page incl. the contained images? HOT 3
- Compatibility with release "Igor"? HOT 3
- Page name is 'a56fad7c-d026-4e88-b6fe-06fb46f3fed4'. Rename does not work. HOT 1
- The "Copy Page Plugin" has a better placement of the command "copy page" HOT 1
- Update index after moving media HOT 1
- Not renaming media with "this>" syntax
- Not renaming media with embedded image syntax HOT 3
- "Last visited" breadcrumb shows both pages after renaming
- Can't only create pages/media namespaces HOT 1
- Update log folder location
- Help with move plugin changes HOT 9
- Plugin breaks new ~ syntax for page relative namespace links HOT 2
- Missing $INFO['userinfo']['name'] on move handler HOT 2
- when i read dokuwiki media (*.jpg) on the smartphone, There is a log message as below. HOT 2
- Show page title in tree view (Feature Request)
- Deprecated log errors + No exit
- $mobileMenuOption.form is not a function HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dokuwiki-plugin-move.