Legacy_Controller Class Reference

Inherits XCube_Controller.

Inheritance diagram for Legacy_Controller:

[legend]
Collaboration diagram for Legacy_Controller:
[legend]
List of all members.

Public Member Functions

 prepare (&$root)
 executeCommon ()
 _setupEnvironment ()
 _setupFilterChain ()
 _setupBlock ()
 _processBlock ()
 _processModule ()
 _setupUser ()
 _setupDB ()
 _setupLanguage ()
_createLanguageManager ($language)
 _setupConfig ()
 _setupDebugger ()
 _processPreBlockFilter ()
 _setupSession ()
 executeHeader ()
 executeView ()
 _executeViewTheme (&$resultRenderTarget)
_createDelegateManager ()
_createServiceManager ()
 checkLogin ()
 logout ()
 switchStateCompulsory (&$strategy)
 setStrategy (&$strategy)
 setDialogMode ($flag)
 getDialogMode ()
getVirtualCurrentModule ()
 getPMInboxUrl ($uid)
 getCountUnreadPM ($uid)
 executeRedirect ($url, $time=1, $message=null)
 isEnableCacheFeature ()
 existActiveCacheFile ($filepath, $cachetime)
 cacheRenderTarget ($filepath, &$renderTarget)
 loadCache ($filepath)
_createContext ()

Detailed Description

This class is a virtual controller that has the 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 with using STATE. But, we may lose flexible setup by this implement. 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.


Member Function Documentation

Legacy_Controller::prepare ( &$  root  ) 

This member function is overridden. The sub-class implements the initialization process which sets up the root object finally.

Parameters:
XCube_Root $root

Reimplemented from XCube_Controller.

Legacy_Controller::executeCommon (  ) 

public

Reimplemented from XCube_Controller.

Legacy_Controller::_setupEnvironment (  ) 

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

Reimplemented from XCube_Controller.

Legacy_Controller::_setupFilterChain (  ) 

[NOTICE] We set up only filters that are decided to register by us. This is not flexible. This is not the style fixed.

[MEMO] For test, you can use automatic loading plug-in with writing a setting in site_custom.ini.php.

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

Reimplemented from XCube_Controller.

Legacy_Controller::_setupBlock (  ) 

FIXME.

Reimplemented from XCube_Controller.

Legacy_Controller::_processBlock (  ) 

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

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

protected

Reimplemented from XCube_Controller.

Legacy_Controller::_processModule (  ) 

Legacy_Controller::_setupUser (  ) 

Sets up a principal object to the root object. In other words, restores the principal object from session or other.

Reimplemented from XCube_Controller.

Legacy_Controller::_setupDB (  ) 

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

Reimplemented from XCube_Controller.

Legacy_Controller::_setupLanguage (  ) 

Create a 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.

& Legacy_Controller::_createLanguageManager ( language  ) 

Factory for the language manager. At first, this member function delegates to get a instance of LanguageManager. If it can't get it, do the following process:

1) Try creating a 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 a instance of Legacy_LanguageManager as default.

protected

Parameters:
string $language
Returns:
Legacy_LanguageManager

Legacy_Controller::_setupConfig (  ) 

This member function is overridden. Loads site configuration informations, and sets them to the member property.

Reimplemented from XCube_Controller.

Legacy_Controller::_setupDebugger (  ) 

Set debbuger object to member property.

Returns:
void

Legacy_Controller::_processPreBlockFilter (  ) 

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

protected

Reimplemented from XCube_Controller.

Legacy_Controller::_setupSession (  ) 

This member function is overrided. Sets up handler for session, then starts session.

Returns:
void

Reimplemented from XCube_Controller.

Legacy_Controller::executeHeader (  ) 

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

Reimplemented from XCube_Controller.

Legacy_Controller::executeView (  ) 

Executes the view logic. This member function is overridden.

public

Reimplemented from XCube_Controller.

Legacy_Controller::_executeViewTheme ( &$  resultRenderTarget  ) 

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

<

Todo:
Do not use literal directly!

& Legacy_Controller::_createDelegateManager (  ) 

Creates an instance of the delegate manager and returns it.

Returns:
XCube_DelegateManager

Reimplemented from XCube_Controller.

& Legacy_Controller::_createServiceManager (  ) 

Creates an instance of the service manager and returns it.

Returns:
XCube_ServiceManager

Reimplemented from XCube_Controller.

Legacy_Controller::checkLogin (  ) 

Check the login request through delegates, and set XoopsObject to member property if the login is success.

public

Legacy_Controller::logout (  ) 

The current user logout.

public

Legacy_Controller::switchStateCompulsory ( &$  strategy  ) 

Deprecated:
See also:
setStrategy()

Legacy_Controller::setStrategy ( &$  strategy  ) 

CAUTION!! This method has a special mission. Because this method changes state after executeCommon, this resets now property. It depends on XCube_Controller steps.

Parameters:
Legacy_AbstractControllerStrategy $strategy

Legacy_Controller::setDialogMode ( flag  ) 

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

Parameters:
$flag bool

Legacy_Controller::getDialogMode (  ) 

Return dialog mode flag.

Returns:
bool

& Legacy_Controller::getVirtualCurrentModule (  ) 

Return current module object. But, it's decided by the rules of the state. Preferences page, Help page and some pages returns the specified module by dirname. It's useful for controlling a theme.

Returns:
XoopsModule

Legacy_Controller::getPMInboxUrl ( uid  ) 

Return URL of pm inbox. This is X2 fixed feature.

Parameters:
$uid int ID of the user
Returns:
string if any functions don't return value, return null.

Legacy_Controller::getCountUnreadPM ( uid  ) 

Return counts of unread pm. This is X2 fixed feature.

Parameters:
$uid int ID of the user
Returns:
int

Legacy_Controller::executeRedirect ( url,
time = 1,
message = null 
)

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, use not this function but redirect_header().

Parameters:
string $url redirect URL. Don't use user's variables or request.
int $time waiting time (sec)
string $message This string doesn't include tags.
Todo:
We'll change this function to delegate.

Reimplemented from XCube_Controller.

Legacy_Controller::isEnableCacheFeature (  ) 

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

Returns:
bool

Legacy_Controller::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 $filepath a file path of the specific cache file.
int $cachetime cache active duration. (Sec)
Returns:
bool

Legacy_Controller::cacheRenderTarget ( filepath,
&$  renderTarget 
)

Save the content of $renderTarget to $filepath.

Parameters:
string $filepath a file path of the cache file.
XCube_RenderTarget $renderBuffer
Returns:
bool success or failure.

Legacy_Controller::loadCache ( filepath  ) 

Loads $filepath and gets the content of the file.

Returns:
string the content or null.

& Legacy_Controller::_createContext (  ) 

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

Returns:
XCube_HttpContext

Reimplemented from XCube_Controller.


The documentation for this class was generated from the following file:
Generated on Thu Nov 2 00:27:11 2006 for XOOPS Cube Legacy by  doxygen 1.5.1