summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2007-08-23 11:15:23 +0000
committerMax Kremmel <xing@synapse.plus.com>2007-08-23 11:15:23 +0000
commit4b4edf3de0ec037a4fa7b64048efb06d46625944 (patch)
treee74f2f1409d2b694fc8382f035b4e0167a86ee5e
parent8c9c9fd491e28c84aef986e873086c22d1474733 (diff)
downloadarticles-4b4edf3de0ec037a4fa7b64048efb06d46625944.tar.gz
articles-4b4edf3de0ec037a4fa7b64048efb06d46625944.tar.bz2
articles-4b4edf3de0ec037a4fa7b64048efb06d46625944.zip
make it possible to edit the title of the article type as well
-rw-r--r--BitArticleType.php33
-rw-r--r--admin/admin_types.php8
-rw-r--r--templates/admin_types.tpl9
3 files changed, 23 insertions, 27 deletions
diff --git a/BitArticleType.php b/BitArticleType.php
index 606d808..441281b 100644
--- a/BitArticleType.php
+++ b/BitArticleType.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Header: /cvsroot/bitweaver/_bit_articles/BitArticleType.php,v 1.19 2007/08/23 11:05:51 squareing Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_articles/BitArticleType.php,v 1.20 2007/08/23 11:15:23 squareing Exp $
* @package article
*
* @copyright Copyright (c) 2004-2006, bitweaver.org
@@ -64,24 +64,21 @@ class BitArticleType extends BitBase
}
if (!$isNewType) {
- $cleanHash['use_ratings'] = (!empty($iParamHash['use_ratings']) ? ($iParamHash['use_ratings']) : 'n');
- $cleanHash['show_pre_publ'] = (!empty($iParamHash['show_pre_publ']) ? ($iParamHash['show_pre_publ']) : 'n');
- $cleanHash['show_post_expire'] = (!empty($iParamHash['show_post_expire']) ? ($iParamHash['show_post_expire']) : 'n');
- $cleanHash['heading_only'] = (!empty($iParamHash['heading_only']) ? ($iParamHash['heading_only']) : 'n');
- $cleanHash['allow_comments'] = (!empty($iParamHash['allow_comments']) ? ($iParamHash['allow_comments']) : 'n');
+ $cleanHash['use_ratings'] = (!empty($iParamHash['use_ratings']) ? ($iParamHash['use_ratings']) : 'n');
+ $cleanHash['show_pre_publ'] = (!empty($iParamHash['show_pre_publ']) ? ($iParamHash['show_pre_publ']) : 'n');
+ $cleanHash['show_post_expire'] = (!empty($iParamHash['show_post_expire']) ? ($iParamHash['show_post_expire']) : 'n');
+ $cleanHash['heading_only'] = (!empty($iParamHash['heading_only']) ? ($iParamHash['heading_only']) : 'n');
+ $cleanHash['allow_comments'] = (!empty($iParamHash['allow_comments']) ? ($iParamHash['allow_comments']) : 'n');
$cleanHash['comment_can_rate_article'] = (!empty($iParamHash['comment_can_rate_article']) ? ($iParamHash['comment_can_rate_article']) : 'n');
- $cleanHash['show_image'] = (!empty($iParamHash['show_image']) ? ($iParamHash['show_image']) : 'n');
- $cleanHash['show_avatar'] = (!empty($iParamHash['show_avatar']) ? ($iParamHash['show_avatar']) : 'n');
- $cleanHash['show_author'] = (!empty($iParamHash['show_author']) ? ($iParamHash['show_author']) : 'n');
- $cleanHash['show_pubdate'] = (!empty($iParamHash['show_pubdate']) ? ($iParamHash['show_pubdate']) : 'n');
- $cleanHash['show_expdate'] = (!empty($iParamHash['show_expdate']) ? ($iParamHash['show_expdate']) : 'n');
- $cleanHash['show_reads'] = (!empty($iParamHash['show_reads']) ? ($iParamHash['show_reads']) : 'n');
- $cleanHash['show_size'] = (!empty($iParamHash['show_size']) ? ($iParamHash['show_size']) : 'n');
- $cleanHash['creator_edit'] = (!empty($iParamHash['creator_edit']) ? ($iParamHash['creator_edit']) : 'n');
- $topicName = (!empty($iParamHash['topic_name']) ? $iParamHash['topic_name'] : NULL);
- if ($topicName) {
- $cleanHash['topic_name'] = $topicName;
- }
+ $cleanHash['show_image'] = (!empty($iParamHash['show_image']) ? ($iParamHash['show_image']) : 'n');
+ $cleanHash['show_avatar'] = (!empty($iParamHash['show_avatar']) ? ($iParamHash['show_avatar']) : 'n');
+ $cleanHash['show_author'] = (!empty($iParamHash['show_author']) ? ($iParamHash['show_author']) : 'n');
+ $cleanHash['show_pubdate'] = (!empty($iParamHash['show_pubdate']) ? ($iParamHash['show_pubdate']) : 'n');
+ $cleanHash['show_expdate'] = (!empty($iParamHash['show_expdate']) ? ($iParamHash['show_expdate']) : 'n');
+ $cleanHash['show_reads'] = (!empty($iParamHash['show_reads']) ? ($iParamHash['show_reads']) : 'n');
+ $cleanHash['show_size'] = (!empty($iParamHash['show_size']) ? ($iParamHash['show_size']) : 'n');
+ $cleanHash['creator_edit'] = (!empty($iParamHash['creator_edit']) ? ($iParamHash['creator_edit']) : 'n');
+ $cleanHash['type_name'] = (!empty($iParamHash['type_name']) ? ($iParamHash['type_name']) : NULL);
} else {
// Was an acceptable name given?
if (empty($iParamHash['type_name']) || ($iParamHash['type_name'] == '')) {
diff --git a/admin/admin_types.php b/admin/admin_types.php
index 389063a..709ebb4 100644
--- a/admin/admin_types.php
+++ b/admin/admin_types.php
@@ -1,9 +1,6 @@
<?php
-// $Header: /cvsroot/bitweaver/_bit_articles/admin/admin_types.php,v 1.8 2006/04/11 17:52:09 squareing Exp $
-// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
-// 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.
-// Initialization
+// $Header: /cvsroot/bitweaver/_bit_articles/admin/admin_types.php,v 1.9 2007/08/23 11:15:23 squareing Exp $
+
require_once( '../../bit_setup_inc.php' );
require_once( ARTICLES_PKG_PATH.'BitArticle.php' );
require_once( ARTICLES_PKG_PATH.'BitArticleType.php' );
@@ -82,6 +79,7 @@ if( isset( $_REQUEST["add_type"] ) ) {
foreach( array_keys( $artTypes ) as $option ) {
$storeHash[$option] = !empty( $_REQUEST[$option][$this_type] ) ? 'y' : 'n';
}
+ $storeHash['type_name'] = $_REQUEST['type_name'][$this_type];
$gContent->storeType( $storeHash );
}
}
diff --git a/templates/admin_types.tpl b/templates/admin_types.tpl
index 052455e..9515802 100644
--- a/templates/admin_types.tpl
+++ b/templates/admin_types.tpl
@@ -1,4 +1,4 @@
-{* $Header: /cvsroot/bitweaver/_bit_articles/templates/admin_types.tpl,v 1.8 2007/06/26 07:11:40 lsces Exp $ *}
+{* $Header: /cvsroot/bitweaver/_bit_articles/templates/admin_types.tpl,v 1.9 2007/08/23 11:15:23 squareing Exp $ *}
{strip}
<div class="floaticon">{bithelp}</div>
@@ -9,7 +9,7 @@
<div class="body">
{formfeedback error=$gContent->mErrors}
-
+
{jstabs}
{jstab title="Article Types"}
{form legend="Modify Article Types"}
@@ -26,7 +26,8 @@
<tr class="{cycle values="odd,even}">
<td>
<input type="hidden" name="type_array[{$types[user].article_type_id}]" />
- <a href="{$smarty.const.ARTICLES_PKG_URL}index.php?type_id={$types[user].article_type_id}">{tr}{$types[user].type_name}{/tr}</a>
+ <input type="text" name="type_name[{$types[user].article_type_id}]" value="{$types[user].type_name}" />
+ <a href="{$smarty.const.ARTICLES_PKG_URL}index.php?type_id={$types[user].article_type_id}">{biticon iname=edit-find iexplain="List Articles"}</a>
</td>
{foreach from=$artTypes item=artType key=key}
<td style="text-align:center;"><input title="{$artType.name}" type="checkbox" name="{$key}[{$types[user].article_type_id}]" {if $types[user].$key eq 'y'}checked="checked"{/if} /></td>
@@ -88,7 +89,7 @@
</li>
</ul>
{/section}
-
+
<div class="row submit">
<input type="submit" name="update_type" value="{tr}Apply changes{/tr}" /><br />
</div>