Skip to content

Commit

Permalink
close #5 fixed: Update center core version issue
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Sep 18, 2017
1 parent cb179c2 commit bbd1da4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
33 changes: 20 additions & 13 deletions app/Http/Controllers/Install/Updates.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,33 @@ public function index()
{
$updates = Updater::all();

$core = $updates['core'];
$core = null;

$modules = array();

if (isset($updates['core'])) {
$core = $updates['core'];
}

$rows = Module::all();
foreach ($rows as $row) {
$alias = $row->get('alias');

if (!isset($updates[$alias])) {
continue;
}
if ($rows) {
foreach ($rows as $row) {
$alias = $row->get('alias');

$m = new \stdClass();
$m->name = $row->get('name');
$m->alias = $row->get('alias');
$m->category = $row->get('category');
$m->installed = $row->get('version');
$m->latest = $updates[$alias];
if (!isset($updates[$alias])) {
continue;
}

$modules[] = $m;
$m = new \stdClass();
$m->name = $row->get('name');
$m->alias = $row->get('alias');
$m->category = $row->get('category');
$m->installed = $row->get('version');
$m->latest = $updates[$alias];

$modules[] = $m;
}
}

return view('install.updates.index', compact('core', 'modules'));
Expand Down
2 changes: 1 addition & 1 deletion resources/views/install/updates/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{{ trans('updates.latest_core') }}
@else
{{ trans('updates.new_core') }}
<a href="{{ url('install/updates/update', ['alias' => 'core', 'version' => $core]) }}" data-toggle="tooltip" title="{{ trans('updates.update', ['version' => '1.5.2']) }}" class="btn btn-warning btn-xs"><i class="fa fa-refresh"></i> &nbsp;{{ trans('updates.update', ['version' => $core]) }}</a>
<a href="{{ url('install/updates/update', ['alias' => 'core', 'version' => $core]) }}" data-toggle="tooltip" title="{{ trans('updates.update', ['version' => $core]) }}" class="btn btn-warning btn-xs"><i class="fa fa-refresh"></i> &nbsp;{{ trans('updates.update', ['version' => $core]) }}</a>
<a href="{{ url('install/updates/changelog') }}" data-toggle="tooltip" title="{{ trans('updates.changelog') }}" class="btn btn-default btn-xs popup"><i class="fa fa-exchange"></i> &nbsp;{{ trans('updates.changelog') }}</a>
@endif
</div>
Expand Down

0 comments on commit bbd1da4

Please sign in to comment.