diff options
| author | lsces <lester@lsces.co.uk> | 2025-08-27 17:27:24 +0100 |
|---|---|---|
| committer | lsces <lester@lsces.co.uk> | 2025-08-27 17:27:24 +0100 |
| commit | 0aa24a7f24b573fd3f19cb888dfefcdc31ae6b82 (patch) | |
| tree | 0ebde514a2cbfeb6063e94717faceba7a38a9222 /admin | |
| parent | b781b829cc69b630da203ab85cdfd1dcffc7e7a3 (diff) | |
| download | tags-0aa24a7f24b573fd3f19cb888dfefcdc31ae6b82.tar.gz tags-0aa24a7f24b573fd3f19cb888dfefcdc31ae6b82.tar.bz2 tags-0aa24a7f24b573fd3f19cb888dfefcdc31ae6b82.zip | |
Code updated to PHP8.4 and namespaceV5-php84
Diffstat (limited to 'admin')
| -rwxr-xr-x[-rw-r--r--] | admin/admin_tags_inc.php | 86 | ||||
| -rw-r--r-- | admin/schema_inc.php | 46 |
2 files changed, 65 insertions, 67 deletions
diff --git a/admin/admin_tags_inc.php b/admin/admin_tags_inc.php index 6533da1..d8fc015 100644..100755 --- a/admin/admin_tags_inc.php +++ b/admin/admin_tags_inc.php @@ -4,108 +4,108 @@ // 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. -$formTagsDisplayOptions = array( - "tags_in_nav" => array( +$formTagsDisplayOptions = [ + "tags_in_nav" => [ 'label' => 'Nav', 'note' => 'Shows the tags in the "nav" location', 'type' => 'toggle', - ), - "tags_in_body" => array( + ], + "tags_in_body" => [ 'label' => 'Body', 'note' => 'Shows the tags in the "body" location', 'type' => 'toggle', - ), - "tags_in_view" => array( + ], + "tags_in_view" => [ 'label' => 'View', 'note' => 'Shows the tags in the "view" location', 'type' => 'toggle', - ), -); + ], +]; $gBitSmarty->assign( 'formTagsDisplayOptions', $formTagsDisplayOptions ); /* -$formTagsOtherOptions = array( - "tags_on_comments" => array( +$formTagsOtherOptions = [ + "tags_on_comments" => [ 'label' => 'Allow Tags on Comments', 'note' => 'Allows tags to be placed on comments', 'type' => 'toggle', - ), -); +], +]; $gBitSmarty->assign( 'formTagsOtherOptions', $formTagsOtherOptions ); */ -$formTagsStripOptions = array( - "tags_lowercase" => array( +$formTagsStripOptions = [ + "tags_lowercase" => [ 'label' => 'Lowercase Tags', 'note' => 'Convert all Tags to lowercase', 'type' => 'toggle', - ), - "tags_strip_spaces" => array( + ], + "tags_strip_spaces" => [ 'label' => 'Strip Spaces', 'note' => 'Strip white space from tags', 'type' => 'toggle', - ), - "tags_strip_nonword" => array( + ], + "tags_strip_nonword" => [ 'label' => 'Strip Non-Word', 'note' => 'Strip non-word characters from tags', 'type' => 'toggle', - ), - "tags_strip_regexp" => array( + ], + "tags_strip_regexp" => [ 'label' => 'Strip Custom', 'note' => 'A regular expression used to strip. Be VERY careful with this expression. This should include the delimiters for the regular expression.', 'type' => 'input', - ), - "tags_strip_replace" => array( + ], + "tags_strip_replace" => [ 'label' => 'Strip Custom Replacement', 'note' => 'The expresion used in the replacement made with the Strip Custom above. Leave blank to just strip any matches.', 'type' => 'input', - ), -); + ], +]; $gBitSmarty->assign( 'formTagsStripOptions', $formTagsStripOptions ); -$formTagLists = array( - "tags_list_id" => array( +$formTagLists = [ + "tags_list_id" => [ 'label' => 'ID', 'note' => 'Content ID', 'type' => 'toggle', - ), - "tags_list_title" => array( + ], + "tags_list_title" => [ 'label' => 'Title', 'note' => 'content title', 'type' => 'toggle', - ), - "tags_list_type" => array( + ], + "tags_list_type" => [ 'label' => 'Type', 'note' => 'content type', 'type' => 'toggle', - ), - "tags_list_author" => array( + ], + "tags_list_author" => [ 'label' => 'Author', 'note' => 'author of tagged content', 'type' => 'toggle', - ), - "tags_list_editor" => array( + ], + "tags_list_editor" => [ 'label' => 'Editor', 'note' => 'last editor', 'type' => 'toggle', - ), - "tags_list_lastmodif" => array( + ], + "tags_list_lastmodif" => [ 'label' => 'last modified', 'note' => 'modification date', 'type' => 'toggle', - ), - "tags_list_ip" => array( + ], + "tags_list_ip" => [ 'label' => 'IP', 'note' => 'editor\'s IP', 'type' => 'toggle', - ), -); + ], +]; $gBitSmarty->assign( 'formTagLists',$formTagLists ); // list of content types that can be tagged // 'sample' is presented anyways, if sample package is installed // 'bitcomment' (?) ... isFeatureActive('tags_on_comments') -$exclude = array( 'bituser', 'tikisticky', 'sample', 'bitcomment'); +$exclude = [ 'bituser', 'tikisticky', 'sample', 'bitcomment']; foreach( $gLibertySystem->mContentTypes as $cType ) { if( !in_array( $cType['content_type_guid'], $exclude ) ) { $formTaggable['guids']['tags_tag_'.$cType['content_type_guid']] = $gLibertySystem->getContentTypeName( $cType['content_type_guid'] ); @@ -125,7 +125,7 @@ if( !empty( $_REQUEST['tags_preferences'] ) ) { } } foreach( array_keys( $formTaggable['guids'] ) as $taggable ) { - $gBitSystem->storeConfig( $taggable, ( ( !empty( $_REQUEST['taggable_content'] ) && in_array( $taggable, $_REQUEST['taggable_content'] ) ) ? 'y' : NULL ), TAGS_PKG_NAME ); + $gBitSystem->storeConfig( $taggable, !empty( $_REQUEST['taggable_content'] ) && in_array( $taggable, $_REQUEST['taggable_content'] ) ? 'y' : null, TAGS_PKG_NAME); } } @@ -138,5 +138,3 @@ foreach( $gLibertySystem->mContentTypes as $cType ) { } $gBitSmarty->assign( 'formTaggable', $formTaggable ); - -?> diff --git a/admin/schema_inc.php b/admin/schema_inc.php index f2b1290..8b63aa6 100644 --- a/admin/schema_inc.php +++ b/admin/schema_inc.php @@ -1,5 +1,5 @@ <?php -$tables = array( +$tables = [ 'tags' => " tag_id I4 PRIMARY, tag C(64) NOTNULL @@ -14,7 +14,7 @@ $tables = array( , CONSTRAINT `tags_content_map_content_ref` FOREIGN KEY (`content_id`) REFERENCES `".BIT_DB_PREFIX."liberty_content` ( `content_id` ) , CONSTRAINT `tags_content_map_tagger_id_ref` FOREIGN KEY (`tagger_id`) REFERENCES `".BIT_DB_PREFIX."users_users` ( `user_id` )' " -); +]; global $gBitInstaller; @@ -22,36 +22,36 @@ foreach( array_keys( $tables ) AS $tableName ) { $gBitInstaller->registerSchemaTable( TAGS_PKG_NAME, $tableName, $tables[$tableName] ); } -$gBitInstaller->registerPackageInfo( TAGS_PKG_NAME, array( +$gBitInstaller->registerPackageInfo( TAGS_PKG_NAME, [ 'description' => "A simple Liberty Service that any package can use to tag its content with key words.", 'license' => '<a href="http://www.gnu.org/licenses/licenses.html#LGPL">LGPL</a>', -) ); +] ); -$gBitInstaller->registerPreferences( TAGS_PKG_NAME, array( - array( TAGS_PKG_NAME, 'tags_in_view', 'y' ), - array( TAGS_PKG_NAME, 'tags_list_title', 'y' ), - array( TAGS_PKG_NAME, 'tags_list_type', 'y' ), - array( TAGS_PKG_NAME, 'tags_list_author', 'y' ), - array( TAGS_PKG_NAME, 'tags_list_lastmodif', 'y' ), -) ); +$gBitInstaller->registerPreferences( TAGS_PKG_NAME, [ + [ TAGS_PKG_NAME, 'tags_in_view', 'y' ], + [ TAGS_PKG_NAME, 'tags_list_title', 'y' ], + [ TAGS_PKG_NAME, 'tags_list_type', 'y' ], + [ TAGS_PKG_NAME, 'tags_list_author', 'y' ], + [ TAGS_PKG_NAME, 'tags_list_lastmodif', 'y' ], +] ); // ### Sequences -$sequences = array ( - 'tags_tag_id_seq' => array( 'start' => 1 ), -); +$sequences = [ + 'tags_tag_id_seq' => [ 'start' => 1 ], +]; $gBitInstaller->registerSchemaSequences( TAGS_PKG_NAME, $sequences ); // ### Default UserPermissions -$gBitInstaller->registerUserPermissions( TAGS_PKG_NAME, array( - array( 'p_tags_admin', 'Can admin tags', 'admin', TAGS_PKG_NAME ), - array( 'p_tags_create', 'Can create tags', 'registered', TAGS_PKG_NAME ), - array( 'p_tags_view', 'Can view tags', 'basic', TAGS_PKG_NAME ), - array( 'p_tags_moderate', 'Can edit tags', 'editors', TAGS_PKG_NAME ), -) ); +$gBitInstaller->registerUserPermissions( TAGS_PKG_NAME, [ + [ 'p_tags_admin', 'Can admin tags', 'admin', TAGS_PKG_NAME ], + [ 'p_tags_create', 'Can create tags', 'registered', TAGS_PKG_NAME ], + [ 'p_tags_view', 'Can view tags', 'basic', TAGS_PKG_NAME ], + [ 'p_tags_moderate', 'Can edit tags', 'editors', TAGS_PKG_NAME ], +] ); // Requirements -$gBitInstaller->registerRequirements( TAGS_PKG_NAME, array( - 'liberty' => array( 'min' => '2.1.4' ), -)); +$gBitInstaller->registerRequirements( TAGS_PKG_NAME, [ + 'liberty' => [ 'min' => '5.0.0' ], +] ); |
