Version 4.7.13
This commit is contained in:
1 parent
fd22d99e69
commit
7124a02564
954 files changed
+29277
-59308
No files matched your search
@@ -66,6 +66,18 @@ class _themes extends \IPS\Node\Controller
|
||||
*/
|
||||
protected function manage()
|
||||
{
|
||||
if ( !\IPS\Request::i()->isAjax() AND \IPS\IPS::canManageResources() )
|
||||
{
|
||||
foreach( \IPS\Theme::themes() as $app )
|
||||
{
|
||||
if( $app->marketplace_id )
|
||||
{
|
||||
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate('marketplace')->removalBanner(FALSE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( \IPS\Theme::designersModeEnabled() and ! isset( \IPS\Request::i()->root ) )
|
||||
{
|
||||
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->message( \IPS\Member::loggedIn()->language()->addToStack('theme_designer_mode_warning'), 'information', NULL, FALSE );
|
||||
@@ -1100,7 +1112,7 @@ class _themes extends \IPS\Node\Controller
|
||||
}
|
||||
|
||||
\IPS\Output::i()->output = new \IPS\Helpers\MultipleRedirect(
|
||||
\IPS\Http\Url::internal( 'app=core&module=customization&controller=themes&do=import' )->setQueryString( array( 'file' => \IPS\Request::i()->file, 'key' => \IPS\Request::i()->key, 'id' => \IPS\Request::i()->id ) )->csrf(),
|
||||
\IPS\Http\Url::internal( 'app=core&module=customization&controller=themes&do=import' )->setQueryString( array( 'file' => \IPS\Request::i()->file, 'key' => \IPS\Request::i()->key, 'id' => \IPS\Request::i()->id, 'manual' => \IPS\Request::i()->manual ) )->csrf(),
|
||||
function( $data )
|
||||
{
|
||||
$set = \IPS\Theme::load( \IPS\Request::i()->id );
|
||||
@@ -1124,6 +1136,13 @@ class _themes extends \IPS\Node\Controller
|
||||
if ( !\is_array( $data ) )
|
||||
{
|
||||
$_SESSION['theme_import'] = array( 'css' => array(), 'isNewSet' => false );
|
||||
|
||||
/* Remove marketplace link */
|
||||
if( \IPS\Theme::load( \IPS\Request::i()->id )->marketplace_id AND \IPS\Request::i()->manual )
|
||||
{
|
||||
\IPS\Theme::load( \IPS\Request::i()->id )->marketplace_id = NULL;
|
||||
\IPS\Theme::load( \IPS\Request::i()->id )->save();
|
||||
}
|
||||
|
||||
/* Save snapshot */
|
||||
\IPS\Theme::load( \IPS\Request::i()->id )->saveHistorySnapshot();
|
||||
@@ -1859,11 +1878,6 @@ class _themes extends \IPS\Node\Controller
|
||||
|
||||
$themeSet = \IPS\Theme::load( $id );
|
||||
$apps = array();
|
||||
|
||||
if( $themeSet->marketplace_id )
|
||||
{
|
||||
\IPS\Output::i()->error( 'app_upload_marketplace_only', '2C163/K', 403, '' );
|
||||
}
|
||||
|
||||
foreach( \IPS\Application::applications() as $key => $data )
|
||||
{
|
||||
@@ -1872,6 +1886,11 @@ class _themes extends \IPS\Node\Controller
|
||||
}
|
||||
|
||||
$form = new \IPS\Helpers\Form( 'form', 'theme_set_import_button' );
|
||||
if( $themeSet->marketplace_id )
|
||||
{
|
||||
$form->addMessage( 'marketplace_resource_manual_upgrade', 'ipsMessage ipsMessage_info' );
|
||||
}
|
||||
$form->addMessage('themes_manual_install_warning');
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Upload( 'core_theme_set_new_import', NULL, FALSE, array( 'allowedFileTypes' => array( 'xml' ), 'temporary' => TRUE ), NULL, NULL, NULL, 'core_theme_set_new_import' ) );
|
||||
|
||||
@@ -1882,7 +1901,7 @@ class _themes extends \IPS\Node\Controller
|
||||
move_uploaded_file( $values['core_theme_set_new_import'], $tempFile );
|
||||
|
||||
/* Initate a redirector */
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=customization&controller=themes&do=import' )->setQueryString( array( 'file' => $tempFile, 'key' => md5_file( $tempFile ), 'id' => \IPS\Request::i()->id) )->csrf() );
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=customization&controller=themes&do=import' )->setQueryString( array( 'file' => $tempFile, 'key' => md5_file( $tempFile ), 'id' => \IPS\Request::i()->id, 'manual' => 1 ) )->csrf() );
|
||||
}
|
||||
|
||||
/* Display */
|
||||
@@ -2610,6 +2629,12 @@ class _themes extends \IPS\Node\Controller
|
||||
|
||||
/* Extra template only variables */
|
||||
$save['attributes'] = \IPS\Request::i()->$attributesName;
|
||||
|
||||
/* This is likely a customization of a core CSS file which was allowed previously, but now is not. So let's inform the user it cannot be saved */
|
||||
if ( $save['app'] === 'core' and $save['location'] === 'global' )
|
||||
{
|
||||
\IPS\Output::i()->error( 'cant_save_global_css_changes_now_sorry', '3C163/Z', 500, '' );
|
||||
}
|
||||
|
||||
$newId = \IPS\Theme::load( $save['set_id'] )->saveCss( $save );
|
||||
}
|
||||
@@ -2992,26 +3017,23 @@ class _themes extends \IPS\Node\Controller
|
||||
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
if ( \IPS\Request::i()->isAjax() )
|
||||
/* Test the syntax */
|
||||
$errors = [];
|
||||
foreach( [ 'header', 'footer', 'css' ] as $key )
|
||||
{
|
||||
/* Test the syntax */
|
||||
$errors = [];
|
||||
foreach( [ 'header', 'footer', 'css' ] as $key )
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
\IPS\Theme::checkTemplateSyntax( $values['theme_simple_' . $key ] );
|
||||
}
|
||||
catch( \LogicException $e )
|
||||
{
|
||||
$errors[] = \IPS\Member::loggedIn()->language()->addToStack( 'theme_error_in_template', NULL, [ 'sprintf' => [ \IPS\Member::loggedIn()->language()->get('theme_simple_' . $key . '_tab') ] ] );
|
||||
}
|
||||
\IPS\Theme::checkTemplateSyntax( $values['theme_simple_' . $key ] );
|
||||
}
|
||||
catch( \LogicException $e )
|
||||
{
|
||||
$errors[] = \IPS\Member::loggedIn()->language()->addToStack( 'theme_error_in_template', NULL, [ 'sprintf' => [ \IPS\Member::loggedIn()->language()->get('theme_simple_' . $key . '_tab') ] ] );
|
||||
}
|
||||
}
|
||||
|
||||
if ( \count( $errors ) )
|
||||
{
|
||||
\IPS\Output::i()->error( implode( ". ", $errors ), '3C163/I', 500, '' );
|
||||
}
|
||||
if ( \count( $errors ) )
|
||||
{
|
||||
\IPS\Output::i()->error( implode( ". ", $errors ), '3C163/I', 500, '' );
|
||||
}
|
||||
|
||||
$themeSet->custom_header = $values['theme_simple_header'];
|
||||
@@ -3144,7 +3166,7 @@ class _themes extends \IPS\Node\Controller
|
||||
{
|
||||
foreach ( $templateNames[$app] as $location => $items )
|
||||
{
|
||||
if ( $location === 'front' )
|
||||
if ( $location === 'front' or $location === 'global' )
|
||||
{
|
||||
foreach ( $templateNames[$app][$location] as $path => $items )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user