Skip to content

Commit

Permalink
Dev: Plugins with load error should not show install button
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Mar 28, 2018
1 parent c9c6643 commit b9d4c2d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
9 changes: 6 additions & 3 deletions application/controllers/admin/PluginManagerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,15 @@ public function scanFiles()
'notice'
);

$data = [];
$data['result'] = $result;
$data['fullpagebar']['returnbutton']['url'] = 'pluginmanager';
$data['fullpagebar']['returnbutton']['text'] = gT('Return to plugin manager');

$this->_renderWrappedTemplate(
'pluginmanager',
'scanFilesResult',
[
'result' => $result
]
$data
);

//$indexUrl = $this->getController()->createUrl('/admin/pluginmanager');
Expand Down
7 changes: 6 additions & 1 deletion application/libraries/PluginManager/PluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ public function scanPlugins($forceReload = false)
}
} else {
// TODO: List faulty plugins.
$result[$pluginName] = [
'pluginName' => $pluginName,
'load_error' => 1
];
}
}

Expand Down Expand Up @@ -309,8 +313,9 @@ public function getPluginInfo($pluginClass, $pluginDir = null)
return null;
} else {
$result['description'] = call_user_func(array($class, 'getDescription'));
$result['pluginName'] = call_user_func(array($class, 'getName'));
$result['pluginName'] = call_user_func(array($class, 'getName'));
$result['pluginClass'] = $class;
$result['load_error'] = 0;
return $result;
}
}
Expand Down
18 changes: 13 additions & 5 deletions application/views/admin/pluginmanager/scanFilesResult.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@

<div class='col-lg-12'>
<div class='pagetitle h3'><?php eT('Plugin manager'); ?></div>
<?php foreach($result as $scannedPlugin): ?>
<div class='col-sm-12'>
<label class='control-label'>
<?php echo $scannedPlugin['pluginName']; ?>
<?php foreach($result as $name => $scannedPlugin): ?>
<div class='form-group col-lg-12'>
<label class='control-label col-sm-4'>
<?php echo $name; ?>
</label>
<a href='' class='btn btn-success'>Install</a>
<?php if ($scannedPlugin['load_error'] == 0): ?>
<a href='' class='btn btn-success' data-toggle='tooltip' title='<?php eT('Install this plugin'); ?>'>
<i class='fa fa-download'></i>&nbsp;
<?php eT('Install'); ?>
</a>
<?php else: ?>
<i class='fa fa-exclamation-triangle text-warning'></i>&nbsp;
<span href='' class='text-warning'><?php eT('Load error. Please contact the plugin author.'); ?></span>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>

0 comments on commit b9d4c2d

Please sign in to comment.