diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-05-14 09:55:19 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-05-14 09:55:19 +0100 |
| commit | c105a9834fd9c5a320d41422c50fa84e5bc12084 (patch) | |
| tree | 48d0d400d6e0a4fd87485e89accfdeaf8db5c24b | |
| parent | 1778d95793e4bc5d494ece84ec177b5629c830f3 (diff) | |
| download | wiki-c105a9834fd9c5a320d41422c50fa84e5bc12084.tar.gz wiki-c105a9834fd9c5a320d41422c50fa84e5bc12084.tar.bz2 wiki-c105a9834fd9c5a320d41422c50fa84e5bc12084.zip | |
php-cs-fixer tidies to php8.5 standards
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
65 files changed, 334 insertions, 345 deletions
diff --git a/.htaccess b/.htaccess index 4250353..4250353 100644..100755 --- a/.htaccess +++ b/.htaccess diff --git a/admin/admin_external_wikis.php b/admin/admin_external_wikis.php index f4ad2a3..c956bd0 100755 --- a/admin/admin_external_wikis.php +++ b/admin/admin_external_wikis.php @@ -29,11 +29,11 @@ if ($_REQUEST["extwiki_id"]) { } $gBitSmarty->assign('info', $info); if (isset($_REQUEST["remove"])) { - + $adminlib->remove_extwiki($_REQUEST["remove"]); } if (isset($_REQUEST["save"])) { - + $adminlib->replace_extwiki($_REQUEST["extwiki_id"], $_REQUEST["extwiki"], $_REQUEST['name']); $info = []; $info["extwiki"] = ''; @@ -73,4 +73,4 @@ if ($offset > 0) { $gBitSmarty->assign('channels', $channels["data"] ); // Display the template -$gBitSystem->display( 'bitpackage:wiki/admin_external_wikis.tpl', null, array( 'display_mode' => 'admin' )); +$gBitSystem->display( 'bitpackage:wiki/admin_external_wikis.tpl', null, [ 'display_mode' => 'admin' ]); diff --git a/admin/pump_wiki_inc.php b/admin/pump_wiki_inc.php index 8a0af3a..141f408 100755 --- a/admin/pump_wiki_inc.php +++ b/admin/pump_wiki_inc.php @@ -16,7 +16,7 @@ To continue with this tutorial, it would be best if you had administrator rights $admin_link = 'You first have to go to the Administration panel (Administration in the top menu bar). Once there you can see a number of links organised by package: __Administration__ --> '; -$pageHash = [ +$pageHash = [ [ 'title' => 'Welcome', 'description' => 'The Wiki Package of bitweaver', @@ -32,7 +32,7 @@ bitweaver was built with extensibility in mind and thus we have made it \'\'easy ** ((Getting Help)) ** ((How to create a Wiki Book)) ** ((How to set your Wiki Homepage)) -** ((bitweaver Glossary))" +** ((bitweaver Glossary))", ], [ 'title' => 'Getting Started', @@ -65,7 +65,7 @@ To control the availability of this __code__ plugin, you can do this on the {$ad !! Other Plugins Some other packages also have plugins. These settings can usually be found in the respective package plugins admin page e.g.: {$admin_link}__Treasury__ --> __Treasury Plugins__. -"], +", ], [ 'title' => 'Getting Help', 'description' => 'Help and Contact Details', @@ -79,7 +79,7 @@ Some other packages also have plugins. These settings can usually be found in th ** the [https://www.bitweaver.org/forums/viewforum.php?f=5|bitweaver Forums] might contain useful information. ** [https://www.bitweaver.org/|bitweaver] currently contains all the documentation we have. * If you think you could contribute to bitweaver in any way, please feel free to contact us. we appreciate all the help we can get. -'], +', ], [ 'title' => 'How to create a Wiki Book', 'description' => 'A wikibook is a handy way to organise pages.', @@ -132,7 +132,7 @@ You can make it more apparent that the ((bitweaver Glossary)) is part of the ((G !Viewing the Wiki Book Now that we have created a Wiki Book, we want to view it and see what all this work was for. If you click on the __Wiki Books__ in your left menu, you will see the ===bitweaver Help=== book. Please click on the book, which will take you to a page, where you can see the Wiki Book you just created. The special aspect of these books, is the easy navigation that comes with the hierarchial structuring of the pages. Above the wiki page, you can now see links that allow you to move forwards, backwards and up one level using those simple navigational links. -'], +', ], [ 'title' => 'How to set your Wiki Homepage', 'description' => 'How to set a specific wikipage as home', @@ -144,7 +144,7 @@ Now that we have created a Wiki Book, we want to view it and see what all this w '.$admin_link.'__Wiki__ --> __Wiki Settings__ Clicking this link will take you to a page with a massive number of options. The one we are interested in, are all in the __Wiki Settings__ tab. The topmost setting is the one we want. The name of the page you enter here, will be the one tha is first shown when clicking on the __Wiki Home__ link in the ===Application Menu=== or the __Wiki__ link in the ===top bar menu===. -'], +', ], [ 'title' => 'bitweaver Glossary', 'description' => 'Definition of Frequently used Terms', @@ -155,7 +155,7 @@ Clicking this link will take you to a page with a massive number of options. The ;Group:In bitweaver groups are given permissions. You can then assign users to various groups. this makes it easy to allow a set of users to edit wiki pages but not edit blogs or vice versa. ;User:When a user registers with your site, that user is added to your database. every user has a defined set of permissions that allow them to access particular parts of your site. to manage these permissions, you have to first define groups and allocate permissions to them. ;Content:Content is any text that is intered into bitweaver that is stored in the central liberty tables. storing the content in one place makes it accesible from various different places allowing users to mix and match such content as they see fit. This makes it possible to easily display images in a wiki text or even display a blog post in an article since they are all considered to be the same. -'], +', ], ]; foreach( $pageHash as $page ) { diff --git a/admin/schema_inc.php b/admin/schema_inc.php index 71ce6c7..b73136a 100755 --- a/admin/schema_inc.php +++ b/admin/schema_inc.php @@ -27,7 +27,7 @@ foreach( array_keys( $tables ) AS $tableName ) { $gBitInstaller->registerSchemaTable( WIKI_PKG_NAME, $tableName, $tables[$tableName] ); } -$gBitInstaller->registerPackageInfo( WIKI_PKG_NAME, [ +$gBitInstaller->registerPackageInfo( WIKI_PKG_NAME, [ 'description' => "A wiki is 'the simplest online database that could possibly work.' No HTML or programming knowledge is needed to contribute to a wiki.", 'license' => '<a href="http://www.gnu.org/licenses/licenses.html#LGPL">LGPL</a>', ] ); @@ -35,17 +35,16 @@ $gBitInstaller->registerPackageInfo( WIKI_PKG_NAME, [ // ### Indexes $indices = [ 'wiki_pages_content_idx' => [ 'table' => 'wiki_pages', 'cols' => 'content_id', 'opts' => 'UNIQUE' ], - 'wiki_page_footnotes_page_idx' => [ 'table' => 'wiki_footnotes', 'cols' => 'page_id', 'opts' => null ] + 'wiki_page_footnotes_page_idx' => [ 'table' => 'wiki_footnotes', 'cols' => 'page_id', 'opts' => null ], ]; $gBitInstaller->registerSchemaIndexes( WIKI_PKG_NAME, $indices ); // ### Sequences $sequences = [ - 'wiki_pages_page_id_seq' => [ 'start' => 1 ] + 'wiki_pages_page_id_seq' => [ 'start' => 1 ], ]; $gBitInstaller->registerSchemaSequences( WIKI_PKG_NAME, $sequences ); - // ### Default UserPermissions $gBitInstaller->registerUserPermissions( WIKI_PKG_NAME, [ [ 'p_wiki_admin_book', 'Can administer books', 'editors', WIKI_PKG_NAME ], @@ -67,7 +66,7 @@ $gBitInstaller->registerUserPermissions( WIKI_PKG_NAME, [ ] ); // ### Default Preferences -$gBitInstaller->registerPreferences( WIKI_PKG_NAME, [ +$gBitInstaller->registerPreferences( WIKI_PKG_NAME, [ //[ WIKI_PKG_NAME, 'warn_on_edit','n' ], //[ WIKI_PKG_NAME, 'wiki_allow_dup_page_names','y' ], [ WIKI_PKG_NAME, 'wiki_attachments','y' ], @@ -128,18 +127,18 @@ $gBitInstaller->registerPreferences( WIKI_PKG_NAME, [ ] ); if( defined( 'RSS_PKG_NAME' )) { - $gBitInstaller->registerPreferences( WIKI_PKG_NAME, [ + $gBitInstaller->registerPreferences( WIKI_PKG_NAME, [ [ RSS_PKG_NAME, WIKI_PKG_NAME.'_rss', 'y' ], ] ); } // ### Register content types -$gBitInstaller->registerContentObjects( WIKI_PKG_NAME, [ +$gBitInstaller->registerContentObjects( WIKI_PKG_NAME, [ 'BitPage' => WIKI_PKG_CLASS_PATH.'BitPage.php', 'BitBook' => WIKI_PKG_CLASS_PATH.'BitBook.php', ] ); // Requirements -$gBitInstaller->registerRequirements( WIKI_PKG_NAME, [ - 'liberty' => [ 'min' => '5.0.0' ], +$gBitInstaller->registerRequirements( WIKI_PKG_NAME, [ + 'liberty' => [ 'min' => '5.0.0' ], ] ); diff --git a/admin/upgrades/5.0.0.php b/admin/upgrades/5.0.0.php index f1da745..4b14dad 100644 --- a/admin/upgrades/5.0.0.php +++ b/admin/upgrades/5.0.0.php @@ -3,11 +3,10 @@ */ global $gBitInstaller; -$infoHash = array( +$infoHash = [ 'package' => WIKI_PKG_NAME, 'version' => str_replace( '.php', '', basename( __FILE__ )), 'description' => "Fixed new format updates", 'post_upgrade' => NULL, -); - +]; diff --git a/book_to_html.php b/book_to_html.php index 1c00595..10ca362 100755 --- a/book_to_html.php +++ b/book_to_html.php @@ -19,39 +19,39 @@ use Bitweaver\KernelTools; function copys($source,$dest) { - if (!is_dir($source)) - return 0; - if (!is_dir($dest)) - { - mkdir($dest); - } - $h=@dir($source); - while (@($entry=$h->read()) !== false) - { - if (($entry!=".")&&($entry!="..")) - { - if (is_dir("$source/$entry")&&$dest!=="$source/$entry") - { - copys("$source/$entry","$dest/$entry"); - } - else - { - @copy("$source/$entry","$dest/$entry"); - } - } - } - $h->close(); - return 1; + if (!is_dir($source)) + return 0; + if (!is_dir($dest)) + { + mkdir($dest); + } + $h=@dir($source); + while (@($entry=$h->read()) !== false) + { + if (($entry!=".")&&($entry!="..")) + { + if (is_dir("$source/$entry")&&$dest!=="$source/$entry") + { + copys("$source/$entry","$dest/$entry"); + } + else + { + @copy("$source/$entry","$dest/$entry"); + } + } + } + $h->close(); + return 1; } function deldirfiles($dir){ $current_dir = opendir($dir); while($entryname = readdir($current_dir)){ - if(is_dir("$dir/$entryname") and ($entryname != "." and $entryname!="..")){ - deldirfiles("{$dir}/{$entryname}"); - }elseif($entryname != "." and $entryname!=".."){ - unlink("{$dir}/{$entryname}"); - } + if(is_dir("$dir/$entryname") and ($entryname != "." and $entryname!="..")){ + deldirfiles("{$dir}/{$entryname}"); + }elseif($entryname != "." and $entryname!=".."){ + unlink("{$dir}/{$entryname}"); + } } closedir($current_dir); } @@ -78,15 +78,15 @@ if(isset($_REQUEST['create'])) { $output.="Generating WebHelp using <b>$name</b> as index. Directory: $name<br/>"; $base = BITHELP_PKG_PATH."$dir"; if(!is_dir(BITHELP_PKG_PATH."$dir")) { - $output.="Creating directory structure in $base<br/>"; - mkdir(BITHELP_PKG_PATH."$dir"); - mkdir("$base/js"); - mkdir("$base/css"); - mkdir("$base/icons"); - mkdir("$base/menu"); - mkdir("$base/pages"); - mkdir("$base/pages/img"); - mkdir("$base/pages/img/wiki_up"); + $output.="Creating directory structure in $base<br/>"; + mkdir(BITHELP_PKG_PATH."$dir"); + mkdir("$base/js"); + mkdir("$base/css"); + mkdir("$base/icons"); + mkdir("$base/menu"); + mkdir("$base/pages"); + mkdir("$base/pages/img"); + mkdir("$base/pages/img/wiki_up"); } $output.="Eliminating previous files<br/>"; deldirfiles("$base/js"); @@ -103,4 +103,4 @@ if(isset($_REQUEST['create'])) { } // Display the template -$gBitSystem->display( 'bitpackage:wiki/create_webhelp.tpl', null, array( 'display_mode' => 'display' )); +$gBitSystem->display( 'bitpackage:wiki/create_webhelp.tpl', null, [ 'display_mode' => 'display' ]); @@ -45,4 +45,4 @@ if ($listHash['offset'] > 0) { $gBitSmarty->assign('channels', $channels["data"]); -$gBitSystem->display( 'bitpackage:wiki/list_books.tpl', null, array( 'display_mode' => 'display' )); +$gBitSystem->display( 'bitpackage:wiki/list_books.tpl', null, [ 'display_mode' => 'display' ]); diff --git a/copyrights.php b/copyrights.php index 7eb663b..511fc87 100755 --- a/copyrights.php +++ b/copyrights.php @@ -44,7 +44,7 @@ if (isset($_REQUEST['editcopyright'])) { $copyrightslib->edit_copyright($copyright_id, $copyrightTitle, $copyrightYear, $copyrightAuthors, $gBitUser->mUserId); } else { $gBitSmarty->assign('msg', KernelTools::tra("You must supply all the information, including title and year.")); - $gBitSystem->display( 'error.tpl' , null, array( 'display_mode' => 'display' )); + $gBitSystem->display( 'error.tpl' , null, [ 'display_mode' => 'display' ]); die; } } @@ -181,10 +181,10 @@ if( isset( $_REQUEST["fCancel"] ) ) { header( "Location: ".$gContent->getDisplayUrlFromHash( $return ) ); die; - } else { + } $formInfo = $_REQUEST; $formInfo['data'] = &$_REQUEST['edit']; - } + } elseif( !empty( $_REQUEST['edit'] ) ) { // perhaps we have a javascript non-saving form submit $formInfo = $_REQUEST; @@ -213,7 +213,7 @@ if( isset( $_REQUEST["preview"] ) ) { $formInfo['parsed_data'] = LibertyContent::parseDataHash( $data_to_parse ); $gContent->invokeServices( 'content_preview_function' ); -} +} $gBitSmarty->assign( 'preview',$preview ); if( $gContent->isInStructure() ) { @@ -242,13 +242,6 @@ if( $gBitSystem->isPackageActive( 'ckeditor' ) ) { $gBitSystem->display( 'bitpackage:wiki/edit_page.tpl', 'Edit: '.$gContent->getTitle() , [ 'display_mode' => 'edit' ] ); - - - - - - - //******************* WIKI Edit Functions function htmldecode( $string ) { @@ -474,7 +467,7 @@ if( isset( $_REQUEST["suck_url"] ) ) { } // Suck another page and append to the end of current require_once UTIL_PKG_INCLUDE_PATH.'htmlparser/html_parser_inc.php'; - $suck_url = isset( $_REQUEST["suck_url"] ) ? $_REQUEST["suck_url"] : ''; + $suck_url = $_REQUEST["suck_url"] ?? ''; $parsehtml = isset( $_REQUEST["parsehtml"] ) ? ( $_REQUEST["parsehtml"] == 'on' ? 'y' : 'n' ): 'n'; if( isset( $_REQUEST['do_suck'] ) && strlen( $suck_url ) > 0 ) { // \note by zaufi diff --git a/edit_book.php b/edit_book.php index 8971c58..813a716 100755 --- a/edit_book.php +++ b/edit_book.php @@ -43,7 +43,7 @@ if( BitBase::verifyId( $_REQUEST["structure_id"] ) || BitBase::verifyId( $_REQUE $newStructure = new LibertyStructure(); // alias => '' is a temporary setting until alias stuff has been removed if( !$node = $newStructure->getNode( -2, $gContent->mContentId ) ) { - $structureHash = array( 'content_id' => $gContent->mContentId, 'alias' => '' ); + $structureHash = [ 'content_id' => $gContent->mContentId, 'alias' => '' ]; $_REQUEST["structure_id"] = $newStructure->storeNode( $structureHash ); } else { $_REQUEST["structure_id"] = $node['structure_id']; @@ -72,7 +72,7 @@ if( $gContent->isValid() ){ if( isset($_REQUEST["createstructure"]) ) { if ((empty($_REQUEST['name']))) { $gBitSmarty->assign('msg', KernelTools::tra( "You must specify a name.")); - $gBitSystem->display( 'error.tpl' , null, array( 'display_mode' => 'edit' )); + $gBitSystem->display( 'error.tpl' , null, [ 'display_mode' => 'edit' ]); die; } @@ -91,12 +91,12 @@ if( isset($_REQUEST["createstructure"]) ) { if( $gContent->isValid() ) { $gStructure = new LibertyStructure(); // alias => '' is a temporary setting until alias stuff has been removed - $structureHash = array( 'content_id' => $gContent->mContentId, 'alias' => '' ); + $structureHash = [ 'content_id' => $gContent->mContentId, 'alias' => '' ]; $structure_id = $gStructure->storeNode( $structureHash ); //Cannot create a structure if a structure already exists if (!isset($structure_id)) { $gBitSmarty->assign('msg', $_REQUEST['name'] . " " . KernelTools::tra( "page not added (Exists)")); - $gBitSystem->display( 'error.tpl' , null, array( 'display_mode' => 'edit' )); + $gBitSystem->display( 'error.tpl' , null, [ 'display_mode' => 'edit' ]); die; } @@ -152,4 +152,4 @@ if( isset($_REQUEST["createstructure"]) ) { } $gBitSystem->setBrowserTitle( !empty($gStructure) && $gStructure->isValid() ? 'Edit Wiki Book:'.$gStructure->getField( 'title' ) : null ); // Display the template -$gBitSystem->display( $mid , null, array( 'display_mode' => 'edit' ));
\ No newline at end of file +$gBitSystem->display( $mid , null, [ 'display_mode' => 'edit' ]);
\ No newline at end of file diff --git a/icons/pkg_wiki.gif b/icons/pkg_wiki.gif Binary files differindex b638c9d..b638c9d 100644..100755 --- a/icons/pkg_wiki.gif +++ b/icons/pkg_wiki.gif diff --git a/icons/pkg_wiki.png b/icons/pkg_wiki.png Binary files differindex fccc64c..fccc64c 100644..100755 --- a/icons/pkg_wiki.png +++ b/icons/pkg_wiki.png diff --git a/includes/bit_setup_inc.php b/includes/bit_setup_inc.php index a9e3bbd..c9ee7f2 100755 --- a/includes/bit_setup_inc.php +++ b/includes/bit_setup_inc.php @@ -1,5 +1,6 @@ <?php namespace Bitweaver\Wiki; + use Bitweaver\KernelTools; global $gBitSystem, $gBitUser; @@ -13,9 +14,9 @@ $pRegisterHash = [ define( 'WIKI_PKG_NAME', $pRegisterHash['package_name'] ); define( 'WIKI_PKG_URL', BIT_ROOT_URL . basename( $pRegisterHash['package_path'] ) . '/' ); define( 'WIKI_PKG_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/' ); -define( 'WIKI_PKG_INCLUDE_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/'); +define( 'WIKI_PKG_INCLUDE_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/'); define( 'WIKI_PKG_CLASS_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/classes/'); -define( 'WIKI_PKG_ADMIN_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/admin/'); +define( 'WIKI_PKG_ADMIN_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/admin/'); $gBitSystem->registerPackage( $pRegisterHash ); diff --git a/includes/classes/BitBook.php b/includes/classes/BitBook.php index d66eb0b..abbd207 100755 --- a/includes/classes/BitBook.php +++ b/includes/classes/BitBook.php @@ -20,11 +20,11 @@ // // $Id: BitBook.php,v 1.14 2010/04/17 22:46:11 wjames5 Exp $ - /** * required setup */ namespace Bitweaver\Wiki; + use Bitweaver\Liberty\LibertyStructure; define('BITBOOK_CONTENT_TYPE_GUID', 'bitbook' ); @@ -42,14 +42,14 @@ class BitBook extends BitPage { public $mPageName; public function __construct( $pPageId=null, $pContentId=null ) { parent::__construct( $pPageId, $pContentId ); - $this->registerContentType( BITBOOK_CONTENT_TYPE_GUID, array( + $this->registerContentType( BITBOOK_CONTENT_TYPE_GUID, [ 'content_type_guid' => BITBOOK_CONTENT_TYPE_GUID, 'content_name' => 'Wiki Book', 'handler_class' => 'BitBook', 'handler_package' => 'wiki', 'handler_file' => 'BitBook.php', - 'maintainer_url' => 'https://www.bitweaver.org' - ) ); + 'maintainer_url' => 'https://www.bitweaver.org', + ] ); $this->mContentTypeGuid = BITBOOK_CONTENT_TYPE_GUID; // Permission setup diff --git a/includes/classes/BitPage.php b/includes/classes/BitPage.php index 30e4aef..d120120 100755 --- a/includes/classes/BitPage.php +++ b/includes/classes/BitPage.php @@ -14,6 +14,7 @@ * required setup */ namespace Bitweaver\Wiki; + use Bitweaver\BitBase; use Bitweaver\KernelTools; use Bitweaver\BitCacheable; @@ -35,7 +36,7 @@ class BitPage extends LibertyMime implements BitCacheable { 'handler_class' => 'BitPage', 'handler_package' => 'wiki', 'handler_file' => 'BitPage.php', - 'maintainer_url' => 'https://www.bitweaver.org' + 'maintainer_url' => 'https://www.bitweaver.org', ] ); $this->mPageId = (int)$pPageId; $this->mContentId = (int)$pContentId; @@ -470,7 +471,6 @@ class BitPage extends LibertyMime implements BitCacheable { return BitPage::getPageLink( $pParamHash['title'], null ); } - /** * Returns include file that will * @return string the fully specified path to file to be included @@ -479,7 +479,6 @@ class BitPage extends LibertyMime implements BitCacheable { return WIKI_PKG_INCLUDE_PATH."display_bitpage_inc.php"; } - /** * Returns the center template for the view selected */ @@ -496,7 +495,6 @@ class BitPage extends LibertyMime implements BitCacheable { return $ret; } - /** * Create the generic title for a content item * @@ -600,7 +598,6 @@ class BitPage extends LibertyMime implements BitCacheable { return $ret; } - /** * Roll back to a specific version of a page * @param int $pVersion Version number to roll back to @@ -647,7 +644,7 @@ class BitPage extends LibertyMime implements BitCacheable { 'links_asc', 'links_desc', 'backlinks_asc', - 'backlinks_desc' + 'backlinks_desc', ]; if( in_array( $pListHash['sort_mode'], $specialSort ) ) { @@ -780,8 +777,8 @@ class BitPage extends LibertyMime implements BitCacheable { while( $res = $result->fetchRow() ) { $aux = []; $aux = $res; - $aux['creator'] = isset( $res['creator_real_name'] ) ? $res['creator_real_name'] : $res['creator_user']; - $aux['editor'] = isset( $res['modifier_real_name'] ) ? $res['modifier_real_name'] : $res['modifier_user']; + $aux['creator'] = $res['creator_real_name'] ?? $res['creator_user']; + $aux['editor'] = $res['modifier_real_name'] ?? $res['modifier_user']; $aux['flag'] = $res["flag"] == 'L' ? 'locked' : 'unlocked'; $aux['display_url'] = static::getDisplayUrlFromHash( $aux ); // display_link does not seem to be used when getList is called @@ -995,7 +992,7 @@ class BitPage extends LibertyMime implements BitCacheable { $pGraphViz->addNode( $pLinkStructure['name'], $pParams['node'] ); foreach( $pLinkStructure['pages'] as $node ) { - $this->linkStructureGraph( $pGraphViz,$node, $pParams ); + $this->linkStructureGraph( $pGraphViz,$node, $pParams ); $pGraphViz->addEdge( [ $pLinkStructure['name'] => $node['name'] ], $pParams['node'] ); } } diff --git a/includes/copyrights_lib.php b/includes/copyrights_lib.php index 122506c..31345db 100755 --- a/includes/copyrights_lib.php +++ b/includes/copyrights_lib.php @@ -14,6 +14,7 @@ * @subpackage CopyrightsLib */ namespace Bitweaver\Wiki; + use Bitweaver\BitBase; class CopyrightsLib extends BitBase { diff --git a/includes/display_bitpage_inc.php b/includes/display_bitpage_inc.php index 53d113f..6b5101c 100755 --- a/includes/display_bitpage_inc.php +++ b/includes/display_bitpage_inc.php @@ -14,6 +14,7 @@ * required setup */ namespace Bitweaver\Wiki; + use Bitweaver\KernelTools; use Bitweaver\Stickies\BitSticky; use Bitweaver\Liberty\LibertyContent; diff --git a/includes/export_lib.php b/includes/export_lib.php index 0146573..7f6c005 100755 --- a/includes/export_lib.php +++ b/includes/export_lib.php @@ -32,7 +32,7 @@ class ExportLib extends \Bitweaver\BitBase { $content = $this->export_wiki_page($page_id, 0); $tar->addData($page_id, $content, $gBitSystem->getUTCTime()); } - $tar->toTar( $pExportFile, false); + $tar->toTar( $pExportFile, false); return ''; } @@ -69,7 +69,7 @@ class ExportLib extends \Bitweaver\BitBase { "INNER JOIN `".BIT_DB_PREFIX."liberty_content_history` th ON (th.`page_id` = th.`page_id`) " . "INNER JOIN `".BIT_DB_PREFIX."users_users` uu ON (uu.`user_id` = th.`user_id`) " . "WHERE wp.`page_id`=? order by th.".$this->mDb->convertSortmode("version_desc"); - $result = $this->mDb->query($query,array($page_id)); + $result = $this->mDb->query($query,[$page_id]); $ret = []; while ($res = $result->fetchRow()) { array_push( $ret, $res ); diff --git a/includes/lookup_page_inc.php b/includes/lookup_page_inc.php index 4d838b1..b28a1d7 100755 --- a/includes/lookup_page_inc.php +++ b/includes/lookup_page_inc.php @@ -14,6 +14,7 @@ * required setup */ namespace Bitweaver\Wiki; + use Bitweaver\Liberty\LibertyStructure; global $gContent; include_once LIBERTY_PKG_INCLUDE_PATH.'lookup_content_inc.php'; @@ -24,7 +25,7 @@ if( empty( $lookupHash )) { } // if we already have a gContent, we assume someone else created it for us, and has properly loaded everything up. -if( empty( $gContent ) || !is_object( $gContent ) || strtolower( get_class( $gContent ) ) != 'bitpage' ) { +if( empty( $gContent ) || !is_object( $gContent ) || strtolower( $gContent::class ) != 'bitpage' ) { if( !empty( $lookupHash['page_id'] ) ) { $loadContentId = BitPage::findContentIdByPageId( $lookupHash['page_id'] ); } elseif( !empty( $lookupHash['content_id'] ) ) { @@ -48,10 +49,10 @@ if( empty( $gContent ) || !is_object( $gContent ) || strtolower( get_class( $gCo $gBitSmarty->assign('dupePages', $existsInfo); $gBitSystem->display('bitpackage:wiki/page_select.tpl', null, [ 'display_mode' => 'display' ]); die; - } else { + } $loadPageId = $existsInfo[0]['page_id']; $loadContentId = $existsInfo[0]['content_id']; - } + } } elseif( $loadPage ) { $gBitSmarty->assign('page', $loadPage);//to have the create page link in the error diff --git a/includes/plugins_lib.php b/includes/plugins_lib.php index 12fde9f..533c743 100755 --- a/includes/plugins_lib.php +++ b/includes/plugins_lib.php @@ -1,211 +1,212 @@ <?php - /** - * Plugin Lib - * - * A port of PhpWiki WikiPlugin class - * Principal use is port PhpWiki plugins, but can be used to make new ones. - * Use: - * - Extends PluginsLib with your class - * - add the lines - * <code> - * include "pluginslib.php"; - * - * function wikiplugin_backlinks($data, $params) { - * $plugin = new BackLinks(); - * return $plugin->run($data, $params); - * } - * function wikiplugin_backlinks_help() { - * $plugin = new BackLinks(); - * return $plugin->getDescription(); - * } * </code> - * @package wiki + /** + * Plugin Lib + * + * A port of PhpWiki WikiPlugin class + * Principal use is port PhpWiki plugins, but can be used to make new ones. + * Use: + * - Extends PluginsLib with your class + * - add the lines + * <code> + * include "pluginslib.php"; + * + * function wikiplugin_backlinks($data, $params) { + * $plugin = new BackLinks(); + * return $plugin->run($data, $params); + * } + * function wikiplugin_backlinks_help() { + * $plugin = new BackLinks(); + * return $plugin->getDescription(); + * } * </code> + * @package wiki */ /** - * @package wiki - * @subpackage PluginsLib - * @author Claudio Bustos - * @version $Revision$ - */ + * @package wiki + * @subpackage PluginsLib + * @author Claudio Bustos + * @version $Revision$ + */ - namespace Bitweaver\Wiki; - use Bitweaver\KernelTools; - - class PluginsLib extends \Bitweaver\BitBase { - public $_errors; - public $_data; - public $_params; - /** - * Array of params to be expanded as arrays. Explode the string with {@link $separator} - * @var array - */ - public $expanded_params = []; - /** - * Separator used to explote params listed on {@link $expanded_params} - * @var string - */ - public $separator = "|"; - /** - * List of fields retrieved from {@link BitBase::list_pages()} - * Keys are the name of the fields and values the names for tra(); - * @var array - */ - public $aInfoPresetNames = array( - "hits" => "Hits", "last_modified" => "Last mod", "user" => "Last author", "len" => "Size", "comment" => "Com", "creator" => "Creator", "version" => "Last ver", "flag" => "Status", "versions" => "Vers", "links" => "Links", "backlinks" => "Backlinks"); + namespace Bitweaver\Wiki; - /** - * Process the params, in this order: - * - default values, asigned on {@link PluginsLib::getDefaultArguments()} - * - request values, sended by GET or POST method, if $request is put to true - * - explicit values, asigned on the Wiki - * @param array sended to wikiplugin_name($data, $params) - * @param bool if set to true, accept values from $_REQUEST - * @param bool if set to true, assign default values from {@link PluginsLib::getDefaultArguments()} - * @return array list of params - */ - function getParams($params, $request = false, $defaults = false) { - if ($defaults === false) { - $defaults = $this->getDefaultArguments(); - } - $args = []; - foreach ($defaults as $arg => $default_val) { - if (isset($params[$arg])) { - $args[$arg] = $params[$arg]; - } elseif(isset($_REQUEST[$arg])) { - $args[$arg] = $_REQUEST[$arg]; - } else { - // maybe this kind of transformation can be grouped on a external function - if ($default_val==="[pagename]") { - $default_val=$_REQUEST["page"]; - } - $args[$arg] = $default_val; - } - if (in_array($arg, $this->expanded_params)) { - if ($args[$arg]) { - $args[$arg] = explode($this->separator, $args[$arg]); - foreach($args[$arg] as $id=>$value) { - $args[$arg][$id]=trim($value); - } - } else { - $args[$arg]=[]; - } - } - } - return $args; - } - /** - * Returns the name of the Plugin - * By default, erase the first 'WikiPlugin' - * Made for overload it. - * @return string - */ - function getName() { - return preg_replace('/^WikiPlugin/', '', get_class($this)); - } - /** - * Returns a description of the Plugin - * Made for overload it. - * @return string - */ - function getDescription() { - return $this->getName(); - } - /** - * Returns the version of the version - * Made for overload it. - * @return string - */ - function getVersion() { - return KernelTools::tra("No version indicated"); - //return preg_replace("/[Revision: $]/", '', - // "\$Revision$"); - } - /** - * Returns the default arguments for the plugin - * Use keys as the arguments and values as ... the default values - * @return array - */ - function getDefaultArguments() { - return array('description' => $this->getDescription()); - } - /** - * Run the plugin - * For sake of God, overload it! - * @param string - * @param array - */ - function run ($data, $params) { - /** - * UGLY ERROR!. - */ - return $this->error("PluginsLib::run: pure virtual function. Don't be so lazy!"); - } - function error ($message) { - return "~np~<span class='warn'>Plugin ".$this->getName()." ".KernelTools::tra("failed")." : ".tra($message)."</span>~/np~"; - } - function getErrorDetail() { - return $this->_errors; - } - function _error($message) { - $this->_errors = $message; - return false; - } - } - /** - * Class with utilities for Plugins +use Bitweaver\KernelTools; + + class PluginsLib extends \Bitweaver\BitBase { + public $_errors; + public $_data; + public $_params; + /** + * Array of params to be expanded as arrays. Explode the string with {@link $separator} + * @var array + */ + public $expanded_params = []; + /** + * Separator used to explote params listed on {@link $expanded_params} + * @var string + */ + public $separator = "|"; + /** + * List of fields retrieved from {@link BitBase::list_pages()} + * Keys are the name of the fields and values the names for tra(); + * @var array + */ + public $aInfoPresetNames = [ + "hits" => "Hits", "last_modified" => "Last mod", "user" => "Last author", "len" => "Size", "comment" => "Com", "creator" => "Creator", "version" => "Last ver", "flag" => "Status", "versions" => "Vers", "links" => "Links", "backlinks" => "Backlinks", ]; + + /** + * Process the params, in this order: + * - default values, asigned on {@link PluginsLib::getDefaultArguments()} + * - request values, sended by GET or POST method, if $request is put to true + * - explicit values, asigned on the Wiki + * @param array sended to wikiplugin_name($data, $params) + * @param bool if set to true, accept values from $_REQUEST + * @param bool if set to true, assign default values from {@link PluginsLib::getDefaultArguments()} + * @return array list of params + */ + function getParams($params, $request = false, $defaults = false) { + if ($defaults === false) { + $defaults = $this->getDefaultArguments(); + } + $args = []; + foreach ($defaults as $arg => $default_val) { + if (isset($params[$arg])) { + $args[$arg] = $params[$arg]; + } elseif(isset($_REQUEST[$arg])) { + $args[$arg] = $_REQUEST[$arg]; + } else { + // maybe this kind of transformation can be grouped on a external function + if ($default_val==="[pagename]") { + $default_val=$_REQUEST["page"]; + } + $args[$arg] = $default_val; + } + if (in_array($arg, $this->expanded_params)) { + if ($args[$arg]) { + $args[$arg] = explode($this->separator, $args[$arg]); + foreach($args[$arg] as $id=>$value) { + $args[$arg][$id]=trim($value); + } + } else { + $args[$arg]=[]; + } + } + } + return $args; + } + /** + * Returns the name of the Plugin + * By default, erase the first 'WikiPlugin' + * Made for overload it. + * @return string + */ + function getName() { + return preg_replace('/^WikiPlugin/', '', get_class($this)); + } + /** + * Returns a description of the Plugin + * Made for overload it. + * @return string + */ + function getDescription() { + return $this->getName(); + } + /** + * Returns the version of the version + * Made for overload it. + * @return string + */ + function getVersion() { + return KernelTools::tra("No version indicated"); + //return preg_replace("/[Revision: $]/", '', + // "\$Revision$"); + } + /** + * Returns the default arguments for the plugin + * Use keys as the arguments and values as ... the default values + * @return array + */ + function getDefaultArguments() { + return ['description' => $this->getDescription()]; + } + /** + * Run the plugin + * For sake of God, overload it! + * @param string + * @param array + */ + function run ($data, $params) { + /** + * UGLY ERROR!. + */ + return $this->error("PluginsLib::run: pure virtual function. Don't be so lazy!"); + } + function error ($message) { + return "~np~<span class='warn'>Plugin ".$this->getName()." ".KernelTools::tra("failed")." : ".tra($message)."</span>~/np~"; + } + function getErrorDetail() { + return $this->_errors; + } + function _error($message) { + $this->_errors = $message; + return false; + } + } + /** + * Class with utilities for Plugins * - * @package wiki - * @subpackage PluginsLib - * @author Claudio Bustos - * @version $Revision$ - */ - class PluginsLibUtil { - /** - * Create a table with information from pages - * @param array key ["data"] from one of the functions that retrieve informaci�n about pages - * @param array list of keys to show. - * @param array definition of the principal field. By default: - * array("field"=>"title","name"=>"Page") - * @return string - */ - public function createTable($aData,$aInfo=false,$aPrincipalField=false) { - // contract - if (!$aPrincipalField or !is_array($aPrincipalField)) { - $aPrincipalField=array("field"=>"title","name"=>"Page"); - } - if (!is_array($aInfo)) { - $aInfo=false; - } - // ~contract - $sOutput=""; - if ($aInfo) { - $iNumCol=count($aInfo)+1; - $sStyle=" style='width:".(floor(100/$iNumCol))."%' "; - // Header for info - $sOutput .= "<table class='normal'><tr><td class='heading' $sStyle>".KernelTools::tra($aPrincipalField["name"])."</td>"; - foreach($aInfo as $iInfo => $sHeader) { - $sOutput .= "<td class='heading' $sStyle >".KernelTools::tra($sHeader)."</td>"; - } - $sOutput .= "</tr>"; - } - $iCounter=1; - foreach($aData as $aPage) { - $sClass=($iCounter%2)?"odd":"even"; - if (!$aInfo) { - $sOutput .= "*((".$aPage[$aPrincipalField["field"]]."))\n"; - } else { - $sOutput .= "<tr><td class='$sClass'>((".$aPage[$aPrincipalField["field"]]."))</td>"; - foreach($aInfo as $sInfo) { - if (isset($aPage[$sInfo])) { - $sOutput .= "<td class='$sClass'>".$aPage[$sInfo]."</td>"; - } - } - } - $iCounter++; - } - if ($aInfo) { - $sOutput .= "</table>"; - } - return $sOutput; - } - }
\ No newline at end of file + * @package wiki + * @subpackage PluginsLib + * @author Claudio Bustos + * @version $Revision$ + */ + class PluginsLibUtil { + /** + * Create a table with information from pages + * @param array key ["data"] from one of the functions that retrieve informaci�n about pages + * @param array list of keys to show. + * @param array definition of the principal field. By default: + * array("field"=>"title","name"=>"Page") + * @return string + */ + public function createTable($aData,$aInfo=false,$aPrincipalField=false) { + // contract + if (!$aPrincipalField or !is_array($aPrincipalField)) { + $aPrincipalField=["field"=>"title","name"=>"Page"]; + } + if (!is_array($aInfo)) { + $aInfo=false; + } + // ~contract + $sOutput=""; + if ($aInfo) { + $iNumCol=count($aInfo)+1; + $sStyle=" style='width:".(floor(100/$iNumCol))."%' "; + // Header for info + $sOutput .= "<table class='normal'><tr><td class='heading' $sStyle>".KernelTools::tra($aPrincipalField["name"])."</td>"; + foreach($aInfo as $iInfo => $sHeader) { + $sOutput .= "<td class='heading' $sStyle >".KernelTools::tra($sHeader)."</td>"; + } + $sOutput .= "</tr>"; + } + $iCounter=1; + foreach($aData as $aPage) { + $sClass=($iCounter%2)?"odd":"even"; + if (!$aInfo) { + $sOutput .= "*((".$aPage[$aPrincipalField["field"]]."))\n"; + } else { + $sOutput .= "<tr><td class='$sClass'>((".$aPage[$aPrincipalField["field"]]."))</td>"; + foreach($aInfo as $sInfo) { + if (isset($aPage[$sInfo])) { + $sOutput .= "<td class='$sClass'>".$aPage[$sInfo]."</td>"; + } + } + } + $iCounter++; + } + if ($aInfo) { + $sOutput .= "</table>"; + } + return $sOutput; + } + }
\ No newline at end of file @@ -14,6 +14,7 @@ * required setup */ namespace Bitweaver\Wiki; + require_once '../kernel/includes/setup_inc.php'; $gBitSystem->verifyPackage( 'wiki' ); @@ -21,7 +22,7 @@ $gBitSystem->verifyPackage( 'wiki' ); if( !empty( $_REQUEST['structure_id'] ) ) { include LIBERTY_PKG_INCLUDE_PATH.'structure_display_inc.php'; } else { - // if no page set + // if no page set if ( !isset( $_REQUEST['page'] ) and !isset( $_REQUEST['page_id'] ) ) { // if auto create home page disabled just get a list if( $gBitSystem->isFeatureActive( 'wiki_disable_auto_home' ) ){ @@ -39,10 +40,10 @@ if( !empty( $_REQUEST['structure_id'] ) ) { 'title' => $wikiHome ?? 'HomePage', 'creator_user_id' => ROOT_USER_ID, 'modifier_user_id' => ROOT_USER_ID, - 'edit' => 'Welcome to '.( $gBitSystem->getConfig( 'site_title', 'our site' ) ) ]; + 'edit' => 'Welcome to '.( $gBitSystem->getConfig( 'site_title', 'our site' ) ), ]; $gHome->store( $homeHash ); } - + include WIKI_PKG_INCLUDE_PATH.'lookup_page_inc.php'; if( $gContent->isValid() ) { $gBitSystem->setCanonicalLink( $gContent->getDisplayUrl() ); diff --git a/liberty_plugins/data.wikigraph.php b/liberty_plugins/data.wikigraph.php index 2aae36d..0a08945 100755 --- a/liberty_plugins/data.wikigraph.php +++ b/liberty_plugins/data.wikigraph.php @@ -26,7 +26,7 @@ $pluginParams = [ 'description' => KernelTools::tra( "Inserts a graph for visual navigation. The graph shows the page and every page that can be reached from that page. It requies the Image_GraphViz pear plugin and graphviz to be installed: <strong>pear install Image_GraphViz</strong>" ), 'help_function' => 'data_wikigraph_help', 'syntax' => "{wikigraph level= title= }".KernelTools::tra( "Wiki page name" )."{/wikigraph}", - 'plugin_type' => DATA_PLUGIN + 'plugin_type' => DATA_PLUGIN, ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAWIKIGRAPH, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAWIKIGRAPH ); @@ -93,14 +93,14 @@ function data_wikigraph( $pData, $pParams ) { } if( !empty( $pData ) ) { - $params = array( + $params = [ 'graph' => $gBitThemes->getGraphvizGraphAttributes( $pParams ), 'node' => $gBitThemes->getGraphvizNodeAttributes( $pParams ), 'edge' => $gBitThemes->getGraphvizEdgeAttributes( $pParams ), - ); + ]; $mapname = md5( microtime() ); - $mapdata = $gContent->linkStructureMap( $pData, isset( $pParams['level'] ) ? $pParams['level'] : 0, $params ); + $mapdata = $gContent->linkStructureMap( $pData, $pParams['level'] ?? 0, $params ); $ret = " <div style='text-align:center'> diff --git a/like_pages.php b/like_pages.php index daf0af3..8ed4f6e 100755 --- a/like_pages.php +++ b/like_pages.php @@ -14,6 +14,7 @@ * required setup */ namespace Bitweaver\Wiki; + use Bitweaver\KernelTools; require_once '../kernel/includes/setup_inc.php'; @@ -33,4 +34,4 @@ $likepages = $gContent->getLikePages( $gContent->mInfo['title'] ); $gBitSmarty->assign( 'likepages', $likepages ); // Display the template -$gBitSystem->display( 'bitpackage:wiki/like_pages.tpl', null, array( 'display_mode' => 'display' ));
\ No newline at end of file +$gBitSystem->display( 'bitpackage:wiki/like_pages.tpl', null, [ 'display_mode' => 'display' ]);
\ No newline at end of file diff --git a/list_pages.php b/list_pages.php index 2154193..65e6e9b 100755 --- a/list_pages.php +++ b/list_pages.php @@ -40,11 +40,11 @@ if( isset( $_REQUEST["batch_submit"] ) && isset( $_REQUEST["checked"] ) && $_REQ $info = $tmpPage->load() && !empty( $tmpPage->mInfo['title'] ) ? $tmpPage->mInfo['title'] : $del; $formHash['input'][] = '<input type="hidden" name="checked[]" value="'.$del.'"/>'.$info; } - $gBitSystem->confirmDialog( $formHash, - [ - 'warning' => KernelTools::tra('Are you sure you want to delete these pages?') . ' (' . KernelTools::tra('Count: ') . count( $_REQUEST["checked"] ) . ')', + $gBitSystem->confirmDialog( $formHash, + [ + 'warning' => KernelTools::tra('Are you sure you want to delete these pages?') . ' (' . KernelTools::tra('Count: ') . count( $_REQUEST["checked"] ) . ')', 'error' => KernelTools::tra('This cannot be undone!'), - ] + ], ); } else { foreach( $_REQUEST["checked"] as $deletepage ) { diff --git a/modules/help_mod_comm_received_objects.tpl b/modules/help_mod_comm_received_objects.tpl index 9e6db5d..9e6db5d 100644..100755 --- a/modules/help_mod_comm_received_objects.tpl +++ b/modules/help_mod_comm_received_objects.tpl diff --git a/modules/help_mod_last_modif_pages.tpl b/modules/help_mod_last_modif_pages.tpl index 42cec0a..42cec0a 100644..100755 --- a/modules/help_mod_last_modif_pages.tpl +++ b/modules/help_mod_last_modif_pages.tpl diff --git a/modules/help_mod_random_pages.tpl b/modules/help_mod_random_pages.tpl index 9e6db5d..9e6db5d 100644..100755 --- a/modules/help_mod_random_pages.tpl +++ b/modules/help_mod_random_pages.tpl diff --git a/modules/help_mod_top_pages.tpl b/modules/help_mod_top_pages.tpl index 5482e10..5482e10 100644..100755 --- a/modules/help_mod_top_pages.tpl +++ b/modules/help_mod_top_pages.tpl diff --git a/modules/help_mod_wiki_last_comments.tpl b/modules/help_mod_wiki_last_comments.tpl index d0e6c01..d0e6c01 100644..100755 --- a/modules/help_mod_wiki_last_comments.tpl +++ b/modules/help_mod_wiki_last_comments.tpl diff --git a/modules/mod_comm_received_objects.tpl b/modules/mod_comm_received_objects.tpl index 5294c4a..5294c4a 100644..100755 --- a/modules/mod_comm_received_objects.tpl +++ b/modules/mod_comm_received_objects.tpl diff --git a/modules/mod_quick_edit.tpl b/modules/mod_quick_edit.tpl index f11f8fb..f11f8fb 100644..100755 --- a/modules/mod_quick_edit.tpl +++ b/modules/mod_quick_edit.tpl diff --git a/modules/mod_random_pages.php b/modules/mod_random_pages.php index 60d2daf..037aee1 100755 --- a/modules/mod_random_pages.php +++ b/modules/mod_random_pages.php @@ -11,7 +11,7 @@ use Bitweaver\Wiki\BitPage; * @package wiki * @subpackage modules */ - + /** * Required files */ diff --git a/modules/mod_recent_page_changes.php b/modules/mod_recent_page_changes.php index b142719..35e9253 100755 --- a/modules/mod_recent_page_changes.php +++ b/modules/mod_recent_page_changes.php @@ -16,7 +16,7 @@ global $gQueryUserId, $moduleParams; /** * required setup */ - + if( $gBitUser->hasPermission( 'p_wiki_view_page' ) ) { $wp = new BitPage(); diff --git a/modules/mod_search_wiki_page.tpl b/modules/mod_search_wiki_page.tpl index 1621b3c..1621b3c 100644..100755 --- a/modules/mod_search_wiki_page.tpl +++ b/modules/mod_search_wiki_page.tpl diff --git a/modules/mod_top_pages.php b/modules/mod_top_pages.php index c913072..ccff418 100755 --- a/modules/mod_top_pages.php +++ b/modules/mod_top_pages.php @@ -21,11 +21,11 @@ extract( $moduleParams ); if( $gBitUser->hasPermission( 'p_wiki_view_page' ) ) { $modWiki = new BitPage(); - $listHash = array( + $listHash = [ 'max_records' => $module_rows, 'sort_mode' => 'hits_desc', 'user_id' => !empty( $module_params['user_pages'] ) ? $gQueryUser->mUserId : null, - ); + ]; $modRank = $modWiki->getList( $listHash ); $gBitSmarty->assign( 'modTopPages', $modRank ); } diff --git a/modules/mod_wiki_last_comments.php b/modules/mod_wiki_last_comments.php index 0be35fc..aaa972b 100755 --- a/modules/mod_wiki_last_comments.php +++ b/modules/mod_wiki_last_comments.php @@ -24,5 +24,5 @@ if( $gBitUser->hasPermission( 'p_wiki_view_page' ) ) { $listHash = [ 'max_records' => $moduleParams['module_rows'], 'user_id' => $gQueryUserId, 'content_type_guid' => BITPAGE_CONTENT_TYPE_GUID ]; $lastComments = $cmt->getList( $listHash ); $gBitSmarty->assign( 'lastComments', $lastComments); - $gBitSmarty->assign( 'moretooltips', isset($module_params["moretooltips"]) ? $module_params["moretooltips"] : 'n'); + $gBitSmarty->assign( 'moretooltips', $module_params["moretooltips"] ?? 'n'); }
\ No newline at end of file diff --git a/modules/mod_wiki_last_comments.tpl b/modules/mod_wiki_last_comments.tpl index d71c2f7..d71c2f7 100644..100755 --- a/modules/mod_wiki_last_comments.tpl +++ b/modules/mod_wiki_last_comments.tpl diff --git a/orphan_pages.php b/orphan_pages.php index cee77fe..87b3524 100755 --- a/orphan_pages.php +++ b/orphan_pages.php @@ -41,11 +41,11 @@ if( isset( $_REQUEST["batch_submit"] ) && isset( $_REQUEST["checked"] ) && $_REQ $formHash['input'][] = '<input type="hidden" name="checked[]" value="'.$del.'"/>'.$info; } - $gBitSystem->confirmDialog( $formHash, - array( - 'warning' => KernelTools::tra('Are you sure you want to delete these pages?') . ' (' . KernelTools::tra('Count: ') . count( $_REQUEST["checked"] ) . ')', + $gBitSystem->confirmDialog( $formHash, + [ + 'warning' => KernelTools::tra('Are you sure you want to delete these pages?') . ' (' . KernelTools::tra('Count: ') . count( $_REQUEST["checked"] ) . ')', 'error' => KernelTools::tra('This cannot be undone!'), - ) + ], ); } else { foreach( $_REQUEST["checked"] as $deletepage ) { @@ -80,4 +80,4 @@ $gBitSmarty->assign( 'listpages', $listpages ); $gBitSmarty->assign( 'listInfo', $listHash['listInfo'] ); // Display the template -$gBitSystem->display( 'bitpackage:wiki/orphan_pages.tpl', KernelTools::tra( 'Orphan Pages' ), array( 'display_mode' => 'list' )); +$gBitSystem->display( 'bitpackage:wiki/orphan_pages.tpl', KernelTools::tra( 'Orphan Pages' ), [ 'display_mode' => 'list' ]); diff --git a/page_history.php b/page_history.php index 1fc012a..7edef23 100755 --- a/page_history.php +++ b/page_history.php @@ -14,7 +14,6 @@ * required setup */ require_once '../kernel/includes/setup_inc.php'; -use Bitweaver\Wiki\BitPage; use Bitweaver\KernelTools; $gBitSystem->verifyPackage( 'wiki' ); diff --git a/page_watches.php b/page_watches.php index db00931..3a1c1dc 100755 --- a/page_watches.php +++ b/page_watches.php @@ -29,8 +29,6 @@ $gComment = new LibertyComment(); $numComments = $gComment->getNumComments($gContent->mContentId); $gBitSmarty->assign('comments_count', $numComments); - - //vd($gContent->mPageId);vd($gContent->mInfo); if( !$gContent->isValid() || empty( $gContent->mInfo ) ) { $gBitSystem->fatalError( KernelTools::tra( "Unknown page" )); @@ -39,11 +37,11 @@ if( !$gContent->isValid() || empty( $gContent->mInfo ) ) { $watches = null; if( !empty( $gContent->mPageId ) ) { - $event = 'wiki_page_changed'; - $watches = $gBitUser->get_event_watches($event, $gContent->mPageId); - $gBitSmarty->assign('watches', $watches); - $gBitSmarty->assign( 'pageInfo', $gContent->mInfo ); - } + $event = 'wiki_page_changed'; + $watches = $gBitUser->get_event_watches($event, $gContent->mPageId); + $gBitSmarty->assign('watches', $watches); + $gBitSmarty->assign( 'pageInfo', $gContent->mInfo ); + } // Display the template $gBitSystem->display( 'bitpackage:wiki/page_watches.tpl', null, [ 'display_mode' => 'display' ] ); diff --git a/print_pages.php b/print_pages.php index cdad9f4..128e74a 100755 --- a/print_pages.php +++ b/print_pages.php @@ -14,7 +14,6 @@ * required setup */ require_once '../kernel/includes/setup_inc.php'; -use Bitweaver\Wiki\BitPage; use Bitweaver\KernelTools; if( !$gBitSystem->isFeatureActive( 'wiki_multiprint' ) ) { @@ -48,4 +47,4 @@ $pages = $gContent->getList( $listHash ); $gBitSmarty->assign('pages', $pages); // Display the template -$gBitSystem->display( 'bitpackage:wiki/print_pages.tpl', null, array( 'display_mode' => 'display' )); +$gBitSystem->display( 'bitpackage:wiki/print_pages.tpl', null, [ 'display_mode' => 'display' ]); diff --git a/rankings.php b/rankings.php index da651bb..5803026 100755 --- a/rankings.php +++ b/rankings.php @@ -24,15 +24,15 @@ $gBitSystem->verifyPermission( 'p_wiki_list_pages' ); $rankingOptions = [ [ 'output' => KernelTools::tra( 'Most Often Viewed' ), - 'value' => 'hits_desc' + 'value' => 'hits_desc', ], [ 'output' => KernelTools::tra( 'Most Recently Modified' ), - 'value' => 'last_modified_desc' + 'value' => 'last_modified_desc', ], [ 'output' => KernelTools::tra( 'Most Active Authors' ), - 'value' => 'top_authors' + 'value' => 'top_authors', ], ]; $gBitSmarty->assign( 'rankingOptions', $rankingOptions ); @@ -67,4 +67,4 @@ if( empty( $gContent ) ) { $rankList = $gContent->getContentRanking( $_REQUEST ); $gBitSmarty->assign( 'rankList', $rankList ); -$gBitSystem->display( 'bitpackage:liberty/rankings.tpl', KernelTools::tra( "Wiki Rankings" ) , array( 'display_mode' => 'display' )); +$gBitSystem->display( 'bitpackage:liberty/rankings.tpl', KernelTools::tra( "Wiki Rankings" ) , [ 'display_mode' => 'display' ]); diff --git a/remove_page.php b/remove_page.php index 58fbfd5..e3d20c7 100755 --- a/remove_page.php +++ b/remove_page.php @@ -30,9 +30,9 @@ if( isset( $_REQUEST["confirm"] ) ) { if( $gContent->expunge() ) { header( "location: ".WIKI_PKG_URL ); die; - } else { - $gBitSystem->fatalError( KernelTools::tra("There was an error deleting the page:") . ' ' . \Bitweaver\vc( $gContent->mErrors )); } + $gBitSystem->fatalError( KernelTools::tra("There was an error deleting the page:") . ' ' . \Bitweaver\vc( $gContent->mErrors )); + } $gBitSystem->setBrowserTitle( KernelTools::tra( 'Confirm delete of: ' ).$gContent->getTitle() ); diff --git a/sitemap.php b/sitemap.php index ecc94ac..3a1f189 100755 --- a/sitemap.php +++ b/sitemap.php @@ -49,7 +49,7 @@ function process_book_list( $pList, $pDepth = 1 ) { } else { $freq = 'monthly'; } - + $hash['changefreq'] = $freq; $hash['priority'] = 1 - round( $pDepth * .5 ) * .1; $gSiteMapHash[$pList[$key]['content_id']] = $hash; diff --git a/templates/admin_external_wikis.tpl b/templates/admin_external_wikis.tpl index e81b152..e81b152 100644..100755 --- a/templates/admin_external_wikis.tpl +++ b/templates/admin_external_wikis.tpl diff --git a/templates/center_wiki_page.php b/templates/center_wiki_page.php index 2c700e6..95cb42e 100755 --- a/templates/center_wiki_page.php +++ b/templates/center_wiki_page.php @@ -1,6 +1,5 @@ <?php -use Bitweaver\Wiki\BitPage; global $moduleParams, $gBitSmarty; // Load up the correct wiki page diff --git a/templates/create_book.tpl b/templates/create_book.tpl index 365a058..365a058 100644..100755 --- a/templates/create_book.tpl +++ b/templates/create_book.tpl diff --git a/templates/import_phpwiki.tpl b/templates/import_phpwiki.tpl index 6a48caf..6a48caf 100644..100755 --- a/templates/import_phpwiki.tpl +++ b/templates/import_phpwiki.tpl diff --git a/templates/index.php b/templates/index.php index ec0e04e..851137d 100644 --- a/templates/index.php +++ b/templates/index.php @@ -1,4 +1,4 @@ -<?php +<?php // This is not a package. header ("location: ../index.php"); diff --git a/templates/menu_wiki_admin.tpl b/templates/menu_wiki_admin.tpl index d39a8dc..d39a8dc 100644..100755 --- a/templates/menu_wiki_admin.tpl +++ b/templates/menu_wiki_admin.tpl diff --git a/templates/orphan_pages.tpl b/templates/orphan_pages.tpl index 7f8e9d5..7f8e9d5 100644..100755 --- a/templates/orphan_pages.tpl +++ b/templates/orphan_pages.tpl diff --git a/templates/page_permissions.tpl b/templates/page_permissions.tpl index 337e8d0..337e8d0 100644..100755 --- a/templates/page_permissions.tpl +++ b/templates/page_permissions.tpl diff --git a/templates/page_select.tpl b/templates/page_select.tpl index b890a41..b890a41 100644..100755 --- a/templates/page_select.tpl +++ b/templates/page_select.tpl diff --git a/templates/page_watches.tpl b/templates/page_watches.tpl index 0b92cc6..0b92cc6 100644..100755 --- a/templates/page_watches.tpl +++ b/templates/page_watches.tpl diff --git a/templates/print_multi_pages.tpl b/templates/print_multi_pages.tpl index 8823403..8823403 100644..100755 --- a/templates/print_multi_pages.tpl +++ b/templates/print_multi_pages.tpl diff --git a/templates/print_pages.tpl b/templates/print_pages.tpl index 01cfb70..01cfb70 100644..100755 --- a/templates/print_pages.tpl +++ b/templates/print_pages.tpl diff --git a/templates/remove_page.tpl b/templates/remove_page.tpl index e465ea9..e465ea9 100644..100755 --- a/templates/remove_page.tpl +++ b/templates/remove_page.tpl diff --git a/templates/rename_page.tpl b/templates/rename_page.tpl index 2a42102..2a42102 100644..100755 --- a/templates/rename_page.tpl +++ b/templates/rename_page.tpl diff --git a/templates/simple_plugin.tpl b/templates/simple_plugin.tpl index 8f30efe..8f30efe 100644..100755 --- a/templates/simple_plugin.tpl +++ b/templates/simple_plugin.tpl diff --git a/templates/slideshow.tpl b/templates/slideshow.tpl index 6f5619d..6f5619d 100644..100755 --- a/templates/slideshow.tpl +++ b/templates/slideshow.tpl diff --git a/templates/user_watch_wiki_page_changed.tpl b/templates/user_watch_wiki_page_changed.tpl index 59db5f1..59db5f1 100644..100755 --- a/templates/user_watch_wiki_page_changed.tpl +++ b/templates/user_watch_wiki_page_changed.tpl diff --git a/templates/user_watch_wiki_page_comment.tpl b/templates/user_watch_wiki_page_comment.tpl index d575a5f..d575a5f 100644..100755 --- a/templates/user_watch_wiki_page_comment.tpl +++ b/templates/user_watch_wiki_page_comment.tpl diff --git a/templates/wiki_change_notification.tpl b/templates/wiki_change_notification.tpl index 64fb040..64fb040 100644..100755 --- a/templates/wiki_change_notification.tpl +++ b/templates/wiki_change_notification.tpl diff --git a/wiki_graph.php b/wiki_graph.php index 1966031..022ca16 100755 --- a/wiki_graph.php +++ b/wiki_graph.php @@ -14,7 +14,6 @@ * required setup */ include_once '../kernel/includes/setup_inc.php'; -use Bitweaver\Wiki\BitPage; include_once WIKI_PKG_INCLUDE_PATH.'lookup_page_inc.php'; include_once UTIL_PKG_INCLUDE_PATH.'pear/Image/GraphViz.php'; $graph = new Image_GraphViz(); diff --git a/wiki_rss.php b/wiki_rss.php index 89d1695..bedad4a 100755 --- a/wiki_rss.php +++ b/wiki_rss.php @@ -48,7 +48,7 @@ if( !$gBitUser->hasPermission( 'p_wiki_view_page' ) ) { $item->date = ( int )$feed['last_modified']; $item->source = 'http://'.$_SERVER['HTTP_HOST'].BIT_ROOT_URL; - $item->author = $gBitUser->getDisplayName( false, array( 'real_name' => $feed['modifier_real_name'], 'login' => $feed['modifier_user'] ) ); + $item->author = $gBitUser->getDisplayName( false, [ 'real_name' => $feed['modifier_real_name'], 'login' => $feed['modifier_user'] ] ); $item->descriptionTruncSize = $gBitSystem->getConfig( 'rssfeed_truncate', 5000 ); $item->descriptionHtmlSyndicated = false; |
