Version 4.0.13.1

This commit is contained in:
Neo committed 2025-12-19 04:57:54 -08:00
1 parent f9e857d255
commit c6a86f0d9b
7517 files changed
+597400 -668041

No files matched your search

Whitespace-only changes.
+82
View File
@@ -0,0 +1,82 @@
<?php
/**
* @brief Return JS files
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 1 Aug 2013
* @version SVN_VERSION_NUMBER
*/
require_once '../../../../init.php';
function loadResource ($url)
{
$response = \IPS\Http\Url::external( $url )->request()->get();
if ( strpos( $response->httpHeaders['Content-Type'], 'javascript' ) !== FALSE )
{
return $response . "\n\n\n\n";
}
else
{
return '';
}
}
if ( \IPS\Request::i()->src )
{
$output = '';
foreach ( explode( ',', \IPS\Request::i()->src ) as $src )
{
if ( mb_substr( $src, -3 ) !== '.js' )
{
continue;
}
$src = str_replace( '../', '&#46;&#46;/', $src );
$exploded = explode( '/', $src );
$app = array_shift( $exploded );
$location = array_shift( $exploded );
/* Interface files are never written to remote locations and subsequently can be loaded directly from disk, which is more efficient */
if( $location == 'interface' )
{
$output .= file_get_contents( \IPS\ROOT_PATH . '/applications/' . $app . '/interface/' . implode( '/', $exploded ) ) . "\n\n\n\n";
/* jquery ui requires a special file for touch compatibility, and it must be included
after jquery ui itself. Rather than doing it manually then having to change it when jUI gets
built-in support, we'll append it automatically here */
if ( $exploded[1] == 'jquery-ui.js' )
{
$exploded[1] = 'jquery-touchpunch.js';
$output .= file_get_contents( \IPS\ROOT_PATH . '/applications/' . $app . '/interface/' . implode( '/', $exploded ) ) . "\n\n\n\n";
}
}
else
{
foreach ( \IPS\Output::i()->js( implode( '/', $exploded ), $app, $location ) as $url )
{
/* If we are in_dev, ckeditor comes from the /dev/ directory instead */
if ( \IPS\IN_DEV && $exploded[0] == 'ckeditor' && $exploded[1] == 'ckeditor.js' )
{
$url = (string)\IPS\Http\Url::internal( "applications/core/dev/ckeditor/ckeditor.js", 'none' );
}
try
{
$output .= loadResource( $url );
}
catch ( \Exception $e )
{
\IPS\Output::i()->sendOutput( '', 500, 'text/javascript' );
}
}
}
}
$cacheHeaders = ( \IPS\IN_DEV !== true AND \IPS\Theme::designersModeEnabled() !== true ) ? \IPS\Output::getCacheHeaders( time(), 360 ) : array();
\IPS\Output::i()->sendOutput( $output, 200, 'text/javascript', $cacheHeaders );
}
+48
View File
@@ -0,0 +1,48 @@
<?php
/**
* @brief Return JS language strings
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 18 Feb 2013
* @version SVN_VERSION_NUMBER
*/
require_once '../../../../init.php';
$langId = intval( \IPS\Request::i()->langId );
$_lang = array();
foreach ( \IPS\Db::i()->select( '*', 'core_sys_lang_words', array( 'lang_id=? AND word_js=?', $langId, TRUE ) ) as $row )
{
$_lang[ $row['word_key'] ] = $row['word_custom'] ?: $row['word_default'];
}
if ( \IPS\IN_DEV )
{
foreach ( \IPS\Application::applications() as $app )
{
if( \IPS\Application::appIsEnabled( $app->directory ) )
{
if ( file_exists( \IPS\ROOT_PATH . "/applications/{$app->directory}/dev/jslang.php" ) )
{
require \IPS\ROOT_PATH . "/applications/{$app->directory}/dev/jslang.php";
$_lang = array_merge( $_lang, $lang );
}
}
}
foreach ( \IPS\Plugin::plugins() as $plugin )
{
if ( file_exists( \IPS\ROOT_PATH . "/plugins/{$plugin->location}/dev/lang.php" ) )
{
require \IPS\ROOT_PATH . "/plugins/{$plugin->location}/dev/lang.php";
$_lang = array_merge( $_lang, $lang );
}
}
}
$cacheHeaders = ( \IPS\IN_DEV !== true AND \IPS\Theme::designersModeEnabled() !== true ) ? \IPS\Output::getCacheHeaders( time(), 360 ) : array();
/* Display */
\IPS\Output::i()->sendOutput( 'ips.setString( ' . json_encode( $_lang ) . ')', 200, 'text/javascript', $cacheHeaders );