Giter Site home page Giter Site logo

newpagetemplate's People

Contributors

dregad avatar micgro42 avatar splitbrain avatar turnermm avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

newpagetemplate's Issues

Messages in DokuWiki deprecated log

Messages in DokuWiki deprecated log:
require(action.php) is deprecated. It was called from require() in /var/www/dokuwiki/lib/plugins/newpagetemplate/action.php:20 Autoloading should be used instead!

  • newpagetemplate Plugin version: 2022-02-05;
  • DokuWiki version: 2023-04-04a "Jack Jackrum";
  • PHP 8.2;

The plugin eliminates a lot of routine. I really, really hope it's still maintained.

Default branch ?

Looking at the source code, I was a bit confused because the default master branch did not reflect the latest changes.

To avoid that, I would suggest to merge the cli branch into master, or to change the default branch to cli.

Thanks

Implementation of @CURNS@

Hi!

According to https://www.dokuwiki.org/plugin:addnewpage#new-page_templates the addnewpage plugin enables possibility of inlcuding custom templates via newpagetemplate. Therefore, following syntax results in expected behaviour, because newpagetemplate explicitly does not support @CURNS@ substitution by default as documented:

===== @CURNS@ does not work =====
{{NEWPAGE>:custom:namespace#:custom:template}}

===== @CURNS@ works with default __template.txt =====
{{NEWPAGE>:custom:namespace}}

As described here I manually adapted newpagetemplate to process @CURNS@ replacement according to default namespace templates which is handled inside inc/common.php.

The adaption inside lib/plugin/newpagetemplate/action.php: I added the 4 lines between @NS@ and @FILE@ and also 4 lines in array below respectively, currently at line 94. Please note that the $ID is written in capitals here what is different from default inc/common.php:

$tpl = str_replace(array(
                              '@ID@',
                              '@NS@',
                              '@CURNS@',
                              '@!CURNS@',
                              '@!!CURNS@',
                              '@!CURNS!@',
                              '@FILE@',
                              '@!FILE@',
                              '@!FILE!@',
                              '@PAGE@',
                              '@!PAGE@',
                              '@!!PAGE@',
                              '@!PAGE!@',
                              '@USER@',
                              '@NAME@',
                              '@MAIL@',
                              '@DATE@',
                              '@EVENT@'
                           ),
                           array(
                              $ID,
                              getNS($ID),
                              curNS($ID),
                              \dokuwiki\Utf8\PhpString::ucfirst(curNS($ID)),
                              \dokuwiki\Utf8\PhpString::ucwords(curNS($ID)),
                              \dokuwiki\Utf8\PhpString::strtoupper(curNS($ID)),
                              $file,
                              utf8_ucfirst($file),
                              utf8_strtoupper($file),
                              $page,
                              utf8_ucfirst($title),
                              utf8_ucwords($title),
                              utf8_strtoupper($title),
                              $_SERVER['REMOTE_USER'],
                              $INFO['userinfo']['name'],
                              $INFO['userinfo']['mail'],
                              $conf['dformat'],
                              $event->name ,
                           ), $tpl);

So far, this little adaption seems to work as expected. It is of great worth in our school environment as part of our customized dokuwiki.

I am not a php coder (yet) nor this is a real issue. Maybe this quick hack to enable the @CURNS@ functionality could be implemented inside this plugin quite easily.

Anyways, thank you for beautiful software!

Why is the required permission not AUTH_READ but AUTH_CREATE?

Hello

When I used this plugin at first, I saw the error "You do not have access to the template โ€ฆ" (while logging out from the superuser account)
Then I found that this is because the ACL of the template was 'read' (I don't want to allow users to change the template) and the required permission was 'create' (Line 151 of action.php)
I think that the permission check might be enough with 'AUTH_READ.'

Could you cope with it? (Tell me if there is a security risk I'm overlooking.)

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.