mirror of
https://github.com/humhub/humhub.git
synced 2025-02-12 03:26:25 +01:00
Enh: Show more information about installed module in marketplace when possible. Instead of limited README.md
This commit is contained in:
parent
f9a4ab0c3f
commit
38e496de6e
@ -18,3 +18,4 @@ HumHub Change Log
|
||||
- Enh: Added `humhub\modules\ui\form\widgets\JsInputWidget:emptyResult()` helper to manage render state of JsInputWidget
|
||||
- Enh: Added `humhub\modules\ui\form\widgets\JsInputWidget:field` in order to access ActiveField instances within JsInputWidget
|
||||
- Enh #4216: Added `humhub\modules\ui\filter\widgets\DropdownFilterInput` in order to support dropdown stream filters
|
||||
- Enh: Show more information about installed module in marketplace when possible. Instead of limited README.md
|
||||
|
@ -56,8 +56,6 @@ class ModuleController extends Controller
|
||||
public function actionIndex()
|
||||
{
|
||||
Yii::$app->moduleManager->flushCache();
|
||||
|
||||
|
||||
return $this->redirect(['/admin/module/list']);
|
||||
}
|
||||
|
||||
@ -66,9 +64,33 @@ class ModuleController extends Controller
|
||||
{
|
||||
$installedModules = Yii::$app->moduleManager->getModules();
|
||||
|
||||
return $this->render('list', ['installedModules' => $installedModules, 'deprecatedModuleIds' => $this->getDeprecatedModules()]);
|
||||
return $this->render('list', [
|
||||
'installedModules' => $installedModules,
|
||||
'deprecatedModuleIds' => $this->getDeprecatedModules(),
|
||||
'marketplaceUrls' => $this->getMarketplaceUrls()
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
private function getMarketplaceUrls()
|
||||
{
|
||||
$marketplaceUrls = [];
|
||||
|
||||
if (Yii::$app->hasModule('marketplace')) {
|
||||
try {
|
||||
foreach (Yii::$app->getModule('marketplace')->onlineModuleManager->getModules() as $id => $module) {
|
||||
if (!empty($module['marketplaceUrl'])) {
|
||||
$marketplaceUrls[$id] = $module['marketplaceUrl'];
|
||||
}
|
||||
}
|
||||
} catch (\Exception $ex) {
|
||||
}
|
||||
}
|
||||
|
||||
return $marketplaceUrls;
|
||||
}
|
||||
|
||||
|
||||
private function getDeprecatedModules()
|
||||
{
|
||||
$deprecatedModuleIds = [];
|
||||
@ -79,7 +101,6 @@ class ModuleController extends Controller
|
||||
$deprecatedModuleIds[] = $id;
|
||||
}
|
||||
}
|
||||
|
||||
} catch (\Exception $ex) {
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ use yii\helpers\Url;
|
||||
/* @var $this \humhub\components\View */
|
||||
/* @var $installedModules array */
|
||||
/* @var $deprecatedModuleIds array */
|
||||
/* @var $marketplaceUrls array */
|
||||
?>
|
||||
|
||||
<div class="panel-body">
|
||||
@ -14,7 +15,9 @@ use yii\helpers\Url;
|
||||
<div><?= Yii::t('AdminModule.modules', 'No modules installed yet. Install some to enhance the functionality!'); ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php foreach ($installedModules as $moduleId => $module) : ?>
|
||||
<?php foreach ($installedModules
|
||||
|
||||
as $moduleId => $module) : ?>
|
||||
<div class="media">
|
||||
<img class="media-object img-rounded pull-left" data-src="holder.js/64x64" alt="64x64"
|
||||
style="width: 64px; height: 64px;" src="<?= $module->getImage(); ?>">
|
||||
@ -27,7 +30,8 @@ use yii\helpers\Url;
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (in_array($module->id, $deprecatedModuleIds)): ?>
|
||||
<span class="label label-default" data-toggle="tooltip" data-placement="bottom" title="<?= Yii::t('AdminModule.modules', 'Not maintained or maintenance is about to be discontinued.'); ?>"><?= Yii::t('AdminModule.modules', 'Legacy'); ?></span>
|
||||
<span class="label label-default" data-toggle="tooltip" data-placement="bottom"
|
||||
title="<?= Yii::t('AdminModule.modules', 'Not maintained or maintenance is about to be discontinued.'); ?>"><?= Yii::t('AdminModule.modules', 'Legacy'); ?></span>
|
||||
<?php endif; ?>
|
||||
</small>
|
||||
</h4>
|
||||
@ -57,8 +61,14 @@ use yii\helpers\Url;
|
||||
· <?= Html::a(Yii::t('AdminModule.modules', 'Uninstall'), Url::to(['/admin/module/remove', 'moduleId' => $moduleId]), ['data-method' => 'POST', 'data-confirm' => Yii::t('AdminModule.modules', 'Are you sure? *ALL* module related data and files will be lost!')]); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($marketplaceUrls[$moduleId])): ?>
|
||||
· <?= Html::a(Yii::t('AdminModule.modules', 'More info') . ' <i class="fa fa-external-link" aria-hidden="true"></i>'
|
||||
, $marketplaceUrls[$moduleId],
|
||||
['rel' => 'noopener', 'target' => '_blank']
|
||||
); ?>
|
||||
<?php else: ?>
|
||||
· <?= Html::a(Yii::t('AdminModule.modules', 'More info'), Url::to(['/admin/module/info', 'moduleId' => $moduleId]), ['data-target' => '#globalModal']); ?>
|
||||
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user