public function index() { $widgets = array(); $wroot = c::get('root.site') . DS . 'widgets'; $wdirs = dir::read($wroot); foreach ($wdirs as $dir) { $file = $wroot . DS . $dir . DS . $dir . '.php'; if (file_exists($file)) { $widgets[$dir] = (require $file); } } return view('dashboard/index', array('topbar' => new Snippet('pages/topbar', array('breadcrumb' => new Snippet('breadcrumb'), 'search' => purl('pages/search/'))), 'history' => history::get(), 'site' => site(), 'widgets' => $widgets, 'user' => site()->user())); }
public function index() { $site = site(); $widgets = array(); $wroot = kirby()->roots()->widgets(); $wdirs = dir::read($wroot); // fetch all top-level pages in the right order $blueprint = blueprint::find($site); $pages = api::subpages($site->children(), $blueprint); foreach ($wdirs as $dir) { $file = $wroot . DS . $dir . DS . $dir . '.php'; if (file_exists($file)) { $widgets[$dir] = (require $file); } } return view('dashboard/index', array('topbar' => new Snippet('pages/topbar', array('breadcrumb' => new Snippet('breadcrumb'), 'search' => purl('pages/search/'))), 'history' => history::get(), 'site' => $site, 'pages' => $pages, 'addbutton' => !api::maxPages($site, $blueprint->pages()->max()), 'widgets' => $widgets, 'user' => site()->user(), 'license' => panel()->license())); }
<?php return array('title' => array('text' => l('dashboard.index.history.title'), 'link' => false), 'html' => function () { return tpl::load(__DIR__ . DS . 'history.html.php', array('history' => history::get())); });