install.php
find
$hooks[] = array(
'hook' => 'integrate_package_upload',
'function' => 'shd_package_upload',
'file' => '$sourcedir/sd_source/Subs-SimpleDeskPackages.php',
'perm' => true,
);
add after
$hooks[] = array(
'hook' => 'integrate_modification_types',
'function' => 'shd_modification_types',
'file' => '$sourcedir/sd_source/Subs-SimpleDeskPackages.php',
'perm' => true,
);
sd_language/SimpleDeskAdmin.english.php
find
$txt['shd_search_rebuilt'] = 'The search index has been rebuilt.';
//@}
add after
//! Package Plugin
//@{
$txt['sdplugin_package'] = 'SDPlugin packages';
//@}
?There seems to be a bug to with SMF call_integration_hook ('integrate_modification_types');? There the modification type is not recognized, please look at image pluginsystem-3.PNG
Subs-SimpleDeskPackages.php
/**
* Sets up the browse section for plugins.
*
* @since 2.1
*/
function shd_modification_types()
{
global $context, $txt;
$context['modification_types'][] = 'sdplugin';
}
sources/Packes.php
$context['modification_types'] = array('modification', 'avatar', 'language', 'unknown');
only when I change in Subs-SimpleDeskPackages.php this to
$context['modification_types'] = array('modification', 'avatar', 'language', 'unknown', 'sdplugin');
is he modification type is detected. For this purpose, I have to remove the variable $packes in Hook integrate_packages_sort_id
function shd_packages_sort_id(&$sort_id, &$packages)
{
global $context, $packages;
But then missing the information that this plugin is installed and when it was installed, please look at image pluginsystem-4.PNG
One step I continued
when in Packes.php change from
function PackageBrowse()
{
global $txt, $scripturl, $context, $forum_version, $sourcedir, $smcFunc;
$context['page_title'] .= ' - ' . $txt['browse_packages'];
$context['forum_version'] = $forum_version;
$context['modification_types'] = array('modification', 'avatar', 'language', 'unknown');
call_integration_hook('integrate_modification_types');
to
function PackageBrowse()
{
global $txt, $scripturl, $context, $forum_version, $sourcedir, $smcFunc;
$context['page_title'] .= ' - ' . $txt['browse_packages'];
$context['forum_version'] = $forum_version;
$type = array('modification', 'avatar', 'language', 'unknown');
$context['modification_types'] = $type;
call_integration_hook('integrate_modification_types');
works the hook "integrate_modification_types" and any modification type can be added. Then only missing the information, if and when installed. If the variable "$packes" to function "shd_packages_sort_id" added, the modification type is no longer detected. But it appears the information if and when installed. ???
I did a commit to fix the hooks not installing/uninstalling correctly. But I can't reproduce your issue. It works fine for me.
With the change in Packes.php (https://github.com/SimpleMachines/SMF2.1/pull/3192/files) is not resolved. There is still no information when and if the plugin is installed. Look at the first image.
If the variable $packages is removed then the information is displayed. But the modification type is not recognized. Look at the last image.
Packes.php
call_integration_hook('integrate_packages_sort_id', array(&$sort_id));
Subs-SimpleDeskPackages.php
function shd_packages_sort_id(&$sort_id)
{
global $context;
$sort_id['sdplugin'] = 1;
$context['available_sdplugin'] = array();
}
The plugin is installed. But can not be uninstalled, because the wrong button is displayed. Look at the first image.
This is a SMF bug: https://github.com/SimpleMachines/SMF2.1/pull/3216
Once that is fixed this will work properly.
Bug fixed :)