plugin:addnewpage
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:addnewpage [2012-09-16 08:02] – [do=addnewpage] 92.225.179.87 | plugin:addnewpage [2024-02-15 21:47] (current) – Aleksandr | ||
---|---|---|---|
Line 2: | Line 2: | ||
---- plugin ---- | ---- plugin ---- | ||
- | description: | + | description: |
- | author | + | author |
- | email : ido@idotech.info | + | email : dregad@mantisbt.org |
type : syntax | type : syntax | ||
- | lastupdate : 2009-04-23 | + | lastupdate : 2023-05-10 |
- | compatible : 2009-02-14, rincewind, angua | + | compatible : Rincewind, Angua, Adora Belle, Ponder Stibbons, Hrun, Detritus, Elenor of Tsort, Frusterick Manners, Greebo, Hogfather, Igor, Jack Jackrum, Kaos |
depends | depends | ||
- | conflicts | + | conflicts |
- | similar | + | similar |
tags : button, form, create | tags : button, form, create | ||
- | downloadurl: | ||
- | ---- | ||
- | This is the new RELEASE for the DokuWiki 2009-02-14 version. If you want the old version see [[plugin:addnewpage_old]] | + | downloadurl: https://github.com/dregad/dokuwiki-plugin-addnewpage/zipball/master |
- | + | bugtracker | |
- | This plugin adds a selection box and an input box for adding a new page. | + | sourcerepo |
- | + | donationurl: https://github.com/sponsors/dregad | |
- | The selection box contains all namespaces of your wiki. | + | |
- | ===== Demo ===== | + | |
- | < | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | ====== syntax ====== | + | |
- | + | ||
- | Just write | + | |
- | {{NEWPAGE}} | + | |
- | + | ||
- | or | + | |
- | {{NEWPAGE> | + | |
- | + | ||
- | where " | + | |
- | * hide the select box | + | |
- | * or show only subnamespace | + | |
- | To configure it, use the config manager. | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | ====== Installation ====== | + | |
- | + | ||
- | Install the plugin using the [[plugin: | + | |
- | + | ||
- | ====== Configuration ====== | + | |
- | + | ||
- | You can configure the plugin in the Config Manager of DokuWiki. | + | |
- | ====== Tips ====== | + | |
- | + | ||
- | If you want to show the add new page forms out of a page (for example in your template), put this line where you want to see the plugin : | + | |
- | <code php> | + | |
- | <?php | + | |
- | echo p_render(' | + | |
- | ?> | + | |
- | </ | + | |
- | + | ||
- | __Hint__: If you like to add an icon stored in " | + | |
- | < | + | |
- | <a href="<? | + | |
- | </ | + | |
- | + | ||
- | ====== Language ====== | + | |
- | * French | + | |
- | * English | + | |
- | * arabic | + | |
- | * Italian (incomplete) | + | |
- | * Russian | + | |
- | * Ukrainian | + | |
- | * German | + | |
- | * Spanish | + | |
- | * Traditional Chinese | + | |
- | * Chinese (Simplified) | + | |
- | * Japanese | + | |
- | * Swedish | + | |
- | * Korean | + | |
- | * Vietnamese | + | |
- | * Other ? add here or mail me : [[ido@woow-fr.com|ido@woow-fr.com]] | + | |
- | + | ||
- | ===== Language files ===== | + | |
- | ==== French ==== | + | |
- | === lang.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /*USE : UTF8*/ | + | |
- | /* | + | |
- | French language file | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | ?> | + | |
- | </ | + | |
- | === settings.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /*USE : UTF8*/ | + | |
- | + | ||
- | /* | + | |
- | * French language file | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | ?> | + | |
- | </ | + | |
- | + | ||
- | ==== English ==== | + | |
- | I made a few linguistic fixes to make it more English :-) | + | |
- | + | ||
- | === lang.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /* | + | |
- | English language file | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | //Setup VIM: ex: et ts=2 enc=utf-8 : | + | |
- | ?> | + | |
- | </code> | + | |
- | === settings.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /*USE : UTF8*/ | + | |
- | + | ||
- | /* | + | |
- | * English language file | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | ?> | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | ==== German ==== | + | |
- | === lang.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /* | + | |
- | German language file | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | //Setup VIM: ex: et ts=2 enc=utf-8 : | + | |
- | ?> | + | |
- | </ | + | |
- | + | ||
- | === settings.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /*USE : UTF8*/ | + | |
- | + | ||
- | /* | + | |
- | * German language file | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | ?> | + | |
- | </code> | + | |
- | + | ||
- | + | ||
- | + | ||
- | ==== Spanish ==== | + | |
- | === lang.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /* | + | |
- | Spanish language file (Paraguay) | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | //Setup VIM: ex: et ts=2 enc=utf-8 : | + | |
- | ?> | + | |
- | </code> | + | |
- | === settings.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /*USE : UTF8*/ | + | |
- | + | ||
- | /* | + | |
- | * Spanish language file | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | ?> | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | ==== Portuguese ==== | + | |
- | === lang.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /* | + | |
- | Portuguese language file | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | //Setup VIM: ex: et ts=2 enc=utf-8 : | + | |
- | ?> | + | |
- | </ | + | |
- | === settings.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /*USE : UTF8*/ | + | |
- | + | ||
- | /* | + | |
- | * Portuguese language file | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | ?> | + | |
- | </code> | + | |
- | + | ||
- | + | ||
- | ==== Traditional Chinese ==== | + | |
- | === lang.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /* | + | |
- | Traditional Chinese language file | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | //Setup VIM: ex: et ts=2 enc=utf-8 : | + | |
- | ?> | + | |
- | </ | + | |
- | === settings.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /* | + | |
- | | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | ?> | + | |
- | </ | + | |
- | + | ||
- | ==== Chinese(Simplified) ==== | + | |
- | === lang.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /* | + | |
- | * Chinese(Simplified) language file | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | //Setup VIM: ex: et ts=2 enc=utf-8 : | + | |
- | ?> | + | |
- | </ | + | |
- | === settings.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /* | + | |
- | | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | ?> | + | |
- | </ | + | |
- | + | ||
- | ==== Italian ==== | + | |
- | + | ||
- | + | ||
- | === lang.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /* | + | |
- | Italian language file | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | //Setup VIM: ex: et ts=2 enc=utf-8 : | + | |
- | ?> | + | |
- | </code> | + | |
- | === settings.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /*USE : UTF8*/ | + | |
- | + | ||
- | /* | + | |
- | * Italian language file | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | ?> | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | ==== Japanese ==== | + | |
- | + | ||
- | === lang.php === | + | |
- | + | ||
- | <code php> | + | |
- | <?php | + | |
- | /* | + | |
- | Japanese language file | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | //Setup VIM: ex: et ts=2 enc=utf-8 : | + | |
- | ?> | + | |
- | </ | + | |
- | + | ||
- | === settings.php === | + | |
- | + | ||
- | <code php> | + | |
- | <?php | + | |
- | /*USE : UTF8*/ | + | |
- | + | ||
- | /* | + | |
- | * Japanese language file | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | ?> | + | |
- | </ | + | |
- | + | ||
- | ==== Swedish ==== | + | |
- | + | ||
- | === lang.php === | + | |
- | + | ||
- | <code php> | + | |
- | <?php | + | |
- | + | ||
- | /* | + | |
- | * Swedish language file | + | |
- | * Save file as UTF8. | + | |
- | */ | + | |
- | + | ||
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | ?> | + | |
- | </ | + | |
- | + | ||
- | === settings.php === | + | |
- | + | ||
- | <code php> | + | |
- | <?php | + | |
- | + | ||
- | /* | + | |
- | * Swedish language file | + | |
- | * Save file as UTF8. | + | |
- | */ | + | |
- | + | ||
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | ?> | + | |
- | </ | + | |
- | ==== Russian ==== | + | |
- | + | ||
- | + | ||
- | === lang.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /* | + | |
- | * Russian language file | + | |
- | */ | + | |
- | $lang[' | + | |
- | + | ||
- | $lang[' | + | |
- | + | ||
- | $lang[' | + | |
- | $lang[' | + | |
- | //Setup VIM: ex: et ts=2 enc=utf-8 : | + | |
- | </ | + | |
- | === settings.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /*USE : UTF8*/ | + | |
- | + | ||
- | /* | + | |
- | * Russian language file | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | </ | + | |
- | + | ||
- | ==== Ukrainian ==== | + | |
- | + | ||
- | === lang.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /* | + | |
- | Ukrainian language file | + | |
- | */ | + | |
- | $lang[' | + | |
- | + | ||
- | $lang[' | + | |
- | + | ||
- | $lang[' | + | |
- | $lang[' | + | |
- | //Setup VIM: ex: et ts=2 enc=utf-8 : | + | |
- | ?> | + | |
- | </ | + | |
- | === settings.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /*USE : UTF8*/ | + | |
- | + | ||
- | /* | + | |
- | * Ukrainian language file | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | ?> | + | |
- | </ | + | |
- | + | ||
- | ==== Arabic ==== | + | |
- | you will need to [[# | + | |
- | + | ||
- | === lang.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /* | + | |
- | Arabic language file by Ojuba.org team <core AT ojuba DOT org> | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | //Setup VIM: ex: et ts=2 enc=utf-8 : | + | |
- | ?> | + | |
- | </ | + | |
- | === settings.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /*USE : UTF8*/ | + | |
- | + | ||
- | /* | + | |
- | * Arabic language file by Ojuba.org team <core AT ojuba DOT org> | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | ?> | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | ==== Korean ==== | + | |
- | === lang.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /* | + | |
- | Korean language file | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | //Setup VIM: ex: et ts=2 enc=utf-8 : | + | |
- | ?> | + | |
- | </ | + | |
- | === settings.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /*USE : UTF8*/ | + | |
- | + | ||
- | /* | + | |
- | * Korean language file | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | ?> | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | ==== Vietnamese ==== | + | |
- | + | ||
- | === lang.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /* | + | |
- | Vietnamese language file | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | //Setup VIM: ex: et ts=2 enc=utf-8 : | + | |
- | ?> | + | |
- | </ | + | |
- | === settings.php === | + | |
- | <code php> | + | |
- | <?php | + | |
- | /*USE : UTF8*/ | + | |
- | + | ||
- | /* | + | |
- | * Vietnamese language file | + | |
- | */ | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | $lang[' | + | |
- | ?> | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | ====== History ====== | + | |
- | * 2008-01-10 : New zip file with some correction (the submit bug in IE, the namespace " | + | |
- | * 2007-05-19 : Portuguese language definitions added for completely hide NEWPAGE by GibaPhp | + | |
- | * 2007-01-21 : Can configure if you want to add some message about rights or completely hide NEWPAGE | + | |
- | * 2007-01-21 : Now support ACL (thanks to 66[dot]7[dot]118[dot]82 (FIXME) ) | + | |
- | * 2007-01-13 : Add new functionality with the syntax < | + | |
- | * 2007-01-12 : Remove 4 invisible hex chars in script.js, adding Italian and Russian (incomplete) | + | |
- | * 2007-01-11 : Fix encoding problem (with old noaccent function) | + | |
- | * 2006-12-20 : New Release, old version on : [[plugin: | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | ====== Discussion ====== | + | |
- | ==== addnewpage as a part of the admin page ==== | + | |
- | Is there a possibilty to add the plugin as a part of the admin page, like the plugins pagemove or upgrade ? | + | |
- | - oscon, 2010-11-15 | + | |
- | ==== Only one newpage per page ==== | + | |
- | Freight has written here, that only one NEWPAGE is allowed on one site, I think, it is very big lack of functionality. | + | |
+ | screenshot_img: | ||
---- | ---- | ||
- | It also doesn' | + | ===== Installation ===== |
- | ---- | + | Search and install the plugin using the [[plugin: |
- | After installing Release rc2009-01-30 addnewpage does not work anymore. Can anybody help me? | + | ===== Description ===== |
- | ---- | + | This plugin |
- | I am not sure where exactly to put the above PHP code (from the [[plugin: | + | |
- | >Put it where you want to see the new page forms. (\lib\tpl\default\main.php)\\ | + | |
- | >> | + | |
- | >>> | + | |
- | <code php> | + | |
- | $out = p_render(' | + | |
- | echo str_replace(array("< | + | |
- | </ | + | |
- | >>> | + | |
- | <code php> | + | |
- | ob_start(); | + | |
- | echo p_render(' | + | |
- | $out = ob_get_clean(); | + | |
- | echo str_replace(array("< | + | |
- | </ | + | |
- | >>>> | + | |
- | <code php> | + | |
- | <?php echo str_replace(array("< | + | |
- | </ | + | |
- | >>>> | + | |
- | < | + | The target |
- | ===== Enhancements ===== | + | |
- | I would like to use the plugin in a wiki with a lot of namespaces and it would be great if the syntax would allow to preset the namespace | + | |
- | this would be benefit so that the users of the wiki do not need to understand the structure of the wiki. | + | |
- | \\ | + | |
- | \\ | + | |
- | The idea of how to implement this would be that you could use the same code as today, but you fill the [namespace] parameter as an default into the field. In addition, you hide the field. This should work! | + | |
- | \\ | + | |
- | what do you think about this?\\ | + | |
- | Martin | + | The plugin can pair with the [[plugin: |
- | > Hello, I think about this functionality. But I don't now what's better between your option and this option : the < | + | |
- | >> Hi, I implemented to code already... so if you want to use it please give me your email and I can send it to you... I do not have any preferences for the option : or > | + | The form submit button is disabled |
- | </ | + | |
+ | ===== Usage ===== | ||
+ | Put '' | ||
- | <del> | + | ==== Screenshots ==== |
- | ===== Script Bug ===== | + | | {{: |
- | Also the new version contains the same bug. I found now the problem: | + | | {{: |
- | script does not contain an error, it is a 3 character long prefix in the file, which is not indicated by normal text editors (probably | + | | {{:plugin: |
- | (I put a German translation, | + | | {{http://i.imgur.com/gQ6yl0Y.png }} | Parent namespaces are greyed-out where the user has no access |
- | > I update again the zip without this invisible hex code... It works better? | + | |
- | > I never see you translation, | + | |
- | >> Now it works :-). | + | |
- | >> (I think it is the editor you use, I found this head too in the PHP files, | + | |
- | >> The German text is already Unicode coded, you can copy it as ASCII. (ß => ß, ü => ü) | + | |
- | </ | + | |
- | By testing the new release, now with %%{{NEWPAGE}}%% its only the root in the list, nothing else. \\ | + | ===== Syntax ===== |
- | >Ok, I've just fix it ! sorry ;) | + | |
- | I'm always getting an error after I've put the < | + | ==== Basic ==== |
- | Fatal error: Call to undefined function: getconf() in / | + | |
- | Is there any particular reason why I would be getting this?\\ | + | |
- | > Do you use the latest DokuWiki release ? | + | |
- | < | + | The basic syntax |
- | I have a bunch of users on my wiki, each with there own namespace that they can put stuff in. It gets really confusing for them to see all the namespaces, especially when they can only create pages in just a few of them. Here is the patch that I made that will restrict the selection box to namespaces in which the current user can actually create a new page. If the showroot option is true, then the root will always be shown, but may be disabled if the permissions aren't right. | + | |
- | < | + | {{NEWPAGE}} |
- | --- syntax.php | + | |
- | +++ syntax.php | + | |
- | @@ -66,15 +66,19 @@ | + | |
- | $ret='< | + | Or, to specify a namespace: |
- | if ($this-> | + | |
- | + | + | |
- | + else $root_disabled=''; | + | |
- | if ($data=='' | + | |
- | - | + | |
- | Lang(' | + | |
- | + | + | |
- | eRoot' | + | |
- | else | + | |
- | - | + | |
- | + | + | |
- | >'; | + | |
- | } | + | |
- | foreach ($r as $k => $v) { | + | |
- | if ($data != '' | + | |
- | if (strpos(":" | + | |
- | } | + | |
- | + | + | |
- | $vv=explode(':', | + | |
- | $vv=str_repeat('& | + | |
- | $ret.='< | + | |
- | </ | + | |
- | </ | + | |
- | Maybe a user have generally the right to add pages, but only in a specific namespace. | + | {{NEWPAGE>namespace}} |
- | <code> | + | |
- | #--- in acl.auth.php | + | |
- | #--- NOT " | + | |
- | * | + | |
- | test: | + | |
- | or | + | Where '' |
+ | When this is specified, the namespace selection box can either be hidden (which it is by default) | ||
+ | This is configured in the main wiki configuration manager. | ||
+ | If '' | ||
- | #--- ONLY " | + | ==== Creating a namespace ==== |
- | * | + | |
- | test: | + | |
- | </ | + | |
- | had the same effect like the option | + | It is possible to use the '' |
- | < | + | |
- | {{NEWPAGE[> | + | |
- | {{NEWPAGE[< | + | |
- | </ | + | |
- | (I am unfortunately not a good PHP programmer) | + | {{NEWPAGE> |
- | > Actually, if a user have write access in ns1:ns2 and not in ns1:ns2:ns3 and again write access in ns1: | + | will create |
- | ------ | ||
+ | ==== Date/ | ||
- | ==== Newpagetemplate patch ==== | + | The plugin supports usage of [[https:// |
- | I just added an action plugin that allows a user to specify a template to use when creating a page. The point of the plugin was to extend the addnewpage plugin so that the user could write something like: | + | |
- | < | + | |
- | {{NEWPAGE> | + | |
- | </code> | + | |
- | and the page :pagetemplate:newpagetemplate would function as a namespace template for the new page (i.e., the : | + | |
- | Here' | + | When used together with the [[# |
- | < | + | |
- | --- syntax.php | + | |
- | +++ syntax.php | + | |
- | @@ -28,8 +28,8 @@ | + | |
- | } | + | |
- | + | ||
- | | + | |
- | - $ns = substr($match, | + | |
- | - return $ns; | + | |
- | + $ns = explode(' | + | |
- | + return array(trim($ns[0]), | + | |
- | } | + | |
- | + | ||
- | + | ||
- | @@ -38,7 +38,7 @@ | + | |
- | $renderer-> | + | |
- | + | ||
- | if ($mode == ' | + | |
- | - | + | |
- | + | + | |
- | if ($cmb==$this-> | + | |
- | $renderer-> | + | |
- | return true; | + | |
- | @@ -49,7 +49,15 @@ | + | |
- | $renderer->doc .= $cmb; | + | |
- | $renderer-> | + | |
- | $renderer-> | + | |
- | - | + | |
- | + if(strlen($data[1])> | + | |
- | + | + | |
- | + | + | |
- | + | + | |
- | + | + | |
- | + } | + | |
- | + } | + | |
- | + | + | |
- | + | + | |
- | $renderer-> | + | |
- | $renderer-> | + | |
- | </ | + | |
- | If you'd like to roll this into the official addnewpage plugin, that would be great! | + | |
- | ---- | + | ==== Configuration overrides ==== |
- | Regarding this patch: How can I apply it? I tried | + | It is possible to override the plugin' |
- | cat the-patch.diff | patch -p0 | + | General syntax: |
- | in the plugin directory, but all three hunks were rejected. Any idea why? | + | ? |
- | -- Niklas Volbers | + | Examples: |
- | you should run it within | + | * overwrite |
- | + | {{NEWPAGE> | |
- | -- Sergio | + | |
- | + | ||
- | > The patched syntax.php of the addnewpage-plugin is not available anymore in the above link. Could anybody please upload the patched code? Because of a lack of php-knowledge, | + | |
- | + | ||
- | ---- | + | |
- | + | ||
- | < | + | |
- | + | ||
- | Found the problem: There may only be on " | + | |
- | -- Freight | + | |
- | + | ||
- | Is there any way to make it so that not only the namespace is shown as a combo box but the pagename as well? Better yet make it like an AJAX-enabled history text field. I always find it a pain to find the name of the link before I get insert it, i.e. I have to leave the page I'm editing and go to the page I want to link to find it's correct link name. | + | |
- | -- Stef | + | |
- | + | ||
- | I found there was a problem with the JavaScript being overridden in Internet Explorer. I couldn' | + | |
- | < | + | |
- | $renderer->doc .= '< | + | |
- | $renderer-> | + | |
- | $renderer-> | + | |
- | $renderer-> | + | |
- | $renderer-> | + | |
- | $renderer-> | + | |
- | $renderer-> | + | |
- | $renderer-> | + | |
- | $renderer-> | + | |
</ | </ | ||
- | + | * custom namespace exclusion and hide root < | |
- | And I made a page called newpage.php that I put in the wiki directory (where I keep my wiki). That file contains the following: | + | {{NEWPAGE>namespace?exclude=project;reports& |
- | + | ||
- | < | + | |
- | <?php | + | |
- | if (!empty($_POST[" | + | |
- | $namespace = $_POST[" | + | |
- | } else { | + | |
- | $namespace = '' | + | |
- | } | + | |
- | if (!empty($_POST[" | + | |
- | $title = $_POST[" | + | |
- | } else { | + | |
- | $title = ''; | + | |
- | } | + | |
- | header(" | + | |
- | ?> | + | |
</ | </ | ||
- | Change the ' | + | ==== New-page templates ==== |
- | Obviously, incredibly quick and dirty and not at all secure - don't use it anywhere public would be my advice - I plan to clean it up when I've sorted out a couple | + | This plugin is also compatible with the [[: |
- | ---- | + | | '' |
- | Does anyone know where to get the plugin code described [[plugin: | + | | '' |
+ | | '' | ||
- | --- | + | In all of these, |
- | The combo only shows " | + | |
+ | ==== Multiple occurences ==== | ||
+ | The '' | ||
- | ==== Add New Page Redirect to Current Page ==== | + | ==== Site templates |
- | ---- | + | To include an add-new-page |
- | When I click the " | + | |
- | ---- | + | |
- | Same here, same DokuWiki version (2007-06-26b). Plugin " | + | |
- | ---- | + | |
- | That's what I get, too (same version). | + | |
- | > I had this problem, but I realized it was because I had two NEWPAGE buttons on the same page. They both receive the same name so the second one would not work and only opened the current page for editing. | + | |
- | ---- | ||
- | I had the problem with "Add new page" redirect to current page. I was able to twinkle some settings to make it work. All changes are related to script.js which is in charge of creating the correct action in formula posted to web server. I had to change: | ||
- | < | ||
- | by | ||
- | < | ||
- | le' | ||
- | |||
- | where '' | ||
- | |||
- | For example in my case, with URL, http:// | ||
- | |||
- | (ie. replace __?id=__ by __/ | ||
- | |||
- | ---- | ||
- | |||
- | I had the same issue with redirection (v. 2007-06-26b) to the current page and I tried the above workaround. However I had to replace | ||
- | |||
- | < | ||
- | ?id= | ||
- | </ | ||
- | |||
- | with | ||
- | |||
- | < | ||
- | / | ||
- | </ | ||
- | |||
- | --- | ||
- | |||
- | I had the exact same issue (but with again a slightly different solution :); I replaced | ||
- | |||
- | < | ||
- | ?id= | ||
- | </ | ||
- | |||
- | with | ||
- | |||
- | < | ||
- | / | ||
- | </ | ||
- | |||
- | I have the DokuWiki folder installed in the root folder of my Web server (I'm using Apache, so in my case this is htdocs/) | ||
- | |||
- | :?: | ||
- | |||
- | **UPDATE:** | ||
- | |||
- | I think the problem is related to the DokuWiki directory not being in the " | ||
- | |||
- | ---- | ||
- | |||
- | I've tried all of these fixes here, and it still doesn' | ||
- | --jasonskipper 01/22/08 | ||
- | |||
- | **UPDATE** | ||
- | |||
- | This is strange, but I tried putting everything back to NORMAL, and it just suddenly worked. | ||
- | |||
- | ---- | ||
- | |||
- | Same problem here, but only in IE6. The plugin works "out of the box" in Firefox, in IE6 the current page is opened for editing. Have tried suggested workarounds above without success. DokuWiki 2007-06-26b in IIS6. - Daniel Lindgren 2008-02-05 | ||
- | |||
- | **UPDATE** | ||
- | |||
- | A day later it works in IE6 too. Haven' | ||
- | |||
- | |||
- | ---- | ||
- | |||
- | I use DokuWiki 2008-03-31 with Firefox, and I have the same problem. I'll try to solve it. Any idea of where the problem is?? | ||
- | |||
- | ---- | ||
- | |||
- | >This is strange, but I tried putting everything back to NORMAL, and it just suddenly worked. It didn't work at first, and it didn't work with any of | ||
- | >the changes, but now it works with just ?id=… –jasonskipper 01/ | ||
- | |||
- | I can confirm this. I started debugging the problem by sticking alerts, and commenting out the do=edit in render. | ||
- | |||
- | ---- | ||
- | |||
- | I had this problem too! After clearing browser' | ||
- | |||
- | ---- | ||
- | |||
- | If you are using Firefox press CTRL+F5 to force the browser to reload all of your wiki content. ;) ~jjwin2k | ||
- | |||
- | ---- | ||
- | |||
- | For me Ctrl-F5 was not enough but 'touch / | ||
- | |||
- | ---- | ||
- | |||
- | I only had this problem when using several addnewpage-tags per wikipage. With one addnewpage-tag it worked. | ||
- | |||
- | ===== Namespace Fix ===== | ||
- | |||
- | Syntax < | ||
- | |||
- | I add this function in **/ | ||
<code php> | <code php> | ||
- | /** | + | <?php echo p_render('xhtml',p_get_instructions('{{NEWPAGE}}'),$info) ?> |
- | * Parse namespace request | + | |
- | * | + | |
- | * @author | + | |
- | */ | + | |
- | function _parse_ns ($ns) { | + | |
- | global $ID; | + | |
- | $ns=preg_replace("/ | + | |
- | $ns=str_replace("/",":", | + | |
- | $ns = cleanID($ns); | + | |
- | return $ns; | + | |
- | } | + | |
</ | </ | ||
- | and change in function **_makecombo**: | + | ==== Namespace Templates |
- | < | + | |
- | -- if (($data != "" | + | |
- | ++ if (($data != "" | + | |
- | </ | + | |
- | FIXME This works only if namespace | + | Add-new-page forms can also be added to [[: |
- | -- // | + | ===== Configuration and Settings |
- | + | ||
- | ==== Sidebar fix ==== | + | |
- | + | ||
- | If you want to use < | + | |
- | <code php> | + | |
- | function _parse_ns ($ns) { | + | |
- | global $INFO; | + | |
- | $ns=preg_replace("/ | + | |
- | $ns=str_replace("/",":", | + | |
- | $ns = cleanID($ns); | + | |
- | return $ns; | + | |
- | } | + | |
- | </ | + | |
- | so the namespace is relative to the main page (not the sidebar' | + | |
- | ==== Namespace Fix - Combo box fix ==== | + | |
- | + | ||
- | Rather than changing this line like so: | + | |
- | < | + | |
- | if(($data != "" | + | |
- | </ | + | |
- | I left it alone and simply added this: | + | |
- | < | + | |
- | | + | |
- | </ | + | |
- | In function **_makecombo** after the line: | + | |
- | < | + | |
- | $hide=$this-> | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | >Hello, 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 temadigital is a namespace that contains the namespaces that I would like the user to choose when creating a new page: | + | |
- | + | ||
- | < | + | |
- | {{NEWPAGE> | + | |
- | </ | + | |
- | >And also, I have noticed that the latest version of this plugin | + | You can configure |
- | [[felipe.uderman@gmail.com | uderman]] | + | - **Excluded namespaces** ('' |
+ | - **Show root namespace** ('' | ||
+ | - **Hide namespace selection** ('' | ||
+ | - **Hide " | ||
+ | - **Hide the input box** ('' | ||
- | ===== submit with ENTER in IE BUG===== | + | =====FAQ===== |
- | if you submit the form < | + | === Why is a privileged user not allowed to add pages? === |
- | there is a solution... | + | Logged in as administrator, |
- | Function setname() never fired in this case.. because it's bind to buttom.onclick event. I think it must be bound to form.onsubmit | + | > This is a [[https:// |
- | So in syntax.php: | ||
- | find | + | === Addnewpage |
- | $renderer-> | + | |
- | change to: | + | |
- | $renderer-> | + | |
+ | Is there a possibility to add the plugin as a part of the admin page, like the plugins pagemove or upgrade? | ||
- | 2008/01/08 miguelito... | + | > Not currently, but this can be done by modifying your template and including the addnewpage form only when '' |
- | ---- | + | === More than one form per page? === |
- | ===== do=addnewpage ===== | + | |
- | Useful plugin. How about an addnewpage command action. | + | Is it possible to have more than one new-page form on a page? |
- | <code php action.php> | + | |
- | <?php | + | |
- | if(!defined(' | + | > Yes. Nothing special needs to be done to permit this, just add the markup wherever you want the forms to appear. |
- | if(!defined(' | + | === Can the textbox be pre-populated with a value? Specifically, |
- | require_once(DOKU_PLUGIN.' | + | |
+ | === How can a add_page form add in the site template automaticaly? | ||
- | class action_plugin_addnewpage extends DokuWiki_Action_Plugin | + | ===== Development ===== |
- | { | + | |
- | var $doc; | + | ==== Issues and feature requests ==== |
+ | Please report all bugs and feature requests through the | ||
+ | [[https:// | ||
- | function getInfo () | + | Items of general interest should be added to the [[#faq|FAQ above]]. |
- | { | + | |
- | return array( | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ); | + | |
- | } | + | |
- | function register ( & $controller ) | + | ==== Releases ==== |
- | { | + | |
- | $controller-> | + | |
- | $controller-> | + | |
- | } | + | |
+ | {{rss> | ||
- | function _handle_act( & $event, $param ) | + | The complete [[https:// |
- | { | + | |
- | if ( $event->data != ' | + | |
- | return; | + | |
- | $event-> | + | |
- | } | + | |
- | function _handle_tpl_act ( & $event, $param ) | + | === Recent commits === |
- | { | + | |
- | if ( $event-> | + | |
- | return; | + | |
- | $event-> | + | |
- | $this->doc = ''; | + | {{rss>https:// |
- | if ( | + | Full [[https://github.com/ |
- | auth_quickaclcheck($_REQUEST[' | + | |
- | and | + | |
- | ( $syntax = plugin_load(' | + | |
- | and | + | |
- | $syntax-> | + | |
- | and | + | |
- | $this-> | + | |
- | ) | + | |
- | print('< | + | |
- | else | + | |
- | print p_locale_xhtml(' | + | |
- | } | + | |
- | } | ||
- | </ | ||
- | Just copy the code into action.php in the addnewpage directory. | ||
- | //5.7.2008 Peter// | + | ==== Legacy releases ==== |
- | ---- | + | |
- | ===== Add page plugin doesn' | + | === Before development moved to Github |
- | I just realized that if you put a subnamespace under a namespace | + | * 2008-01-10: New zip file with some correction (the submit bug in IE, the namespace " |
+ | * 2007-05-19: Portuguese language definitions added for completely hide NEWPAGE by GibaPhp | ||
+ | * 2007-01-21: Can configure | ||
+ | * 2007-01-21: Now support ACL (thanks to 66[dot]7[dot]118[dot]82) | ||
+ | * 2007-01-13: Add new functionality with the syntax < | ||
+ | * 2007-01-12: Remove 4 invisible hex chars in script.js, adding Italian and Russian (incomplete) | ||
+ | * 2007-01-11: Fix encoding problem (with old noaccent function) | ||
+ | * 2006-12-20: New Release, old version [used to be] at '' | ||
- | It doesn't show the subnamespace in the list | + | === When this plugin was 'addnewpage_old' |
- | for example, if there' | + | * 2006-11-14: Fixed: bug with new dokuwiki version. |
+ | * 2006-07-05: Fixed: Zip file is now ok. Added: Russian language file. | ||
+ | * 2006-06-20 : Fixed: Problem with the empty select box, Added: Multilanguage Support; Root Namespace (see Kibi' | ||
- | Any one could fix this? | ||
- | > This may work. | + | ===== History |
- | > | + | |
- | > Replace below (around line 153) in function _getnslist in syntax.php file | + | |
- | >< | + | |
- | $r=$this-> | + | |
- | </ | + | |
- | > with | + | |
- | >< | + | |
- | $r=$this-> | + | |
- | </ | + | |
+ | The plugin was [[plugin: | ||
+ | It was forked after the 2009-02-14 release of Dokuwiki, and moved to GitHub by [[https:// | ||
+ | Refer to the [[# | ||
- | > | + | In 2013, [[https://github.com/samwilson|Sam Wilson]] picked up the plugin' |
- | > | + | |
- | >< | + | |
- | $r=$this-> | + | |
- | </ | + | |
- | 改为 | + | |
- | >< | + | |
- | $r=$this-> | + | |
- | </ | + | |
- | 我的系统是WinXP,测试正常。 | + | |
- | + | ||
- | [[http://forum.dokuwiki.org/thread/5546|另外一种方法可以参考这里]] | + | |
- | ===== Plugin is incompatible with DokuWiki Release 2009-02-14 ===== | + | |
- | + | ||
- | After upgrading to Release 2009-02-14, this plugin | + | |
- | + | ||
- | < | + | |
- | {{NEWPAGE}} | + | |
- | </ | + | |
- | + | ||
- | does not result in any output. However, Peter Niebling' | + | |
- | + | ||
- | Is this going to be fixed? | + | |
- | + | ||
- | > this can be fixed by replacing the handle function with this | + | |
- | > <code php> | + | |
- | function handle($match, | + | |
- | $ns = substr($match, | + | |
- | | + | |
- | } | + | |
- | </ | + | |
- | > | + | |
- | > and add the line to the top of the render function | + | |
- | > <code php> | + | |
- | $data = $data[0]; | + | |
- | </ | + | |
- | > this should fix it | + | |
- | > greetings, dominik | + | |
- | >> | + | |
- | + | ||
- | ===== RTL problem fix ===== | + | |
- | this script hardcodes left, it should use right in RTL languages | + | |
- | + | ||
- | this is a simple patch | + | |
- | + | ||
- | <code diff> | + | |
- | --- syntax.php~ 2009-06-13 23: | + | |
- | +++ syntax.php 2009-06-13 23: | + | |
- | @@ -44,7 +44,8 @@ | + | |
- | | + | |
- | } | + | |
- | + | ||
- | - $renderer-> | + | |
- | + if ($lang[' | + | |
- | + $renderer-> | + | |
- | | + | |
- | | + | |
- | | + | |
- | </ | + | |
- | + | ||
- | ===== Conflict with other JavaScript ===== | + | |
- | I encountered confliction other JavaScript' | + | |
- | + | ||
- | **script.js** | + | |
- | #2 function setAddPageName() { | + | |
- | **syntax.php** | + | |
- | #50 ... onsubmit=" | + | |
- | + | ||
- | + | ||
- | ===== Remove language sections on page ===== | + | |
- | + | ||
- | Could you please remove the packaged language sections of this page, since most of them are in the plugin archive. Thanks | + | |
- | + | ||
- | ===== Usage in Template: not valid ===== | + | |
- | If you use this in a template and add a namespace to it, the > will be recognized as closing tag. The same happens with >. Can something be done about it? | + | |
- | <? | + | |
- | echo p_render(' | + | |
- | ?> | + | |
- | Feb.06.2011 | + | |
- | + | ||
- | ===== XHTML validation fails ===== | + | |
- | + | ||
- | I have found that XHTML validation fails at (at least) two places: | + | |
- | + | ||
- | * the %%<div class=" | + | |
- | * some %%option%% elements inside | + | |
- | + | ||
- | Here is a patch (please note that I use Unix end-of-line style). Thanks for this plugin and the time spent in maintenance. | + | |
- | + | ||
- | <code diff syntax.diff> | + | |
- | --- syntax.php.orig 2011-05-09 13: | + | |
- | +++ syntax.php 2011-05-09 13: | + | |
- | @@ -15,6 +15,7 @@ | + | |
- | ); | + | |
- | } | + | |
- | + | ||
- | + function getPType(){ return ' | + | |
- | + | ||
- | | + | |
- | | + | |
- | @@ -98,12 +99,12 @@ | + | |
- | + | ||
- | if ($data=='' | + | |
- | | + | |
- | - $ret.='< | + | |
- | + $ret.='< | + | |
- | | + | |
- | | + | |
- | } else { | + | |
- | | + | |
- | - $ret.='< | + | |
- | + $ret.='< | + | |
- | | + | |
- | | + | |
- | | + | |
- | @@ -116,7 +117,7 @@ | + | |
- | | + | |
- | | + | |
- | | + | |
- | - $ret.='< | + | |
- | + $ret.='< | + | |
- | | + | |
- | } | + | |
- | | + | |
- | </ | + | |
- | benat, 2011-05-09 | + | * Michael Braun |
+ | * Róbert Toth (FurloSK) | ||
+ | * Gerrit Uitslag ([[user> | ||
+ | * Albert Chern, disabling of restricted parent namespaces in 2015 | ||
+ | In May 2023, Damien Regad decided to take over the plugin' | ||
+ | Thanks to [[https:// | ||
- | ===== Showing some namespaces in root but not all? ===== | ||
- | I installed this on Dokuwiki last release I think 4/11/2011 and I notice that only some items in the \\ root are displaying on the menu but not all sub-namespaces and not all namespaces? I'm not sure how to fix this? |
plugin/addnewpage.1347775349.txt.gz · Last modified: 2012-09-16 08:02 by 92.225.179.87