Version 5.0.13
This commit is contained in:
1 parent
b89858b2ff
commit
5efe744c5f
1407 files changed
+69690
-30177
No files matched your search
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use IPS\Output;
|
||||
use IPS\Output\Javascript;
|
||||
use IPS\Request;
|
||||
|
||||
define('REPORT_EXCEPTIONS', TRUE);
|
||||
require_once '../../../../init.php';
|
||||
|
||||
$content = <<<JS
|
||||
;(() => {
|
||||
"use strict";
|
||||
Debug.log( "No component supplied in the request." );
|
||||
})();
|
||||
JS;
|
||||
|
||||
|
||||
if ( isset( Request::i()->component ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
$content = Javascript::generateWebComponent( Request::i()->component );
|
||||
}
|
||||
catch ( Exception $e )
|
||||
{
|
||||
$encodedComponent = json_encode( Request::i()->component );
|
||||
$content = <<<JS
|
||||
;(() => {
|
||||
"use strict";
|
||||
Debug.log( "The source file for the component " + {$encodedComponent} + " could not be found." );
|
||||
})();
|
||||
JS;
|
||||
}
|
||||
}
|
||||
|
||||
$cacheHeaders = ( \IPS\IN_DEV ) ? Output::getNoCacheHeaders() : Output::getCacheHeaders( time(), 360 );
|
||||
|
||||
Output::i()->sendOutput( $content, 200, 'text/javascript', $cacheHeaders );
|
||||
Reference in new issue
Block a user