This commit is contained in:
Abdulrahman
2019-05-23 20:22:47 +03:00
parent dacbb1c2e5
commit fb023a4018
5 changed files with 195 additions and 180 deletions

View File

@@ -37,17 +37,20 @@
<LOOP NAME="installed_plugins">
<div class="col-sm-12 col-md-3 mt-2">
<div class="card">
<img class="card-img-top" src="{{icon}}" alt="{{plg_name}}">
<div class="card-body">
<h5 class="card-title" style="max-height: 30px; min-height: 30px; overflow-y: auto">
<img class="card-img-top img-responsive" src="{{icon}}" alt="{{plg_name}}">
<div class="card-img-overlay p-3">
<div class="font-weight-normal px-2 rounded text-white" style="line-height:2; background: rgba(18, 16, 16, 0.4);">
<IF LOOP="plg_disabled">
{{plg_name}}
<i class="fa fa-toggle-off"></i>
<ELSE>
{{extra_info.plugin_title}} {{extra_info.plugin_version}}
</IF>
</h5>
<p class="card-text" style="max-height: 100px; min-height: 100px; overflow-y: auto">
</div>
</div>
<div class="card-body">
<p class="card-text " style="font-size:13px; max-height: 100px; min-height: 50px; overflow-y: auto">
<IF LOOP="plg_disabled">
{{plg_dsc}}
<ELSE>
@@ -58,14 +61,17 @@
</p>
</div>
<div class="card-footer">
<div class="card-footer btn-group">
<IF LOOP="plg_disabled">
<a class="btn btn-outline-primary btn-sm" href="{plugin_enable_link}{{plg_name}}" title="{lang.ENABLE}"><i class="fa fa-toggle-on" title="{lang.ENABLE}"></i> {lang.ENABLE}</a>
<a class="btn btn-outline-secondary btn-sm" href="{plugin_enable_link}{{plg_name}}" title="{lang.ENABLE}"><i class="fa fa-toggle-on" title="{lang.ENABLE}"></i> {lang.ENABLE}</a>
<ELSE>
<a class="btn btn-outline-primary btn-sm" href="{plugin_disable_link}{{plg_name}}" title="{lang.DISABLE}"><i class="fa fa-toggle-off" title="{lang.DISABLE}"></i> {lang.DISABLE}</a>
<IF LOOP="has_settings_page">
<a class="btn btn-outline-secondary btn-sm" href="./?{{extra_info.settings_page}}" title="{lang.R_CONFIGS}"><i class="fa fa-gear" title="{lang.R_CONFIGS}"></i></a>
</IF>
<a class="btn btn-outline-secondary btn-sm" href="{plugin_disable_link}{{plg_name}}" title="{lang.DISABLE}"><i class="fa fa-toggle-off" title="{lang.DISABLE}"></i> {lang.DISABLE}</a>
</IF>
<a class="btn btn-outline-primary btn-sm" href="{plugin_uninstall_link}{{plg_name}}" title="{lang.DELETE}" onclick="javascript:return confirm_form();"><i class="fa fa-remove" title="{lang.DELETE}"></i> {lang.DELETE}</a>
<a class="btn btn-outline-secondary btn-sm" href="{plugin_uninstall_link}{{plg_name}}" title="{lang.DELETE}" onclick="javascript:return confirm_form();"><i class="fa fa-remove" title="{lang.DELETE}"></i> {lang.DELETE}</a>
</div>
</div>
</div>
@@ -164,7 +170,6 @@
<div class="media-body d-flex justify-content-between">
<div>
<h5 class="mt-0 mb-2">{{title}}</h5>
<div style="direction: ltr;">
<IF NAME="case == check">{{current_version}} → </IF>{{version}}
</div>

View File

@@ -74,6 +74,11 @@ switch ($case):
while ($row = $SQL->fetch($result))
{
if(! file_exists(PATH . KLEEJA_PLUGINS_FOLDER . '/' . $row['plg_name'] . '/init.php'))
{
continue;
}
$installed_plugins[$row['plg_name']] = $row;
$installed_plugins[$row['plg_name']]['extra_info'] = Plugins::getInstance()->installed_plugin_info($row['plg_name']);
@@ -84,6 +89,11 @@ switch ($case):
? PATH . KLEEJA_PLUGINS_FOLDER . '/' . $row['plg_name'] . '/icon.png'
: $STYLE_PATH_ADMIN . 'images/plugin.png';
$installed_plugins[$row['plg_name']]['has_settings_page'] = ! empty(
$installed_plugins[$row['plg_name']]['extra_info']['settings_page']
) && ! preg_match('/^https?:\/\//', $installed_plugins[$row['plg_name']]['extra_info']['settings_page']);
foreach (['plugin_title', 'plugin_description'] as $localizedInfo)
{
if (is_array($installed_plugins[$row['plg_name']]['extra_info'][$localizedInfo]))

View File

@@ -794,7 +794,7 @@ function add_config_r($configs)
function update_config($name, $value, $escape = true, $group = false)
{
global $SQL, $dbprefix, $d_groups, $userinfo;
global $SQL, $dbprefix, $d_groups, $userinfo, $config;
$value = $escape ? $SQL->escape($value) : $value;
$table = "{$dbprefix}config";

View File

@@ -262,7 +262,7 @@ return [
'PACKAGE_REMOTE_FILE_MISSING' => 'حزمة "%s" ليست موجودة على متجر كليجا الخارجي!',
'STORE_SERVER_ERROR' => 'واجهنا خطأ أثناء الإتصال بخادم متجر كليجا الخارجي...',
'INSTALLED_PLUGINS' => 'الإضافات المثبتة',
'LOCAL_PLUGINS' => 'الإضافات المحلية',
'LOCAL_PLUGINS' => 'الإضافات المحلية (غير مثبتة)',
'KLEEJA_STORE' => 'متجر كليجا',
'KLJ_VER_NO_PLUGIN' => 'هذه الإضافة/الستايل يمكنها العمل على إصدار كليجا %1$s حتى إصدار %2$s.',
'VERSION' => 'الإصدار',

View File

@@ -259,7 +259,7 @@ return [
'PACKAGE_REMOTE_FILE_MISSING' => 'Package of "%s" is not on Kleeja remote server!',
'STORE_SERVER_ERROR' => 'We encountered an error while connecting to the kleeja store remote server ...',
'INSTALLED_PLUGINS' => 'Installed Plugins',
'LOCAL_PLUGINS' => 'Local Plugins',
'LOCAL_PLUGINS' => 'Local Plugins (Not Installed)',
'KLEEJA_STORE' => 'Kleeja Store',
'KLJ_VER_NO_PLUGIN' => 'This plugin/style can works on Kleeja version %1$s up to version %2$s.',
'VERSION' => 'Version',