dregad / dokuwiki-plugin-addnewpage Goto Github PK
View Code? Open in Web Editor NEWThis plugin adds a form for adding a new page (with namespace selection).
Home Page: https://www.dokuwiki.org/plugin:addnewpage
This plugin adds a form for adding a new page (with namespace selection).
Home Page: https://www.dokuwiki.org/plugin:addnewpage
When the pagename you type in the form contains a colon character ':', it creates a namespace with the name right of the colon. Is it a bug or a feature? The documentation on dokuwiki.org is not clear about this point.
There's something quite strange in this translation...
I assume I'm missing something simple, but I can't figure it out. I'm trying to create a skeleton framework that I can reuse for various things. As part of this skeleton i have a namespace "site_template". Somewhere in there, I'm using the addnewpage plugin and I don't want to hardcode the location, since the new page should be created relative to the current location (who point of the skeletal structure). I was originally trying "{{NEWPAGE>.:network}}" to put it in the network namespace under the current namespace (site_template). But that wasn't working. Then I got to looking at namespace templates. So now i'm trying "{{NEWPAGE>@ns@:network}}" But that just creates a namespace "ns:network" at the root. Am I missing something?
so when I am not logged in, {{NEWPAGE}} shows that I don't have permission. However, this doesn't automatically change after I log in; I have to manually click 'edit' and save so that this updates and enables me to create a new page. Is this only happening to me, or is this a bug?
See the plugin in action, and have a play with it, at: http://wiki.samwilson.id.au/dokuwiki FIXME
No demo page available at this url
$ diff de/ de-informal/
diff de/lang.php de-informal/lang.php
7c7
< $lang['nooption'] = "Sie besitzen nicht die Benutzerrechte um Seiten hinzuzufügen.";
---
> $lang['nooption'] = "Du besitzt nicht die Benutzerrechte um Seiten hinzuzufügen.";
Hi,
As described above, when I press the Add page button, it redirects to the start page.
Cleaned the cache. Also the button doesn't get disabled when the field for input new page is empty
Any ideas?
Thanks,
Dario
The form submit button is not disabled if there is no text in the title field. And when I click on it it redirects me to another existing page.
Problem
Due to poorly written condition in _makecombo()
function in syntax.php
file, form for creating of new page will (under some conditions) be shown even when user does not have privileges for doing so.
Note that this will not lead to security flaw, as Dokuwiki still shows Permission Denied warning after submitting, but still, it's something that should be fixed.
Conditions and how to reproduce
Bug will show up only when using {{NEWPAGE>[ns]}}
syntax, ie. namespace must be defined. Moreover, plugin»addnewpage»addpage_hide
option must be checked in Config Manager. This will lead to New page form being always displayed.
Fix
We need to perform additional ACL check in _makecombo()
function by replacing of these lines:
if (($data != "") && ($hide)) {
return '<input type="hidden" name="np_cat" id="np_cat" value="'.$this->_parse_ns($data).'"/>';
}
with this code:
if (($data != "") && ($hide)) {
if (auth_quickaclcheck($data.":") < AUTH_CREATE)
return $this->getLang('nooption');
else
return '<input type="hidden" name="np_cat" id="np_cat" value="'.$this->_parse_ns($data).'"/>';
}
Hope this will help!
Occurs on a page with {{NEWPAGE>namespace}}
tag, i.e. not using the #
template option.
Back trace:
#1 .../inc/parser/handler.php(284): syntax_plugin_addnewpage->handle('{{NEWPAGE>activ...', 5, 229, Object(Doku_Handler))
#2 .../inc/Parsing/Lexer/Lexer.php(270): Doku_Handler->plugin('{{NEWPAGE>activ...', 5, 229, 'addnewpage')
#3 .../inc/Parsing/Lexer/Lexer.php(197): dokuwiki\Parsing\Lexer\Lexer->invokeHandler('{{NEWPAGE>activ...', 5, 229)
#4 .../inc/Parsing/Lexer/Lexer.php(147): dokuwiki\Parsing\Lexer\Lexer->dispatchTokens('', '{{NEWPAGE>activ...', '_plugin_addnewp...', 229, 229)
#5 .../inc/Parsing/Parser.php(109): dokuwiki\Parsing\Lexer\Lexer->parse(' \\\\\n\n[[c_templa...')
#6 .../inc/parserutils.php(234): dokuwiki\Parsing\Parser->parse('\n====== Fiches ...')
#7 .../inc/parserutils.php(198): p_get_instructions('====== Fiches d...')
#8 .../inc/parserutils.php(525): p_cached_instructions('.../w...', false, 'activites:start')
#9 .../inc/parserutils.php(299): p_render_metadata('activites:start', Array)
#10 .../inc/common.php(266): p_get_metadata('activites:start')
#11 .../doku.php(97): pageinfo()
#12 {main}
This is with PHP 8.2 and DokuWiki Jack Jackrum release
This plugin has been unattended for many years, with community contributions just sitting there.
I need some fixes for PHP 8 compatibility, so I asked @samwilson if he was OK to let me help with maintenance or even take over the plugin.
He would like to make sure the community is fine with that, so if you are please vote with a 👍
Hi,
How could we force a .md suffix to ensure tech page would be title.md
and so that the markdownextra plugin will automatically parse it as markdown.
I haven’t find the way how I could automatically add the .md suffix.
It would be also useful to have this option configurable by adding a parameter to the syntax. I think many markdownextra plugin user would like this option.
I search for a way the url to be ?do=edit&id=title.md
and not ?do=edit&id=title
but I’m just to dumb to figure out.
Thanks for your help.
The plugins page says it is compatible with 2022-07-31 "Igor" but I am getting the following Warning with my PHP 8.1 installation:
[01-Feb-2023 23:33:43 Asia/Kolkata] PHP Warning: Undefined array key 1 in /home/ekvastra/wiki.ekvastra.in/lib/plugins/addnewpage/syntax.php on line 66
Environment: Release 2014-09-29b "Hrun"
Symptom
Reproducibility: Always
Is this a known issue?
How does plug-in evaluate whether user is permitted to create pages in a given namespace (Dokuwiki ACL or file permissions)?
Thanks a lot for this great plug-in, which is a must!
Is there a way to control the “Hide namespace selection” option on a per-instance basis as opposed to site-wide?
When newpagetemplates or newpagevars parameters are not set (e.g. when using a plain {{NEWPAGE}}
tag) and the newpagetemplate plugin is installed, it throws PHP Warnings.
This is really a bug of the newpagetemplate plugin, and has been reported there with a proposed fix several months ago (see turnermm/newpagetemplate#10).
I'm sorry that I don't know how to raise a feature request on Github.So I put the feature request in here hope you can see it.
I am trying to define a newpage button with a certain namespaces of a certain namespace showing on a combo box, but it is not working. The only way I can see a combo box is if I use {{NEWPAGE}} alone. Is it possible? I am trying the following syntax, where nsA(root:nsA:nsB) is a namespace that contains the namespaces that I would like the user to choose when creating a new page:
{{NEWPAGE>:nsA}},but combo box just can show subset of NSs for root not for naA
I love this pulgin.If it is possible to do that above,I'll very appreciate! Thank you very much.
Pls add an option that i can use headings instead of namespace
In DokuWiki deprecated logs:
resolve_pageid() is deprecated. It was called from syntax_plugin_addnewpage::_parseNSTemplatePage() in /Users/dregad/dev/dokuwiki/addnewpage/syntax.php:312 dokuwiki\File\PageResolver should be used instead!
Hi,
Since the installation I have the problem that pages where I can select "Add page" take an incredibly long time to load. Pages without the option load in the expected time. As soon as I deactivate the plugin, all pages load again as I expect.
Since I took over the system from my predecessor, PHP 5.6 is still running on the server. But this should be changed soon. Could this be a problem?
Thanks in advance!
Hello, thank you for the plugin.
Just a recommendation
on line 103 of syntax.php
. DOKU_TAB . DOKU_TAB . '<input class="edit" type="text" name="title" size="20" maxlength="255" tabindex="2" placeholder="Page Name" />' . DOKU_LF
Would also recommend adding some space to the form-control class but that's just nitpicking.
.form-control {
margin-bottom: 1em;
}
fancy
When I fill the field I may have instantly responses if some pages match but if I click on the search button then the http://wiki.clinique2rives.fr/lib/images/loading.gif is shown and nothing happens anymore. strange isn't it?
Hello,
neither the suggested solution on https://www.dokuwiki.org/plugin:addnewpage
Bug: Plugin jumps into Startpage-Editmode instead of creating new page
When Plugin jumps into Startpage-Editmode instead of creating new page, go into
Admin - Configuration and press save. Then it will work.
nor any other of my (few) attempts (set a ns, changing options,...) did solve the problem.
The Plugin persistently opens the Startpage in Edit-Mode. Without creating any new page.
The only "inconvenience" left so far i can think of is a misunderstanding of "go into Admin-Configuration an press save": that means to log in as Admin (what i am by default on the questioned Wiki), open the Admin- & Plugin-Config-Page, scroll down and press "Save", right? Or is there any other "Admin-Page"?
Any Ideas on that topic are most appreciated! Especially the helpful ones... ;-)
Regards,
Boris
This is related to #50.
Is it possible to get the option that the page created is the start page of a a name space? That is, if I write "some_page" in the input field, the page created is actually "some_page:start".
Perhaps it could be generic, the syntax could be modified with an optional "subnamespace": {{NEWPAGE>namespace>subnamespace}}
If you wrote "MY_PAGE" in the input field, your new page would be namespace:MY_PAGE:subnamespace
, e.g. from {{NEWPAGE>reports:electrical>start}}
I would get reports:electrical:MY_PAGE:start
.
Or even {{NEWPAGE>reports:electrical>some:deep:structure}}
to get reports:electrical:MY_PAGE:some:deep:structure
.
The reason is this: we use this plugin to create new problem report pages (bug reports, non-conformity reports), but people also need to upload various files relating to the problem, and I would like that these are stored in sub-namespaces withe the report's name.
I could ask people to write "the name of the page:start" in the input field, but I know many are not that technically minded and some will find this complicated and make errors, e.g. add spaces around the colon.
{{NEWPAGE>foo:@INPUT@:start}}
syntax (taken from the documentation) does not work (as described in the documentation).
Placeholder @INPUT@
is not replaced, resulting in new page ids, like so: /doku.php?id=foo:input:start:newpage
. (tested with Jackrum and current version of plugin)
Hi to the developer,
Iam using dokuwiki "Adora Belle" and the plugin with the latest version (2013-02-14).
Browser IE8 and Firefox.
When I click the “Add new page”-Button I get always redirected to the page where I placed the NewPage-Field and there was no new file created. The standard workarounds (clearing cache, cookies, etc) are already made, no success. Can anybody confirm that issue?
When using {{NEWPAGE}} in the sidebar the width is too large. Is there a way to control the width?
Hello, Is it possible to enhance the plugin adding a set of new pages instead of adding only one page?
With basic text into (something like "Page is currently being drafted. " ) and automatic registration?
I need to create a set 200 pages so I did generate the .txt whith database query but i can't create their associated dokuwiki metadata so the pages can't be edited. Really need a plugin and don't know how to develop it.
I have set the start page of each namespace to have the "add new page to that namespace" box. My users are seeing "You are not allowed to add pages" when they have Delete rights in ACLs. The only users who can still see the add new page box are the Superusers I put in the configuration manager.
Hi! Thank you for creating this , it really works very well in our workflow :)
Question though: is there a way to prefill the field (in my case i would like all docs to start with an ISO date)
Something like (in ascii art):
[2015-12-23 ChangePageTitle ] [Add page]
Thank you in advance, regards,
Vincent
When I activate add new page plugin, the table generated by struct plugin does not appear on the page.
Any advice would be appreciated.
The current version of the plugin has the date 2016-12-23 in plugin.info.txt. That seems highly improbable given #93 and the recent commits.
Dear Sam
I install the plugin and it looks fine. However, I was always directed to the start page and am unable to create the new page under the target namespace.
I am using the latest dokuwiki version ponder stibbons
You kind advice will be much appreciated
Greeting from HK
I'm using the dokuwiki version Weatherwax. When I create a new page using the add new page button then my __template.txt file isn't used and the url for the new document looks a little bit strange (e.g. the namespace is part of np_cat and not of the id).
doku.php?np_cat=sys&title=test&do=edit&id=
Before I've upgraded (from Adora Belle to Weatherwax and from the old version of 'add new page' to the new one) the url of a new document looks like:
doku.php?id=sys:test
Regards.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.