Version 4.6.0
This commit is contained in:
1 parent
f79dcf067a
commit
517a5e1f70
2036 files changed
+110041
-26162
No files matched your search
@@ -299,7 +299,7 @@ CODE;
|
||||
\file_put_contents( \IPS\ROOT_PATH . "/plugins/{$values['plugin_location']}/settings.rename.php", $defaultSettings );
|
||||
\file_put_contents( \IPS\ROOT_PATH . "/plugins/{$values['plugin_location']}/dev/jslang.php", "<?php\n\n\$lang = array(\n\n\n\n);\n" );
|
||||
\file_put_contents( \IPS\ROOT_PATH . "/plugins/{$values['plugin_location']}/dev/lang.php", "<?php\n\n\$lang = array(\n\n\n\n);\n" );
|
||||
\file_put_contents( \IPS\ROOT_PATH . "/plugins/{$values['plugin_location']}/dev/versions.json", json_encode( array() ) );
|
||||
\file_put_contents( \IPS\ROOT_PATH . "/plugins/{$values['plugin_location']}/dev/versions.json", json_encode( array( 10000 => '1.0.0' ) ) );
|
||||
\file_put_contents( \IPS\ROOT_PATH . "/plugins/{$values['plugin_location']}/dev/setup/install.php", preg_replace( '/(<\?php\s)\/*.+?\*\//s', '$1', str_replace(
|
||||
array(
|
||||
'{version_human} Upgrade',
|
||||
@@ -413,7 +413,7 @@ CODE;
|
||||
}
|
||||
|
||||
/* Upgrade */
|
||||
if( \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'applications', 'plugins_install' ) AND !$this->marketplace_id )
|
||||
if( \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'applications', 'plugins_install' ) AND !$this->marketplace_id AND \IPS\IPS::canManageResources() )
|
||||
{
|
||||
$buttons['upgrade'] = array(
|
||||
'icon' => 'upload',
|
||||
@@ -461,11 +461,14 @@ CODE;
|
||||
'link' => \IPS\Http\Url::internal( "app=core&module=applications&controller=plugins&do=developer&id={$this->_id}" ),
|
||||
);
|
||||
|
||||
$buttons['download'] = array(
|
||||
'icon' => 'download',
|
||||
'title' => 'download',
|
||||
'link' => \IPS\Http\Url::internal( "app=core&module=applications&controller=plugins&do=download&id={$this->_id}" )->csrf(),
|
||||
);
|
||||
if( !$this->marketplace_id )
|
||||
{
|
||||
$buttons['download'] = array(
|
||||
'icon' => 'download',
|
||||
'title' => 'download',
|
||||
'link' => \IPS\Http\Url::internal("app=core&module=applications&controller=plugins&do=download&id={$this->_id}")->csrf(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -626,6 +629,22 @@ CODE;
|
||||
}
|
||||
\IPS\Db::i()->update( 'core_widget_areas', array( 'widgets' => json_encode( $newWidgets ) ), array( 'id=?', $area['id'] ) );
|
||||
}
|
||||
|
||||
/* clean up widget areas table */
|
||||
foreach ( \IPS\Db::i()->select( '*', 'core_widget_areas' ) as $row )
|
||||
{
|
||||
$data = json_decode( $row['widgets'], true );
|
||||
|
||||
foreach ( $data as $key => $widget)
|
||||
{
|
||||
if ( isset( $widget['plugin'] ) and $widget['plugin'] == $this->id )
|
||||
{
|
||||
unset( $data[$key]) ;
|
||||
}
|
||||
}
|
||||
|
||||
\IPS\Db::i()->update( 'core_widget_areas', array( 'widgets' => json_encode( $data ) ), array( 'id=?', $row['id'] ) );
|
||||
}
|
||||
|
||||
/* Call onOtherUninstall so that other applications may perform any necessary cleanup */
|
||||
foreach( \IPS\Application::allExtensions( 'core', 'Uninstall', FALSE ) as $extension )
|
||||
@@ -830,7 +849,7 @@ CODE;
|
||||
}
|
||||
catch ( \RuntimeException $e )
|
||||
{
|
||||
throw new \RuntimeException( \IPS\Member::loggedIn()->language()->addToStack('dev_could_not_write_data') );
|
||||
throw new \RuntimeException( \IPS\Member::loggedIn()->language()->addToStack('dev_plugin_not_writable') );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user