27if ( ! defined(
'XCUBE_CORE_PATH' ) ) {
28 define(
'XCUBE_CORE_PATH', __DIR__ );
31require_once XCUBE_CORE_PATH .
'/XCube_Root.class.php';
33require_once XCUBE_CORE_PATH .
'/XCube_ActionFilter.class.php';
34require_once XCUBE_CORE_PATH .
'/XCube_RenderSystem.class.php';
35require_once XCUBE_CORE_PATH .
'/XCube_Delegate.class.php';
37require_once XCUBE_CORE_PATH .
'/XCube_Object.class.php';
38require_once XCUBE_CORE_PATH .
'/XCube_Service.class.php';
40require_once XCUBE_CORE_PATH .
'/XCube_Identity.class.php';
41require_once XCUBE_CORE_PATH .
'/XCube_RoleManager.class.php';
42require_once XCUBE_CORE_PATH .
'/XCube_Permission.class.php';
44require_once XCUBE_CORE_PATH .
'/XCube_LanguageManager.class.php';
46require_once XCUBE_CORE_PATH .
'/XCube_ActionForm.class.php';
47require_once XCUBE_CORE_PATH .
'/XCube_TextFilter.class.php';
48require_once XCUBE_CORE_PATH .
'/XCube_Session.class.php';
113 public $mSetupUser =
null;
121 public $mExecute =
null;
129 public $mSetupTextFilter =
null;
131 public function __construct() {
133 $this->_mBlockChain = [];
134 $this->_mFilterChain = [];
135 $this->_mLoadedFilterNames = [];
141 $this->mSetupTextFilter->add(
'XCube_TextFilter::getInstance', XCUBE_DELEGATE_PRIORITY_FINAL );
151 $this->mRoot =& $root;
211 $this->mExecute->call(
new XCube_Ref( $this ) );
229 public function executeForward(
string $url,
int $time = 0,
string $message =
null ) {
231 header(
'location: ' . $url );
242 public function executeRedirect(
string $url,
int $time = 1,
string $message =
null ) {
252 $this->_mFilterChain[] =& $filter;
303 $this->mSetupTextFilter->call(
new XCube_Ref( $textFilter ) );
304 $this->mRoot->setTextFilter( $textFilter );
324 $this->mRoot->setSession( $session );
333 $this->mSetupUser->call(
new XCube_Ref( $this->mRoot->mContext->mUser ),
new XCube_Ref( $this ),
new XCube_Ref( $this->mRoot->mContext ) );
342 foreach ( array_keys( $this->_mFilterChain ) as $key ) {
343 $this->_mFilterChain[ $key ]->preFilter();
377 foreach ( array_keys( $this->_mFilterChain ) as $key ) {
378 $this->_mFilterChain[ $key ]->preBlockFilter();
388 foreach ( array_reverse( array_keys( $this->_mFilterChain ) ) as $key ) {
389 $this->_mFilterChain[ $key ]->postFilter();
404 if ( is_dir( $path ) && ( $files = glob( $path .
'/*.class.php' ) ) ) {
405 foreach ( $files as $file ) {
407 $className = basename( $file,
'.class.php' );
408 if ( XC_CLASS_EXISTS( $className ) && ! isset( $this->_mLoadedFilterNames[ $className ] ) ) {
409 $this->_mLoadedFilterNames[ $className ] =
true;
410 $instance =
new $className( $this );
426 return $delegateManager;
435 require_once XCUBE_CORE_PATH .
'/XCube_ServiceManager.class.php';
438 return $serviceManager;
447 $chunkName = $this->mRoot->getSiteConfig(
'Cube',
'PermissionManager' );
452 $manager =& $this->mRoot->_createInstance( $this->mRoot->getSiteConfig( $chunkName,
'class' ), $this->mRoot->getSiteConfig( $chunkName,
'path' ) );
463 $chunkName = $this->mRoot->getSiteConfig(
'Cube',
'RoleManager' );
468 $manager =& $this->mRoot->_createInstance( $this->mRoot->getSiteConfig( $chunkName,
'class' ), $this->mRoot->getSiteConfig( $chunkName,
'path' ) );
481 $context->setRequest( $request );
& _createDelegateManager()
& _createPermissionManager()
& _createServiceManager()
executeRedirect(string $url, int $time=1, string $message=null)
addActionFilter(&$filter)
executeForward(string $url, int $time=0, string $message=null)
[Final] Used for the simple mechanism for common delegation in XCube.