Пример #1
0
 public function render()
 {
     // check object rules
     if ($this->rules && !Conditions::checkConditions($this->rules)) {
         return false;
     }
     $html = '';
     if ($this->htmlBefore) {
         $html .= $this->htmlBefore;
     }
     $html .= $this->renderContent();
     if (isset($this->htmlAfter)) {
         $html .= $this->htmlAfter;
     }
     return $html;
 }
Пример #2
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;
Пример #3
0
 /**
  * @return array
  */
 private function getDisplayCols()
 {
     $cols = array();
     foreach ($this->columns as $col) {
         $col instanceof Column;
         // check column display rules
         if (!$col->conditions || $col->conditions && Conditions::checkConditions($col->conditions)) {
             $cols[] = $col;
         }
     }
     return $cols;
 }