Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -11,7 +11,7 @@
|
||||
namespace IPS\core\modules\admin\customization;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -21,7 +21,12 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
* themesettings
|
||||
*/
|
||||
class _themesettings extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
{
|
||||
/**
|
||||
* @brief Has been CSRF-protected
|
||||
*/
|
||||
public static $csrfProtected = TRUE;
|
||||
|
||||
/**
|
||||
* Execute
|
||||
*
|
||||
@@ -41,7 +46,7 @@ class _themesettings extends \IPS\Dispatcher\Controller
|
||||
),
|
||||
array(
|
||||
NULL,
|
||||
\IPS\Member::loggedIn()->language()->addToStack( 'core_theme_set_title_' . intval( \IPS\Request::i()->set_id ) )
|
||||
\IPS\Member::loggedIn()->language()->addToStack( 'core_theme_set_title_' . \intval( \IPS\Request::i()->set_id ) )
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -97,14 +102,14 @@ class _themesettings extends \IPS\Dispatcher\Controller
|
||||
$return = array();
|
||||
foreach( \IPS\Db::i()->select( '*', 'core_theme_settings_fields', array( 'sc_set_id=? AND sc_tab_key=?', $theme->id, $activeTab ), 'sc_order' ) as $row )
|
||||
{
|
||||
$return[ $row['sc_id'] ] = call_user_func( array( $self, '_settingRow' ), $row );
|
||||
$return[ $row['sc_id'] ] = $self->_settingRow( $row );
|
||||
}
|
||||
return $return;
|
||||
},
|
||||
// getRow
|
||||
function( $id ) use ( $self )
|
||||
{
|
||||
return call_user_func( array( $self, '_settingRow' ), \IPS\Db::i()->select( '*', 'core_theme_settings_fields', array( 'sc_id=?', $id ) )->first() );
|
||||
return $self->_settingRow( \IPS\Db::i()->select( '*', 'core_theme_settings_fields', array( 'sc_id=?', $id ) )->first() );
|
||||
},
|
||||
// getRowParentId
|
||||
function()
|
||||
@@ -202,6 +207,8 @@ class _themesettings extends \IPS\Dispatcher\Controller
|
||||
*/
|
||||
public function reorder()
|
||||
{
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
/* Normalise AJAX vs non-AJAX */
|
||||
if( isset( \IPS\Request::i()->ajax_order ) )
|
||||
{
|
||||
@@ -250,8 +257,8 @@ class _themesettings extends \IPS\Dispatcher\Controller
|
||||
public function form()
|
||||
{
|
||||
$current = NULL;
|
||||
$setId = intval( \IPS\Request::i()->set_id );
|
||||
$id = intval( \IPS\Request::i()->id );
|
||||
$setId = \intval( \IPS\Request::i()->set_id );
|
||||
$id = \intval( \IPS\Request::i()->id );
|
||||
$set = \IPS\Theme::load( $setId );
|
||||
|
||||
if ( $id )
|
||||
@@ -288,6 +295,12 @@ class _themesettings extends \IPS\Dispatcher\Controller
|
||||
),
|
||||
function( $val )
|
||||
{
|
||||
/* Check key format */
|
||||
if( !preg_match( '/^[a-zA-Z0-9_]+$/', $val ) )
|
||||
{
|
||||
throw new \InvalidArgumentException('core_theme_settings_error_key_disallowed_characters');
|
||||
}
|
||||
|
||||
/* Make sure key is unique */
|
||||
try
|
||||
{
|
||||
@@ -313,7 +326,7 @@ class _themesettings extends \IPS\Dispatcher\Controller
|
||||
return true;
|
||||
} ) );
|
||||
|
||||
if ( count( $tabs ) )
|
||||
if ( \count( $tabs ) )
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\Radio( 'theme_custom_setting_tab_key_type', 'existing', FALSE, array(
|
||||
'options' => array( 'existing' => 'theme_custom_setting_tab_key_o_existing',
|
||||
@@ -504,7 +517,7 @@ class _themesettings extends \IPS\Dispatcher\Controller
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$setId = intval( \IPS\Request::i()->set_id );
|
||||
$setId = \intval( \IPS\Request::i()->set_id );
|
||||
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'theme_settings_remove' );
|
||||
|
||||
|
||||
Reference in new issue
Block a user