forked from SoarinFerret/dokuwiki-plugin-pagebuttons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new page button, new folder button
- Loading branch information
1 parent
af0870a
commit 589a603
Showing
12 changed files
with
650 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
/** | ||
* New Folder Button plugin | ||
* | ||
* @copyright (c) 2020 Cody Ernesti | ||
* @license GPLv2 or later (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) | ||
* @author Cody Ernesti | ||
*/ | ||
|
||
namespace dokuwiki\plugin\pagebuttons; | ||
use dokuwiki\Menu\Item\AbstractItem; | ||
|
||
/** | ||
* Class NewFolderButton | ||
* | ||
* Implements the plugin's NewFolder button for DokuWiki's menu system | ||
* | ||
* @package dokuwiki\plugin\pagebuttons | ||
*/ | ||
class NewFolderButton extends AbstractItem { | ||
|
||
/** @var string icon file */ | ||
protected $svg = __DIR__ . '/images/folder-plus-outline.svg'; | ||
|
||
/** @inheritdoc */ | ||
public function __construct() { | ||
parent::__construct(); | ||
$this->params['sectok'] = getSecurityToken(); | ||
} | ||
|
||
/** | ||
* Get label from plugin language file | ||
* | ||
* @return string | ||
*/ | ||
public function getLabel() { | ||
$plugin = plugin_load('action', $this->type); | ||
return "New Folder"; | ||
//return $plugin->getLang('newfolder_menu_item'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
/** | ||
* Page Buttons plugin | ||
* | ||
* @copyright (c) 2020 Cody Ernesti | ||
* @license GPLv2 or later (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) | ||
* @author Cody Ernesti | ||
*/ | ||
|
||
namespace dokuwiki\plugin\pagebuttons; | ||
use dokuwiki\Menu\Item\AbstractItem; | ||
|
||
/** | ||
* Class NewPageButton | ||
* | ||
* Implements the plugin's new button for DokuWiki's menu system | ||
* | ||
* @package dokuwiki\plugin\pagebuttons | ||
*/ | ||
class NewPageButton extends AbstractItem { | ||
|
||
/** @var string icon file */ | ||
protected $svg = __DIR__ . '/images/file-plus-outline.svg'; | ||
|
||
/** @inheritdoc */ | ||
public function __construct() { | ||
parent::__construct(); | ||
$this->params['sectok'] = getSecurityToken(); | ||
} | ||
|
||
/** | ||
* Get label from plugin language file | ||
* | ||
* @return string | ||
*/ | ||
public function getLabel() { | ||
$plugin = plugin_load('action', $this->type); | ||
return "New Page"; | ||
//return $plugin->getLang('newpage_menu_item'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
# Delete Page Button Plugin for DokuWiki | ||
# Page Buttons Plugin for DokuWiki | ||
|
||
The plugin adds a _Delete page_ button to DokuWiki's | ||
[PageMenu](https://www.dokuwiki.org/devel:menus). | ||
The plugin adds a few Page Menu buttons to perform useful actions: | ||
|
||
This provides a simpler, quicker and more intuitive way for users to | ||
delete wiki pages, compared to the | ||
[documented page deletion method](https://www.dokuwiki.org/page#delete_a_page). | ||
* _Delete Page_ - Deletes the current page | ||
* _New Page_ - Creates a 'subpage' under the current namespace | ||
* _New Folder_ - Creates a 'subfolder' under the current namespace | ||
|
||
![Screenshot](images/screenshot.png) | ||
|
||
Copyright (c) 2020 Damien Regad <[email protected]> | ||
|
||
|
||
## License | ||
|
||
This program is free software; you can redistribute it and/or modify | ||
|
@@ -24,17 +20,12 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of | |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
|
||
|
||
## Installation and Configuration | ||
|
||
Please refer to https://www.dokuwiki.org/plugin:deletepagebutton for information | ||
on how to install and configure this plugin in DokuWiki. | ||
|
||
If you install this plugin manually, make sure it is installed in | ||
`lib/plugins/deletepagebutton/` - if the folder is called differently, | ||
`lib/plugins/pagebuttons/` - if the folder is called differently, | ||
it will not work! | ||
|
||
|
||
## Compatibility | ||
|
||
This plugin has been developped and tested with DokuWiki release | ||
|
@@ -45,12 +36,14 @@ Earlier releases are not supported. | |
## Support | ||
|
||
Source code and support for this plugin can be found at | ||
https://github.com/dregad/dokuwiki-plugin-deletepagebutton | ||
https://github.com/SoarinFerret/dokuwiki-plugin-pagebuttons | ||
|
||
## Credits | ||
|
||
Icon: https://materialdesignicons.com/icon/trash-can-outline | ||
Icons: | ||
* https://materialdesignicons.com/icon/trash-can-outline | ||
* https://materialdesignicons.com/icon/folder-plus-outline | ||
* https://materialdesignicons.com/icon/file-plus-outline | ||
|
||
|
||
I first thought I could adapt | ||
[this old plugin](https://github.com/caillou/dokuwiki-plugin-delete) | ||
but I ended up restarting from scratch. | ||
Built off the work provided here: https://github.com/dregad/dokuwiki-plugin-deletepagebutton |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,30 @@ | ||
<?php | ||
/** | ||
* Delete Page Button plugin - English language file | ||
* Page Buttons plugin - English language file | ||
* | ||
* @copyright (c) 2020 Cody Ernesti | ||
* @license GPLv2 or later (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) | ||
* @author Cody Ernesti | ||
* | ||
* Modified from: https://github.com/dregad/dokuwiki-plugin-deletepagebutton | ||
* | ||
* Original license info: | ||
* | ||
* @copyright (c) 2020 Damien Regad | ||
* @license GPLv2 or later (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) | ||
* @author Damien Regad | ||
*/ | ||
|
||
$lang['menu_item'] = 'Delete page'; | ||
$lang['deleted_ok'] = 'Page deleted successfully'; | ||
$lang['newpage_menu_item'] = 'New page'; | ||
$lang['delete_menu_item'] = 'Delete page'; | ||
$lang['newfolder_menu_item'] = 'New folder'; | ||
$lang['deleted_ok'] = 'Page deleted successfully'; | ||
|
||
$lang['js']['title'] = $lang['menu_item']; | ||
$lang['js']['confirm'] = 'Are you sure you want to delete this page ?'; | ||
$lang['js']['btn_ok'] = 'OK'; | ||
$lang['js']['btn_cancel'] = 'Cancel'; | ||
$lang['js']['delete_title'] = $lang['delete_menu_item']; | ||
$lang['js']['newpage_title'] = $lang['newpage_menu_item']; | ||
$lang['js']['newfolder_title'] = $lang['newfolder_menu_item']; | ||
$lang['js']['delete_confirm'] = 'Are you sure you want to delete this page ?'; | ||
$lang['js']['newpage_prompt'] = 'What is the name of the sub-page you would like to create ?'; | ||
$lang['js']['newfolder_prompt'] = 'What is the name of sub-folder you would like to create ?'; | ||
$lang['js']['btn_ok'] = 'OK'; | ||
$lang['js']['btn_cancel'] = 'Cancel'; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.