public static function listPending() { $all = globFiles('migration/*'); $applied = db()->select('update_migration')->assocs('id'); $pending = array(); foreach ($all as $id) { if (empty($applied[$id])) { $pending[] = $id; } } return $pending; }
recalcTree($child); $child->right = ++$counter; } } } if (empty($_GET['content'])) { $self = MODUL_SELF . '&layeredit=' . intval($_GET['layeredit']); $layers = db()->select('content_layer')->relate(); $layers[0] = 'System Root'; $scripts = array(); foreach (iv::get('scripts') as $key => $script) { $scripts[$key] = $script['name']; } $layer_templates = globFiles('style/' . $conf->page->style . '/layer/*', false); $layer_templates[''] = 'Kein Template'; $panel_templates = globFiles('style/' . $conf->page->style . '/panel/*', false); $panel_templates[''] = 'Kein Template'; if (!empty($_GET['frontpage'])) { $conf->set('page', 'startpage', $_GET['frontpage']); } if (!empty($_GET['movepanel'])) { db()->id_update('content_panel', array('layer' => $_GET['parent']), $_GET['movepanel']); if (db()->affected_rows) { throw new redirect($self); } } if (!empty($_REQUEST['parent'])) { // do not allow cyclic references $layer = $_GET['layerupdate'] ?: $_GET['movelayer']; if (db()->query("SELECT 1 FROM content_layer node JOIN content_layer sub\n\t\t\tON node.lft < sub.lft AND node.rgt > sub.rgt\n\t\t\tWHERE node.id = %d AND sub.id = %d", $layer, $_REQUEST['parent'])->value()) { throw new Exception('You can not do that!');
public function getOptions() { return globFiles($this->info['pattern']); }
if (empty($packages[$_GET['edit']])) { throw new Exception('Paket nicht gefunden!'); } new update_manager($view, $packages[$_GET['edit']]); } elseif (isset($_GET['storefile'])) { $view->format = 'plain'; $pkg = new update_package(array('id' => $_POST['pkg'])); $pkg->updateFile($_POST['path'], $_POST['content']); $view->content('ok'); } elseif (isset($_GET['addpackage'])) { $view->format = 'plain'; $pkg = new update_package($_POST); $pkg->install($writer); $view->content('ok'); } elseif (isset($_GET['getmigrations'])) { $all = globFiles('migration/*'); $applied = db()->select('update_migration')->assocs('id'); $result = $pending = array(); foreach ($all as $id) { if (empty($applied[$id])) { $pending[] = $id; } } $view->plain(json_encode($pending)); } elseif (!empty($_GET['install'])) { $view->format = 'plain'; $migrations = new update_migration(); $migrations->install($_GET['install']); } else { $view->js('assets/js/update.js'); $view->js('assets/js/migration.js');