Esempio n. 1
0
    $total_objects = 0;
    foreach ($pages as $pg) {
        if (isset($pg['objects'])) {
            $total_objects += count($pg['objects']);
        }
    }
    $page = new \Meta\Builder\Page($path, $pageArray);
    // create json of all objects
    $objectsJson = array();
    foreach ((array) $page->objects as $object) {
        if ($object instanceof \Meta\Builder\Object) {
            $objectsJson[] = json_encode($object);
        }
    }
    $side_content = render('builder-objects.php', array('pages' => $pages, 'page_current' => $path, 'count_objects' => $total_objects));
    echo render('builder-manage.php', array('pageLabel' => $page->label, 'pageType' => $page->pageType, 'pageTypes' => \Meta\Builder::pageTypes(), 'pageShowOnMenu' => $page->showonmenu, 'pageParent' => $page->parentmenu, 'pageIcon' => $page->menuIcon, 'pageCheckPerms' => $page->checkperms, 'pageGroupsAllowed' => $page->groupsAllowed, 'pageObjects' => $page->objects, 'pagesList' => \Meta\Builder\Menu::buildSelect(), 'page_name' => $path, 'side_content' => $side_content, 'groupList' => \Meta\Builder::listGroups(), 'componentList' => \Meta\Builder::listComponents(), 'iconList' => bootstrap_glyphicons_list(), 'objectsJson' => $objectsJson, 'rulesList' => json_encode(\Meta\Builder\Conditions::listConditions()), 'cmdsList' => json_encode(\Meta\Builder\Commands::listCmds()), 'validationsList' => json_encode(\Meta\Builder\Validations::listValidations()), 'formattersList' => json_encode(\Meta\Builder\Formatters::listFormatters()), 'framesList' => json_encode(\Meta\Builder::pageNames('frame'))));
});
// re-order page object
route_add('builder/page/reorder/*', function ($page_name) {
    $resp = array();
    $resp['errors'] = array();
    if (is_demo()) {
        $resp['errors'][] = \Meta\Builder::demoMsg();
    }
    if (!$resp['errors']) {
        $pages = \Meta\Builder::read('pages');
        $old_list = $pages[$page_name]['objects'];
        $new_list = array();
        foreach ((array) $_REQUEST['item'] as $key) {
            $new_list[$key] = $old_list[$key];
            $new_list[$key]['id'] = $key;