diff options
| author | lsces <lester@lsces.co.uk> | 2025-08-29 13:03:22 +0100 |
|---|---|---|
| committer | lsces <lester@lsces.co.uk> | 2025-08-29 13:03:22 +0100 |
| commit | 7fefadbccfeb0e9effe1342adb7a5d52755d401c (patch) | |
| tree | 0dc004ed1fe5864c16bcc89792afe0e517784c15 | |
| parent | b7529990329f68fcc817469536d8783899b34cda (diff) | |
| download | wiki-7fefadbccfeb0e9effe1342adb7a5d52755d401c.tar.gz wiki-7fefadbccfeb0e9effe1342adb7a5d52755d401c.tar.bz2 wiki-7fefadbccfeb0e9effe1342adb7a5d52755d401c.zip | |
Admin tools updated to PHP8.4 and namespace
| -rwxr-xr-x[-rw-r--r--] | admin/admin_external_wikis.php | 58 | ||||
| -rwxr-xr-x[-rw-r--r--] | admin/admin_wiki_inc.php | 201 | ||||
| -rwxr-xr-x[-rw-r--r--] | admin/index.php | 3 | ||||
| -rwxr-xr-x[-rw-r--r--] | admin/pump_wiki_inc.php | 37 | ||||
| -rwxr-xr-x[-rw-r--r--] | admin/schema_inc.php | 192 |
5 files changed, 242 insertions, 249 deletions
diff --git a/admin/admin_external_wikis.php b/admin/admin_external_wikis.php index 636fd87..f4ad2a3 100644..100755 --- a/admin/admin_external_wikis.php +++ b/admin/admin_external_wikis.php @@ -3,11 +3,17 @@ // All Rights Reserved. See below for details and a complete list of authors. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details. // Initialization -require_once( '../../kernel/includes/setup_inc.php' ); -include_once( KERNEL_PKG_INCLUDE_PATH.'admin_lib.php' ); + +/** + * required setup + */ +require_once '../../kernel/includes/setup_inc.php'; +use Bitweaver\KernelTools; +include_once KERNEL_PKG_INCLUDE_PATH.'admin_lib.php'; + if (!$gBitUser->isAdmin()) { - $gBitSmarty->assign('msg', tra("You dont have permission to use this feature")); - $gBitSystem->display( 'error.tpl' , NULL, array( 'display_mode' => 'admin' )); + $gBitSmarty->assign('msg', KernelTools::tra("You dont have permission to use this feature")); + $gBitSystem->display( 'error.tpl' , null, [ 'display_mode' => 'admin' ] ); die; } if (!isset($_REQUEST["extwiki_id"])) { @@ -17,7 +23,7 @@ $gBitSmarty->assign('extwiki_id', $_REQUEST["extwiki_id"]); if ($_REQUEST["extwiki_id"]) { $info = $adminlib->get_extwiki($_REQUEST["extwiki_id"]); } else { - $info = array(); + $info = []; $info["extwiki"] = ''; $info['name'] = ''; } @@ -29,52 +35,42 @@ if (isset($_REQUEST["remove"])) { if (isset($_REQUEST["save"])) { $adminlib->replace_extwiki($_REQUEST["extwiki_id"], $_REQUEST["extwiki"], $_REQUEST['name']); - $info = array(); + $info = []; $info["extwiki"] = ''; $info['name'] = ''; $gBitSmarty->assign('info', $info); $gBitSmarty->assign('name', ''); } -if (empty( $_REQUEST["sort_mode"] )) { - $sort_mode = 'received_date_desc'; -} else { - $sort_mode = $_REQUEST["sort_mode"]; -} -$gBitSmarty->assignByRef('sort_mode', $sort_mode); -if (!isset($_REQUEST["offset"])) { - $offset = 0; -} else { - $offset = $_REQUEST["offset"]; -} + +$sort_mode = $_REQUEST["sort_mode"] ?? 'received_date_desc'; +$gBitSmarty->assign('sort_mode', $sort_mode); + +$offset = $_REQUEST["offset"] ?? 0; if (isset($_REQUEST['page'])) { $page = &$_REQUEST['page']; $offset = ($page - 1) * $max_records; } -$gBitSmarty->assignByRef('offset', $offset); -if (isset($_REQUEST["find"])) { - $find = $_REQUEST["find"]; -} else { - $find = ''; -} -$gBitSmarty->assignByRef('find', $find); +$gBitSmarty->assign('offset', $offset); + +$find = $_REQUEST["find"] ?? ''; +$gBitSmarty->assign('find', $find); $channels = $adminlib->list_extwiki($offset, $max_records, $sort_mode, $find); $cant_pages = ceil($channels["cant"] / $max_records); -$gBitSmarty->assignByRef('cant_pages', $cant_pages); -$gBitSmarty->assign('actual_page', 1 + ($offset / $max_records)); +$gBitSmarty->assign('cant_pages', $cant_pages); +$gBitSmarty->assign('actual_page', 1 + $offset / $max_records ); if ($channels["cant"] > ($offset + $max_records)) { - $gBitSmarty->assign('next_offset', $offset + $max_records); + $gBitSmarty->assign('next_offset', $offset + $max_records ); } else { $gBitSmarty->assign('next_offset', -1); } // If offset is > 0 then prev_offset if ($offset > 0) { - $gBitSmarty->assign('prev_offset', $offset - $max_records); + $gBitSmarty->assign('prev_offset', $offset - $max_records ); } else { $gBitSmarty->assign('prev_offset', -1); } -$gBitSmarty->assignByRef('channels', $channels["data"]); +$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, array( 'display_mode' => 'admin' )); diff --git a/admin/admin_wiki_inc.php b/admin/admin_wiki_inc.php index 8840ff9..1be19b2 100644..100755 --- a/admin/admin_wiki_inc.php +++ b/admin/admin_wiki_inc.php @@ -3,68 +3,68 @@ // All Rights Reserved. See below for details and a complete list of authors. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details. -$formWikiLists = array( - "wiki_list_page_id" => array( +$formWikiLists = [ + "wiki_list_page_id" => [ 'label' => 'Page ID', 'note' => 'Page ID of the wikipage.', - ), - "wiki_list_content_id" => array( + ], + "wiki_list_content_id" => [ 'label' => 'Content ID', 'note' => 'Content ID of the wikipage.', - ), - "wiki_list_name" => array( + ], + "wiki_list_name" => [ 'label' => 'Name', 'note' => 'Name of the wikipage.', - ), - "wiki_list_hits" => array( + ], + "wiki_list_hits" => [ 'label' => 'Hits', 'note' => 'How often the page has been viewed.', - ), - "wiki_list_lastmodif" => array( + ], + "wiki_list_lastmodif" => [ 'label' => 'Last modification date', 'note' => 'Date of the last modification of a page.', - ), - "wiki_list_creator" => array( + ], + "wiki_list_creator" => [ 'label' => 'Creator', 'note' => 'Name of the creator of a page.', - ), - "wiki_list_user" => array( + ], + "wiki_list_user" => [ 'label' => 'User', 'note' => 'Last user to modify the page.', - ), - "wiki_list_lastver" => array( + ], + "wiki_list_lastver" => [ 'label' => 'Last version number', 'note' => 'Shows the currently active version number.', - ), - "wiki_list_comment" => array( + ], + "wiki_list_comment" => [ 'label' => 'Comment', 'note' => 'Display the comment added on the last commit.', - ), - "wiki_list_status" => array( + ], + "wiki_list_status" => [ 'label' => 'Status', 'note' => 'Displays wether the page is locked or open for modifications.', - ), - "wiki_list_versions" => array( + ], + "wiki_list_versions" => [ 'label' => 'Versions', 'note' => 'Display the number of available versions of a page.', - ), - "wiki_list_links" => array( + ], + "wiki_list_links" => [ 'label' => 'Links', 'note' => 'Displays the number of links within a page.', - ), - "wiki_list_backlinks" => array( + ], + "wiki_list_backlinks" => [ 'label' => 'Backlinks', 'note' => 'Number of pages that link to a page.', - ), - "wiki_list_format_guid" => array( + ], + "wiki_list_format_guid" => [ 'label' => 'Format GUID', 'note' => 'Display the format GUID the page was saved in.', - ), - "wiki_list_size" => array( + ], + "wiki_list_size" => [ 'label' => 'Size', 'note' => 'Size of page in bytes.', - ), -); + ], +]; $gBitSmarty->assign( 'formWikiLists',$formWikiLists ); if (isset($_REQUEST["wikilistconf"])) { @@ -74,60 +74,60 @@ if (isset($_REQUEST["wikilistconf"])) { } } -$formWikiFeatures = array( - "wiki_backlinks" => array( +$formWikiFeatures = [ + "wiki_backlinks" => [ 'label' => 'Backlinks', 'note' => 'Display a dropdown list of pages that link to a page.', - ), - "wiki_like_pages" => array( + ], + "wiki_like_pages" => [ 'label' => 'Like Pages', 'note' => 'Display a list of pages that have a common word in the names.', - ), - "wiki_allow_dup_page_names" => array( + ], + "wiki_allow_dup_page_names" => [ 'label' => 'Allow Duplicate Page Names', 'note' => 'Allow Wiki Pages with duplicate page names', - ), - "wiki_history" => array( + ], + "wiki_history" => [ 'label' => 'History', 'note' => 'Allow access to the page\'s history.', - ), - "wiki_list_orphans" => array( + ], + "wiki_list_orphans" => [ 'label' => 'List Orphans', 'note' => 'Allow access to a listing of all orphaned wikipages.', - ), - "wiki_attachments" => array( + ], + "wiki_attachments" => [ 'label' => 'Attachments', 'note' => 'Allow the attachment of files to a wikipage.', - ), - "wiki_comments" => array( + ], + "wiki_comments" => [ 'label' => 'Comments', 'note' => 'Allow the addition of user comments at the end of every wikipage.', - ), - "wiki_undo" => array( + ], + "wiki_undo" => [ 'label' => 'Undo', 'note' => 'Reverts a wikipage to the previous version held in its page history.', - ), - "wiki_rankings" => array( + ], + "wiki_rankings" => [ 'label' => 'Rankings', 'note' => 'Creates a ranking system based on the number of times a page is accessed.', - ), - "wiki_usrlock" => array( + ], + "wiki_usrlock" => [ 'label' => 'Users can lock pages', 'note' => 'Users who have the right permissions can lock pages preventing changes by other users.', - ), - "wiki_creator_admin" => array( + ], + "wiki_creator_admin" => [ 'label' => 'Page creators are admin of their pages', 'note' => 'Users who create a page, have all permissions regarding that particular page.', - ), - "wiki_url_import" => array( + ], + "wiki_url_import" => [ 'label' => 'Allow URL Import', 'note' => 'Allow urls to be imported and saved to the wiki.', - ), - "wiki_preserve_leading_blanks" => array( + ], + "wiki_preserve_leading_blanks" => [ 'label' => 'Preserve leading blanks', 'note' => 'Preserve leading blanks on Wiki Pages, provided for compatiblity with sites migrated from Tikiwiki.', - ), -); + ], +]; $gBitSmarty->assign( 'formWikiFeatures',$formWikiFeatures ); if( !empty( $_REQUEST["wikifeatures"] )) { @@ -156,44 +156,44 @@ if( !empty( $_REQUEST["wikifeatures"] )) { $gBitSmarty->assign("wiki_user_versions", 'n'); } } -$formWikiInOut = array( - "wiki_monosp" => array( +$formWikiInOut = [ + "wiki_monosp" => [ 'label' => 'Automonospaced text', 'note' => 'When adding a space at the beginning of a line, the given line uses a monospace font.', - ), - "wiki_words" => array( + ], + "wiki_words" => [ 'label' => 'WikiWords', 'note' => 'Automagically change words with CamelCaps or under_scores to links to internal wiki pages.', - ), - "wiki_plurals" => array( + ], + "wiki_plurals" => [ 'label' => 'Link plural WikiWords to their singular form', 'note' => 'If you use WikiWords as page name in a text, it will be linked to WikiWord.', - ), - "wiki_page_title" => array( + ], + "wiki_page_title" => [ 'label' => 'Page Title', 'note' => 'Display the page title at the top of every wikipage.', - ), - "wiki_description" => array( + ], + "wiki_description" => [ 'label' => 'Description', 'note' => 'Display a brief page description just below the title of the page.', - ), - "wiki_hide_date" => array( + ], + "wiki_hide_date" => [ 'label' => 'Hide Date', 'note' => 'Hide the date and creation / modification information.', - ), - "wiki_footnotes" => array( + ], + "wiki_footnotes" => [ 'label' => 'Footnotes', 'note' => 'Allow the addition of footnotes to wikipages.', - ), - "wiki_uses_slides" => array( + ], + "wiki_uses_slides" => [ 'label' => 'Use Slideshows', 'note' => 'If a wikipage is plit into a number of pages, this can be viewed as a slideshow, without menus or excess data on the page. can be useful for presentations and the like.', - ), - "wiki_multiprint" => array( + ], + "wiki_multiprint" => [ 'label' => 'Print Multiple Pages', 'note' => 'Allow joining of pages for printing purposes.', - ), -); + ], +]; $gBitSmarty->assign( 'formWikiInOut',$formWikiInOut ); if( !empty( $_REQUEST["wikiinout"] )) { @@ -202,28 +202,28 @@ if( !empty( $_REQUEST["wikiinout"] )) { } } -$formWikiBooks = array( - "wiki_books" => array( +$formWikiBooks = [ + "wiki_books" => [ 'label' => 'WikiBooks', 'note' => 'Allow the creation and use of WikiBooks - hierarchial collections of wiki pages', - ), - "wiki_book_show_path" => array( + ], + "wiki_book_show_path" => [ 'label' => 'Show book path', 'note' => 'If this settings is enabled, the path pointing to the currently viewed page will be displayed at the top of the page.<br />Alternatively, you can turn on the module "<a href="'.KERNEL_PKG_URL.'admin/index.php?page=layout">liberty -> structure navigation</a>".', - ), - "wiki_book_show_navigation" => array( + ], + "wiki_book_show_navigation" => [ 'label' => 'Show book navigation links', 'note' => 'Book navigation links allow you to navigate books more easily providing the following links:<br /><strong>previous | parent page | next</strong>.<br />Alternatively, you can turn on the module "<a href="'.KERNEL_PKG_URL.'admin/index.php?page=layout">liberty -> structure navigation</a>".', - ), - "wikibook_use_icons" => array( + ], + "wikibook_use_icons" => [ 'label' => 'Use navigation icons instead of words', 'note' => 'This option will remove the names of the navigation controls and replace them with appropriate icons for navigation. This can be useful if you feel that navigation is too cluttered when showing that many words.', - ), - "wikibook_hide_add_content" => array( + ], + "wikibook_hide_add_content" => [ 'label' => 'Hide Edit "Structure Content"', 'note' => 'Hide the tabbed panel to add content to the structure. This might be hidden for performance reasons.', - ), -); + ], +]; $gBitSmarty->assign( 'formWikiBooks',$formWikiBooks ); if( !empty( $_REQUEST["wikibooks"] )) { @@ -232,20 +232,20 @@ if( !empty( $_REQUEST["wikibooks"] )) { } } -$formWikiWatch = array( - "wiki_watch_author" => array( +$formWikiWatch = [ + "wiki_watch_author" => [ 'label' => 'Page author watch', 'note' => 'Automatically set a watch for the author of a page.', - ), - "wiki_watch_editor" => array( + ], + "wiki_watch_editor" => [ 'label' => 'Page editor watch', 'note' => 'Automatically set a watch for the editor of a page.', - ), -// "wiki_watch_comments" => array( + ], +// "wiki_watch_comments" => [ // 'label' => 'Comment watch', // 'note' => 'Allow watching of comments (who knows if this works).', -// ), -); +// ], +]; $gBitSmarty->assign( 'formWikiWatch',$formWikiWatch ); if( !empty( $_REQUEST["wikiwatch"] )) { @@ -284,4 +284,3 @@ if( !empty( $_REQUEST["wikisetcopyright"] )) { $gBitSmarty->assign("wiki_copyrights", $gBitSystem->getConfig( "wiki_copyrights" )); $gBitSmarty->assign('wiki_license_page', $gBitSystem->getConfig( "wiki_license_page" )); $gBitSmarty->assign('wiki_submit_notice', $gBitSystem->getConfig( "wiki_submit_notice" )); -?> diff --git a/admin/index.php b/admin/index.php index 80f6d40..209c02e 100644..100755 --- a/admin/index.php +++ b/admin/index.php @@ -1,4 +1,3 @@ <?php // This is not a package. - header ("location: ../index.php"); -?>
\ No newline at end of file + header ("location: ../index.php");
\ No newline at end of file diff --git a/admin/pump_wiki_inc.php b/admin/pump_wiki_inc.php index ba4c01e..ff2fb53 100644..100755 --- a/admin/pump_wiki_inc.php +++ b/admin/pump_wiki_inc.php @@ -7,7 +7,7 @@ /** * required setup */ -require_once( WIKI_PKG_CLASS_PATH.'BitPage.php' ); +use Bitweaver\Wiki\BitPage; $tutorial_intro = '^This tutorial does not contain any direct links to any particular pages. This is to help you understand how to navigate bitweaver. If you don\'t feel confident about finding your way back to this page, it might be useful to open a second browser window to carry out these instructions or print this page before continuing. @@ -16,11 +16,11 @@ 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 = array( - array( +$pageHash = [ +[ 'title' => 'Welcome', 'description' => 'The Wiki Package of bitweaver', - 'edit' => 'Welcome to bitweaver. + 'edit' => "Welcome to bitweaver. We appreciate that you are taking the time to test this unique product. bitweaver allows you to create a website exactly the way you want it to be. You can install packages as you need them, enhancing or reducing the functionality of your site. If you should have space limitations you can delete packages from your server without any consequences (as long as it\'s none of the required packages). bitweaver was built with extensibility in mind and thus we have made it \'\'easy\'\' to create new packages for developers and just plug them into the bitweaver framework. We envisage that more packages will become in the future. If you should require additional functionality, it is worth keeping your eyes on [http://www.bitweaver.org/wiki/index.php?page=bitweaverFeatures|bitweaver Features], where we will announce all new packages as they are developed and reach a stable status. @@ -32,9 +32,9 @@ 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)) -'), - array( +** ((bitweaver Glossary))" +], + [ 'title' => 'Getting Started', 'description' => 'Some basic pointer on where to go after installation', 'edit' => "{maketoc} @@ -65,8 +65,8 @@ 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__. -"), - array( +"], + [ 'title' => 'Getting Help', 'description' => 'Help and Contact Details', 'edit' => 'bitweaver features an internal help system that provides help in virtually all forms and areas where you have to enter information. However, should you require more help, you can always contact us by any of the means mentioned below. @@ -79,8 +79,8 @@ Some other packages also have plugins. These settings can usually be found in th ** the [http://www.bitweaver.org/forums/viewforum.php?f=5|bitweaver Forums] might contain useful information. ** [http://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. -'), - array( +'], + [ 'title' => 'How to create a Wiki Book', 'description' => 'A wikibook is a handy way to organise pages.', 'edit' => '{maketoc} @@ -132,8 +132,8 @@ 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. -'), - array( +'], + [ 'title' => 'How to set your Wiki Homepage', 'description' => 'How to set a specific wikipage as home', 'edit' => 'This page will guide you through the process of defining a particular wikipage as you Wiki HomePage. @@ -144,8 +144,8 @@ 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===. -'), - array( +'], + [ 'title' => 'bitweaver Glossary', 'description' => 'Definition of Frequently used Terms', 'edit' => ';Package:A Package is a part of bitweaver that can manipulate, store and/or display information. Packages are always self-contained entities that can be installed, or uninstalled should require additional functionality. A list of currently available packages can be found on [http://www.bitweaver.org|bitweaver]. bitweaver differentiates between internal and foreign packages. Internal packages are packages that have been created inhouse and are meant to work with bitweaver from the ground up and will probably not work with any other application. a Foreign Package is usually a standalone application that has been modified in a way to fit into bitweaver. We try and keep these modifications to a minimum, allowing for easy upgrades to new versions. @@ -155,12 +155,12 @@ 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 ) { // common settings for all of these pages - $page['fSavePage'] = TRUE; + $page['fSavePage'] = true; $page['user_id'] = ROOT_USER_ID; $page['format_guid'] = 'tikiwiki'; @@ -172,4 +172,3 @@ foreach( $pageHash as $page ) { $gBitSmarty->assign( 'error',$error ); } } -?> diff --git a/admin/schema_inc.php b/admin/schema_inc.php index 2ff6e8b..71ce6c7 100644..100755 --- a/admin/schema_inc.php +++ b/admin/schema_inc.php @@ -1,6 +1,6 @@ <?php -$tables = array( +$tables = [ 'wiki_pages' => " page_id I4 PRIMARY, @@ -19,7 +19,7 @@ $tables = array( , CONSTRAINT `wiki_footnotes_user_ref` FOREIGN KEY (`user_id`) REFERENCES `".BIT_DB_PREFIX."users_users` (`user_id`)' ", -); +]; global $gBitInstaller; @@ -27,119 +27,119 @@ foreach( array_keys( $tables ) AS $tableName ) { $gBitInstaller->registerSchemaTable( WIKI_PKG_NAME, $tableName, $tables[$tableName] ); } -$gBitInstaller->registerPackageInfo( WIKI_PKG_NAME, array( +$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>', -) ); +] ); // ### Indexes -$indices = array ( - 'wiki_pages_content_idx' => array( 'table' => 'wiki_pages', 'cols' => 'content_id', 'opts' => 'UNIQUE' ), - 'wiki_page_footnotes_page_idx' => array( 'table' => 'wiki_footnotes', 'cols' => 'page_id', 'opts' => NULL ) -); +$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 ] +]; $gBitInstaller->registerSchemaIndexes( WIKI_PKG_NAME, $indices ); // ### Sequences -$sequences = array ( - 'wiki_pages_page_id_seq' => array( 'start' => 1 ) -); +$sequences = [ + 'wiki_pages_page_id_seq' => [ 'start' => 1 ] +]; $gBitInstaller->registerSchemaSequences( WIKI_PKG_NAME, $sequences ); // ### Default UserPermissions -$gBitInstaller->registerUserPermissions( WIKI_PKG_NAME, array( - array('p_wiki_admin_book', 'Can administer books', 'editors', WIKI_PKG_NAME), - array('p_wiki_admin', 'Can admin the wiki', 'admin', WIKI_PKG_NAME), - array('p_wiki_update_book', 'Can edit books', 'editor', WIKI_PKG_NAME), - array('p_wiki_create_book', 'Can create books', 'editor', WIKI_PKG_NAME), - array('p_wiki_edit_copyright', 'Can edit copyright notices', 'editor', WIKI_PKG_NAME), - array('p_wiki_edit_dynvar', 'Can edit dynamic variables', 'editors', WIKI_PKG_NAME), - array('p_wiki_update_page', 'Can edit pages', 'editor', WIKI_PKG_NAME), - array('p_wiki_create_page', 'Can create pages', 'editor', WIKI_PKG_NAME), - array('p_wiki_list_pages', 'Can list pages', 'editor', WIKI_PKG_NAME), - array('p_wiki_lock_page', 'Can lock pages', 'editors', WIKI_PKG_NAME), - array('p_wiki_remove_page', 'Can remove a wiki page', 'editors', WIKI_PKG_NAME), - array('p_wiki_rename_page', 'Can rename pages', 'editors', WIKI_PKG_NAME), - array('p_wiki_rollback', 'Can rollback pages', 'editors', WIKI_PKG_NAME), - array('p_wiki_save_minor', 'Can save as minor edit', 'editor', WIKI_PKG_NAME), - array('p_wiki_view_history', 'Can view page history', 'basic', WIKI_PKG_NAME), - array('p_wiki_view_page', 'Can view page/pages', 'basic', WIKI_PKG_NAME), -) ); +$gBitInstaller->registerUserPermissions( WIKI_PKG_NAME, [ + [ 'p_wiki_admin_book', 'Can administer books', 'editors', WIKI_PKG_NAME ], + [ 'p_wiki_admin', 'Can admin the wiki', 'admin', WIKI_PKG_NAME ], + [ 'p_wiki_update_book', 'Can edit books', 'editor', WIKI_PKG_NAME ], + [ 'p_wiki_create_book', 'Can create books', 'editor', WIKI_PKG_NAME ], + [ 'p_wiki_edit_copyright', 'Can edit copyright notices', 'editor', WIKI_PKG_NAME ], + [ 'p_wiki_edit_dynvar', 'Can edit dynamic variables', 'editors', WIKI_PKG_NAME ], + [ 'p_wiki_update_page', 'Can edit pages', 'editor', WIKI_PKG_NAME ], + [ 'p_wiki_create_page', 'Can create pages', 'editor', WIKI_PKG_NAME ], + [ 'p_wiki_list_pages', 'Can list pages', 'editor', WIKI_PKG_NAME ], + [ 'p_wiki_lock_page', 'Can lock pages', 'editors', WIKI_PKG_NAME ], + [ 'p_wiki_remove_page', 'Can remove a wiki page', 'editors', WIKI_PKG_NAME ], + [ 'p_wiki_rename_page', 'Can rename pages', 'editors', WIKI_PKG_NAME ], + [ 'p_wiki_rollback', 'Can rollback pages', 'editors', WIKI_PKG_NAME ], + [ 'p_wiki_save_minor', 'Can save as minor edit', 'editor', WIKI_PKG_NAME ], + [ 'p_wiki_view_history', 'Can view page history', 'basic', WIKI_PKG_NAME ], + [ 'p_wiki_view_page', 'Can view page/pages', 'basic', WIKI_PKG_NAME ], +] ); // ### Default Preferences -$gBitInstaller->registerPreferences( WIKI_PKG_NAME, array( - //array( WIKI_PKG_NAME, 'warn_on_edit','n'), - //array( WIKI_PKG_NAME, 'wiki_allow_dup_page_names','y'), - array( WIKI_PKG_NAME, 'wiki_attachments','y'), - array( WIKI_PKG_NAME, 'wiki_backlinks','y'), - array( WIKI_PKG_NAME, 'wiki_book_show_navigation','y'), - array( WIKI_PKG_NAME, 'wiki_book_show_path','y'), - array( WIKI_PKG_NAME, 'wiki_books','y'), - //array( WIKI_PKG_NAME, 'wiki_comments','n'), - //array( WIKI_PKG_NAME, 'wiki_copyrights','n'), - //array( WIKI_PKG_NAME, 'wiki_creator_admin','n'), - array( WIKI_PKG_NAME, 'wiki_description','y'), - array( WIKI_PKG_NAME, 'wiki_dump','y'), - //array( WIKI_PKG_NAME, 'wiki_footnotes','n'), - //array( WIKI_PKG_NAME, 'wiki_hide_date','n'), - array( WIKI_PKG_NAME, 'wiki_history','y'), - array( WIKI_PKG_NAME, 'wiki_home_page','Welcome'), - array( WIKI_PKG_NAME, 'wiki_last_changes','y'), - //array( WIKI_PKG_NAME, 'wiki_license_page',''), - array( WIKI_PKG_NAME, 'wiki_like_pages','y'), - array( WIKI_PKG_NAME, 'wiki_list_backlinks','y'), - array( WIKI_PKG_NAME, 'wiki_list_comment','y'), - array( WIKI_PKG_NAME, 'wiki_list_creator','y'), - //array( WIKI_PKG_NAME, 'wiki_list_format_guid',''), - array( WIKI_PKG_NAME, 'wiki_list_hits','y'), - array( WIKI_PKG_NAME, 'wiki_list_lastmodif','y'), - array( WIKI_PKG_NAME, 'wiki_list_lastver','y'), - array( WIKI_PKG_NAME, 'wiki_list_links','y'), - array( WIKI_PKG_NAME, 'wiki_list_name','y'), - array( WIKI_PKG_NAME, 'wiki_list_orphans','y'), - array( WIKI_PKG_NAME, 'wiki_list_size','y'), - array( WIKI_PKG_NAME, 'wiki_list_status','y'), - array( WIKI_PKG_NAME, 'wiki_list_user','y'), - array( WIKI_PKG_NAME, 'wiki_list_versions','y'), - //array( WIKI_PKG_NAME, 'wiki_monosp','n'), - //array( WIKI_PKG_NAME, 'wiki_multiprint','n'), - array( WIKI_PKG_NAME, 'wiki_page_regex','strict'), - array( WIKI_PKG_NAME, 'wiki_page_title','y'), - array( WIKI_PKG_NAME, 'wiki_pictures','y'), - array( WIKI_PKG_NAME, 'wiki_plurals','y'), - //array( WIKI_PKG_NAME, 'wiki_preserve_leading_blanks','n'), - //array( WIKI_PKG_NAME, 'wiki_ranking','n'), - array( WIKI_PKG_NAME, 'wiki_rankings','y'), - //array( WIKI_PKG_NAME, 'wiki_section_edit','n'), - //array( WIKI_PKG_NAME, 'wiki_submit_notice',''), - array( WIKI_PKG_NAME, 'wiki_tables','new'), - //array( WIKI_PKG_NAME, 'wiki_undo','n'), - //array( WIKI_PKG_NAME, 'wiki_url_import','n'), - //array( WIKI_PKG_NAME, 'wiki_user_versions','n'), - //array( WIKI_PKG_NAME, 'wiki_uses_slides','n'), - //array( WIKI_PKG_NAME, 'wiki_usrlock','n'), - array( WIKI_PKG_NAME, 'wiki_warn_on_edit_time','2'), - //array( WIKI_PKG_NAME, 'wiki_watch_author','n'), - //array( WIKI_PKG_NAME, 'wiki_watch_comments','n'), - //array( WIKI_PKG_NAME, 'wiki_watch_editor','n'), - //array( WIKI_PKG_NAME, 'wiki_words','y'), - //array( WIKI_PKG_NAME, 'wikibook_hide_add_content','n'), - //array( WIKI_PKG_NAME, 'wikibook_use_icons','n'), -) ); +$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' ], + [ WIKI_PKG_NAME, 'wiki_backlinks','y' ], + [ WIKI_PKG_NAME, 'wiki_book_show_navigation','y' ], + [ WIKI_PKG_NAME, 'wiki_book_show_path','y' ], + [ WIKI_PKG_NAME, 'wiki_books','y' ], + //[ WIKI_PKG_NAME, 'wiki_comments','n' ], + //[ WIKI_PKG_NAME, 'wiki_copyrights','n' ], + //[ WIKI_PKG_NAME, 'wiki_creator_admin','n' ], + [ WIKI_PKG_NAME, 'wiki_description','y' ], + [ WIKI_PKG_NAME, 'wiki_dump','y' ], + //[ WIKI_PKG_NAME, 'wiki_footnotes','n' ], + //[ WIKI_PKG_NAME, 'wiki_hide_date','n' ], + [ WIKI_PKG_NAME, 'wiki_history','y' ], + [ WIKI_PKG_NAME, 'wiki_home_page','Welcome' ], + [ WIKI_PKG_NAME, 'wiki_last_changes','y' ], + //[ WIKI_PKG_NAME, 'wiki_license_page','' ], + [ WIKI_PKG_NAME, 'wiki_like_pages','y' ], + [ WIKI_PKG_NAME, 'wiki_list_backlinks','y' ], + [ WIKI_PKG_NAME, 'wiki_list_comment','y' ], + [ WIKI_PKG_NAME, 'wiki_list_creator','y' ], + //[ WIKI_PKG_NAME, 'wiki_list_format_guid','' ], + [ WIKI_PKG_NAME, 'wiki_list_hits','y' ], + [ WIKI_PKG_NAME, 'wiki_list_lastmodif','y' ], + [ WIKI_PKG_NAME, 'wiki_list_lastver','y' ], + [ WIKI_PKG_NAME, 'wiki_list_links','y' ], + [ WIKI_PKG_NAME, 'wiki_list_name','y' ], + [ WIKI_PKG_NAME, 'wiki_list_orphans','y' ], + [ WIKI_PKG_NAME, 'wiki_list_size','y' ], + [ WIKI_PKG_NAME, 'wiki_list_status','y' ], + [ WIKI_PKG_NAME, 'wiki_list_user','y' ], + [ WIKI_PKG_NAME, 'wiki_list_versions','y' ], + //[ WIKI_PKG_NAME, 'wiki_monosp','n' ], + //[ WIKI_PKG_NAME, 'wiki_multiprint','n' ], + [ WIKI_PKG_NAME, 'wiki_page_regex','strict' ], + [ WIKI_PKG_NAME, 'wiki_page_title','y' ], + [ WIKI_PKG_NAME, 'wiki_pictures','y' ], + [ WIKI_PKG_NAME, 'wiki_plurals','y' ], + //[ WIKI_PKG_NAME, 'wiki_preserve_leading_blanks','n' ], + //[ WIKI_PKG_NAME, 'wiki_ranking','n' ], + [ WIKI_PKG_NAME, 'wiki_rankings','y' ], + //[ WIKI_PKG_NAME, 'wiki_section_edit','n' ], + //[ WIKI_PKG_NAME, 'wiki_submit_notice','' ], + [ WIKI_PKG_NAME, 'wiki_tables','new' ], + //[ WIKI_PKG_NAME, 'wiki_undo','n' ], + //[ WIKI_PKG_NAME, 'wiki_url_import','n' ], + //[ WIKI_PKG_NAME, 'wiki_user_versions','n' ], + //[ WIKI_PKG_NAME, 'wiki_uses_slides','n' ], + //[ WIKI_PKG_NAME, 'wiki_usrlock','n' ], + [ WIKI_PKG_NAME, 'wiki_warn_on_edit_time','2' ], + //[ WIKI_PKG_NAME, 'wiki_watch_author','n' ], + //[ WIKI_PKG_NAME, 'wiki_watch_comments','n' ], + //[ WIKI_PKG_NAME, 'wiki_watch_editor','n' ], + //[ WIKI_PKG_NAME, 'wiki_words','y' ], + //[ WIKI_PKG_NAME, 'wikibook_hide_add_content','n' ], + //[ WIKI_PKG_NAME, 'wikibook_use_icons','n' ], +] ); if( defined( 'RSS_PKG_NAME' )) { - $gBitInstaller->registerPreferences( WIKI_PKG_NAME, array( - array( RSS_PKG_NAME, WIKI_PKG_NAME.'_rss', 'y'), - )); + $gBitInstaller->registerPreferences( WIKI_PKG_NAME, [ + [ RSS_PKG_NAME, WIKI_PKG_NAME.'_rss', 'y' ], + ] ); } // ### Register content types -$gBitInstaller->registerContentObjects( WIKI_PKG_NAME, array( +$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, array( - 'liberty' => array( 'min' => '2.1.4' ), -)); +$gBitInstaller->registerRequirements( WIKI_PKG_NAME, [ + 'liberty' => [ 'min' => '5.0.0' ], +] ); |
