Version 5.0.0 beta 4
This commit is contained in:
1 parent
e86153356a
commit
2f24f9de48
276 files changed
+8614
-6044
No files matched your search
@@ -39,8 +39,8 @@ use function defined;
|
||||
use function in_array;
|
||||
use function is_array;
|
||||
use function is_bool;
|
||||
use const IPS\CIC;
|
||||
use const IPS\CONVERTERS_DEV_UI;
|
||||
use const IPS\DEMO_MODE;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
@@ -63,9 +63,9 @@ class convert extends Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
public function execute(): void
|
||||
{
|
||||
if ( \IPS\CIC )
|
||||
if ( CIC )
|
||||
{
|
||||
Output::i()->error( 'module_no_permission', '2V368/2', 403, '' );
|
||||
}
|
||||
@@ -80,7 +80,7 @@ class convert extends Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function manage()
|
||||
protected function manage() : void
|
||||
{
|
||||
/* Do we have an id? */
|
||||
if ( ! isset( Request::i()->id ) )
|
||||
@@ -193,7 +193,7 @@ class convert extends Controller
|
||||
* @param bool $count Count database rows
|
||||
* @return array
|
||||
*/
|
||||
public static function getMenuRows( $softwareClass, $filter=TRUE, $return=FALSE, $count=TRUE )
|
||||
public static function getMenuRows( Software $softwareClass, bool $filter=TRUE, bool $return=FALSE, bool $count=TRUE ) : array
|
||||
{
|
||||
$libraryClass = $softwareClass->getLibrary();
|
||||
|
||||
@@ -231,7 +231,7 @@ class convert extends Controller
|
||||
throw $e;
|
||||
}
|
||||
|
||||
Output::i()->error( $e->getMessage(), '1V101/3', 500 );
|
||||
Output::i()->error( $e->getMessage(), '1V101/3' );
|
||||
}
|
||||
|
||||
return $menuRows;
|
||||
@@ -243,7 +243,7 @@ class convert extends Controller
|
||||
* @param App $app Application we are converting
|
||||
* @return array
|
||||
*/
|
||||
protected function _getNextStep( $app )
|
||||
protected function _getNextStep( App $app ) : array
|
||||
{
|
||||
/* Set our variables */
|
||||
$appId = $app->app_id;
|
||||
@@ -376,7 +376,7 @@ class convert extends Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function emptyData()
|
||||
protected function emptyData() : void
|
||||
{
|
||||
Session::i()->csrfCheck();
|
||||
|
||||
@@ -418,7 +418,7 @@ class convert extends Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function runStep()
|
||||
protected function runStep() : void
|
||||
{
|
||||
Session::i()->csrfCheck();
|
||||
|
||||
@@ -615,7 +615,7 @@ class convert extends Controller
|
||||
* @param App $app App we are converting
|
||||
* @return bool
|
||||
*/
|
||||
protected function _checkMethodConfiguration( $app )
|
||||
protected function _checkMethodConfiguration( App $app ) : bool
|
||||
{
|
||||
$softwareClass = $app->getSource();
|
||||
|
||||
@@ -636,7 +636,7 @@ class convert extends Controller
|
||||
foreach( $getMoreInfo as $key => $input )
|
||||
{
|
||||
$fieldClass = $input['field_class'];
|
||||
$form->add( new $fieldClass( $key, $input['field_default'], $input['field_required'], $input['field_extra'], isset( $input['field_validation'] ) ? $input['field_validation'] : NULL ) );
|
||||
$form->add( new $fieldClass( $key, $input['field_default'], $input['field_required'], $input['field_extra'], $input['field_validation'] ?? NULL ) );
|
||||
if ( $input['field_hint'] !== NULL )
|
||||
{
|
||||
$form->addMessage( $input['field_hint'], 'ipsMessage ipsMessage--info' );
|
||||
@@ -667,7 +667,7 @@ class convert extends Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function error()
|
||||
public function error() : void
|
||||
{
|
||||
if ( !isset( Request::i()->id ) )
|
||||
{
|
||||
@@ -695,7 +695,7 @@ class convert extends Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function settings()
|
||||
public function settings() : void
|
||||
{
|
||||
if ( !isset( Request::i()->id ) )
|
||||
{
|
||||
@@ -747,7 +747,7 @@ class convert extends Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function finish()
|
||||
public function finish() : void
|
||||
{
|
||||
if ( !isset( Request::i()->id ) )
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@ use function defined;
|
||||
use function in_array;
|
||||
use function is_array;
|
||||
use function is_bool;
|
||||
use const IPS\DEMO_MODE;
|
||||
use const IPS\CIC;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
@@ -66,9 +66,9 @@ class create extends Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
public function execute(): void
|
||||
{
|
||||
if ( \IPS\CIC )
|
||||
if ( CIC )
|
||||
{
|
||||
Output::i()->error( 'module_no_permission', '2V391/3', 403, '' );
|
||||
}
|
||||
@@ -85,7 +85,7 @@ class create extends Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function manage()
|
||||
protected function manage() : void
|
||||
{
|
||||
/* We only use the Wizard helper for starting a conversion, so we need to make sure it is always starting new and not using old session data */
|
||||
Output::i()->title = Member::loggedIn()->language()->addToStack( 'convert_start' );
|
||||
@@ -105,7 +105,7 @@ class create extends Controller
|
||||
* @param array $data Wizard data from previous steps
|
||||
* @return Form|array
|
||||
*/
|
||||
public function _chooseSoftware( $data )
|
||||
public function _chooseSoftware( array $data ) : Form|array
|
||||
{
|
||||
$options = array();
|
||||
foreach( Software::software()['core'] AS $key => $classname )
|
||||
@@ -133,7 +133,7 @@ class create extends Controller
|
||||
* @param array $data Wizard data from previous steps
|
||||
* @return Form|array
|
||||
*/
|
||||
public function _chooseApplications( $data )
|
||||
public function _chooseApplications( array $data ) : Form|array
|
||||
{
|
||||
/* Figure out what converter libraries we have for the selected application */
|
||||
$software = $data['convert_start_source_software'];
|
||||
@@ -195,7 +195,7 @@ class create extends Controller
|
||||
* @param array $data Wizard data from previous steps
|
||||
* @return Form|array
|
||||
*/
|
||||
public function _setDatabaseDetails( $data )
|
||||
public function _setDatabaseDetails( array $data ) : Form|array
|
||||
{
|
||||
$form = new Form( 'convert_database_details', 'enter_conversion_details' );
|
||||
|
||||
@@ -438,7 +438,7 @@ class create extends Controller
|
||||
* @param array $data Wizard data from previous steps
|
||||
* @return Form
|
||||
*/
|
||||
public function _setConversionDetails( $data )
|
||||
public function _setConversionDetails( array $data ) : Form
|
||||
{
|
||||
/* We may be coming here from a previously incomplete conversion setup...detect and set the parent app ID appropriately */
|
||||
if( ( !isset( $data['_app_parent'] ) OR !$data['_app_parent'] ) AND isset( Request::i()->id ) )
|
||||
@@ -489,7 +489,7 @@ class create extends Controller
|
||||
* @param Form $form Form object
|
||||
* @return void
|
||||
*/
|
||||
protected function _addConversionApplication( $app, &$form )
|
||||
protected function _addConversionApplication( App $app, Form $form ) : void
|
||||
{
|
||||
$softwareClass = $app->getSource();
|
||||
$libraryClass = $softwareClass->getLibrary();
|
||||
@@ -504,7 +504,7 @@ class create extends Controller
|
||||
}
|
||||
catch( Exception $e )
|
||||
{
|
||||
$form->addMessage( 'nothing_convertable_found', 'ipsMessage ipsMessage--warning', TRUE );
|
||||
$form->addMessage( 'nothing_convertable_found', 'ipsMessage ipsMessage--warning' );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -557,7 +557,7 @@ class create extends Controller
|
||||
foreach( $getMoreInfo as $key => $input )
|
||||
{
|
||||
$fieldClass = $input['field_class'];
|
||||
$formElements[ $key ] = new $fieldClass( $key, $input['field_default'], $input['field_required'], $input['field_extra'], isset( $input['field_validation'] ) ? $input['field_validation'] : NULL, NULL, NULL, $key );
|
||||
$formElements[ $key ] = new $fieldClass( $key, $input['field_default'], $input['field_required'], $input['field_extra'], $input['field_validation'] ?? NULL, NULL, NULL, $key );
|
||||
if ( $input['field_hint'] !== NULL )
|
||||
{
|
||||
Member::loggedIn()->language()->words[ $key . '_desc' ] = $input['field_hint'];
|
||||
@@ -589,7 +589,7 @@ class create extends Controller
|
||||
/* If there was nothing to convert, show an appropriate message */
|
||||
if( $softwareClass::canConvertSettings() === FALSE AND !count( $menuRows ) )
|
||||
{
|
||||
$form->addMessage( 'nothing_convertable_found', 'ipsMessage ipsMessage--warning', TRUE );
|
||||
$form->addMessage( 'nothing_convertable_found', 'ipsMessage ipsMessage--warning' );
|
||||
}
|
||||
|
||||
/* If there is a message to show, go ahead and show it */
|
||||
|
||||
@@ -39,6 +39,7 @@ use function defined;
|
||||
use function file_put_contents;
|
||||
use function get_class;
|
||||
use function in_array;
|
||||
use const IPS\CIC;
|
||||
use const IPS\CONVERTERS_DEV_UI;
|
||||
use const IPS\DEMO_MODE;
|
||||
use const IPS\FOLDER_PERMISSION_NO_WRITE;
|
||||
@@ -64,7 +65,7 @@ class manage extends Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
public function execute(): void
|
||||
{
|
||||
if ( DEMO_MODE === TRUE )
|
||||
{
|
||||
@@ -81,7 +82,7 @@ class manage extends Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function manage()
|
||||
protected function manage() : void
|
||||
{
|
||||
/* If mod_rewrite is not enabled, advise the administrator that old URLs will not redirect to the new locations automatically */
|
||||
if( !Settings::i()->htaccess_mod_rewrite )
|
||||
@@ -149,6 +150,8 @@ class manage extends Controller
|
||||
try
|
||||
{
|
||||
$classname = get_class( $app->getSource() );
|
||||
|
||||
/* @var Software $classname */
|
||||
return $classname::softwareName();
|
||||
}
|
||||
catch( Exception $ex )
|
||||
@@ -173,7 +176,7 @@ class manage extends Controller
|
||||
}
|
||||
);
|
||||
|
||||
if( !\IPS\CIC )
|
||||
if( !CIC )
|
||||
{
|
||||
Output::i()->sidebar['actions']['start'] = [
|
||||
'primary' => true,
|
||||
@@ -240,12 +243,7 @@ class manage extends Controller
|
||||
|
||||
return $return;
|
||||
}
|
||||
catch( InvalidArgumentException $e )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
/* Application has been uninstalled */
|
||||
catch( OutOfRangeException $e )
|
||||
catch( InvalidArgumentException | OutOfRangeException $e )
|
||||
{
|
||||
return array();
|
||||
}
|
||||
@@ -253,7 +251,7 @@ class manage extends Controller
|
||||
|
||||
/* Display */
|
||||
Output::i()->title = Member::loggedIn()->language()->addToStack( 'menu__convert_manage' );
|
||||
Output::i()->output .= (string) $table;
|
||||
Output::i()->output .= $table;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -261,7 +259,7 @@ class manage extends Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function software()
|
||||
public function software() : void
|
||||
{
|
||||
if ( \IPS\IN_DEV === FALSE )
|
||||
{
|
||||
@@ -322,7 +320,7 @@ class manage extends Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function library()
|
||||
public function library() : void
|
||||
{
|
||||
if ( \IPS\IN_DEV === FALSE )
|
||||
{
|
||||
@@ -383,7 +381,7 @@ class manage extends Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function edit()
|
||||
public function edit() : void
|
||||
{
|
||||
if ( !isset( Request::i()->id ) )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user