Version 4.1.2
This commit is contained in:
1 parent
3ba79295ee
commit
28bd025b35
1131 files changed
+63658
-20579
No files matched your search
@@ -99,7 +99,7 @@ class _Theme extends \IPS\cms\Theme
|
||||
|
||||
foreach( new \DirectoryIterator( $path . '/' . $group->getFilename() ) as $file )
|
||||
{
|
||||
if ( $file->isDot() || mb_substr( $file->getFilename(), -6 ) !== '.phtml')
|
||||
if ( $file->isDot() || ( mb_substr( $file->getFilename(), -6 ) !== '.phtml' and mb_substr( $file->getFilename(), -3 ) !== '.js' and mb_substr( $file->getFilename(), -4 ) !== '.css' ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ class _Theme extends \IPS\cms\Theme
|
||||
$html = file_get_contents( $path . '/' . $group->getFilename() . '/' . $file->getFilename() );
|
||||
|
||||
/* Parse the header tag */
|
||||
preg_match( '/^<ips:template parameters="(.+?)?"([^>]+?)>(\r\n?|\n)/', $html, $params );
|
||||
preg_match( '/^<ips:template parameters="([^"]+?)?"([^>]+?)>(\r\n?|\n)/', $html, $params );
|
||||
|
||||
/* Strip it */
|
||||
$html = ( isset($params[0]) ) ? str_replace( $params[0], '', $html ) : $html;
|
||||
@@ -117,7 +117,7 @@ class _Theme extends \IPS\cms\Theme
|
||||
|
||||
if ( isset( $params[2] ) and mb_stristr( $params[2], 'original_group' ) )
|
||||
{
|
||||
preg_match( '#original_group="(.+?)"#', $params[2], $submatches );
|
||||
preg_match( '#original_group="(.+?)?"#', $params[2], $submatches );
|
||||
|
||||
if ( isset( $submatches[1] ) )
|
||||
{
|
||||
@@ -133,7 +133,7 @@ class _Theme extends \IPS\cms\Theme
|
||||
|
||||
if ( isset( $templates[ $key ] ) )
|
||||
{
|
||||
if ( md5( trim( $templates[ $key ]['template_content'] ) ) == md5( trim( $html ) ) )
|
||||
if ( md5( trim( $templates[ $key ]['template_content'] ) ) == md5( trim( $html ) ) and 1==2 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -144,8 +144,9 @@ class _Theme extends \IPS\cms\Theme
|
||||
{
|
||||
$added = TRUE;
|
||||
\IPS\Db::i()->update( 'cms_templates', array(
|
||||
'template_content' => $html,
|
||||
'template_params' => ( isset($params[1]) ) ? $params[1] : '',
|
||||
'template_content' => $html,
|
||||
'template_params' => ( isset($params[1]) ) ? $params[1] : '',
|
||||
'template_file_object' => NULL
|
||||
), array( 'template_id=?', $templates[ $key ]['template_id'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,7 +256,7 @@ class _Theme extends \IPS\Theme
|
||||
}
|
||||
else
|
||||
{
|
||||
@chmod( $path . '/' . $template['template_location'] . '/' . $template['template_group'] . '/' . $fileName, 0777 );
|
||||
@chmod( $path . '/' . $template['template_location'] . '/' . $template['template_group'] . '/' . $fileName, \IPS\IPS_FILE_PERMISSION );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -280,7 +280,7 @@ class _Theme extends \IPS\Theme
|
||||
$where = array();
|
||||
$templates = array();
|
||||
|
||||
if ( ( \IPS\IN_DEV or \IPS\Theme::designersModeEnabled() ) AND ! ( $returnType & static::RETURN_DATABASE_ONLY ) )
|
||||
if ( ( \IPS\IN_DEV or \IPS\Theme::designersModeEnabled() ) AND ! ( $returnType ^ static::RETURN_DATABASE_ONLY ) )
|
||||
{
|
||||
$fixedLocations = array( 'admin', 'front', 'global' );
|
||||
$results = array();
|
||||
@@ -342,7 +342,7 @@ class _Theme extends \IPS\Theme
|
||||
|
||||
$contents = file_get_contents( static::_getHtmlPath( 'cms', $location->getFilename(), $file->getFilename() ) . '/' . $template->getFilename() );
|
||||
$key = \IPS\cms\Theme\Template::extractDataFromTag( $contents, 'key' );
|
||||
$key = $key ? $key : \IPS\Http\Url::seoTitle( $title );
|
||||
$key = $key ? $key : \IPS\Http\Url::seoTitle( $file->getFilename() . '_' . $title );
|
||||
$ogroup = \IPS\cms\Theme\Template::extractDataFromTag( $contents, 'original_group' );
|
||||
$params = \IPS\cms\Theme\Template::extractParamsFromTag( $contents );
|
||||
$container = NULL;
|
||||
|
||||
Reference in new issue
Block a user