summaryrefslogtreecommitdiff
path: root/list.php
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2005-08-26 10:15:15 +0000
committerMax Kremmel <xing@synapse.plus.com>2005-08-26 10:15:15 +0000
commit04136bdba7c067bf09174d3ed6427dbe265d8e01 (patch)
treebf2ac5191c103ac7e4f2a3675d6960bd929c5f91 /list.php
parent607fcfd7cec87a689b7b3210bb29d79cb5ab17cd (diff)
downloadarticles-04136bdba7c067bf09174d3ed6427dbe265d8e01.tar.gz
articles-04136bdba7c067bf09174d3ed6427dbe265d8e01.tar.bz2
articles-04136bdba7c067bf09174d3ed6427dbe265d8e01.zip
get article submissions working
Diffstat (limited to 'list.php')
-rw-r--r--list.php39
1 files changed, 14 insertions, 25 deletions
diff --git a/list.php b/list.php
index 7ef2218..0f145b5 100644
--- a/list.php
+++ b/list.php
@@ -1,6 +1,6 @@
<?php
-// $Header: /cvsroot/bitweaver/_bit_articles/list.php,v 1.1 2005/06/30 01:10:45 bitweaver Exp $
-// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
+// $Header: /cvsroot/bitweaver/_bit_articles/list.php,v 1.2 2005/08/26 10:15:15 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
@@ -10,9 +10,6 @@ require_once( ARTICLES_PKG_PATH.'BitArticle.php' );
// Is package installed and enabled
$gBitSystem->verifyPackage( 'articles' );
-// TODO - do we really want to use a Wiki feature here? wolff_borg
-//$gBitSystem->isFeatureActive( 'feature_listPages' );
-
// Now check permissions to access this page
$gBitSystem->verifyPermission( 'bit_p_read_article' );
@@ -24,12 +21,10 @@ $gBitSystem->verifyPermission( 'bit_p_read_article' );
then we check permission to delete articles.
if so, we call histlib's method remove_all_versions for all the checked articles.
*/
-if (isset($_REQUEST["submit_mult"]) && isset($_REQUEST["checked"]) && $_REQUEST["submit_mult"] == "remove_articles") {
-
-
+if( isset( $_REQUEST["submit_mult"] ) && isset( $_REQUEST["checked"] ) && $_REQUEST["submit_mult"] == "remove_articles" ) {
// Now check permissions to remove the selected articles
$gBitSystem->verifyPermission( 'bit_p_remove_article' );
-
+
if( !empty( $_REQUEST['cancel'] ) ) {
// user cancelled - just continue on, doing nothing
} elseif( empty( $_REQUEST['confirm'] ) ) {
@@ -38,12 +33,12 @@ if (isset($_REQUEST["submit_mult"]) && isset($_REQUEST["checked"]) && $_REQUEST[
foreach( $_REQUEST["checked"] as $del ) {
$formHash['input'][] = '<input type="hidden" name="checked[]" value="'.$del.'"/>';
}
- $gBitSystem->confirmDialog( $formHash, array( 'warning' => 'Are you sure you want to delete '.count($_REQUEST["checked"]).' articles?', 'error' => 'This cannot be undone!' ) );
+ $gBitSystem->confirmDialog( $formHash, array( 'warning' => 'Are you sure you want to delete '.count($_REQUEST["checked"] ).' articles?', 'error' => 'This cannot be undone!' ));
} else {
- foreach ($_REQUEST["checked"] as $deleteId) {
+ foreach( $_REQUEST["checked"] as $deleteId ) {
$tmpPage = new BitArticle( $deleteId );
- if( !$tmpPage->load() || !$tmpPage->expunge() ) {
- array_merge( $errors, array_values( $tmpPage->mErrors ) );
+ if( !$tmpPage->load()|| !$tmpPage->expunge() ) {
+ array_merge( $errors, array_values( $tmpPage->mErrors ));
}
}
if( !empty( $errors ) ) {
@@ -52,20 +47,17 @@ if (isset($_REQUEST["submit_mult"]) && isset($_REQUEST["checked"]) && $_REQUEST[
}
}
-$now = date( "U" );
-
-if ( !isset( $_REQUEST["type"] ) ) {
+if( !isset( $_REQUEST["type"] ) ) {
$_REQUEST["type"] = '';
}
-if ( !isset( $_REQUEST["topic"] ) ) {
+if( !isset( $_REQUEST["topic"] ) ) {
$_REQUEST["topic"] = '';
}
$article = new BitArticle();
-if (empty($_REQUEST['status_id']) || (!$gBitUser->hasPermission('bit_p_view_submissions') && !$gBitUser->hasPermission('bit_p_admin_articles'))) {
+if( empty( $_REQUEST['status_id'] ) || ( !$gBitUser->hasPermission( 'bit_p_view_submissions' ) && !$gBitUser->hasPermission( 'bit_p_admin_articles' ) ) ) {
$_REQUEST['status_id'] = ARTICLE_STATUS_APPROVED;
}
-
$listarticles = $article->getList( $_REQUEST );
$topics = BitArticleTopic::listTopics();
@@ -74,12 +66,9 @@ $smarty->assign_by_ref( 'topics', $topics );
$types = BitArticleType::listTypes();
$smarty->assign_by_ref( 'types', $types );
-
-
-$smarty->assign_by_ref('control', $_REQUEST["control"]);
-$smarty->assign_by_ref('listpages', $listarticles["data"]);
+$smarty->assign_by_ref( 'control', $_REQUEST["control"] );
+$smarty->assign_by_ref( 'listpages', $listarticles["data"] );
// Display the template
-$gBitSystem->display( 'bitpackage:articles/list_articles.tpl', tra("articles") );
-
+$gBitSystem->display( 'bitpackage:articles/list_articles.tpl', tra( "articles" ));
?>