Skip to content

Commit

Permalink
Misc Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanedev-maroc committed Jul 25, 2017
1 parent 7c349c9 commit 6286cce
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 27 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
}
},
"scripts": {
"testbench": "composer require --dev \"orchestra/testbench=~3.4.0\""
"testbench": "composer require --dev \"orchestra/testbench=~3.4\""
},
"extra": {
"branch-alias": {
Expand Down
16 changes: 0 additions & 16 deletions resources/views/admin/_composers/sidebar/item.blade.php

This file was deleted.

4 changes: 0 additions & 4 deletions resources/views/admin/_composers/sidebar/main.blade.php

This file was deleted.

43 changes: 43 additions & 0 deletions resources/views/admin/_includes/sidebar.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
use Arcanesoft\Sidebar\Entities\Item;
/**
* Render sidebar item.
*
* @param \Arcanesoft\Sidebar\Entities\Item $item
*
* @return string
*/
function renderSidebarItem(Item $item)
{
$output = [];
$output[] = '<li class="'.trim($item->childrenClass().' '.$item->activeClass('active open')).'">';
if ($item->hasChildren()) {
$output[] = '<a href="javascript:void(0);">';
$output[] = '<i class="'.$item->icon().'"></i> <span>'.$item->title().'</span> <i class="fa fa-angle-left pull-right"></i>';
$output[] = '</a>';
$output[] = '<ul class="treeview-menu">';
$output[] = $item->children()->transform(function ($child) { return renderSidebarItem($child); })->implode(PHP_EOL);
$output[] = '</ul>';
}
else {
$output[] = '<a href="'.$item->url().'">';
$output[] = '<i class="'.$item->icon().'"></i> <span>'.$item->title().'</span>';
$output[] = '</a>';
}
$output[] = '</li>';
return implode(PHP_EOL, $output);
}
?>

<ul class="sidebar-menu">
<li class="header">{{ trans('foundation::navigation.sidebar.main-navigation') }}</li>
@foreach($sidebarItems as $item)
{!! renderSidebarItem($item) !!}
@endforeach
</ul>
2 changes: 1 addition & 1 deletion resources/views/admin/_template/sidebar-main.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
</form>
@endif

{{ sidebar()->render('foundation::admin._composers.sidebar.main') }}
{{ sidebar()->render('foundation::admin._includes.sidebar') }}
</section>
</aside>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<li>
<div class="timeline-item">
<div class="timeline-body text-center">
{!! $entries->render('foundation::admin_partials.pagination.small') !!}
{!! $entries->render('foundation::admin._partials.pagination.small') !!}
</div>
</div>
</li>
10 changes: 6 additions & 4 deletions src/ViewComposers/System/ApplicationInfoComposer.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php namespace Arcanesoft\Foundation\ViewComposers\System;

use Illuminate\View\View;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;

/**
* Class ApplicationInfoComposer
Expand Down Expand Up @@ -68,16 +70,16 @@ private function getApplicationSize()
/**
* Get the folder size.
*
* @param string $dir
* @param string $path
*
* @return int
*/
private function getFolderSize($dir)
private function getFolderSize($path)
{
$size = 0;

foreach (glob(rtrim($dir, '/').'/*', GLOB_NOSORT) as $each) {
$size += is_file($each) ? filesize($each) : $this->getFolderSize($each);
foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)) as $directory){
$size += $directory->getSize();
}

return $size;
Expand Down

0 comments on commit 6286cce

Please sign in to comment.