summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlsces <lester@lsces.co.uk>2014-05-31 21:23:49 +0100
committerlsces <lester@lsces.co.uk>2014-05-31 21:23:49 +0100
commite183de9c4d97e670b850929c7ff1152fab01d6d1 (patch)
tree5d201181d0058f961ed30d7566b8ea0ea2a92c0d
parent4753d5552aa9cb66c3cdc10387d2a490d41f7a42 (diff)
downloadarticles-e183de9c4d97e670b850929c7ff1152fab01d6d1.tar.gz
articles-e183de9c4d97e670b850929c7ff1152fab01d6d1.tar.bz2
articles-e183de9c4d97e670b850929c7ff1152fab01d6d1.zip
PSR trial tidyup. Drop trailing ?> and tidy legacy bracing.
-rw-r--r--admin/admin_articles_inc.php1
-rw-r--r--admin/admin_topics.php3
-rw-r--r--admin/admin_types.php3
-rw-r--r--admin/index.php2
-rw-r--r--admin/upgrade_inc.php3
-rw-r--r--admin/upgrades/1.0.0.php1
-rw-r--r--article_filter_inc.php1
-rw-r--r--article_history.php4
-rw-r--r--articles_rss.php5
-rw-r--r--bit_setup_inc.php1
-rw-r--r--display_article_inc.php1
-rw-r--r--edit.php9
-rw-r--r--edit_topic.php7
-rw-r--r--index.php7
-rw-r--r--liberty_plugins/data.articles.php4
-rw-r--r--list.php3
-rw-r--r--list_topics.php3
-rw-r--r--lookup_article_inc.php1
-rw-r--r--lookup_article_topic_inc.php1
-rw-r--r--modules/index.php2
-rw-r--r--modules/mod_articles.php1
-rw-r--r--print.php8
-rw-r--r--rankings.php3
-rw-r--r--read.php3
-rw-r--r--templates/index.php4
-rw-r--r--test/TestTikiArticle.php31
-rw-r--r--test/index.php4
27 files changed, 40 insertions, 76 deletions
diff --git a/admin/admin_articles_inc.php b/admin/admin_articles_inc.php
index d3ee493..8b8ca69 100644
--- a/admin/admin_articles_inc.php
+++ b/admin/admin_articles_inc.php
@@ -100,4 +100,3 @@ if( !empty( $_REQUEST['store_settings'] )) {
simple_set_int( "articles_description_length", ARTICLES_PKG_NAME );
simple_set_value( "articles_image_size", ARTICLES_PKG_NAME );
}
-?>
diff --git a/admin/admin_topics.php b/admin/admin_topics.php
index 3210e16..7afe06e 100644
--- a/admin/admin_topics.php
+++ b/admin/admin_topics.php
@@ -1,6 +1,6 @@
<?php
// $Header$
-require_once( '../../kernel/setup_inc.php' );
+require_once '../../kernel/setup_inc.php';
include_once( ARTICLES_PKG_PATH.'BitArticle.php' );
include_once( ARTICLES_PKG_PATH.'lookup_article_topic_inc.php' );
@@ -28,4 +28,3 @@ $topics = BitArticleTopic::getTopicList();
$gBitSmarty->assign( 'topics', $topics );
$gBitSystem->display( 'bitpackage:articles/admin_topics.tpl', tra( 'Edit Topics' ) , array( 'display_mode' => 'admin' ));
-?>
diff --git a/admin/admin_types.php b/admin/admin_types.php
index 350e8ed..c02c338 100644
--- a/admin/admin_types.php
+++ b/admin/admin_types.php
@@ -1,7 +1,7 @@
<?php
// $Header$
-require_once( '../../kernel/setup_inc.php' );
+require_once '../../kernel/setup_inc.php';
require_once( ARTICLES_PKG_PATH.'BitArticle.php' );
require_once( ARTICLES_PKG_PATH.'BitArticleType.php' );
@@ -89,4 +89,3 @@ $gBitSmarty->assign( 'types', $types );
// Display the template
$gBitSystem->display( 'bitpackage:articles/admin_types.tpl', tra('Edit Article Types') , array( 'display_mode' => 'admin' ));
-?>
diff --git a/admin/index.php b/admin/index.php
index ec0e04e..1e6de35 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -2,5 +2,3 @@
// This is not a package.
header ("location: ../index.php");
-
-?>
diff --git a/admin/upgrade_inc.php b/admin/upgrade_inc.php
index 28a7743..2405e86 100644
--- a/admin/upgrade_inc.php
+++ b/admin/upgrade_inc.php
@@ -388,7 +388,6 @@ array( 'DATADICT' => array(
),
);
-if( isset( $upgrades[$gUpgradeFrom][$gUpgradeTo] ) ) {
+if ( isset( $upgrades[$gUpgradeFrom][$gUpgradeTo] ) ) {
$gBitSystem->registerUpgrade( ARTICLES_PKG_NAME, $upgrades[$gUpgradeFrom][$gUpgradeTo] );
}
-?>
diff --git a/admin/upgrades/1.0.0.php b/admin/upgrades/1.0.0.php
index ab96312..a3277e5 100644
--- a/admin/upgrades/1.0.0.php
+++ b/admin/upgrades/1.0.0.php
@@ -20,4 +20,3 @@ $gBitInstaller->registerPackageUpgrade( $infoHash, array(
array( 'DROPSEQUENCE' => array( 'article_topics_t_id_seq' ) ),
)),
));
-?>
diff --git a/article_filter_inc.php b/article_filter_inc.php
index 29e2eb0..8635c12 100644
--- a/article_filter_inc.php
+++ b/article_filter_inc.php
@@ -27,4 +27,3 @@ if( $gBitSystem->isFeatureActive( 'articles_display_filter_bar' ) && ( $gBitUser
$gBitSmarty->assign( 'filter', $filter );
}
-?>
diff --git a/article_history.php b/article_history.php
index 7ad72d1..4a8d525 100644
--- a/article_history.php
+++ b/article_history.php
@@ -16,7 +16,7 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
+require_once '../kernel/setup_inc.php';
require_once( ARTICLES_PKG_PATH.'BitArticle.php' );
$gBitSystem->verifyPackage( 'articles' );
@@ -56,8 +56,6 @@ $gBitSmarty->assign_by_ref( 'listInfo', $history['listInfo'] );
$numPages = ceil( $gContent->getHistoryCount() / $gBitSystem->getConfig('max_records', 20) );
$gBitSmarty->assign( 'numPages', $numPages );
-
// Display the template
$gBitSmarty->assign_by_ref( 'gContent', $gContent );
$gBitSystem->display( 'bitpackage:articles/article_history.tpl', NULL, array( 'display_mode' => 'display' ));
-?>
diff --git a/articles_rss.php b/articles_rss.php
index c1acbf9..ae3237d 100644
--- a/articles_rss.php
+++ b/articles_rss.php
@@ -10,7 +10,7 @@
*/
// ensure that we use absolute URLs everywhere
$_REQUEST['uri_mode'] = TRUE;
-require_once( "../kernel/setup_inc.php" );
+require_once '../kernel/setup_inc.php';
$gBitSystem->verifyPackage( 'articles' );
$gBitSystem->verifyPackage( 'rss' );
@@ -53,7 +53,7 @@ if( !$gBitUser->hasPermission( 'p_articles_read' ) ) {
$parseHash['data'] = preg_replace( LIBERTY_SPLIT_REGEX, "", $feed['data'] );
$item->description = $articles->parseData( $parseHash );
- $item->date = ( int )$feed['publish_date'];
+ $item->date = (int) $feed['publish_date'];
$item->source = BIT_ROOT_URI;
$item->author = $feed['author_name'];
@@ -67,4 +67,3 @@ if( !$gBitUser->hasPermission( 'p_articles_read' ) ) {
// finally we are ready to serve the data
echo $rss->saveFeed( $rss_version_name, $cacheFile );
}
-?>
diff --git a/bit_setup_inc.php b/bit_setup_inc.php
index be76956..20a9f4c 100644
--- a/bit_setup_inc.php
+++ b/bit_setup_inc.php
@@ -26,4 +26,3 @@ if( $gBitSystem->isPackageActive( 'articles' ) ) {
$gBitSystem->registerNotifyEvent( array( "article_submitted" => tra( "A user submits an article" ) ) );
}
-?>
diff --git a/display_article_inc.php b/display_article_inc.php
index 34397ba..e722a97 100644
--- a/display_article_inc.php
+++ b/display_article_inc.php
@@ -29,4 +29,3 @@ if( @$gContent->mInfo['allow_comments'] == 'y' ) {
// Display the Index Template
$gBitSystem->display( 'bitpackage:articles/read_article.tpl', @$gContent->mInfo['title'] , array( 'display_mode' => 'display' ));
-?>
diff --git a/edit.php b/edit.php
index 5eedfad..d2fa014 100644
--- a/edit.php
+++ b/edit.php
@@ -12,17 +12,17 @@
/**
* Initialization
*/
-require_once( '../kernel/setup_inc.php' );
+require_once '../kernel/setup_inc.php';
require_once( ARTICLES_PKG_PATH . 'BitArticle.php' );
// Is package installed and enabled
$gBitSystem->verifyPackage( 'articles' );
-include_once('lookup_article_inc.php');
+include_once 'lookup_article_inc.php';
-if( $gContent->isValid() ){
+if ( $gContent->isValid() ) {
$gContent->verifyUpdatePermission();
-}else{
+} else {
$gContent->verifyCreatePermission();
}
@@ -90,4 +90,3 @@ $gBitSmarty->assign( 'feedback', ( !empty( $feedback ) ? $feedback : NULL ) );
// Display the Index Template
$gBitSmarty->assign( 'show_page_bar', 'n' );
$gBitSystem->display( 'bitpackage:articles/edit_article.tpl', tra( "Articles" ) , array( 'display_mode' => 'edit' ));
-?>
diff --git a/edit_topic.php b/edit_topic.php
index 58bff2a..5795097 100644
--- a/edit_topic.php
+++ b/edit_topic.php
@@ -8,12 +8,12 @@
/**
* Initialization
*/
-require_once( '../kernel/setup_inc.php' );
+require_once '../kernel/setup_inc.php';
require_once( ARTICLES_PKG_PATH."BitArticle.php" );
include_once( ARTICLES_PKG_PATH."lookup_article_topic_inc.php" );
-if( !$gBitSystem->verifyPackage( 'articles' ) ) {
+if ( !$gBitSystem->verifyPackage( 'articles' ) ) {
$gBitSmarty->assign( 'msg', tra( "This package is disabled" ) . ": Articles" );
$gBitSystem->display( "error.tpl" , NULL, array( 'display_mode' => 'edit' ));
die;
@@ -36,6 +36,3 @@ if( isset( $_REQUEST["fSubmitSaveTopic"] ) ) {
}
$gBitSystem->display( 'bitpackage:articles/edit_topic.tpl' , NULL, array( 'display_mode' => 'edit' ));
-
-
-?>
diff --git a/index.php b/index.php
index b6704ed..c0f46b9 100644
--- a/index.php
+++ b/index.php
@@ -5,7 +5,7 @@
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details.
// Initialization
-require_once( '../kernel/setup_inc.php' );
+require_once '../kernel/setup_inc.php';
// Is package installed and enabled
$gBitSystem->verifyPackage( 'articles' );
@@ -14,8 +14,8 @@ require_once( ARTICLES_PKG_PATH.'BitArticle.php' );
// Now check permissions to access this page
$gBitSystem->verifyPermission( 'p_articles_read' );
-if( !empty( $_REQUEST['article_id'] ) ) {
- $param = array ( 'article_id' => ( int )$_REQUEST['article_id'] );
+if ( !empty( $_REQUEST['article_id'] ) ) {
+ $param = array ( 'article_id' => (int) $_REQUEST['article_id'] );
bit_redirect( BitArticle::getDisplayUrlFromHash( $param ) );
}
@@ -25,4 +25,3 @@ $gBitSmarty->assign_by_ref( 'gDefaultCenter', $gDefaultCenter );
// Display the template
$gBitSystem->display( 'bitpackage:kernel/dynamic.tpl', tra( 'Articles' ) , array( 'display_mode' => 'display' ));
-?>
diff --git a/liberty_plugins/data.articles.php b/liberty_plugins/data.articles.php
index 99bdc16..5009a7a 100644
--- a/liberty_plugins/data.articles.php
+++ b/liberty_plugins/data.articles.php
@@ -42,7 +42,8 @@ $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAARTICLES, $pluginParams );
$gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAARTICLES );
// Help Routine
-function data_articles_help() {
+function data_articles_help()
+{
$help =
'<table class="data help">'
.'<tr>'
@@ -150,4 +151,3 @@ function data_articles($data, $params) { // No change in the parameters with Cly
return "<div class=error>The articles package is not active.</div>";
}
}
-?>
diff --git a/list.php b/list.php
index b7f178c..08f1616 100644
--- a/list.php
+++ b/list.php
@@ -8,7 +8,7 @@
/**
* Initialization
*/
-require_once( '../kernel/setup_inc.php' );
+require_once '../kernel/setup_inc.php';
require_once( ARTICLES_PKG_PATH.'BitArticle.php' );
include_once( ARTICLES_PKG_PATH.'article_filter_inc.php' );
@@ -80,4 +80,3 @@ $gBitSmarty->assign( 'listpages', $listArticles );
// Display the template
$gBitSystem->display( 'bitpackage:articles/list_articles.tpl', tra( "Articles" ), array( 'display_mode' => 'list' ));
-?>
diff --git a/list_topics.php b/list_topics.php
index 0a77fe8..2425aa4 100644
--- a/list_topics.php
+++ b/list_topics.php
@@ -8,7 +8,7 @@
/**
* Initialization
*/
-require_once( '../kernel/setup_inc.php' );
+require_once '../kernel/setup_inc.php';
include_once( ARTICLES_PKG_PATH.'BitArticle.php' );
include_once( ARTICLES_PKG_PATH.'lookup_article_topic_inc.php' );
@@ -21,4 +21,3 @@ $topics = BitArticleTopic::getTopicList();
$gBitSmarty->assign( 'topics', $topics );
$gBitSystem->display( 'bitpackage:articles/list_topics.tpl', tra( 'List Topics' ) , array( 'display_mode' => 'list' ));
-?>
diff --git a/lookup_article_inc.php b/lookup_article_inc.php
index 9e15bd8..c3dc8b7 100644
--- a/lookup_article_inc.php
+++ b/lookup_article_inc.php
@@ -30,4 +30,3 @@ if( empty( $gContent ) || !is_object( $gContent ) ) {
$gBitSmarty->clear_assign( 'gContent' );
$gBitSmarty->assign( 'gContent', $gContent );
}
-?>
diff --git a/lookup_article_topic_inc.php b/lookup_article_topic_inc.php
index c48dfd2..e294722 100644
--- a/lookup_article_topic_inc.php
+++ b/lookup_article_topic_inc.php
@@ -26,4 +26,3 @@
}
$gBitSmarty->assign_by_ref( 'gContent', $gContent );
}
-?>
diff --git a/modules/index.php b/modules/index.php
index 3e305fe..1e6de35 100644
--- a/modules/index.php
+++ b/modules/index.php
@@ -2,5 +2,3 @@
// This is not a package.
header ("location: ../index.php");
-
-?> \ No newline at end of file
diff --git a/modules/mod_articles.php b/modules/mod_articles.php
index a7d63a1..e048758 100644
--- a/modules/mod_articles.php
+++ b/modules/mod_articles.php
@@ -54,4 +54,3 @@ if( ( !empty( $module_params['topic_id'] ) || !empty( $module_params['topic_name
$_template->tpl_vars['params'] = new Smarty_variable( !empty( $moduleParams['params'] ) );
$_template->tpl_vars['listtype'] = new Smarty_variable( ( isset($module_params['list_type']) && (strncasecmp($module_params['list_type'], 'u', 1) == 0) ) ? 'ul' : 'ol' );
$_template->tpl_vars['modArticles'] = new Smarty_variable( $articlelist );
-?>
diff --git a/print.php b/print.php
index 28e1de5..c2be343 100644
--- a/print.php
+++ b/print.php
@@ -8,7 +8,7 @@
/**
* Initialization
*/
-require_once( '../kernel/setup_inc.php' );
+require_once '../kernel/setup_inc.php';
include_once( ARTICLES_PKG_PATH . 'art_lib.php' );
@@ -65,10 +65,6 @@ if ( isset( $_REQUEST["article_id"] ) ) {
$heading = $article_data["heading"];
$gBitSmarty->assign( 'parsed_body', $tikilib->parse_data( $body ) );
$gBitSmarty->assign( 'parsed_heading', $tikilib->parse_data( $heading ) );
-}
-
-
+}
$gBitSmarty->display( "bitpackage:articles/print_article.tpl" );
-
-?>
diff --git a/rankings.php b/rankings.php
index 66b887c..3a2929f 100644
--- a/rankings.php
+++ b/rankings.php
@@ -8,7 +8,7 @@
/**
* Initialization
*/
-require_once( '../kernel/setup_inc.php' );
+require_once '../kernel/setup_inc.php';
include_once( LIBERTY_PKG_PATH . 'LibertyContent.php' );
include_once( ARTICLES_PKG_PATH . 'BitArticle.php' );
@@ -64,4 +64,3 @@ $rankList = $gContent->getContentRanking( $_REQUEST );
$gBitSmarty->assign( 'rankList', $rankList );
$gBitSystem->display( 'bitpackage:liberty/rankings.tpl', tra( "Article Rankings" ) , array( 'display_mode' => 'display' ));
-?>
diff --git a/read.php b/read.php
index c235eac..aa3c0b3 100644
--- a/read.php
+++ b/read.php
@@ -8,7 +8,7 @@
/**
* Initialization
*/
-require_once( '../kernel/setup_inc.php' );
+require_once '../kernel/setup_inc.php';
require_once( ARTICLES_PKG_PATH.'BitArticle.php' );
@@ -62,4 +62,3 @@ if( @$gContent->mInfo['allow_comments'] == 'y' ) {
// Display the Index Template
$gBitSystem->display( 'bitpackage:articles/read_article.tpl', @$gContent->mInfo['title'] , array( 'display_mode' => 'display' ));
-?>
diff --git a/templates/index.php b/templates/index.php
index 3e305fe..30a5490 100644
--- a/templates/index.php
+++ b/templates/index.php
@@ -1,6 +1,4 @@
-<?php
+<?php
// This is not a package.
header ("location: ../index.php");
-
-?> \ No newline at end of file
diff --git a/test/TestTikiArticle.php b/test/TestTikiArticle.php
index 48e3660..9b80cd7 100644
--- a/test/TestTikiArticle.php
+++ b/test/TestTikiArticle.php
@@ -1,20 +1,20 @@
<?php
-require_once('../../kernel/setup_inc.php');
+require_once '../../kernel/setup_inc.php';
require_once(ARTICLES_PKG_PATH.'BitArticle.php');
-class TestBitArticle extends Test {
+class TestBitArticle extends Test
+{
+ public $test;
+ public $id;
+ public $count;
- var $test;
- var $id;
- var $count;
-
- function TestBitArticle()
+ public function TestBitArticle()
{
$this->test = new BitArticle();
Assert::equalsTrue($this->test != NULL, 'Error during initialisation');
}
- function testGetItems()
+ public function testGetItems()
{
$filter = array();
$list = $this->test->getList($filter);
@@ -22,7 +22,7 @@ class TestBitArticle extends Test {
Assert::equalsTrue(is_array($list));
}
- function testStoreItem()
+ public function testStoreItem()
{
$newItemHash = array(
"title" => "Test Title",
@@ -47,35 +47,35 @@ class TestBitArticle extends Test {
Assert::equalsTrue($this->test->store($newItemHash));
}
- function testIsValidItem()
+ public function testIsValidItem()
{
Assert::equalsTrue($this->test->isValid());
}
- function testNullItem()
+ public function testNullItem()
{
$this->id = $this->test->mArticleId;
$this->test = NULL;
Assert::equals($this->test, NULL);
}
- function testLoadItem()
+ public function testLoadItem()
{
$this->test = new BitArticle($this->id);
Assert::equals($this->test->load(), 37);
}
- function testUrlItem()
+ public function testUrlItem()
{
Assert::equalsTrue($this->test->getDisplayUrl() != "");
}
- function testExpungeItem()
+ public function testExpungeItem()
{
Assert::equalsTrue($this->test->expunge());
}
- function testCountItems()
+ public function testCountItems()
{
$filter = array();
$count = count($this->test->getList($filter));
@@ -83,4 +83,3 @@ class TestBitArticle extends Test {
}
}
-?>
diff --git a/test/index.php b/test/index.php
index 8a4f33c..97e21e4 100644
--- a/test/index.php
+++ b/test/index.php
@@ -1,6 +1,4 @@
<?php
-require_once( '../../kernel/setup_inc.php' );
+require_once '../../kernel/setup_inc.php';
require_once( KERNEL_PKG_PATH.'test/index.php' );
-
-?>