Version 5.0.0 beta 8
This commit is contained in:
1 parent
54d5dcd0a0
commit
214f649f1d
483 files changed
+35354
-33568
No files matched your search
@@ -610,7 +610,7 @@ class Templates extends ActiveRecord
|
||||
*/
|
||||
public static function exportForm( bool $appPluginBuild=FALSE, array $preSelected=array() ): Form
|
||||
{
|
||||
$form = new Form( 'form', $appPluginBuild ? 'save' : 'next' );
|
||||
$form = new Form( 'form', $appPluginBuild ? 'save' : 'download' );
|
||||
if( !$appPluginBuild )
|
||||
{
|
||||
$form->addMessage( 'cms_templates_export_description', 'ipsMessage ipsMessage_information' );
|
||||
@@ -623,21 +623,17 @@ class Templates extends ActiveRecord
|
||||
|
||||
$templates = [];
|
||||
|
||||
foreach(Templates::getTemplates( Templates::RETURN_DATABASE_ONLY + Templates::RETURN_ALL ) as $template )
|
||||
foreach(Templates::getTemplates( Templates::RETURN_DATABASE_AND_IN_DEV + Templates::RETURN_ALL ) as $template )
|
||||
{
|
||||
$title = Templates::readableGroupName( $template->group );
|
||||
|
||||
if ( $template->location === 'database' )
|
||||
if( $template->location == 'database' )
|
||||
{
|
||||
$templates['database'][ $template->group ] = $title;
|
||||
}
|
||||
else if ( $template->location === 'block' )
|
||||
else
|
||||
{
|
||||
$templates['block'][ $template->key ] = $title . ' > ' . $template->title;
|
||||
}
|
||||
else if ( $template->location === 'page' )
|
||||
{
|
||||
$templates['page'][ $template->key ] = $title . ' > ' . $template->title;
|
||||
$templates[ $template->location ][ $template->key ] = $title . ' > ' . $template->title;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -737,7 +733,10 @@ class Templates extends ActiveRecord
|
||||
if ( !in_array( substr( $k, 9 ), array( 'content', 'params' ) ) )
|
||||
{
|
||||
$xml->startAttribute( $k );
|
||||
$xml->text( $v );
|
||||
if( !empty( $v ) )
|
||||
{
|
||||
$xml->text( $v );
|
||||
}
|
||||
$xml->endAttribute();
|
||||
}
|
||||
}
|
||||
@@ -857,7 +856,7 @@ class Templates extends ActiveRecord
|
||||
|
||||
$conflictKey = md5( microtime() );
|
||||
|
||||
$templates = Theme::i()->getAllTemplates( 'cms', NULL, NULL, \IPS\cms\Theme::RETURN_DATABASE_ONLY + Theme::RETURN_ALL );
|
||||
$templates = \IPS\cms\Theme::i()->getAllTemplates( 'cms', [ 'database', 'page', 'css', 'js' ], [], \IPS\cms\Theme::RETURN_DATABASE_ONLY + Theme::RETURN_ALL );
|
||||
|
||||
if ( ! @$xml->read() )
|
||||
{
|
||||
@@ -866,7 +865,7 @@ class Templates extends ActiveRecord
|
||||
$xml->read();
|
||||
while ( $xml->read() )
|
||||
{
|
||||
if ( $xml->name === 'template' )
|
||||
if ( $xml->name == 'template' )
|
||||
{
|
||||
$node = new SimpleXMLElement( $xml->readOuterXML() );
|
||||
$attrs = array();
|
||||
@@ -883,7 +882,6 @@ class Templates extends ActiveRecord
|
||||
$attrs[ $k ] = ( $tryJson ) ?: (string) $v;
|
||||
}
|
||||
|
||||
|
||||
if ( isset( $attrs['template_title'] ) and isset( $attrs['template_location'] ) and isset( $attrs['template_group'] ) )
|
||||
{
|
||||
/* Got this template? */
|
||||
|
||||
Reference in new issue
Block a user