summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Kalkosinski <pppspoonman@users.sourceforge.net>2008-11-17 21:57:05 +0000
committerTomasz Kalkosinski <pppspoonman@users.sourceforge.net>2008-11-17 21:57:05 +0000
commitf17b75830065fae0794efa99a3cac5f3d9173657 (patch)
tree7fed2555a5e2d62d1dbeb72ec0c349b238280151
parentf6584b853fcf6dd79b03095a7a4465e433ff4633 (diff)
downloadwiki-f17b75830065fae0794efa99a3cac5f3d9173657.tar.gz
wiki-f17b75830065fae0794efa99a3cac5f3d9173657.tar.bz2
wiki-f17b75830065fae0794efa99a3cac5f3d9173657.zip
Fix for 1889113 - cannot create WikiBook. Provide nice information about error cause. Capitalize create new book button.
-rw-r--r--edit_book.php9
-rw-r--r--templates/create_book.tpl8
2 files changed, 11 insertions, 6 deletions
diff --git a/edit_book.php b/edit_book.php
index 5bb010f..7d06e81 100644
--- a/edit_book.php
+++ b/edit_book.php
@@ -1,6 +1,6 @@
<?php
/**
- * $Header: /cvsroot/bitweaver/_bit_wiki/edit_book.php,v 1.16 2008/10/20 21:40:12 spiderr Exp $
+ * $Header: /cvsroot/bitweaver/_bit_wiki/edit_book.php,v 1.17 2008/11/17 21:57:05 pppspoonman Exp $
*
* Copyright (c) 2004 bitweaver.org
* Copyright (c) 2003 tikwiki.org
@@ -8,7 +8,7 @@
* All Rights Reserved. See copyright.txt for details and a complete list of authors.
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details
*
- * $Id: edit_book.php,v 1.16 2008/10/20 21:40:12 spiderr Exp $
+ * $Id: edit_book.php,v 1.17 2008/11/17 21:57:05 pppspoonman Exp $
* @package wiki
* @subpackage functions
*/
@@ -119,6 +119,11 @@ if( isset($_REQUEST["createstructure"]) ) {
}
}
header( "location: ".WIKI_PKG_URL."edit_book.php?structure_id=".$structure_id );
+ } else {
+ $gBitSmarty->assign_by_ref( 'errors', $gContent->mErrors );
+ $gBitSmarty->assign( 'name', $_REQUEST['name']);
+ $gBitSmarty->assign( 'chapters', $_REQUEST['chapters']);
+ $mid = 'bitpackage:wiki/create_book.tpl';
}
} elseif( @BitBase::verifyId( $_REQUEST["structure_id"] ) && $gContent->isValid() ) {
// Get all wiki pages for the select box
diff --git a/templates/create_book.tpl b/templates/create_book.tpl
index 587974a..5ae6adc 100644
--- a/templates/create_book.tpl
+++ b/templates/create_book.tpl
@@ -1,4 +1,4 @@
-{* $Header: /cvsroot/bitweaver/_bit_wiki/templates/create_book.tpl,v 1.2 2005/10/29 17:57:43 squareing Exp $ *}
+{* $Header: /cvsroot/bitweaver/_bit_wiki/templates/create_book.tpl,v 1.3 2008/11/17 21:57:04 pppspoonman Exp $ *}
{strip}
<div class="floaticon">{bithelp}</div>
@@ -13,7 +13,7 @@
{formfeedback error=`$errors.title`}
{formlabel label="Book Title" for="name"}
{forminput}
- <input type="text" name="name" id="name" size="50" maxlength="240"/>
+ <input type="text" name="name" id="name" size="50" maxlength="240" value="{$name}"/>
{formhelp note="Enter the name of your WikiBook."}
{/forminput}
</div>
@@ -21,13 +21,13 @@
<div class="row">
{formlabel label="Table of Contents<br />(optional)" for="chapters"}
{forminput}
- <textarea rows="10" cols="50" name="chapters" id="chapters"></textarea>
+ <textarea rows="10" cols="50" name="chapters" id="chapters">{$chapters}</textarea>
{formhelp note="To enter the table of contents manually, you can add WikiPage names on separate lines. Pages that don't exist will be added automagically and you can edit them later."}
{/forminput}
</div>
<div class="row submit">
- <input type="submit" value="{tr}create new book{/tr}" name="createstructure" />
+ <input type="submit" value="{tr}Create new book{/tr}" name="createstructure" />
</div>
{/form}
</div><!-- end .body -->