Example #1
0
 /**
  * Get paginated pages.
  *
  * @param int  $page  Number of pages per page
  * @param int  $limit Results per page
  * @param bool $all   Show published or all
  *
  * @return StdClass Object with $items and $totalItems for pagination
  */
 public function paginate($page = 1, $limit = 10, $all = false)
 {
     $result = new \StdClass();
     $result->page = $page;
     $result->limit = $limit;
     $result->totalItems = 0;
     $result->items = array();
     $query = $this->page->orderBy('created_at', 'DESC')->where('lang', $this->getLang());
     if (!$all) {
         $query->where('is_published', 1);
     }
     $pages = $query->skip($limit * ($page - 1))->take($limit)->get();
     $result->totalItems = $this->totalPages($all);
     $result->items = $pages->all();
     return $result;
 }
 /**
  * Display a listing of videos
  *
  * @return Response
  */
 public function index()
 {
     $pages = Page::orderBy('created_at', 'DESC')->paginate(10);
     $user = Auth::user();
     $data = array('pages' => $pages, 'user' => $user, 'admin_user' => Auth::user());
     return View::make('admin.pages.index', $data);
 }
Example #3
0
 public function tat_ca()
 {
     $data['post'] = Page::orderBy('id', 'desc')->paginate(11);
     $data['loai'] = 0;
     $data['title'] = 'Tất cả việc làm | Website viec lam sinh vien uy tin hang dau Viet Nam';
     return View::make('template.content', $data);
 }
Example #4
0
 public function tat_ca()
 {
     $data['post'] = Page::orderBy('id', 'desc')->paginate(11);
     $data['loai'] = 0;
     $data['title'] = 'Tất cả việc làm | Website viec lam sinh vien uy tin hang dau Viet Nam';
     $data['description'] = 'Việc Làm Sinh Viên Đà Nẵng - Nơi sinh viên tìm kiếm việc làm thêm, việc làm bán thời gian. Có hàng ngàn việc làm thêm cho sinh viên, việc làm thêm ở Đà Nẵng';
     return View::make('template.content', $data);
 }
Example #5
0
 /** @test **/
 public function it_orders_the_values()
 {
     $this->createComponent('pages');
     $this->insertOn('pages', ['title' => 'House', 'content' => 'Repeating']);
     $this->insertOn('pages', ['title' => 'Sherlock', 'content' => 'Elementary Watson.']);
     $this->insertOn('pages', ['title' => 'Psych!', 'content' => 'Repeating']);
     $pages = Page::orderBy('title', 'DESC')->get();
     $this->assertEquals('Sherlock', $pages->first()->title);
     $this->assertEquals('House', $pages->last()->title);
 }
Example #6
0
 /**
  *
  * @param $pageId int
  * @return nothing
  * @author Tremor
  */
 public function page($pageId = 0)
 {
     $this->data['active'] = __FUNCTION__;
     if (isset($pageId) && !empty($pageId) && is_numeric($pageId)) {
         $this->data['placeList'] = Place::lists('name', 'id');
         $this->data['page'] = Page::find($pageId);
         return View::make('admin.page.one')->with($this->data);
     } else {
         $this->data['pageList'] = Page::orderBy('place_id')->orderBy('sort')->get();
         return View::make('admin.page.list')->with($this->data);
     }
 }
 public function get_index()
 {
     $admin = Auth::user();
     $mp3s = MP3::orderBy('created_at', 'desc')->take(10)->get();
     $mp3scount = MP3::count();
     $mp4s = MP4::orderBy('created_at', 'desc')->take(10)->get();
     $mp4scount = MP4::count();
     $users = User::orderBy('created_at', 'desc')->take(10)->get();
     $userscount = User::count();
     $categories = Category::orderBy('name')->take(10)->get();
     $catscount = Category::count();
     $pages = Page::orderBy('created_at', 'desc')->paginate(10);
     $pages_count = Page::count();
     $title = 'Administrasyon';
     return View::make('admin.index')->withAdmin($admin)->withMp3s($mp3s)->withMp4s($mp4s)->withUsers($users)->withCategories($categories)->withPages($pages)->withTitle($title)->withMp3sCount($mp3scount)->withMp4sCount($mp4scount)->withUsersCount($userscount)->withCatsCount($catscount)->withPagesCount($pages_count);
 }
Example #8
0
 public function page_tatca()
 {
     $data['post'] = Page::orderBy('id', 'desc')->paginate(11);
     $data['loai'] = 0;
     return View::make('admin.content_page', $data);
 }
Example #9
0
 public function pages()
 {
     $pages = Page::orderBy('order', 'ASC')->get();
     $data = array('pages' => $pages);
     return View::make('admin.sections.pages', $data);
 }
 public function pages()
 {
     $data = array('pages' => Page::orderBy('created_at', 'DESC')->get(), 'page_title' => 'Pages', 'page_description' => 'All Pages', 'menu' => Menu::orderBy('order', 'ASC')->get(), 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all());
     return View::make('Theme::page-list', $data);
 }
Example #11
0
       <?php 
if ($settings->pages_in_menu) {
    ?>
       <li class="dropdown <?php 
    if (Request::is('pages/*') || Request::is('pages')) {
        echo 'active';
    }
    ?>
">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-file-text"></i> <?php 
    echo $settings->pages_in_menu_text;
    ?>
 <b class="caret"></b></a>
          <ul class="dropdown-menu">
            <?php 
    $pages = Page::orderBy('order', 'ASC')->get();
    ?>
            <?php 
    foreach ($pages as $page_link) {
        ?>
              <li><a href="<?php 
        echo URL::to('pages') . '/' . $page_link->url;
        ?>
"><?php 
        echo $page_link->title;
        ?>
</a></li>
            <?php 
    }
    ?>