Version 4.1.19
This commit is contained in:
1 parent
28bd025b35
commit
2bd5025018
2674 files changed
+233518
-77766
No files matched your search
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Core Application Class
|
||||
* @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 18 Feb 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -47,35 +47,15 @@ class _Application extends \IPS\Application
|
||||
*/
|
||||
public function get__badge()
|
||||
{
|
||||
/* Is there an update to show? */
|
||||
$badge = NULL;
|
||||
|
||||
if( $this->update_version )
|
||||
$return = parent::get__badge();
|
||||
|
||||
if ( $return )
|
||||
{
|
||||
$data = json_decode( $this->update_version, TRUE );
|
||||
|
||||
if( !empty($data['longversion']) AND $data['longversion'] > $this->long_version )
|
||||
{
|
||||
$released = NULL;
|
||||
|
||||
if( $data['released'] AND intval($data['released']) == $data['released'] AND \strlen($data['released']) == 10 )
|
||||
{
|
||||
$released = (string) \IPS\DateTime::ts( $data['released'] )->localeDate();
|
||||
}
|
||||
else if( $data['released'] )
|
||||
{
|
||||
$released = $data['released'];
|
||||
}
|
||||
|
||||
$badge = array(
|
||||
0 => 'new',
|
||||
1 => '',
|
||||
2 => \IPS\Theme::i()->getTemplate( 'global', 'core' )->updatebadge( $data['version'], \IPS\Http\Url::internal( 'app=core&module=system&controller=upgrade', 'admin' ), $released, FALSE )
|
||||
);
|
||||
}
|
||||
$availableUpgrade = $this->availableUpgrade( TRUE, FALSE );
|
||||
$return[2] = \IPS\Theme::i()->getTemplate( 'global', 'core' )->updatebadge( $availableUpgrade['version'], \IPS\Http\Url::internal( 'app=core&module=system&controller=upgrade', 'admin' ), $availableUpgrade['released'], FALSE );
|
||||
}
|
||||
|
||||
return $badge;
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -109,4 +89,139 @@ class _Application extends \IPS\Application
|
||||
$module->key == 'contact' and $controller == 'contact'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Can view page even when site is offline
|
||||
*
|
||||
* @param \IPS\Application\Module $module The module
|
||||
* @param string $controller The controller
|
||||
* @param string|NULL $do To "do" parameter
|
||||
* @return bool
|
||||
*/
|
||||
public function allowOfflineAccess( \IPS\Application\Module $module, $controller, $do )
|
||||
{
|
||||
return (
|
||||
$module->key == 'system'
|
||||
and
|
||||
(
|
||||
in_array( $controller, array(
|
||||
'login', // Because you can login when offline
|
||||
'embed', // Because the offline message can contain embedded media
|
||||
'lostpass',
|
||||
'register'
|
||||
) )
|
||||
or
|
||||
(
|
||||
$controller === 'ajax' and $do === 'states' // Makes sure address input still works within the ACP otherwise the form to turn site back online is broken
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Default front navigation
|
||||
*
|
||||
* @code
|
||||
|
||||
// Each item...
|
||||
array(
|
||||
'key' => 'Example', // The extension key
|
||||
'app' => 'core', // [Optional] The extension application. If ommitted, uses this application
|
||||
'config' => array(...), // [Optional] The configuration for the menu item
|
||||
'title' => 'SomeLangKey', // [Optional] If provided, the value of this language key will be copied to menu_item_X
|
||||
'children' => array(...), // [Optional] Array of child menu items for this item. Each has the same format.
|
||||
)
|
||||
|
||||
return array(
|
||||
'rootTabs' => array(), // These go in the top row
|
||||
'browseTabs' => array(), // These go under the Browse tab on a new install or when restoring the default configuraiton; or in the top row if installing the app later (when the Browse tab may not exist)
|
||||
'browseTabsEnd' => array(), // These go under the Browse tab after all other items on a new install or when restoring the default configuraiton; or in the top row if installing the app later (when the Browse tab may not exist)
|
||||
'activityTabs' => array(), // These go under the Activity tab on a new install or when restoring the default configuraiton; or in the top row if installing the app later (when the Activity tab may not exist)
|
||||
)
|
||||
* @endcode
|
||||
* @return array
|
||||
*/
|
||||
public function defaultFrontNavigation()
|
||||
{
|
||||
$activityTabs = array(
|
||||
array( 'key' => 'AllActivity' ),
|
||||
array( 'key' => 'YourActivityStreams' ),
|
||||
);
|
||||
|
||||
foreach ( array( 1, 2 ) as $k )
|
||||
{
|
||||
try
|
||||
{
|
||||
\IPS\core\Stream::load( $k );
|
||||
$activityTabs[] = array(
|
||||
'key' => 'YourActivityStreamsItem',
|
||||
'config' => array( 'menu_stream_id' => $k )
|
||||
);
|
||||
}
|
||||
catch ( \Exception $e ) { }
|
||||
}
|
||||
|
||||
$activityTabs[] = array( 'key' => 'Search' );
|
||||
|
||||
return array(
|
||||
'rootTabs' => array(),
|
||||
'browseTabsEnd' => array(
|
||||
array( 'key' => 'Guidelines' ),
|
||||
array( 'key' => 'StaffDirectory' ),
|
||||
array( 'key' => 'OnlineUsers' ),
|
||||
array( 'key' => 'Leaderboard' )
|
||||
),
|
||||
'activityTabs' => $activityTabs
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform some legacy URL parameter conversions
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertLegacyParameters()
|
||||
{
|
||||
/* Convert §ion= to &controller= */
|
||||
if ( isset( \IPS\Request::i()->section ) AND !isset( \IPS\Request::i()->controller ) )
|
||||
{
|
||||
\IPS\Request::i()->controller = \IPS\Request::i()->section;
|
||||
}
|
||||
|
||||
/* Convert &showuser= */
|
||||
if ( isset( \IPS\Request::i()->showuser ) and is_numeric( \IPS\Request::i()->showuser ) )
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=members&controller=profile&id=' . \IPS\Request::i()->showuser ) );
|
||||
}
|
||||
|
||||
/* Redirect ?app=core&module=attach§ion=attach&attach_rel_module=post&attach_id= */
|
||||
if ( isset( \IPS\Request::i()->app ) AND \IPS\Request::i()->app == 'core' AND isset( \IPS\Request::i()->controller ) AND \IPS\Request::i()->controller == 'attach' AND isset( \IPS\Request::i()->attach_id ) AND is_numeric( \IPS\Request::i()->attach_id ) )
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "applications/core/interface/file/attachment.php?id=" . \IPS\Request::i()->attach_id, 'none' ) );
|
||||
}
|
||||
|
||||
/* redirect vnc to new streams */
|
||||
if( isset( \IPS\Request::i()->app ) AND \IPS\Request::i()->app == 'core' AND isset( \IPS\Request::i()->controller ) AND \IPS\Request::i()->controller == 'vnc' )
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=discover&controller=streams' ) );
|
||||
}
|
||||
|
||||
/* redirect 4.0 activity page to streams */
|
||||
if( isset( \IPS\Request::i()->app ) AND \IPS\Request::i()->app == 'core' AND isset( \IPS\Request::i()->module ) AND (\IPS\Request::i()->module == 'activity' ) AND isset( \IPS\Request::i()->controller ) AND \IPS\Request::i()->controller == 'activity' )
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=discover&controller=streams' ) );
|
||||
}
|
||||
|
||||
/* redirect old messenger link */
|
||||
if( isset( \IPS\Request::i()->app ) AND \IPS\Request::i()->app == 'members' AND isset( \IPS\Request::i()->module ) AND (\IPS\Request::i()->module == 'messaging' ) )
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=messaging&controller=messenger', 'front', 'messaging' ) );
|
||||
}
|
||||
|
||||
/* redirect old messenger link */
|
||||
if( isset( \IPS\Request::i()->module ) AND \IPS\Request::i()->module == 'global' AND isset( \IPS\Request::i()->controller ) AND (\IPS\Request::i()->controller == 'register' ) )
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=system&controller=register', 'front', 'register', NULL, \IPS\Settings::i()->logins_over_https ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user