Exemplo n.º 1
0
echo Xhtml::make('div', function ($html) {
    $html->content_panel('Pages', function ($div) {
        $div->div(function ($html) {
            $html->table(function ($table) {
                $table->setClass('table table-striped table-hover');
                $table->thead(function ($thead) {
                    $thead->tr(function ($tr) {
                        $tr->th('Title');
                        $tr->th('author');
                        $tr->th('publish date');
                        $tr->th('created');
                        $tr->th('updated');
                        $tr->th('');
                    });
                });
                $table->tbody(function ($tbody) {
                    $tbody->tr(function ($tr) {
                        $tr->td(function ($td) {
                            $td->span(function ($span) {
                                $span->a(function ($a) {
                                    $a->i()->class('icon-edit');
                                    // $a->setHref('#edit');
                                    $a->setTitle(trans('ravel::form.edit'));
                                    $a->setRootAttr('ng-click', 'edit(item)');
                                });
                            });
                            $td->span()->ng_bind('item.title', 'ng-bind');
                        });
                        $tr->td()->ng_bind('item.author.username', 'ng-bind');
                        $tr->td()->ng_bind('item.publish_date', 'ng-bind');
                        $tr->td()->ng_bind('item.created_at', 'ng-bind');
                        $tr->td()->ng_bind('item.updated_at', 'ng-bind');
                        $tr->td(function ($td) {
                        });
                        $tr->setNgRepeat('item in recordset', 'ng-repeat');
                    });
                });
                $table->tfoot(function ($tfoot) {
                    $tfoot->tr(function ($tr) {
                        $tr->td(function ($td) {
                            // $td->div(function($div)
                            // {
                            //   // $content = "<div class='paginator' paginate-pages='{{pages}}'></div>";
                            //   // $div->putText($content);
                            //   $div->setClass('pagination');
                            //   $div->setRootAttr('paginate-pages',aw('pages'));
                            // });
                            $td->div()->class('paginator pagination')->paginatepages('{{pages}}', 'paginate-pages');
                            $td->setColspan('6');
                        });
                    });
                });
            });
        });
    }, function ($html) {
        $html->button('create')->class('button')->ng_click('create()', 'ng-click');
    });
});
Exemplo n.º 2
0
        foreach ($menulinks as $key => $menu) {
            $ul->li(function ($li) use($menu, $parent) {
                $ParentlinkClass = 'menu-parent';
                if ($menu['active']) {
                    $ParentlinkClass = 'menu-parent current';
                }
                if (isset($menu['children'])) {
                    $li->a($menu['label'])->href($menu['link'])->class($ParentlinkClass);
                    $li->menulinks($menu['children'], false);
                } else {
                    if ($parent) {
                        $li->a($menu['label'])->href($menu['link'])->class($ParentlinkClass);
                    } else {
                        if ($menu['active']) {
                            $li->a($menu['label'])->href($menu['link'])->class('current');
                        } else {
                            $li->a($menu['label'])->href($menu['link']);
                        }
                    }
                }
            });
        }
        if ($parent) {
            $ul->setId('main-nav');
        }
    });
});
echo Xhtml::make('nav', function ($div) use($menu_links) {
    $div->setClass('test');
    $div->menulinks($menu_links);
});
Exemplo n.º 3
0
        foreach ($menulinks as $key => $menu) {
            $ul->li(function ($li) use($menu, $parent) {
                $ParentlinkClass = 'nav-top-item no-submenu';
                if ($menu['active']) {
                    $ParentlinkClass = 'nav-top-item no-submenu current';
                }
                if (isset($menu['children'])) {
                    $li->a($menu['label'])->href($menu['link'])->class($ParentlinkClass);
                    $li->menulinks($menu['children'], false);
                } else {
                    if ($parent) {
                        $li->a($menu['label'])->href($menu['link'])->class($ParentlinkClass);
                    } else {
                        if ($menu['active']) {
                            $li->a($menu['label'])->href($menu['link'])->class('current');
                        } else {
                            $li->a($menu['label'])->href($menu['link']);
                        }
                    }
                }
            });
        }
        if ($parent) {
            $ul->setId('main-nav');
        }
    });
});
echo Xhtml::make('nav', function ($div) use($menu_links) {
    $div->setClass('menu-main-menu-container');
    $div->menulinks($menu_links);
});
Exemplo n.º 4
0
echo Xhtml::make('div', function ($html) {
    $html->content_panel(trans('ravel::content.post_categories'), function ($div) {
        $div->div(function ($html) {
            $html->table(function ($table) {
                $table->setClass('table table-striped table-hover');
                $table->thead(function ($thead) {
                    $thead->tr(function ($tr) {
                        $tr->th(trans('ravel::content.category_name'));
                        $tr->th(trans('ravel::content.list_layout'));
                        $tr->th(trans('ravel::content.item_layout'));
                        $tr->th(trans('ravel::app.created_at'));
                        $tr->th(trans('ravel::app.updated_at'));
                        $tr->th('');
                    });
                });
                $table->tbody(function ($tbody) {
                    $tbody->tr(function ($tr) {
                        $tr->td(function ($td) {
                            $td->span(function ($span) {
                                $span->a(function ($a) {
                                    $a->i()->class('icon-edit');
                                    // $a->setHref('#edit');
                                    $a->setTitle(trans('ravel::form.edit'));
                                    $a->setRootAttr('ng-click', 'edit(item)');
                                });
                            });
                            $td->span()->ng_bind('item.name', 'ng-bind');
                        });
                        $tr->td()->ng_bind('item.list_layout', 'ng-bind');
                        $tr->td()->ng_bind('item.item_layout', 'ng-bind');
                        $tr->td()->ng_bind('item.created_at', 'ng-bind');
                        $tr->td()->ng_bind('item.updated_at', 'ng-bind');
                        $tr->td(function ($td) {
                        });
                        $tr->setNgRepeat('item in recordset', 'ng-repeat');
                    });
                });
                $table->tfoot(function ($tfoot) {
                    $tfoot->tr(function ($tr) {
                        $tr->td(function ($td) {
                            $td->div()->class('paginator pagination')->paginatepages('{{pages}}', 'paginate-pages');
                            $td->setColspan('6');
                        });
                    });
                });
            });
        });
    }, function ($html) {
        $html->button('create')->class('button')->ng_click('create()', 'ng-click');
    });
});
Exemplo n.º 5
0
echo Xhtml::make('div', function ($html) {
    $html->content_panel('Users', function ($div) {
        $div->div(function ($html) {
            $html->table(function ($table) {
                $table->thead(function ($thead) {
                    $thead->tr(function ($tr) {
                        $tr->th('username');
                        $tr->th('email');
                        $tr->th('usergroup');
                        $tr->th('status');
                        $tr->th('created');
                        $tr->th('updated');
                        $tr->th('');
                    });
                });
                $table->tbody(function ($tbody) {
                    $tbody->tr(function ($tr) {
                        $tr->td()->ng_bind('item.username', 'ng-bind');
                        $tr->td()->ng_bind('item.email', 'ng-bind');
                        $tr->td()->ng_bind('item.usergroup.group', 'ng-bind');
                        $tr->td(function ($td) {
                            $td->span(showActivated())->ng_show('item.activated', 'ng-show');
                            $td->span(showDeactivated())->ng_hide('item.activated', 'ng-hide');
                        });
                        $tr->td()->ng_bind('item.created_at', 'ng-bind');
                        $tr->td()->ng_bind('item.updated_at', 'ng-bind');
                        $tr->td();
                        $tr->setNgRepeat('item in recordset', 'ng-repeat');
                    });
                });
                $table->tfoot(function ($tfoot) {
                    $tfoot->tr(function ($tr) {
                        $tr->td(function ($td) {
                            $td->div(function ($div) {
                                $content = '<a href="#" title="First Page">&laquo; First</a><a href="#" title="Previous Page">&laquo; Previous</a>
                      <a href="#" class="number" title="1">1</a>
                      <a href="#" class="number" title="2">2</a>
                      <a href="#" class="number current" title="3">3</a>
                      <a href="#" class="number" title="4">4</a>
                      <a href="#" title="Next Page">Next &raquo;</a><a href="#" title="Last Page">Last &raquo;</a>';
                                $div->putText($content);
                                $div->setClass('pagination');
                            });
                            $td->setColspan('6');
                        });
                    });
                });
            });
        });
    }, function ($html) {
        $html->button('create')->class('button')->ng_click('create()', 'ng-click');
    });
});