Made big headway in preference management, accounts, importing stuff, etc. etc.

This commit is contained in:
James Cole
2014-07-06 15:18:11 +02:00
parent 188105492c
commit 4192f2bc8f
46 changed files with 672 additions and 187 deletions

View File

@@ -1,19 +1,35 @@
<?php
use Carbon\Carbon as Carbon;
use Firefly\Helper\Preferences\PreferencesHelperInterface as PHI;
use Firefly\Storage\Account\AccountRepositoryInterface as ARI;
class HomeController extends BaseController {
public function __construct(ARI $accounts) {
class HomeController extends BaseController
{
protected $accounts;
protected $preferences;
public function __construct(ARI $accounts, PHI $preferences)
{
$this->accounts = $accounts;
$this->preferences = $preferences;
View::share('menu', 'home');
}
public function index()
{
public function index()
{
// get list setting:
$pref = $this->preferences->get('frontpageAccounts', []);
// get the accounts to display on the home screen:
$count = $this->accounts->count();
if ($pref->data == []) {
$list = $this->accounts->getActiveDefault();
} else {
$list = $this->accounts->getByIds($pref->data);
}
// build the home screen:
return View::make('index')->with('count',$count);
}
return View::make('index')->with('count', $count)->with('accounts', $list);
}
}