/** * Show this page of objects from the query. * The query must be set with {@link set_query()} before calling this * function. If the number of objects specified in 'set_ranges' exceeds (rows * x columns), then the page number specifies which page of objects to show in * the grid. If there are no objects, then don't render a grid, but display a * 'no objects' message. */ public function display() { if (!isset($this->_num_objects)) { $this->_num_objects = $this->_get_size(); $this->pager->set_ranges($this->_num_objects, $this->_num_rows * $this->_num_columns); } if ($this->_num_objects > 0) { $objects = $this->_get_objects(); if (isset($this->env->profiler)) { $this->env->profiler->start('ui'); } $this->_draw($objects); if (isset($this->env->profiler)) { $this->env->profiler->stop('ui'); } } else { $this->_draw_empty_grid(); } }
$grid->pager->pages_to_show = 2; $grid->pager->show_first_and_last = false; $grid->pager->show_total = false; $grid->set_page_size(Default_page_size); $grid->set_query($theme_query); $grid->display(); ?> </div> </div> <div> <h1>Preview (level 1 heading)</h1> <h2>Buttons & Menus (level 2 heading)</h2> <?php require_once 'webcore/gui/page_navigator.php'; $navigator = new PAGE_NAVIGATOR($Page); $navigator->set_ranges(50, 10); $navigator->pages_to_show = 4; $navigator->display(); ?> <div class="button-content"> <?php require_once 'webcore/cmd/commands.php'; $menu = $Page->make_menu(); $menu->commands->append_group('Group One'); $menu->append('One', '#', '{icons}/buttons/edit'); $menu->append('Two', '#', '{icons}/buttons/add'); $item = $menu->append('Three', '#', '{icons}/buttons/delete'); $item->description = 'Button three includes a description below'; $menu->renderer->content_mode &= ~Menu_show_icon; $menu->display(); ?>