mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Merge branch 'rhymix:master' into master
This commit is contained in:
commit
e5b729f8e9
152 changed files with 2348 additions and 792 deletions
|
|
@ -706,8 +706,8 @@ class Context
|
|||
*/
|
||||
public static function getFTPInfo()
|
||||
{
|
||||
$ftp_info = self::$_instance->db_info->ftp_info;
|
||||
if (!$ftp_info->ftp_user || !$ftp_info->ftp_root_path)
|
||||
$ftp_info = self::$_instance->db_info->ftp_info ?? null;
|
||||
if (empty($ftp_info->ftp_user) || empty($ftp_info->ftp_root_path))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
|
@ -2508,11 +2508,19 @@ class Context
|
|||
* Add html code before </head>
|
||||
*
|
||||
* @param string $header add html code before </head>.
|
||||
* @param bool $prepend
|
||||
* @return void
|
||||
*/
|
||||
public static function addHtmlHeader($header)
|
||||
public static function addHtmlHeader($header, bool $prepend = false)
|
||||
{
|
||||
self::$_instance->html_header .= (self::$_instance->html_header ? "\n" : '') . $header;
|
||||
if ($prepend)
|
||||
{
|
||||
self::$_instance->html_header = $header . (self::$_instance->html_header ? "\n" : '') . self::$_instance->html_header;
|
||||
}
|
||||
else
|
||||
{
|
||||
self::$_instance->html_header .= (self::$_instance->html_header ? "\n" : '') . $header;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -2594,10 +2602,19 @@ class Context
|
|||
* Add html code after <body>
|
||||
*
|
||||
* @param string $header Add html code after <body>
|
||||
* @param bool $prepend
|
||||
* @return void
|
||||
*/
|
||||
public static function addBodyHeader($header)
|
||||
public static function addBodyHeader($header, bool $prepend = false)
|
||||
{
|
||||
self::$_instance->body_header .= (self::$_instance->body_header ? "\n" : '') . $header;
|
||||
if ($prepend)
|
||||
{
|
||||
self::$_instance->body_header = $header . (self::$_instance->body_header ? "\n" : '') . self::$_instance->body_header;
|
||||
}
|
||||
else
|
||||
{
|
||||
self::$_instance->body_header .= (self::$_instance->body_header ? "\n" : '') . $header;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -2614,10 +2631,19 @@ class Context
|
|||
* Add html code before </body>
|
||||
*
|
||||
* @param string $footer Add html code before </body>
|
||||
* @param bool $prepend
|
||||
* @return void
|
||||
*/
|
||||
public static function addHtmlFooter($footer)
|
||||
public static function addHtmlFooter($footer, bool $prepend = false)
|
||||
{
|
||||
self::$_instance->html_footer .= (self::$_instance->html_footer ? "\n" : '') . $footer;
|
||||
if ($prepend)
|
||||
{
|
||||
self::$_instance->html_footer = $footer . (self::$_instance->html_footer ? "\n" : '') . self::$_instance->html_footer;
|
||||
}
|
||||
else
|
||||
{
|
||||
self::$_instance->html_footer .= (self::$_instance->html_footer ? "\n" : '') . $footer;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class DisplayHandler extends Handler
|
|||
}
|
||||
else
|
||||
{
|
||||
if($responseMethod == 'JSON' || $responseMethod == 'JS_CALLBACK' || isset($_SERVER['HTTP_X_AJAX_COMPAT']) || isset($_POST['_rx_ajax_compat']))
|
||||
if($responseMethod == 'JSON' || isset($_SERVER['HTTP_X_AJAX_COMPAT']) || isset($_POST['_rx_ajax_compat']))
|
||||
{
|
||||
self::_printJSONHeader();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,7 +136,6 @@ class HTMLDisplayHandler
|
|||
// compile if connected to the layout
|
||||
if($layout_srl > 0)
|
||||
{
|
||||
|
||||
// handle separately if the layout is faceoff
|
||||
if($layout_info && isset($layout_info->type) && $layout_info->type == 'faceoff')
|
||||
{
|
||||
|
|
@ -164,6 +163,16 @@ class HTMLDisplayHandler
|
|||
$oTemplate = new Rhymix\Framework\Template;
|
||||
$output = $oTemplate->compile($layout_path, $layout_file, $edited_layout_file);
|
||||
|
||||
// Add layout header script.
|
||||
if ($layout_srl > 0)
|
||||
{
|
||||
$part_config = ModuleModel::getModulePartConfig('layout', $layout_srl);
|
||||
if ($part_config && isset($part_config->header_script))
|
||||
{
|
||||
Context::addHtmlHeader($part_config->header_script, true);
|
||||
}
|
||||
}
|
||||
|
||||
// if popup_layout, remove admin bar.
|
||||
$realLayoutPath = FileHandler::getRealPath($layout_path);
|
||||
if(substr_compare($realLayoutPath, '/', -1) !== 0)
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ class FrontEndFileHandler extends Handler
|
|||
* <pre>
|
||||
* case js
|
||||
* $args[0]: file name
|
||||
* $args[1]: type (head | body)
|
||||
* $args[1]: type (head | body | module)
|
||||
* $args[2]: unused (previously targetIe)
|
||||
* $args[3]: index
|
||||
* case css
|
||||
|
|
@ -245,6 +245,7 @@ class FrontEndFileHandler extends Handler
|
|||
}
|
||||
else if($file->fileExtension == 'js')
|
||||
{
|
||||
$file->jstype = $media === 'module' ? $media : '';
|
||||
$file->key = sprintf('%s/%s', $file->filePath, $file->keyName);
|
||||
}
|
||||
|
||||
|
|
@ -489,7 +490,7 @@ class FrontEndFileHandler extends Handler
|
|||
$concat_filename = self::$assetdir . '/combined/' . sha1(serialize($concat_files)) . '.css';
|
||||
if (!file_exists(\RX_BASEDIR . $concat_filename) || filemtime(\RX_BASEDIR . $concat_filename) < $concat_max_timestamp)
|
||||
{
|
||||
$concat_content = Rhymix\Framework\Formatter::concatCSS($concat_files, $concat_filename);
|
||||
$concat_content = Rhymix\Framework\Formatter::concatCSS($concat_files, \RX_BASEDIR . $concat_filename);
|
||||
$concat_content = '@charset "UTF-8";' . "\n\n" . preg_replace('/@charset\s*[\'"][a-z0-9-]+[\'"];\s*/i', '', $concat_content);
|
||||
Rhymix\Framework\Storage::write(\RX_BASEDIR . $concat_filename, $concat_content);
|
||||
}
|
||||
|
|
@ -584,7 +585,8 @@ class FrontEndFileHandler extends Handler
|
|||
$concat_filename = self::$assetdir . '/combined/' . sha1(serialize($concat_files)) . '.js';
|
||||
if (!file_exists(\RX_BASEDIR . $concat_filename) || filemtime(\RX_BASEDIR . $concat_filename) < $concat_max_timestamp)
|
||||
{
|
||||
Rhymix\Framework\Storage::write(\RX_BASEDIR . $concat_filename, Rhymix\Framework\Formatter::concatJS($concat_files, $concat_filename));
|
||||
$concat_content = Rhymix\Framework\Formatter::concatJS($concat_files, \RX_BASEDIR . $concat_filename);
|
||||
Rhymix\Framework\Storage::write(\RX_BASEDIR . $concat_filename, $concat_content);
|
||||
}
|
||||
$concat_filename .= '?t=' . filemtime(\RX_BASEDIR . $concat_filename);
|
||||
$result[] = array('file' => \RX_BASEURL . $concat_filename);
|
||||
|
|
@ -602,7 +604,12 @@ class FrontEndFileHandler extends Handler
|
|||
{
|
||||
$url .= '?t=' . filemtime($file->fileFullPath);
|
||||
}
|
||||
$result[] = array('file' => $url);
|
||||
$attrs = '';
|
||||
if ($file->jstype)
|
||||
{
|
||||
$attrs = ' type="' . $file->jstype . '"';
|
||||
}
|
||||
$result[] = array('file' => $url, 'attrs' => $attrs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -624,7 +631,7 @@ class FrontEndFileHandler extends Handler
|
|||
{
|
||||
foreach ($indexedMap as $file)
|
||||
{
|
||||
if ($file->isExternalURL || !is_readable($file->fileFullPath))
|
||||
if ($file->isExternalURL || !is_readable($file->fileFullPath) || !empty($file->jstype))
|
||||
{
|
||||
$concat_key++;
|
||||
$concat_list[$concat_key][] = $file;
|
||||
|
|
|
|||
|
|
@ -268,13 +268,6 @@ class ModuleHandler extends Handler
|
|||
|
||||
// Reset layout_srl in module_info.
|
||||
$module_info->{$targetSrl} = $layoutSrl;
|
||||
|
||||
// Add layout header script.
|
||||
$part_config = ModuleModel::getModulePartConfig('layout', $layoutSrl);
|
||||
if ($part_config && isset($part_config->header_script))
|
||||
{
|
||||
Context::addHtmlHeader($part_config->header_script);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue