Add plugin source to list of plugins.
* plugin_api.inc.php: - Add static list of bundled plugins. - Add function to check if plugin is bundled. * plugins.inc.php: - Set source of plugin (Spartacus, bundled or local). * plugins.inc.tpl: - Display plugin source. * Add language constants. Signed-off-by: Thomas Hochstein <thh@inter.net>
This commit is contained in:
parent
f576501737
commit
d179f1b154
@ -1,6 +1,8 @@
|
||||
Version 2.4-alpha1 ()
|
||||
------------------------------------------------------------------------
|
||||
|
||||
* Display source of plugins (Spartacus, bundled or locally installed).
|
||||
|
||||
* Switch new installations with MySQL >= 5.6.4 or MariaDB >= 10.0.5
|
||||
to the InooDB stoprage engine and utf8mb4 charset. This enables
|
||||
proper unicode support plus fulltext indexes, something older
|
||||
|
@ -155,6 +155,7 @@ if (isset($serendipity['GET']['plugin_to_conf'])) {
|
||||
$data['adminAction'] = 'addnew';
|
||||
$data['type'] = $serendipity['GET']['type'];
|
||||
|
||||
# get plugin data from Spartacus
|
||||
$foreignPlugins = $pluginstack = $errorstack = array();
|
||||
serendipity_plugin_api::hook_event('backend_plugins_fetchlist', $foreignPlugins);
|
||||
$pluginstack = array_merge((array)$foreignPlugins['pluginstack'], $pluginstack);
|
||||
@ -173,6 +174,7 @@ if (isset($serendipity['GET']['plugin_to_conf'])) {
|
||||
$foreignPlugins = array_merge($foreignPlugins, $foreignPluginsTemp);
|
||||
}
|
||||
|
||||
# load data for installed plugins
|
||||
$plugins = serendipity_plugin_api::get_installed_plugins();
|
||||
$classes = serendipity_plugin_api::enum_plugin_classes(($serendipity['GET']['type'] === 'event'));
|
||||
if ($serendipity['GET']['only_group'] == 'UPGRADE') {
|
||||
@ -237,7 +239,6 @@ if (isset($serendipity['GET']['plugin_to_conf'])) {
|
||||
$props['local_documentation'] = 'plugins/' . $props['pluginPath'] . '/README';
|
||||
}
|
||||
}
|
||||
|
||||
$pluginstack[$class_data['true_name']] = $props;
|
||||
} else {
|
||||
// False is returned if a plugin could not be instantiated
|
||||
@ -249,6 +250,18 @@ if (isset($serendipity['GET']['plugin_to_conf'])) {
|
||||
$pluggroups = array();
|
||||
$pluggroups[''] = array();
|
||||
foreach($pluginstack AS $plugname => $plugdata) {
|
||||
# add pluginsource to pluginstack
|
||||
if (isset($foreignPlugins['pluginstack'][$plugname])) {
|
||||
# remote plugin
|
||||
$pluginstack[$plugname]['pluginsource'] = 'Spartacus';
|
||||
} elseif (serendipity_plugin_api::is_bundled_plugin($plugname)) {
|
||||
# bundled plugin
|
||||
$pluginstack[$plugname]['pluginsource'] = PLUGIN_SOURCE_BUNDLED;
|
||||
} else {
|
||||
# everything else must be "local"
|
||||
$pluginstack[$plugname]['pluginsource'] = PLUGIN_SOURCE_LOCAL;
|
||||
}
|
||||
# create pluggroups
|
||||
if ($serendipity['GET']['only_group'] == 'ALL') {
|
||||
$pluggroups['ALL'][] = $plugdata;
|
||||
} elseif ($serendipity['GET']['only_group'] == 'UPGRADE' && $plugdata['upgradable']) {
|
||||
|
@ -7,6 +7,40 @@ if (IN_serendipity !== true) {
|
||||
die ('Don\'t hack!');
|
||||
}
|
||||
|
||||
// List of bundled core plugins
|
||||
define('BUNDLED_PLUGINS',
|
||||
array(
|
||||
'serendipity_event_bbcode',
|
||||
'serendipity_event_creativecommons',
|
||||
'serendipity_event_emoticate',
|
||||
'serendipity_event_entryproperties',
|
||||
'serendipity_event_mailer',
|
||||
'serendipity_event_nl2br',
|
||||
'serendipity_event_responsiveimages',
|
||||
'serendipity_event_s9ymarkup',
|
||||
'serendipity_event_spamblock',
|
||||
'serendipity_event_spartacus',
|
||||
'serendipity_event_templatechooser',
|
||||
'serendipity_event_textile',
|
||||
'serendipity_event_xhtmlcleanup',
|
||||
'serendipity_plugin_archives',
|
||||
'serendipity_plugin_calendar',
|
||||
'serendipity_plugin_categories',
|
||||
'serendipity_plugin_comments',
|
||||
'serendipity_plugin_creativecommons',
|
||||
'serendipity_plugin_entrylinks',
|
||||
'serendipity_plugin_eventwrapper',
|
||||
'serendipity_plugin_history',
|
||||
'serendipity_plugin_html_nugget',
|
||||
'serendipity_plugin_plug',
|
||||
'serendipity_plugin_recententries',
|
||||
'serendipity_plugin_remoterss',
|
||||
'serendipity_plugin_superuser',
|
||||
'serendipity_plugin_syndication',
|
||||
'serendipity_plugin_templatedropdown'
|
||||
)
|
||||
);
|
||||
|
||||
include_once S9Y_INCLUDE_PATH . 'include/functions.inc.php';
|
||||
|
||||
/* Core API function mappings
|
||||
@ -1001,6 +1035,18 @@ class serendipity_plugin_api
|
||||
return $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a plugin is bundled with s9y core
|
||||
*
|
||||
* @access public
|
||||
* @param string Name of a plugin
|
||||
* @return boolean
|
||||
*/
|
||||
static function is_bundled_plugin($name)
|
||||
{
|
||||
return in_array ($name, BUNDLED_PLUGINS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a plugin is an event plugin
|
||||
*
|
||||
|
@ -1129,3 +1129,6 @@
|
||||
@define('PLUGIN_LINK_SPARTACUS', 'Weitere Informationen');
|
||||
@define('PLUGIN_ALL_UPDATED', 'Alle Plugins aktualisiert');
|
||||
@define('MEDIA_DIRECTORY_MOVE', 'Dateien verschieben');
|
||||
@define('SOURCE', 'Quelle');
|
||||
@define('PLUGIN_SOURCE_BUNDLED', 'mitgeliefertes Plugin');
|
||||
@define('PLUGIN_SOURCE_LOCAL', 'lokal installiert');
|
||||
|
@ -1129,3 +1129,6 @@
|
||||
@define('PLUGIN_LINK_SPARTACUS', 'Weitere Informationen');
|
||||
@define('PLUGIN_ALL_UPDATED', 'Alle Plugins aktualisiert');
|
||||
@define('MEDIA_DIRECTORY_MOVE', 'Dateien verschieben');
|
||||
@define('SOURCE', 'Quelle');
|
||||
@define('PLUGIN_SOURCE_BUNDLED', 'mitgeliefertes Plugin');
|
||||
@define('PLUGIN_SOURCE_LOCAL', 'lokal installiert');
|
||||
|
@ -1131,3 +1131,6 @@
|
||||
@define('PLUGIN_LINK_SPARTACUS', 'More information');
|
||||
@define('PLUGIN_ALL_UPDATED', 'All Plugins updated');
|
||||
@define('MEDIA_DIRECTORY_MOVE', 'Move files to another directory');
|
||||
@define('SOURCE', 'Source');
|
||||
@define('PLUGIN_SOURCE_BUNDLED', 'bundled core plugin');
|
||||
@define('PLUGIN_SOURCE_LOCAL', 'locally installed');
|
||||
|
@ -113,6 +113,9 @@
|
||||
{if ! empty($plug.version)}
|
||||
<li class="plugin_version"><b>{$CONST.VERSION|capitalize}:</b> {$plug.version}</li>
|
||||
{/if}
|
||||
{if ! empty($plug.pluginsource)}
|
||||
<li class="plugin_source"><b>{$CONST.SOURCE|capitalize}:</b> {$plug.pluginsource}</li>
|
||||
{/if}
|
||||
{if ! empty($plug.pluginlocation) && ($plug.pluginlocation != 'local' || $plug.pluginsource == 'Spartacus')}
|
||||
<li class="plugin_link"><a href="http://spartacus.s9y.org/index.php?mode=bygroups_{$plug.plugintype}_{$lang}#{$plug.class_name|escape}">{$CONST.PLUGIN_LINK_SPARTACUS}</a></li>
|
||||
{/if}
|
||||
|
Loading…
x
Reference in New Issue
Block a user