Version 4.1.19

This commit is contained in:
Neo committed 2025-12-19 05:38:56 -08:00
1 parent 28bd025b35
commit 2bd5025018
2674 files changed
+233518 -77766

No files matched your search

@@ -2,9 +2,9 @@
/**
* @brief streams
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @package IPS Community Suite
* @since 01 Jul 2015
* @version SVN_VERSION_NUMBER
*/
@@ -72,11 +72,35 @@ class _streams extends \IPS\Node\Controller
{
$schema = json_decode( file_get_contents( \IPS\ROOT_PATH . "/applications/core/data/schema.json" ), TRUE );
/* Get the default language strings */
if( file_exists( \IPS\ROOT_PATH . "/applications/core/data/lang.xml" ) )
{
/* Open XML file */
$dom = new \IPS\Xml\DOMDocument( '1.0', 'UTF-8' );
$dom->load( \IPS\ROOT_PATH . "/applications/core/data/lang.xml" );
$xp = new \DomXPath( $dom );
$results = $xp->query('//language/app/word[contains(@key, "stream_title_")]');
$defaultLanguages = array();
foreach( $results as $lang )
{
$defaultLanguages[ str_replace( 'stream_title_', '', $lang->getAttribute('key') ) ] = $lang->nodeValue;
}
}
foreach ( $schema['core_streams']['inserts'] as $insertData )
{
try
{
\IPS\Db::i()->replace( 'core_streams', $insertData );
$newId = \IPS\Db::i()->replace( 'core_streams', $insertData, TRUE );
$oldId = $insertData['id'];
if ( $oldId and $newId )
{
\IPS\Lang::saveCustom( 'core', "stream_title_{$newId}", $defaultLanguages[ $oldId ] );
}
}
catch( \IPS\Db\Exception $e )
{}
@@ -128,7 +152,8 @@ class _streams extends \IPS\Node\Controller
$form = new \IPS\Helpers\Form;
$form->add( new \IPS\Helpers\Form\CheckboxSet( 'all_activity_extra_stream', $currentValuesStream, FALSE, array( 'options' => $options ) ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'activity_stream_rss', \IPS\Settings::i()->activity_stream_rss ) );
if ( $values = $form->values() )
{
$toSave = array();
@@ -136,6 +161,9 @@ class _streams extends \IPS\Node\Controller
{
$toSave[ "all_activity_{$k}" ] = intval( in_array( $k, $values['all_activity_extra_stream'] ) );
}
$toSave[ 'activity_stream_rss' ] = $values['activity_stream_rss'];
$form->saveAsSettings( $toSave );
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=discovery&controller=streams' ), 'saved' );
}