XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
Legacy_Controller Class Reference
Inheritance diagram for Legacy_Controller:
XCube_Controller

Public Member Functions

 prepare (&$root)
 
 executeCommon ()
 
 executeCommonSubset (bool $connectdb=true)
 
 _setupLogger ()
 
getLogger ()
 
 _getLocalTimezone ()
 
 _setupEnvironment ()
 
 _setupFilterChain ()
 
 _setupBlock ()
 
 _processBlock ()
 
 _parseUrl ()
 
 setupModuleContext ($dirname=null)
 
 _processModule ()
 
 _processHostAbstractLayer ()
 
 _setupUser ()
 
 _setupErrorHandler ()
 
 _setupDB ()
 
 _setupLanguage ()
 
_createLanguageManager ($language)
 
 _setupConfig ()
 
 _setupScript ()
 
 _setupDebugger ()
 
 _processPreBlockFilter ()
 
 _processModulePreload ($dirname)
 
 _setupSession ()
 
 executeHeader ()
 
 executeView ()
 
 _executeViewTheme (&$resultRenderTarget)
 
_createDelegateManager ()
 
_createServiceManager ()
 
 checkLogin ()
 
 logout ()
 
 switchStateCompulsory (&$strategy)
 
 setStrategy (&$strategy)
 
 setDialogMode ($flag)
 
 getDialogMode ()
 
getVirtualCurrentModule ()
 
 executeRedirect ($url, $time=1, $message=null, $addRedirect=true)
 
 isEnableCacheFeature ()
 
 existActiveCacheFile ($filepath, $cachetime)
 
 cacheRenderTarget ($filepath, &$renderTarget)
 
 loadCache ($filepath)
 
_createContext ()
 
 getPreferenceEditUrl (&$module)
 
 getHelpViewUrl (&$module)
 
- Public Member Functions inherited from XCube_Controller
 execute ()
 
 executeForward (string $url, int $time=0, string $message=null)
 
 executeRedirect (string $url, int $time=1, string $message=null)
 
 addActionFilter (&$filter)
 
getDB ()
 
 _setupTextFilter ()
 
 _processFilter ()
 
 _processPostFilter ()
 
 _processPreload ( $path)
 
_createPermissionManager ()
 
_createRoleManager ()
 

Data Fields

 $_mAdminModeFlag = false
 
 $_mStrategy = null
 
 $mDialogMode = false
 
 $mCheckLogin = null
 
 $mLogout = null
 
 $mCreateLanguageManager = null
 
 $mSetBlockCachePolicy = null
 
 $mActiveModules = null
 
 $mSetModuleCachePolicy = null
 
 $mGetLanguageName = null
 
 $mSetupDebugger = null
 
 $mDebugger
 
 $_mNotifyRedirectToUser = null
 
 $mLogger = null
 
- Data Fields inherited from XCube_Controller
 $mRoot
 
 $_mBlockChain = []
 
 $_mFilterChain = []
 
 $_mLoadedFilterNames = []
 
 $mDB
 
 $mLocale
 
 $mLanguage
 
 $mSetupUser = null
 
 $mExecute = null
 
 $mSetupTextFilter = null
 

Protected Member Functions

 _loadInterfaceFiles ()
 

Detailed Description

This class is a virtual controller that ensures compatibility with XOOPS 2.0.x.

[NOTICE] XOOPS 2.0.x can switch to public mode and control panel mode. This controller emulates its process by using STATE. But, we may lose flexible setup with this implementation. Now, we are investigating the influence.

[TODO] XCube_Controller keeps a process that set up instances of some legacy classes, yet. We should move its process to this controller.

Definition at line 50 of file Legacy_Controller.class.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Reimplemented from XCube_Controller.

Definition at line 116 of file Legacy_Controller.class.php.

Member Function Documentation

◆ _createContext()

& _createContext ( )

Creates the context object to initial the root object, and returns it.

Returns
XCube_HttpContext

Reimplemented from XCube_Controller.

Definition at line 1412 of file Legacy_Controller.class.php.

◆ _createDelegateManager()

& _createDelegateManager ( )
Returns
XCube_DelegateManager

Reimplemented from XCube_Controller.

Definition at line 996 of file Legacy_Controller.class.php.

◆ _createLanguageManager()

& _createLanguageManager ( $language)

Factory for the language manager

At first, this member function delegates to get an instance of LanguageManager. If it can't get it, do the following process:

@exemple 1) Try creating an instance of 'Legacy_LanguageManager_' . ucfirst($language) 2) If the class doesn't exist, try loading 'LanguageManager.class.php' in the specified language. 3) Re-try creating the instance.

If it can't create any instances, create an instance of Legacy_LanguageManager as default.

@access protected

Parameters
string$language
Returns
Legacy_LanguageManager

Definition at line 704 of file Legacy_Controller.class.php.

◆ _createServiceManager()

& _createServiceManager ( )
Returns
XCube_ServiceManager

Reimplemented from XCube_Controller.

Definition at line 1016 of file Legacy_Controller.class.php.

◆ _executeViewTheme()

_executeViewTheme ( & $resultRenderTarget)

$resultRenderTarget object The render target of content's result.

Parameters
$resultRenderTarget

Get the render-system through theme object.

<

Todo
Do not use literal directly!

Definition at line 947 of file Legacy_Controller.class.php.

◆ _getLocalTimezone()

_getLocalTimezone ( )

Definition at line 272 of file Legacy_Controller.class.php.

◆ _loadInterfaceFiles()

_loadInterfaceFiles ( )
protected

Definition at line 846 of file Legacy_Controller.class.php.

◆ _parseUrl()

_parseUrl ( )

Definition at line 468 of file Legacy_Controller.class.php.

◆ _processBlock()

_processBlock ( )

@MEMO Process of Block Fetch objects from $this->mBlockChain render the result of the object with html data, and set the result to the member property.

In this member function, the cache mechanism must be important. If the object has its own cache settings, this function loads the data from the cache instead of calling the business logic of the block.

@access protected

@MEMO Create render-target for blocks We use reset() to re-cycle this object in the foreach loop.

Reimplemented from XCube_Controller.

Definition at line 383 of file Legacy_Controller.class.php.

◆ _processHostAbstractLayer()

_processHostAbstractLayer ( )

IIS

Note
IIS does not set REQUEST_URI. This system defines it. But...
Backwards compatibility ! The old system depend on this setting. We have to confirm it and modify!

Definition at line 555 of file Legacy_Controller.class.php.

◆ _processModule()

_processModule ( )

Notify that the current user is accessing a non-activated module controller

Definition at line 524 of file Legacy_Controller.class.php.

◆ _processModulePreload()

_processModulePreload ( $dirname)

Definition at line 798 of file Legacy_Controller.class.php.

◆ _processPreBlockFilter()

_processPreBlockFilter ( )

Calls the preBlockFilter() member function of action filters which have been loaded to the list of the controller.

@access protected

Reimplemented from XCube_Controller.

Definition at line 792 of file Legacy_Controller.class.php.

◆ _setupBlock()

_setupBlock ( )

!FIXME.

Reimplemented from XCube_Controller.

Definition at line 366 of file Legacy_Controller.class.php.

◆ _setupConfig()

_setupConfig ( )

This member function is overridden. Loads site configuration information, and sets them as a member property.

Reimplemented from XCube_Controller.

Definition at line 741 of file Legacy_Controller.class.php.

◆ _setupDB()

_setupDB ( )

Create the instance of DataBase class, and set it to member property. @access protected

Reimplemented from XCube_Controller.

Definition at line 624 of file Legacy_Controller.class.php.

◆ _setupDebugger()

_setupDebugger ( )

Set debugger object to member property.

Returns
void

Definition at line 775 of file Legacy_Controller.class.php.

◆ _setupEnvironment()

_setupEnvironment ( )

This member function is overridden. Set up the controller and the environment.

Reimplemented from XCube_Controller.

Definition at line 324 of file Legacy_Controller.class.php.

◆ _setupErrorHandler()

_setupErrorHandler ( )

Definition at line 616 of file Legacy_Controller.class.php.

◆ _setupFilterChain()

_setupFilterChain ( )

@NOTICE We only set up the filters that we have decided to register. It's not flexible. It's not the fixed style.

@MEMO For testing, you can use the autoload plugin by writing a parameter in site_custom.ini.php

site_custom.ini.php: [Legacy] AutoPreload = 1

Reimplemented from XCube_Controller.

Definition at line 361 of file Legacy_Controller.class.php.

◆ _setupLanguage()

_setupLanguage ( )

Create an instance of Legacy_LanguageManager by the specified language, and set it to member properties.

@Notice Now, this member function sets a string to the member property without language manager.

Reimplemented from XCube_Controller.

Definition at line 655 of file Legacy_Controller.class.php.

◆ _setupLogger()

_setupLogger ( )

Definition at line 258 of file Legacy_Controller.class.php.

◆ _setupScript()

_setupScript ( )

Definition at line 764 of file Legacy_Controller.class.php.

◆ _setupSession()

_setupSession ( )

This member function is overridden. Set up the session manager, then start the session.

@access protected

Returns
void

Reimplemented from XCube_Controller.

Definition at line 834 of file Legacy_Controller.class.php.

◆ _setupUser()

_setupUser ( )

Sets a main object to the root object. In other words, it restores the main object of the session or similar.

Reimplemented from XCube_Controller.

Definition at line 601 of file Legacy_Controller.class.php.

◆ cacheRenderTarget()

cacheRenderTarget ( $filepath,
& $renderTarget )

Save the content of $renderTarget to $filepath.

Parameters
string$filepatha file path of the cache file.
$renderTarget
Returns
bool success or failure.

Definition at line 1386 of file Legacy_Controller.class.php.

◆ checkLogin()

checkLogin ( )

Check the login request through the delegates and set XoopsObject to member property if the connection is successful.

@access public

Definition at line 1035 of file Legacy_Controller.class.php.

◆ executeCommon()

executeCommon ( )

@access public

Reimplemented from XCube_Controller.

Definition at line 186 of file Legacy_Controller.class.php.

◆ executeCommonSubset()

executeCommonSubset ( bool $connectdb = true)

Subset of executeCommon() Method It will be used when process starts with $xoopsOption['nocommon'] and This process requires connecting XOOPS Database or LEGACY constant values But it won't do any other initial settings (e.g. Session start, Permission handling)

@access public

Parameters
bool$connectdbset false if you don't want to connect XOOPS Database

Definition at line 248 of file Legacy_Controller.class.php.

◆ executeHeader()

executeHeader ( )

Usually this member function is called after executeCommon(). But, some bases don't call this. Therefore, the page controller type base does not have to write the necessary code here. For example, this is good to call blocks.

@Todo Now, It's done to run admin panel.

We changed a render-system class in a pure drawing system. Therefore, a controller should not be required for compatibility.

Version
2.3.0 Gigamaster removed old version process in XCL2020/PHP7.

cache check

Checks whether the cache file exists.

Checks whether the active cache file exists. If it's OK, load cache and do display.

Version
2.3.0 Gigamaster //$renderTarget->setResult($this->loadCache($filepath));

Reimplemented from XCube_Controller.

Definition at line 855 of file Legacy_Controller.class.php.

◆ executeRedirect()

executeRedirect ( $url,
$time = 1,
$message = null,
$addRedirect = true )

This member function works to redirect as well as redirect_header(). But, this member function handles raw values which hasn't been converted by htmlspecialchars(). Therefore, if user calls this function with the wrong value, some problems may be raised. If you can't understand the difference, do not use this function but redirect_header().

Parameters
string$urlredirect URL. Don't use user's variables or request.
int$timewaiting time (sec)
string | null$messageThis string doesn't include tags.
Todo
Change this function to delegate.
Remarks
This method encodes $url and $message directly without its template, to share the template with old function.

Definition at line 1201 of file Legacy_Controller.class.php.

◆ executeView()

executeView ( )

Executes the view logic. This member function is overridden.

@access public

Cache Control

Reimplemented from XCube_Controller.

Definition at line 904 of file Legacy_Controller.class.php.

◆ existActiveCacheFile()

existActiveCacheFile ( $filepath,
$cachetime )

Gets a value indicating wheter a cache file keeps life time. If $cachetime is 0 or the specific cache file doesn't exist, gets false.

Parameters
string$filepatha file path of the specific cache file.
int$cachetimecache active duration. (Sec)
Returns
bool

Definition at line 1367 of file Legacy_Controller.class.php.

◆ getDialogMode()

getDialogMode ( )

Return dialog mode flag.

Returns
bool

Definition at line 1168 of file Legacy_Controller.class.php.

◆ getHelpViewUrl()

getHelpViewUrl ( & $module)

Gets URL of help viewer by this controller.

Parameters
XoopsModule$module
Returns
string absolute URL

Definition at line 1444 of file Legacy_Controller.class.php.

◆ getLogger()

& getLogger ( )

Definition at line 267 of file Legacy_Controller.class.php.

◆ getPreferenceEditUrl()

getPreferenceEditUrl ( & $module)

Gets URL of preference editor by this controller.

Parameters
XoopsModule$module
Returns
string absolute URL

Definition at line 1429 of file Legacy_Controller.class.php.

◆ getVirtualCurrentModule()

& getVirtualCurrentModule ( )

Return current module object. But, it's decided by the rules of the state. Note that Preferences, Help and some other views return the specified module by dirname. This is useful for controlling a theme.

Returns
XoopsModule

Definition at line 1181 of file Legacy_Controller.class.php.

◆ isEnableCacheFeature()

isEnableCacheFeature ( )

Gets a value indicating whether the controller can use a cache mechanism.

Returns
bool

Definition at line 1354 of file Legacy_Controller.class.php.

◆ loadCache()

loadCache ( $filepath)

Loads $filepath and gets the content of the file.

Parameters
$filepath
Returns
string the content or null.

Definition at line 1403 of file Legacy_Controller.class.php.

◆ logout()

logout ( )

The current user logout.

@access public

Definition at line 1096 of file Legacy_Controller.class.php.

◆ prepare()

prepare ( & $root)

This member function is overridden. The subclass implements the initialization process that sets up the final root object.

Parameters
XCube_Root$root

Reimplemented from XCube_Controller.

Definition at line 149 of file Legacy_Controller.class.php.

◆ setDialogMode()

setDialogMode ( $flag)

Set bool flag to dialog mode flag. If you set true, executeView() will use Legacy_DialogRenderTarget class as render target.

Parameters
bool$flag

Definition at line 1159 of file Legacy_Controller.class.php.

◆ setStrategy()

setStrategy ( & $strategy)

âš  CAUTION âš  This method has a very specific task. After executeCommon, this method changes the state and resets the property. It depends on the steps of XCube_Controller.

Parameters
Legacy_AbstractControllerStrategy$strategy

Definition at line 1139 of file Legacy_Controller.class.php.

◆ setupModuleContext()

setupModuleContext ( $dirname = null)

Definition at line 490 of file Legacy_Controller.class.php.

◆ switchStateCompulsory()

switchStateCompulsory ( & $strategy)
Parameters
$strategy
See also
setStrategy()
Deprecated

Definition at line 1126 of file Legacy_Controller.class.php.

Field Documentation

◆ $_mAdminModeFlag

$_mAdminModeFlag = false

Definition at line 52 of file Legacy_Controller.class.php.

◆ $_mNotifyRedirectToUser

$_mNotifyRedirectToUser = null

Definition at line 109 of file Legacy_Controller.class.php.

◆ $_mStrategy

$_mStrategy = null

Definition at line 54 of file Legacy_Controller.class.php.

◆ $mActiveModules

$mActiveModules = null

Definition at line 81 of file Legacy_Controller.class.php.

◆ $mCheckLogin

$mCheckLogin = null

Definition at line 61 of file Legacy_Controller.class.php.

◆ $mCreateLanguageManager

$mCreateLanguageManager = null

Definition at line 71 of file Legacy_Controller.class.php.

◆ $mDebugger

$mDebugger

Definition at line 101 of file Legacy_Controller.class.php.

◆ $mDialogMode

$mDialogMode = false

Definition at line 56 of file Legacy_Controller.class.php.

◆ $mGetLanguageName

$mGetLanguageName = null

Definition at line 91 of file Legacy_Controller.class.php.

◆ $mLogger

$mLogger = null

Definition at line 114 of file Legacy_Controller.class.php.

◆ $mLogout

$mLogout = null

Definition at line 66 of file Legacy_Controller.class.php.

◆ $mSetBlockCachePolicy

$mSetBlockCachePolicy = null

Definition at line 76 of file Legacy_Controller.class.php.

◆ $mSetModuleCachePolicy

$mSetModuleCachePolicy = null

Definition at line 86 of file Legacy_Controller.class.php.

◆ $mSetupDebugger

$mSetupDebugger = null

Definition at line 96 of file Legacy_Controller.class.php.


The documentation for this class was generated from the following file: