Version 4.6.0
This commit is contained in:
1 parent
f79dcf067a
commit
517a5e1f70
2036 files changed
+110041
-26162
No files matched your search
@@ -546,7 +546,7 @@ class _themes extends \IPS\Node\Controller
|
||||
}
|
||||
|
||||
/* Start importing */
|
||||
$data = array( 'buildingDesignersFiles' => true, 'toBuild' => $toBuild, 'extensions' => $extensions, 'totalItems' => \count( array_keys( $toBuild ) ) + \count( array_keys( $extensions ) ), 'totalDone' => 0, 'extra' => array() );
|
||||
$data = array( 'buildingDesignersFiles' => true, 'toBuild' => $toBuild, 'extensions' => $extensions, 'totalItems' => \count( array_keys( $toBuild ) ) * 3 + \count( array_keys( $extensions ) ), 'totalDone' => 0, 'extra' => array() );
|
||||
|
||||
return array( $data, \IPS\Member::loggedIn()->language()->addToStack('theme_dm_building') );
|
||||
}
|
||||
@@ -664,7 +664,7 @@ class _themes extends \IPS\Node\Controller
|
||||
$table->parsers = array(
|
||||
'resource_data' => function( $val, $row ) use ($set)
|
||||
{
|
||||
if ( \in_array( mb_substr( $row['resource_name'], mb_strrpos( $row['resource_name'], '.' ) + 1 ), array_merge( \IPS\Image::$imageExtensions, array( 'svg' ) ) ) )
|
||||
if ( \in_array( mb_substr( $row['resource_name'], mb_strrpos( $row['resource_name'], '.' ) + 1 ), array_merge( \IPS\Image::supportedExtensions(), array( 'svg' ) ) ) )
|
||||
{
|
||||
$row['resource_filename'] = $set->resource( ltrim( $row['resource_path'], '/' ) . $row['resource_name'], $row['resource_app'], $row['resource_location'] );
|
||||
}
|
||||
@@ -674,7 +674,7 @@ class _themes extends \IPS\Node\Controller
|
||||
'resource_name' => function( $val, $row ) use ($set)
|
||||
{
|
||||
|
||||
if ( \in_array( mb_substr( $row['resource_name'], mb_strrpos( $row['resource_name'], '.' ) + 1 ), array_merge( \IPS\Image::$imageExtensions, array( 'svg' ) ) ) )
|
||||
if ( \in_array( mb_substr( $row['resource_name'], mb_strrpos( $row['resource_name'], '.' ) + 1 ), array_merge( \IPS\Image::supportedExtensions(), array( 'svg' ) ) ) )
|
||||
{
|
||||
$row['resource_filename'] = $set->resource( ltrim( $row['resource_path'], '/' ) . $row['resource_name'], $row['resource_app'], $row['resource_location'] );
|
||||
}
|
||||
@@ -864,7 +864,7 @@ class _themes extends \IPS\Node\Controller
|
||||
\IPS\Member::loggedIn()->language()->words['core_theme_resource_name_choice_o_filename_desc'] = sprintf( \IPS\Member::loggedIn()->language()->get('core_theme_resource_name_choice_o_filename_desc'), $current['resource_name'] );
|
||||
}
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Upload( 'core_theme_resource_filename', ( isset( $current['resource_filename'] ) ? \IPS\File::get( 'core_Theme', $current['resource_filename'] ) : NULL ), TRUE, array( 'obscure' => FALSE, 'maxFileSize' => 1.2, 'storageExtension' => 'core_Theme', 'storageContainer' => 'set_resources_' . $set->_id ), NULL, NULL, NULL, 'core_theme_resource_filename' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Upload( 'core_theme_resource_filename', ( isset( $current['resource_filename'] ) ? \IPS\File::get( 'core_Theme', $current['resource_filename'] ) : NULL ), TRUE, array( 'obscure' => ( $id ) ? TRUE : FALSE, 'maxFileSize' => 1.2, 'storageExtension' => 'core_Theme', 'storageContainer' => 'set_resources_' . $set->_id ), NULL, NULL, NULL, 'core_theme_resource_filename' ) );
|
||||
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
@@ -919,12 +919,14 @@ class _themes extends \IPS\Node\Controller
|
||||
/* Resource may be used in CSS */
|
||||
\IPS\File::getClass('core_Theme')->deleteContainer( 'css_built_' . $set->id );
|
||||
$set->css_map = array();
|
||||
$set->css_updated = time();
|
||||
$set->save();
|
||||
|
||||
foreach( $set->children() as $child )
|
||||
{
|
||||
\IPS\File::getClass('core_Theme')->deleteContainer( 'css_built_' . $child->id );
|
||||
$child->css_map = array();
|
||||
$child->css_updated = time();
|
||||
$child->save();
|
||||
}
|
||||
|
||||
@@ -1101,8 +1103,7 @@ class _themes extends \IPS\Node\Controller
|
||||
$masterCss = \IPS\Theme::load( \IPS\Request::i()->id )->getRawCss( null, null, null, \IPS\Theme::RETURN_BIT_NAMES, false );
|
||||
|
||||
/* Open XML file */
|
||||
$xml = new \IPS\Xml\XMLReader;
|
||||
$xml->open( \IPS\Request::i()->file );
|
||||
$xml = \IPS\Xml\XMLReader::safeOpen( \IPS\Request::i()->file );
|
||||
|
||||
if ( ! @$xml->read() )
|
||||
{
|
||||
@@ -1489,11 +1490,7 @@ class _themes extends \IPS\Node\Controller
|
||||
|
||||
$url = (string) \IPS\File::create( 'core_Theme', $name, base64_decode( $xml->readString() ) );
|
||||
|
||||
$image = \IPS\Image::create( base64_decode( $xml->readString() ) );
|
||||
$width = $image->width;
|
||||
$height = $image->height;
|
||||
|
||||
$set->saveSet( array( 'logo' => array( $type => array( 'url' => $url, 'width' => $width, 'height' => $height ) ) ) );
|
||||
$set->saveSet( array( 'logo' => array( $type => array( 'url' => $url, 'height' => $xml->getAttribute('height') ?? 100 ) ) ) );
|
||||
}
|
||||
|
||||
$xml->next();
|
||||
@@ -1528,6 +1525,9 @@ class _themes extends \IPS\Node\Controller
|
||||
\IPS\Theme::setThemeCustomized( $set->id );
|
||||
|
||||
$set->resetCacheKey();
|
||||
|
||||
/* Update children */
|
||||
$set->updateChildrenThemeSettings();
|
||||
|
||||
/* Conflicts to fix? */
|
||||
if ( \IPS\Db::i()->select( 'count(*)', 'core_theme_conflict', array( 'conflict_set_id=?', \IPS\Request::i()->id ) )->first() )
|
||||
@@ -2014,6 +2014,10 @@ class _themes extends \IPS\Node\Controller
|
||||
$xml->text( $file );
|
||||
$xml->endAttribute();
|
||||
|
||||
$xml->startAttribute('height');
|
||||
$xml->text( $data['height'] );
|
||||
$xml->endAttribute();
|
||||
|
||||
/* Get image data */
|
||||
$original = \IPS\File::get( 'core_Theme', $data['url'] );
|
||||
|
||||
@@ -2311,10 +2315,8 @@ class _themes extends \IPS\Node\Controller
|
||||
|
||||
/* Finish */
|
||||
$xml->endDocument();
|
||||
|
||||
$name = addslashes( str_replace( array( ' ', '.', ',' ), '_', \IPS\Member::loggedIn()->language()->get('core_theme_set_title_' . $themeSet->_id ) ) . '.xml' );
|
||||
|
||||
\IPS\Output::i()->sendOutput( $xml->outputMemory(), 200, 'application/xml', array( 'Content-Disposition' => \IPS\Output::getContentDisposition( 'attachment', $name ), FALSE, FALSE ) );
|
||||
|
||||
\IPS\Output::i()->sendOutput( $xml->outputMemory(), 200, 'application/xml', array( 'Content-Disposition' => \IPS\Output::getContentDisposition( 'attachment', \IPS\Member::loggedIn()->language()->get('core_theme_set_title_' . $themeSet->_id ) . " {$version}.xml" ), FALSE, FALSE ) );
|
||||
}
|
||||
|
||||
/* Display */
|
||||
@@ -3035,7 +3037,7 @@ class _themes extends \IPS\Node\Controller
|
||||
{
|
||||
$form = new \IPS\Helpers\Form;
|
||||
$form->hiddenvalues['id'] = \IPS\Request::i()->id;
|
||||
$form->add( new \IPS\Helpers\Form\Select( 'member_reset_where', '*', TRUE, array( 'options' => \IPS\Member\Group::groups( TRUE, FALSE ), 'multiple' => TRUE, 'parse' => 'normal', 'unlimited' => '*', 'unlimitedLang' => 'all' ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\CheckboxSet( 'member_reset_where', '*', TRUE, array( 'options' => \IPS\Member\Group::groups( TRUE, FALSE ), 'multiple' => TRUE, 'parse' => 'normal', 'unlimited' => '*', 'unlimitedLang' => 'all', 'impliedUnlimited' => TRUE ) ) );
|
||||
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user