From: <var...@us...> - 2022-01-23 17:29:42
|
Revision: 10931 http://sourceforge.net/p/phpwiki/code/10931 Author: vargenau Date: 2022-01-23 17:29:40 +0000 (Sun, 23 Jan 2022) Log Message: ----------- Add button to create the page if it does not exist. Modified Paths: -------------- trunk/locale/it/pgsrc/NoteDiRilascio trunk/pgsrc/ReleaseNotes trunk/themes/Crao/templates/body.tmpl trunk/themes/MonoBook/templates/body.tmpl trunk/themes/Portland/templates/body.tmpl trunk/themes/Sidebar/templates/body.tmpl trunk/themes/Wordpress/templates/body.tmpl trunk/themes/blog/templates/body.tmpl trunk/themes/default/templates/body.tmpl trunk/themes/wikilens/templates/body.tmpl Modified: trunk/locale/it/pgsrc/NoteDiRilascio =================================================================== --- trunk/locale/it/pgsrc/NoteDiRilascio 2022-01-23 12:10:34 UTC (rev 10930) +++ trunk/locale/it/pgsrc/NoteDiRilascio 2022-01-23 17:29:40 UTC (rev 10931) @@ -1,4 +1,4 @@ -Date: Thu, 20 Jan 2022 12:14:25 +0000 +Date: Sun, 23 Jan 2022 18:28:59 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.6.0) Content-Type: application/x-phpwiki; pagename=NoteDiRilascio; @@ -22,6 +22,7 @@ === Changes === * Warn user that leaving the page will lose modifications. +* Add button to create the page if it does not exist. * TOOLBAR_IMAGE_PULLDOWN is true by default. * Remove ADODB DATABASE_TYPE. Use SQL (Pear) or PDO. * Add “Rename” tab in Sidebar theme. Modified: trunk/pgsrc/ReleaseNotes =================================================================== --- trunk/pgsrc/ReleaseNotes 2022-01-23 12:10:34 UTC (rev 10930) +++ trunk/pgsrc/ReleaseNotes 2022-01-23 17:29:40 UTC (rev 10931) @@ -1,4 +1,4 @@ -Date: Thu, 20 Jan 2022 12:14:25 +0000 +Date: Sun, 23 Jan 2022 18:28:59 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.6.0) Content-Type: application/x-phpwiki; pagename=ReleaseNotes; @@ -22,6 +22,7 @@ === Changes === * Warn user that leaving the page will lose modifications. +* Add button to create the page if it does not exist. * TOOLBAR_IMAGE_PULLDOWN is true by default. * Remove ADODB DATABASE_TYPE. Use SQL (Pear) or PDO. * Add “Rename” tab in Sidebar theme. Modified: trunk/themes/Crao/templates/body.tmpl =================================================================== --- trunk/themes/Crao/templates/body.tmpl 2022-01-23 12:10:34 UTC (rev 10930) +++ trunk/themes/Crao/templates/body.tmpl 2022-01-23 17:29:40 UTC (rev 10931) @@ -14,25 +14,32 @@ <main role="main"> <?php $action = $request->getArg('action'); - if (empty($revision)) { - $revision = $page->getCurrentRevision(false); - } - if (($action == 'edit') && $page->get('locked') && !$user->isAdmin()) { ?> - <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> - <?php echo _("This page has been locked and cannot be edited.") ?> - </p> - <?php - } - if (($action != 'edit') && ($action != 'revert') - && $revision and !$revision->isCurrent()) { ?> - <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> - <?php echo _("You are viewing an old revision of this page.")?> - <?php echo Button('browse', _("View the current version."), $page)?> - </p> + if ($page->exists()) { + if (empty($revision)) { + $revision = $page->getCurrentRevision(false); + } + if (($action == 'edit') && $page->get('locked') && !$user->isAdmin()) { ?> + <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> + <?php echo _("This page has been locked and cannot be edited.") ?> + </p> + <?php + } + if (($action != 'edit') && ($action != 'revert') + && $revision and !$revision->isCurrent()) { ?> + <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> + <?php echo _("You are viewing an old revision of this page.")?> + <?php echo Button('browse', _("View the current version."), $page)?> + </p> + <?php } ?> + <?php if (!empty($redirected)) { ?> + <p><?php echo $redirected ?></p> + <?php } ?> + <?php } elseif (($action != "create") && ($action != "edit")) { ?> + <p class="warning_msg"> + <?php echo _("This page does not exist.") ?> + <?php echo Button('create', _("Create it."), $page)?> + </p> <?php } ?> - <?php if (!empty($redirected)) { ?> - <p><?php echo $redirected ?></p> - <?php } ?> <?php echo $CONTENT ?> </main> <?php echo Template('bottom') ?> Modified: trunk/themes/MonoBook/templates/body.tmpl =================================================================== --- trunk/themes/MonoBook/templates/body.tmpl 2022-01-23 12:10:34 UTC (rev 10930) +++ trunk/themes/MonoBook/templates/body.tmpl 2022-01-23 17:29:40 UTC (rev 10931) @@ -8,25 +8,32 @@ <main role="main"> <?php $action = $request->getArg('action'); - if (empty($revision)) { - $revision = $page->getCurrentRevision(false); - } - if (($action == 'edit') && $page->get('locked') && !$user->isAdmin()) { ?> - <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> - <?php echo _("This page has been locked and cannot be edited.") ?> - </p> - <?php - } - if (($action != 'edit') && ($action != 'revert') - && $revision and !$revision->isCurrent()) { ?> - <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> - <?php echo _("You are viewing an old revision of this page.")?> - <?php echo Button('browse', _("View the current version."), $page)?> - </p> + if ($page->exists()) { + if (empty($revision)) { + $revision = $page->getCurrentRevision(false); + } + if (($action == 'edit') && $page->get('locked') && !$user->isAdmin()) { ?> + <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> + <?php echo _("This page has been locked and cannot be edited.") ?> + </p> + <?php + } + if (($action != 'edit') && ($action != 'revert') + && $revision and !$revision->isCurrent()) { ?> + <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> + <?php echo _("You are viewing an old revision of this page.")?> + <?php echo Button('browse', _("View the current version."), $page)?> + </p> + <?php } ?> + <?php if (!empty($redirected)) { ?> + <p><?php echo $redirected ?></p> + <?php } ?> + <?php } elseif (($action != "create") && ($action != "edit")) { ?> + <p class="warning_msg"> + <?php echo _("This page does not exist.") ?> + <?php echo Button('create', _("Create it."), $page)?> + </p> <?php } ?> - <?php if (!empty($redirected)) { ?> - <p><?php echo $redirected ?></p> - <?php } ?> <div id="bodyContent"> <?php echo $CONTENT ?> <div class="clear-floats"></div> Modified: trunk/themes/Portland/templates/body.tmpl =================================================================== --- trunk/themes/Portland/templates/body.tmpl 2022-01-23 12:10:34 UTC (rev 10930) +++ trunk/themes/Portland/templates/body.tmpl 2022-01-23 17:29:40 UTC (rev 10931) @@ -9,25 +9,32 @@ <main role="main"> <?php $action = $request->getArg('action'); - if (empty($revision)) { - $revision = $page->getCurrentRevision(false); - } - if (($action == 'edit') && $page->get('locked') && !$user->isAdmin()) { ?> - <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> - <?php echo _("This page has been locked and cannot be edited.") ?> - </p> - <?php - } - if (($action != 'edit') && ($action != 'revert') - && $revision and !$revision->isCurrent()) { ?> - <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> - <?php echo _("You are viewing an old revision of this page.")?> - <?php echo Button('browse', _("View the current version."), $page)?> - </p> + if ($page->exists()) { + if (empty($revision)) { + $revision = $page->getCurrentRevision(false); + } + if (($action == 'edit') && $page->get('locked') && !$user->isAdmin()) { ?> + <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> + <?php echo _("This page has been locked and cannot be edited.") ?> + </p> + <?php + } + if (($action != 'edit') && ($action != 'revert') + && $revision and !$revision->isCurrent()) { ?> + <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> + <?php echo _("You are viewing an old revision of this page.")?> + <?php echo Button('browse', _("View the current version."), $page)?> + </p> + <?php } ?> + <?php if (!empty($redirected)) { ?> + <p><?php echo $redirected ?></p> + <?php } ?> + <?php } elseif (($action != "create") && ($action != "edit")) { ?> + <p class="warning_msg"> + <?php echo _("This page does not exist.") ?> + <?php echo Button('create', _("Create it."), $page)?> + </p> <?php } ?> - <?php if (!empty($redirected)) { ?> - <p><?php echo $redirected ?></p> - <?php } ?> <?php echo $CONTENT ?> </main> <?php echo Template('navbar') ?> Modified: trunk/themes/Sidebar/templates/body.tmpl =================================================================== --- trunk/themes/Sidebar/templates/body.tmpl 2022-01-23 12:10:34 UTC (rev 10930) +++ trunk/themes/Sidebar/templates/body.tmpl 2022-01-23 17:29:40 UTC (rev 10931) @@ -6,25 +6,32 @@ <?php echo Template('top') ?> <?php $action = $request->getArg('action'); - if (empty($revision)) { - $revision = $page->getCurrentRevision(false); - } - if (($action == 'edit') && $page->get('locked') && !$user->isAdmin()) { ?> - <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> - <?php echo _("This page has been locked and cannot be edited.") ?> - </p> - <?php - } - if (($action != 'edit') && ($action != 'revert') - && $revision and !$revision->isCurrent()) { ?> - <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> - <?php echo _("You are viewing an old revision of this page.")?> - <?php echo Button('browse', _("View the current version."), $page)?> - </p> + if ($page->exists()) { + if (empty($revision)) { + $revision = $page->getCurrentRevision(false); + } + if (($action == 'edit') && $page->get('locked') && !$user->isAdmin()) { ?> + <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> + <?php echo _("This page has been locked and cannot be edited.") ?> + </p> + <?php + } + if (($action != 'edit') && ($action != 'revert') + && $revision and !$revision->isCurrent()) { ?> + <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> + <?php echo _("You are viewing an old revision of this page.")?> + <?php echo Button('browse', _("View the current version."), $page)?> + </p> + <?php } ?> + <?php if (!empty($redirected)) { ?> + <p><?php echo $redirected ?></p> + <?php } ?> + <?php } elseif (($action != "create") && ($action != "edit")) { ?> + <p class="warning_msg"> + <?php echo _("This page does not exist.") ?> + <?php echo Button('create', _("Create it."), $page)?> + </p> <?php } ?> - <?php if (!empty($redirected)) { ?> - <p><?php echo $redirected ?></p> - <?php } ?> <div id="bodyContent"> <?php echo $CONTENT ?> <div class="clear-floats"></div> Modified: trunk/themes/Wordpress/templates/body.tmpl =================================================================== --- trunk/themes/Wordpress/templates/body.tmpl 2022-01-23 12:10:34 UTC (rev 10930) +++ trunk/themes/Wordpress/templates/body.tmpl 2022-01-23 17:29:40 UTC (rev 10931) @@ -5,25 +5,32 @@ <main role="main"> <?php $action = $request->getArg('action'); - if (empty($revision)) { - $revision = $page->getCurrentRevision(false); - } - if (($action == 'edit') && $page->get('locked') && !$user->isAdmin()) { ?> - <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> - <?php echo _("This page has been locked and cannot be edited.") ?> - </p> - <?php - } - if (($action != 'edit') && ($action != 'revert') - && $revision and !$revision->isCurrent()) { ?> - <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> - <?php echo _("You are viewing an old revision of this page.")?> - <?php echo Button('browse', _("View the current version."), $page)?> - </p> + if ($page->exists()) { + if (empty($revision)) { + $revision = $page->getCurrentRevision(false); + } + if (($action == 'edit') && $page->get('locked') && !$user->isAdmin()) { ?> + <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> + <?php echo _("This page has been locked and cannot be edited.") ?> + </p> + <?php + } + if (($action != 'edit') && ($action != 'revert') + && $revision and !$revision->isCurrent()) { ?> + <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> + <?php echo _("You are viewing an old revision of this page.")?> + <?php echo Button('browse', _("View the current version."), $page)?> + </p> + <?php } ?> + <?php if (!empty($redirected)) { ?> + <p><?php echo $redirected ?></p> + <?php } ?> + <?php } elseif (($action != "create") && ($action != "edit")) { ?> + <p class="warning_msg"> + <?php echo _("This page does not exist.") ?> + <?php echo Button('create', _("Create it."), $page)?> + </p> <?php } ?> - <?php if (!empty($redirected)) { ?> - <p><?php echo $redirected ?></p> - <?php } ?> <?php echo $CONTENT ?> </main> <?php echo $GLOBALS['ErrorManager']->getPostponedErrorsAsHTML() ?> Modified: trunk/themes/blog/templates/body.tmpl =================================================================== --- trunk/themes/blog/templates/body.tmpl 2022-01-23 12:10:34 UTC (rev 10930) +++ trunk/themes/blog/templates/body.tmpl 2022-01-23 17:29:40 UTC (rev 10931) @@ -6,25 +6,32 @@ <main role="main"> <?php $action = $request->getArg('action'); - if (empty($revision)) { - $revision = $page->getCurrentRevision(false); - } - if (($action == 'edit') && $page->get('locked') && !$user->isAdmin()) { ?> - <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> - <?php echo _("This page has been locked and cannot be edited.") ?> - </p> - <?php - } - if (($action != 'edit') && ($action != 'revert') - && $revision and !$revision->isCurrent()) { ?> - <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> - <?php echo _("You are viewing an old revision of this page.")?> - <?php echo Button('browse', _("View the current version."), $page)?> - </p> + if ($page->exists()) { + if (empty($revision)) { + $revision = $page->getCurrentRevision(false); + } + if (($action == 'edit') && $page->get('locked') && !$user->isAdmin()) { ?> + <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> + <?php echo _("This page has been locked and cannot be edited.") ?> + </p> + <?php + } + if (($action != 'edit') && ($action != 'revert') + && $revision and !$revision->isCurrent()) { ?> + <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> + <?php echo _("You are viewing an old revision of this page.")?> + <?php echo Button('browse', _("View the current version."), $page)?> + </p> + <?php } ?> + <?php if (!empty($redirected)) { ?> + <p><?php echo $redirected ?></p> + <?php } ?> + <?php } elseif (($action != "create") && ($action != "edit")) { ?> + <p class="warning_msg"> + <?php echo _("This page does not exist.") ?> + <?php echo Button('create', _("Create it."), $page)?> + </p> <?php } ?> - <?php if (!empty($redirected)) { ?> - <p><?php echo $redirected ?></p> - <?php } ?> <div id="bodyContent"> <?php echo $CONTENT ?> </div> Modified: trunk/themes/default/templates/body.tmpl =================================================================== --- trunk/themes/default/templates/body.tmpl 2022-01-23 12:10:34 UTC (rev 10930) +++ trunk/themes/default/templates/body.tmpl 2022-01-23 17:29:40 UTC (rev 10931) @@ -7,25 +7,32 @@ <main role="main"> <?php $action = $request->getArg('action'); - if (empty($revision)) { - $revision = $page->getCurrentRevision(false); - } - if (($action == 'edit') && $page->get('locked') && !$user->isAdmin()) { ?> - <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> - <?php echo _("This page has been locked and cannot be edited.") ?> - </p> - <?php - } - if (($action != 'edit') && ($action != 'revert') - && $revision and !$revision->isCurrent()) { ?> - <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> - <?php echo _("You are viewing an old revision of this page.")?> - <?php echo Button('browse', _("View the current version."), $page)?> - </p> + if ($page->exists()) { + if (empty($revision)) { + $revision = $page->getCurrentRevision(false); + } + if (($action == 'edit') && $page->get('locked') && !$user->isAdmin()) { ?> + <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> + <?php echo _("This page has been locked and cannot be edited.") ?> + </p> + <?php + } + if (($action != 'edit') && ($action != 'revert') + && $revision and !$revision->isCurrent()) { ?> + <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> + <?php echo _("You are viewing an old revision of this page.")?> + <?php echo Button('browse', _("View the current version."), $page)?> + </p> + <?php } ?> + <?php if (!empty($redirected)) { ?> + <p><?php echo $redirected ?></p> + <?php } ?> + <?php } elseif (($action != "create") && ($action != "edit")) { ?> + <p class="warning_msg"> + <?php echo _("This page does not exist.") ?> + <?php echo Button('create', _("Create it."), $page)?> + </p> <?php } ?> - <?php if (!empty($redirected)) { ?> - <p><?php echo $redirected ?></p> - <?php } ?> <div id="content"> <?php echo $CONTENT ?> </div> Modified: trunk/themes/wikilens/templates/body.tmpl =================================================================== --- trunk/themes/wikilens/templates/body.tmpl 2022-01-23 12:10:34 UTC (rev 10930) +++ trunk/themes/wikilens/templates/body.tmpl 2022-01-23 17:29:40 UTC (rev 10931) @@ -30,25 +30,32 @@ } ?> </h1> <?php $action = $request->getArg('action'); - if (empty($revision)) { - $revision = $page->getCurrentRevision(false); - } - if (($action == 'edit') && $page->get('locked') && !$user->isAdmin()) { ?> - <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> - <?php echo _("This page has been locked and cannot be edited.") ?> - </p> - <?php - } - if (($action != 'edit') && ($action != 'revert') - && $revision and !$revision->isCurrent()) { ?> - <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> - <?php echo _("You are viewing an old revision of this page.")?> - <?php echo Button('browse', _("View the current version."), $page)?> - </p> + if ($page->exists()) { + if (empty($revision)) { + $revision = $page->getCurrentRevision(false); + } + if (($action == 'edit') && $page->get('locked') && !$user->isAdmin()) { ?> + <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> + <?php echo _("This page has been locked and cannot be edited.") ?> + </p> + <?php + } + if (($action != 'edit') && ($action != 'revert') + && $revision and !$revision->isCurrent()) { ?> + <p class="warning_msg"><strong><?php echo _("Note:") ?></strong> + <?php echo _("You are viewing an old revision of this page.")?> + <?php echo Button('browse', _("View the current version."), $page)?> + </p> + <?php } ?> + <?php if (!empty($redirected)) { ?> + <p><?php echo $redirected ?></p> + <?php } ?> + <?php } elseif (($action != "create") && ($action != "edit")) { ?> + <p class="warning_msg"> + <?php echo _("This page does not exist.") ?> + <?php echo Button('create', _("Create it."), $page)?> + </p> <?php } ?> - <?php if (!empty($redirected)) { ?> - <p><?php echo $redirected ?></p> - <?php } ?> <?php echo $CONTENT ?> </main> <?php echo Template('bottom') ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |