Version 4.0.13.1
This commit is contained in:
1 parent
f9e857d255
commit
c6a86f0d9b
7517 files changed
+597400
-668041
No files matched your search
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Dispatcher (Web)
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Tools
|
||||
* @since 4 Sept 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPSUtf8\Dispatcher;
|
||||
use \IPSUtf8\Output\Browser\Template;
|
||||
|
||||
/**
|
||||
* Web Dispatcher
|
||||
*/
|
||||
class Browser extends \IPSUtf8\Dispatcher
|
||||
{
|
||||
/**
|
||||
* Run
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$this->controller = ( \IPSUtf8\Request::i()->controller ) ? \IPSUtf8\Request::i()->controller : 'browser';
|
||||
|
||||
$fileLocation = \THIS_PATH . '/modules/browser/' . $this->controller . '.php';
|
||||
$classname = 'IPSUtf8\\modules\\browser\\' . $this->controller;
|
||||
|
||||
if( !file_exists( $fileLocation ) )
|
||||
{
|
||||
\IPSUtf8\Output\Browser::i()->error( "Page doesn't exist" );
|
||||
}
|
||||
|
||||
/* Run */
|
||||
$this->controllerObj = new $classname;
|
||||
if( !( $this->controllerObj instanceof \IPSUtf8\Dispatcher\Controller ) )
|
||||
{
|
||||
\IPSUtf8\Output\Browser::i()->error( "Page doesn't exist" );
|
||||
}
|
||||
|
||||
$this->controllerObj->execute();
|
||||
|
||||
/* Output */
|
||||
if ( \IPSUtf8\Request::i()->isAjax() )
|
||||
{
|
||||
\IPSUtf8\Output\Browser::i()->sendOutput( Template::blankTemplate( \IPSUtf8\Output\Browser::i()->output ), 200, 'text/html', \IPSUtf8\Output\Browser::i()->httpHeaders );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPSUtf8\Output\Browser::i()->sendOutput( Template::wrapper( \IPSUtf8\Output\Browser::i()->title, \IPSUtf8\Output\Browser::i()->output ), 200, 'text/html', \IPSUtf8\Output\Browser::i()->httpHeaders );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Init
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Dispatcher (CLI)
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Tools
|
||||
* @since 4 Sept 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPSUtf8\Dispatcher;
|
||||
|
||||
/**
|
||||
* CLI Dispatcher
|
||||
*/
|
||||
class Cli extends \IPSUtf8\Dispatcher
|
||||
{
|
||||
/**
|
||||
* Run
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$obj = new \IPSUtf8\modules\cli\cli;
|
||||
$obj->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Init
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Abstract class that Controllers should extend
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @since 18 Feb 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPSUtf8\Dispatcher;
|
||||
|
||||
/**
|
||||
* Abstract class that Controllers should extend
|
||||
*/
|
||||
abstract class Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Execute
|
||||
*
|
||||
* @param string $command The part of the query string which will be used to get the method
|
||||
* @param \IPS\Http\Url|NULL $url The base URL for this controller or NULL to calculate automatically
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
if( \IPSUtf8\Request::i()->do and \substr( \IPSUtf8\Request::i()->do, 0, 1 ) !== '_' )
|
||||
{
|
||||
$method = ( \IPSUtf8\Request::i()->do and preg_match( '/^[a-zA-Z\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', \IPSUtf8\Request::i()->do ) ) ? \IPSUtf8\Request::i()->do : NULL;
|
||||
|
||||
if ( $method !== NULL AND method_exists( $this, $method ) )
|
||||
{
|
||||
call_user_func( array( $this, $method ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPSUtf8\Output\Browser::i()->error( "Page not found" );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->manage();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Dispatcher
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Tools
|
||||
* @since 4 Sept 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPSUtf8;
|
||||
|
||||
/**
|
||||
* Dispatcher
|
||||
*/
|
||||
abstract class Dispatcher
|
||||
{
|
||||
/**
|
||||
* @brief Singleton Instance
|
||||
*/
|
||||
protected static $instance = NULL;
|
||||
|
||||
/**
|
||||
* @brief Controller
|
||||
*/
|
||||
public $controller = 'browser';
|
||||
|
||||
/**
|
||||
* @brief Controller
|
||||
*/
|
||||
public $controllerObj = NULL;
|
||||
|
||||
/**
|
||||
* Get instance
|
||||
*
|
||||
* @return \IPS\Dispatcher
|
||||
*/
|
||||
public static function i()
|
||||
{
|
||||
if( self::$instance === NULL )
|
||||
{
|
||||
$classname = get_called_class();
|
||||
if ( $classname === 'IPSUtf8\Dispatcher' )
|
||||
{
|
||||
self::$instance = new \IPSUtf8\Dispatcher\Browser;
|
||||
}
|
||||
else
|
||||
{
|
||||
self::$instance = new $classname;
|
||||
}
|
||||
|
||||
self::$instance->init();
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the dispatcher
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Init
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Whitespace-only changes.
Reference in new issue
Block a user