summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-05-15 16:43:54 +0100
committerLester Caine <lester@lsces.co.uk>2026-05-15 16:43:54 +0100
commita4da8ac38a74e726a5c50ab0a9bb7ad839dc75c5 (patch)
tree5022148776c9308e4631fa898cdf9f5d421dfc43
parentdf681ca9a20464ec61ebf34cd5622b9c5c9aec61 (diff)
downloadpigeonholes-a4da8ac38a74e726a5c50ab0a9bb7ad839dc75c5.tar.gz
pigeonholes-a4da8ac38a74e726a5c50ab0a9bb7ad839dc75c5.tar.bz2
pigeonholes-a4da8ac38a74e726a5c50ab0a9bb7ad839dc75c5.zip
Namespace fixes
-rwxr-xr-xadmin/admin_pigeonholes_inc.php9
-rwxr-xr-xassign_content.php5
-rwxr-xr-xedit_pigeonholes.php23
-rwxr-xr-xlist.php3
-rwxr-xr-xview.php11
5 files changed, 28 insertions, 23 deletions
diff --git a/admin/admin_pigeonholes_inc.php b/admin/admin_pigeonholes_inc.php
index 9313f23..a2e9185 100755
--- a/admin/admin_pigeonholes_inc.php
+++ b/admin/admin_pigeonholes_inc.php
@@ -1,4 +1,5 @@
<?php
+use Bitweaver\KernelTools;
// $Header$
$pigeonholeDisplaySettings = [
@@ -66,8 +67,8 @@ $pigeonholeContentEditSettings = [
$gBitSmarty->assign( 'pigeonholeContentEditSettings', $pigeonholeContentEditSettings );
$listStyles = [
- 'dynamic' => tra( 'Dynamic list' ),
- 'table' => tra( 'Table based list' ),
+ 'dynamic' => KernelTools::tra( 'Dynamic list' ),
+ 'table' => KernelTools::tra( 'Table based list' ),
];
$gBitSmarty->assign( 'listStyles', $listStyles );
@@ -77,13 +78,13 @@ unset( $tableColumns[0] );
$gBitSmarty->assign( 'tableColumns', $tableColumns );
$memberLimit = [
- '0' => tra( 'Only display category title' ),
+ '0' => KernelTools::tra( 'Only display category title' ),
'10' => 10,
'20' => 20,
'30' => 30,
'50' => 50,
'100' => 100,
- '9999' => tra( 'Unlimited' ),
+ '9999' => KernelTools::tra( 'Unlimited' ),
];
$gBitSmarty->assign( 'memberLimit', $memberLimit );
diff --git a/assign_content.php b/assign_content.php
index d8ef5d0..7b710dc 100755
--- a/assign_content.php
+++ b/assign_content.php
@@ -16,6 +16,7 @@
/**
* required setup
*/
+use Bitweaver\KernelTools;
require_once '../kernel/includes/setup_inc.php';
$gBitSystem->verifyPackage( 'pigeonholes' );
@@ -26,7 +27,7 @@ include_once( PIGEONHOLES_PKG_INCLUDE_PATH.'lookup_pigeonholes_inc.php' );
$feedback = '';
$gBitSmarty->assign( 'feedback', $feedback );
-$contentTypes = [ '' => tra( 'All Content' ) ];
+$contentTypes = [ '' => KernelTools::tra( 'All Content' ) ];
foreach( $gLibertySystem->mContentTypes as $cType ) {
if( $cType['content_type_guid'] != PIGEONHOLES_CONTENT_TYPE_GUID ) {
$contentTypes[$cType['content_type_guid']] = $gLibertySystem->getContentTypeName( $cType['content_type_guid'] );
@@ -134,5 +135,5 @@ $gBitSmarty->assign( 'assignableContent', $assignableContent );
$gBitSmarty->assign( 'contentCount', count( $assignableContent ) );
// Display the template
-$gBitSystem->display( 'bitpackage:pigeonholes/assign_content.tpl', tra( 'Assign Content to Categories' ) , [ 'display_mode' => 'display' ]);
+$gBitSystem->display( 'bitpackage:pigeonholes/assign_content.tpl', KernelTools::tra( 'Assign Content to Categories' ) , [ 'display_mode' => 'display' ]);
?>
diff --git a/edit_pigeonholes.php b/edit_pigeonholes.php
index 71dfd47..0fc2f85 100755
--- a/edit_pigeonholes.php
+++ b/edit_pigeonholes.php
@@ -22,6 +22,7 @@ $gBitSystem->verifyPackage( 'pigeonholes' );
$gBitSystem->verifyPermission( 'p_pigeonholes_create' );
use Bitweaver\Pigeonholes\Pigeonholes;
+use Bitweaver\KernelTools;
include_once PIGEONHOLES_PKG_INCLUDE_PATH.'lookup_pigeonholes_inc.php';
// include edit structure file only when structure_id is known
@@ -41,7 +42,7 @@ global $gStructure;
// store the form if we need to
if( !empty( $_REQUEST['pigeonhole_store'] ) ) {
if(( empty( $_REQUEST['pigeonhole']['title'] ))) {
- $gBitSystem->fatalError( tra( "You must specify a title." ));
+ $gBitSystem->fatalError( KernelTools::tra( "You must specify a title." ));
}
// we need to get the root structure id
@@ -50,7 +51,7 @@ if( !empty( $_REQUEST['pigeonhole_store'] ) ) {
$pigeonStore = new Pigeonholes( null, !empty( $_REQUEST['pigeonhole_content_id'] ) ? $_REQUEST['pigeonhole_content_id'] : null );
$pigeonStore->load();
if( $pigeonStore->store( $_REQUEST['pigeonhole'] )) {
- header( "Location: ".$_SERVER['SCRIPT_NAME'].'?structure_id='.$pigeonStore->mStructureId.( !empty( $_REQUEST['action'] ) ? '&action='.$_REQUEST['action'] : '' )."&success=".urlencode( tra( "The category was successfully stored" ) ) );
+ header( "Location: ".$_SERVER['SCRIPT_NAME'].'?structure_id='.$pigeonStore->mStructureId.( !empty( $_REQUEST['action'] ) ? '&action='.$_REQUEST['action'] : '' )."&success=".urlencode( KernelTools::tra( "The category was successfully stored" ) ) );
} else {
$feedback['error'] = $gContent->mErrors;
}
@@ -70,7 +71,7 @@ if( !empty( $_REQUEST['action'] ) || isset( $_REQUEST["confirm"] ) ) {
if( $_REQUEST["action"] == 'remove' || isset( $_REQUEST["confirm"] ) ) {
if( isset( $_REQUEST["confirm"] ) ) {
if( $gContent->expunge() ) {
- bit_redirect( $_SERVER['SCRIPT_NAME'].'?structure_id='.$gContent->mInfo["parent_id"] );
+ KernelTools::bit_redirect( $_SERVER['SCRIPT_NAME'].'?structure_id='.$gContent->mInfo["parent_id"] );
} else {
$feedback['error'] = $gContent->mErrors;
}
@@ -81,7 +82,7 @@ if( !empty( $_REQUEST['action'] ) || isset( $_REQUEST["confirm"] ) ) {
$formHash['action'] = 'remove';
$msgHash = [
'label' => 'Remove Pigeonhole',
- 'confirm_item' => $gContent->mInfo['title'].'<br />'.tra( 'and any subcategories' ),
+ 'confirm_item' => $gContent->mInfo['title'].'<br />'.KernelTools::tra( 'and any subcategories' ),
'warning' => 'This will remove the pigeonhole but will <strong>not</strong> modify or remove the content itself.',
];
$gBitSystem->confirmDialog( $formHash, $msgHash );
@@ -89,13 +90,13 @@ if( !empty( $_REQUEST['action'] ) || isset( $_REQUEST["confirm"] ) ) {
if( $_REQUEST['action'] == 'dismember' && !empty( $_REQUEST['pigeonhole_content_id'] ) && !empty( $_REQUEST['parent_id'] ) ) {
if( $gContent->expungePigeonholeMember( [ 'parent_id' => $_REQUEST['parent_id'], 'member_id' => $_REQUEST['pigeonhole_content_id'] ] ) ) {
- $feedback['success'] = tra( 'The item was successfully removed' );
+ $feedback['success'] = KernelTools::tra( 'The item was successfully removed' );
} else {
- $feedback['error'] = tra( 'The item could not be removed' );
+ $feedback['error'] = KernelTools::tra( 'The item could not be removed' );
}
// Have we been asked to return somewhere else?
if (!empty($_REQUEST['return_uri'])) {
- bit_redirect($_REQUEST['return_uri']);
+ KernelTools::bit_redirect($_REQUEST['return_uri']);
}
// used to avoid displaying edit form
unset( $_REQUEST['action'] );
@@ -110,7 +111,7 @@ if( !empty( $_REQUEST['success'] ) ) {
if ( $gBitSystem->isFeatureActive( 'pigeonholes_permissions' ) ) {
$tmpPerms = $gBitUser->isAdmin() ? $gBitUser->getGroupPermissions() : $gBitUser->mPerms;
- $perms[''] = tra( 'None' );
+ $perms[''] = KernelTools::tra( 'None' );
foreach( $tmpPerms as $perm => $info ) {
$perms[$info['package']][$perm] = $perm;
}
@@ -126,7 +127,7 @@ if ( $gBitSystem->isFeatureActive( 'pigeonholes_groups' ) ) {
$allGroups = $gBitUser->getAllGroups( $listHash );
// create a usable array for group selection
- $groups[0] = tra( 'None' );
+ $groups[0] = KernelTools::tra( 'None' );
foreach( $allGroups as $group ) {
$groups[$group['group_id']] = $group['group_name'];
}
@@ -150,7 +151,7 @@ if ( $gBitSystem->isFeatureActive( 'pigeonholes_themes' ) ) {
// Display the template
if ( !empty( $gStructure ) ) {
- $gBitSystem->display( 'bitpackage:pigeonholes/edit_pigeonholes.tpl', !empty( $gStructure->mInfo['title'] ) ? tra( 'Edit Pigeonhole' ).': '.$gStructure->mInfo["title"] : tra( 'Create Pigeonhole' ) , [ 'display_mode' => 'edit' ]);
+ $gBitSystem->display( 'bitpackage:pigeonholes/edit_pigeonholes.tpl', !empty( $gStructure->mInfo['title'] ) ? KernelTools::tra( 'Edit Pigeonhole' ).': '.$gStructure->mInfo["title"] : KernelTools::tra( 'Create Pigeonhole' ) , [ 'display_mode' => 'edit' ]);
} else {
- $gBitSystem->display( 'bitpackage:pigeonholes/edit_pigeonholes.tpl', tra( 'Create Pigeonhole' ) , [ 'display_mode' => 'edit' ]);
+ $gBitSystem->display( 'bitpackage:pigeonholes/edit_pigeonholes.tpl', KernelTools::tra( 'Create Pigeonhole' ) , [ 'display_mode' => 'edit' ]);
}
diff --git a/list.php b/list.php
index 5ba6908..0afce88 100755
--- a/list.php
+++ b/list.php
@@ -11,6 +11,7 @@
/**
* required setup
*/
+use Bitweaver\KernelTools;
require_once("../kernel/includes/setup_inc.php");
$gBitSystem->verifyPackage( 'pigeonholes' );
@@ -40,5 +41,5 @@ if( !empty( $pigeonList ) ) {
}
$gBitSmarty->assign( 'listInfo', $listHash['listInfo'] );
-$gBitSystem->display( 'bitpackage:pigeonholes/list.tpl', tra( 'List Categories' ) , [ 'display_mode' => 'list' ]);
+$gBitSystem->display( 'bitpackage:pigeonholes/list.tpl', KernelTools::tra( 'List Categories' ) , [ 'display_mode' => 'list' ]);
?>
diff --git a/view.php b/view.php
index 6013fa2..bd9971b 100755
--- a/view.php
+++ b/view.php
@@ -16,6 +16,7 @@
/**
* required setup
*/
+use Bitweaver\KernelTools;
require_once '../kernel/includes/setup_inc.php';
$gBitSystem->verifyPackage( 'pigeonholes' );
@@ -43,16 +44,16 @@ $gStructure->load();
if( !empty( $_REQUEST['action'] ) ) {
if( $_REQUEST['action'] == 'dismember' && !empty( $_REQUEST['content_id'] ) && !empty( $_REQUEST['parent_id'] ) && $gContent->verifyUpdatePermission() ) {
if( $gContent->expungePigeonholeMember( [ 'parent_id' => $_REQUEST['content_id'], 'member_id' => $_REQUEST['parent_id'] ] ) ) {
- $feedback['success'] = tra( 'The item was successfully removed' );
+ $feedback['success'] = KernelTools::tra( 'The item was successfully removed' );
} else {
- $feedback['error'] = tra( 'The item could not be removed' );
+ $feedback['error'] = KernelTools::tra( 'The item could not be removed' );
}
}
}
// confirm that structure is valid
if( empty( $gStructure ) || !$gStructure->isValid() ) {
- $gBitSystem->fatalError( tra( 'Invalid structure' ));
+ $gBitSystem->fatalError( KernelTools::tra( 'Invalid structure' ));
}
$gBitSmarty->assign( 'gStructure', $gStructure );
@@ -71,10 +72,10 @@ if( $gContent->checkPathPermissions( $gContent->getField( 'path' ) ) ) {
$pigeonList = $gContent->getList( $listHash );
$gBitSmarty->assign( 'pigeonList', $pigeonList );
} else {
- $memberFeedback['warning'] = tra( "You do not have the required permissions to view the content of this category" );
+ $memberFeedback['warning'] = KernelTools::tra( "You do not have the required permissions to view the content of this category" );
}
$gContent->addHit();
// Display the template
-$gBitSystem->display( 'bitpackage:pigeonholes/view_structure.tpl', tra( 'View Pigeonhole' ) , [ 'display_mode' => 'display' ]);
+$gBitSystem->display( 'bitpackage:pigeonholes/view_structure.tpl', KernelTools::tra( 'View Pigeonhole' ) , [ 'display_mode' => 'display' ]);
?>