mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-25 23:05:25 +09:00
Merge branch 'rhymix:master' into master
This commit is contained in:
commit
d327bb1926
43 changed files with 588 additions and 221 deletions
|
|
@ -163,7 +163,7 @@ class Context
|
|||
{
|
||||
// Create a singleton instance and initialize static properties.
|
||||
self::$_instance = new Context();
|
||||
self::$_oFrontEndFileHandler = self::$_instance->oFrontEndFileHandler = new FrontEndFileHandler();
|
||||
self::$_oFrontEndFileHandler = self::$_instance->oFrontEndFileHandler = FrontEndFileHandler::getInstance();
|
||||
self::$_user_vars = self::$_user_vars ?: new stdClass;
|
||||
}
|
||||
return self::$_instance;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ class DisplayHandler extends Handler
|
|||
{
|
||||
public static $response_size = 0;
|
||||
public static $debug_printed = 0;
|
||||
public $content_size = 0;
|
||||
public $handler = NULL;
|
||||
|
||||
/**
|
||||
|
|
@ -140,12 +139,15 @@ class DisplayHandler extends Handler
|
|||
$buff = ltrim($buff, "\n\r\t\v\x00\x20\u{FEFF}");
|
||||
|
||||
// call a trigger after display
|
||||
self::$response_size = $this->content_size = strlen($output);
|
||||
ModuleHandler::triggerCall('display', 'after', $output);
|
||||
|
||||
// Measure the response size.
|
||||
self::$response_size = strlen((string)$output);
|
||||
|
||||
// Output buffered content only if the current page is HTML.
|
||||
if ($handler instanceof HTMLDisplayHandler)
|
||||
{
|
||||
self::$response_size += strlen($buff);
|
||||
echo $buff;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,13 +53,38 @@ class FrontEndFileHandler extends Handler
|
|||
*/
|
||||
public $jsBodyMapIndex = array();
|
||||
|
||||
/**
|
||||
* Logging
|
||||
*/
|
||||
protected $_log_enabled = false;
|
||||
protected $_log_entries = [];
|
||||
|
||||
/**
|
||||
* Singleton
|
||||
*/
|
||||
protected static $_instance = null;
|
||||
|
||||
/**
|
||||
* Get singleton instance
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public static function getInstance(): self
|
||||
{
|
||||
if (self::$_instance === null)
|
||||
{
|
||||
self::$_instance = new self();
|
||||
}
|
||||
return self::$_instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check SSL
|
||||
*
|
||||
* @return bool If using ssl returns true, otherwise returns false.
|
||||
* @deprecated
|
||||
*/
|
||||
public function isSsl()
|
||||
public static function isSsl()
|
||||
{
|
||||
return \RX_SSL;
|
||||
}
|
||||
|
|
@ -92,6 +117,10 @@ class FrontEndFileHandler extends Handler
|
|||
{
|
||||
$args = array($args);
|
||||
}
|
||||
if ($this->_log_enabled)
|
||||
{
|
||||
$this->_log_entries[] = $args;
|
||||
}
|
||||
|
||||
// Replace obsolete paths with current paths.
|
||||
$args[0] = preg_replace(array_keys(HTMLDisplayHandler::$replacements), array_values(HTMLDisplayHandler::$replacements), $args[0]);
|
||||
|
|
@ -252,6 +281,26 @@ class FrontEndFileHandler extends Handler
|
|||
return $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start logging.
|
||||
*/
|
||||
public function startLog()
|
||||
{
|
||||
$this->_log_enabled = true;
|
||||
$this->_log_entries = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* End logging and return the log entries.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function endLog(): array
|
||||
{
|
||||
$this->_log_enabled = false;
|
||||
return $this->_log_entries;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process CSS and JS file
|
||||
*
|
||||
|
|
|
|||
|
|
@ -848,15 +848,10 @@ class ModuleHandler extends Handler
|
|||
$seo_title = config('seo.subpage_title') ?: '$SITE_TITLE - $SUBPAGE_TITLE';
|
||||
}
|
||||
$seo_title = Context::replaceUserLang($seo_title);
|
||||
$subpage_title = $module_info->browser_title;
|
||||
if (in_array($module_info->module, ['member']))
|
||||
{
|
||||
$subpage_title = '';
|
||||
}
|
||||
Context::setBrowserTitle($seo_title, array(
|
||||
'site_title' => Context::getSiteTitle(),
|
||||
'site_subtitle' => Context::getSiteSubtitle(),
|
||||
'subpage_title' => $subpage_title,
|
||||
'subpage_title' => $module_info->browser_title,
|
||||
'page' => Context::get('page') ?: 1,
|
||||
));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue