Git Product home page Git Product logo

dokuwiki-plugin-addnewpage's Introduction

Add New Page Plugin for DokuWiki

Copyright (c) 2006 Benjamin Santalucia [email protected]
Copyright (c) 2013 Sam Wilson [email protected]
Copyright (c) 2023 Damien Regad [email protected]

The plugin lets users put add new page forms within pages, with optional namespace selection.

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 or later.

This program is distributed in the hope that it will be useful, 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 the plugin's wiki page for information on how to install, configure and use this plugin in DokuWiki.

Support

Source code and support for this plugin can be found at https://github.com/dregad/dokuwiki-plugin-addnewpage

Credits

The plugin was originally written by Benjamin Santalucia (aka iDo) in 2006. It was forked after the 2009-02-14 release of Dokuwiki, and moved to GitHub by Robert McLeod in 2012. Refer to the Legacy Releases section in the plugin's home page for details on what happened in those early, pre-GitHub years.

In 2013, Sam Wilson picked up the plugin's maintenance and actively supported it until he stopped using DokuWiki at the end of 2016. During this time, he merged several improvements and fixes contributed by these fine people:

In May 2023, Damien Regad decided to take over the plugin's maintenance.

Thanks to all the people who contributed to this plugin over the years.

dokuwiki-plugin-addnewpage's People

Contributors

alexbelchior avatar alexgearbox avatar algorys avatar araname avatar arnehanssen avatar bobzbobz avatar brilanto avatar coastgnu avatar dokuwiki-translate avatar dregad avatar hamstar avatar jeinwag avatar joergdd avatar klap-in avatar micgro42 avatar michael-dev avatar mirko91 avatar mw75 avatar nelidimitrova avatar oleksiyfur avatar qezwan avatar rationality23 avatar reangd avatar samo079 avatar samwilson avatar sergey-art82 avatar sitenl avatar sizzname avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dokuwiki-plugin-addnewpage's Issues

New page plugin redirects to start page

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

enhancement: Add new namespace

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.

add a suffix - add a new Markdown

Hi,
How could we force a .md suffix to ensure tech page would be title.mdand 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=titlebut I’m just to dumb to figure out.
Thanks for your help.

@NS@ not working?

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?

Enhance plugin adding

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.

New maintainer ?

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 👍

pre-fill the page-title box

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

PHP 8.1 compatibility

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

Superuser: "You are not allowed to add pages"

Environment: Release 2014-09-29b "Hrun"

  • "Add new page" plug-in installed using extension manager
  • Default plug-in configuration
  • ACL is enabled

Symptom

  • After installation of plug-in pages may be created as documented.
  • Once logged out and re-logged in (as superuser) plug-in shows message as in subject.
  • Workaround: Re-install plug-in using extension manager to enable functionality during current session

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!

No new page added and redirect on the current page

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?

ACL Check doesn't work properly

  1. the plug-in seems to Register for any Check-ACL Event:
    $contr->register_hook('DOKUWIKI_STARTED', 'AFTER', $this, 'check_acl', array());
    When I add a simple echo Statement in function check_acl, then it appears on any page, wherever I
    navigate in my wiki

    Is this really intended?
  2. the check_acl function refuses access for any user but the @admin to read the template file
    permission-denied
    although the template file is readable (even writable) for a user of group @author
    wiki-screenshot_23012017_131324_004-red

Button not showing

I installed this plugin in order to make it easier for my users to create pages and assign them to a namespace easily, but the 'Add New Page' function/button doesn't show anywhere in my wiki, even as admin. Am I missing a step here?

This is how it looks in the conf settings page.
image

Template file isn't used with Weatherwax

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.

LANG de-informal is missing

$ 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.";

newpagetemplate plugin throws PHP Warnings

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).

question on installation

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

date 2016-12-23?

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.

Can you restrain the namespace list to a particular subset of NSs.

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.

"Plugin jumps into Startpage-Editmode"

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

[Improvement] width

When using {{NEWPAGE}} in the sidebar the width is too large. Is there a way to control the width?

pagename contains a colon ':'

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.

Undefined array key warning in addnewpage/syntax.php line 66

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

Form visible even when user does not have necessary rights

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!

permission doesn't update automatically

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?

Slow loading since installation

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!

Users denied permission to add pages

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.

Add placeholder= to indicate field requires a page name

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

image

resolve_pageid() is deprecated

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.