/** * Setup the layout used by the controller. * * @return void */ protected function setupLayout() { if (!is_null($this->layout)) { $categories = Category::all(); $pages = Page::all(); $this->layout = View::make($this->layout)->with('styles', $this->styles)->with('scripts', $this->scripts)->with('content_title', '')->with('categories', $categories)->with('pages', $pages)->with('inline_js', $this->inline_js)->with('sidebar', null); } }
public function test_save_transaction() { $pageLangs = ['en_US' => new PageLangDTO('name 1', 'content 1', 'seo title 1', 'seo description 1', 'handle 1'), 'pt_BR' => null]; try { $this->pageService->save(true, $pageLangs); } catch (Exception $ignore) { } $pages = Page::all(); $this->assertEmpty($pages); }
public function index() { if (\Input::get('theme')) { \Cookie::queue('theme', \Input::get('theme'), 100); return Redirect::to('/')->withCookie(cookie('theme', \Input::get('theme'), 100)); } $data = array('videos' => Video::where('active', '=', '1')->orderBy('created_at', 'DESC')->simplePaginate($this->videos_per_page), 'current_page' => 1, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'pagination_url' => '/videos', 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all()); //dd($data['videos']); return View::make('Theme::home', $data); }
public function index() { $search_value = Input::get('value'); if (empty($search_value)) { return Redirect::to('/'); } $videos = Video::where('active', '=', 1)->where('title', 'LIKE', '%' . $search_value . '%')->orderBy('created_at', 'desc')->get(); $posts = Post::where('active', '=', 1)->where('title', 'LIKE', '%' . $search_value . '%')->orderBy('created_at', 'desc')->get(); $data = array('videos' => $videos, 'posts' => $posts, 'search_value' => $search_value, '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::search-list', $data); }
public function category($category) { $page = Input::get('page'); if (!empty($page)) { $page = Input::get('page'); } else { $page = 1; } $cat = PostCategory::where('slug', '=', $category)->first(); $data = array('posts' => Post::where('active', '=', '1')->where('post_category_id', '=', $cat->id)->orderBy('created_at', 'DESC')->simplePaginate($this->posts_per_page), 'current_page' => $page, 'category' => $cat, 'page_title' => 'Posts - ' . $cat->name, 'page_description' => 'Page ' . $page, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'pagination_url' => '/posts/category/' . $category, 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all()); return View::make('Theme::post-list', $data); }
/** * Display a listing of the resource. * * @return Response */ public function index($category_slug) { $categories = Category::all(); $cat_id = 0; foreach ($categories as $category) { if ($category->name == $category_slug || strtolower($category->name) == $category_slug) { $cat_id = $category->id; break; } } $data = array('media' => Media::where('active', '=', 1)->where('category_id', '=', $cat_id)->orderBy('created_at', 'desc')->paginate(Config::get('site.num_results_per_page')), 'categories' => Category::all(), 'pages' => Page::all(), 'settings' => Setting::first()); return View::make('Theme::home', $data); }
public function show_favorites() { if (!Auth::guest()) { $page = Input::get('page'); if (empty($page)) { $page = 1; } $favorites = Favorite::where('user_id', '=', Auth::user()->id)->orderBy('created_at', 'desc')->get(); $favorite_array = array(); foreach ($favorites as $key => $fave) { array_push($favorite_array, $fave->video_id); } $videos = Video::where('active', '=', '1')->whereIn('id', $favorite_array)->paginate(12); $data = array('videos' => $videos, 'page_title' => ucfirst(Auth::user()->username) . '\'s Favorite Videos', 'current_page' => $page, 'page_description' => 'Page ' . $page, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'pagination_url' => '/favorites', 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all()); return View::make('Theme::video-list', $data); } else { return Redirect::to('videos'); } }
public static function getMenu() { $page = Page::all(); foreach ($page as $value) { $route = $value['route']; $title = $value['title']; ?> <li><a href="<?php echo $route; ?> "><?php echo $title; ?> </a></li> <?php } }
public function home() { try { $settings = Setting::first(); if ($settings) { $search = Input::get('search'); if (isset($search)) { $media = Media::where('active', '=', 1)->where('title', 'LIKE', '%' . $search . '%')->orderBy('created_at', 'desc')->paginate(Config::get('site.num_results_per_page')); } else { $media = Media::with('media_likes', 'comments')->where('active', '=', 1)->orderBy('created_at', 'desc')->paginate(Config::get('site.num_results_per_page')); } $categories = Category::orderBy('order', 'ASC')->get(); $pages = Page::all(); $data = array('media' => $media, 'search' => $search, 'categories' => $categories, 'pages' => $pages, 'settings' => Setting::first()); return View::make('Theme::home', $data); } else { throw new Exception('settings not set, first install the script'); } } catch (Exception $e) { return Redirect::to('install.php'); } }
public function get_create() { $this->data['create'] = true; $this->data['pages'] = Page::all(); return View::make('admin.' . $this->views . '.form', $this->data); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $pages = Page::all(); return View::make('backend.pages.index')->with('pages', $pages); }
function all($request) { $page = new Page(); $list = $page->all($page); echo json_encode($list); }
public function action_new() { $pages = Page::all(); $tree = $this->createTree($pages); return View::make('admin.pages.new')->with('pages', $tree); }
/** * Display a listing of pages * * @return Response */ public function index() { $pages = Page::all()->except(array(1, 2)); return View::make('pages.index', compact('pages')); }
<?php include '../../inc/init.inc'; isset($conditions) ? $args['conditions'] = $conditions : ''; $res->total = isset($args) ? Page::count($args) : Page::count(); $res->currentPage = isset($currentPage) ? $currentPage : 1; $res->limit = $args['limit'] = isset($limit) ? $limit : 7; $args['offset'] = ($res->currentPage - 1) * $args['limit']; $args['order'] = isset($order) ? $order : 'created_at desc'; $res->pages = Page::all($args); $res->search_opts = array(0 => array('label' => 'Quel article cherchez vous ?', 'field' => 'title', 'type' => 'text', 'class' => 'xxlarge')); $res->useTemplate("Wiki");
public function index() { $pages = Page::all(); return View::make('admin.pages.pages.index')->with(['pages' => $pages]); }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show($slug) { $media = Media::with('media_likes', 'comments')->where('slug', '=', $slug)->first(); if (isset($media)) { $view_increment = $this->handleViewCount($media->id); $next = Media::where('active', '=', 1)->where('created_at', '>', date("Y-m-d H:i:s", strtotime($media->created_at)))->first(); $previous = Media::where('active', '=', 1)->where('created_at', '<', date("Y-m-d H:i:s", strtotime($media->created_at)))->orderBy('created_at', 'desc')->first(); $media_next = Media::where('active', '=', 1)->where('created_at', '>=', date("Y-m-d H:i:s", strtotime($media->created_at)))->take(6)->get(); $next_media_count = $media_next->count(); if ($next_media_count < 6) { $get_prev_results = 6 - $next_media_count; $media_prev = Media::where('active', '=', 1)->where('created_at', '<', date("Y-m-d H:i:s", strtotime($media->created_at)))->orderBy('created_at', 'DESC')->take($get_prev_results)->get(); } else { $media_prev = array(); } $data = array('item' => $media, 'media_next' => $media_next, 'next' => $next, 'previous' => $previous, 'media_prev' => $media_prev, 'view_increment' => $view_increment, 'settings' => Setting::first(), 'categories' => Category::all(), 'pages' => Page::all(), 'single' => true); return View::make('Theme::media', $data); } else { return Redirect::to('/'); } }
public function password_reset_token($token) { $data = array('type' => 'reset_password', 'token' => $token, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'payment_settings' => PaymentSetting::first(), 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all()); return View::make('Theme::auth', $data); }
public function index() { $page = Page::all(); return View::make('Admin/pages/page/allPage', compact('page')); }
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); }
public function showPages() { $pages = Page::all(); return View::make('backend.admin.config.pageslist')->with('pages', $pages); }
<?php /* @var $this CommentController */ /* @var $model Comment */ Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$('#comment-grid').yiiGridView('update', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n"); ?> <h1>Журнал Комментариев</h1> <?php echo CHtml::link('Расширеный поиск', '#', array('class' => 'search-button')); ?> <div class="search-form" style="display:none"> <?php $this->renderPartial('_search', array('model' => $model)); ?> </div><!-- search-form --> <?php $this->widget('zii.widgets.grid.CGridView', array('id' => 'comment-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array('id', 'content', 'status' => array('name' => 'status', 'value' => '($data->status == 1) ? "Опубликовано":"Скрыто"', 'filter' => array('1' => 'Опубликовано', '0' => 'Скрыто')), 'page_id' => array('name' => 'page_id', 'value' => '$data->page->title', 'filter' => Page::all()), 'created' => array('name' => 'created', 'value' => 'date("j.m.Y H:i", $data->created)', 'filter' => false), 'user_id' => array('name' => 'user_id', 'value' => '$data->user->username', 'filter' => User::all()), 'guest' => array('name' => 'guest', 'value' => '($data->guest == 1) ? "Гость":"Пользователь"', 'filter' => array('1' => 'Гость', '0' => 'Пользователь')), array('class' => 'CButtonColumn', 'updateButtonOptions' => array('style' => 'display: none')))));
<div class="row"> <?php echo $form->label($model, 'status'); ?> <?php echo $form->dropDownList($model, 'status', array('' => '', '1' => 'Опубликовано', '0' => 'Скрыто')); ?> </div> <div class="row"> <?php echo $form->label($model, 'page_id'); ?> <?php echo $form->dropDownList($model, 'page_id', Page::all(), array('empty' => '')); ?> </div> <div class="row"> <?php echo $form->label($model, 'user_id'); ?> <?php echo $form->dropDownList($model, 'user_id', User::all(), array('empty' => '')); ?> </div> <div class="row"> <?php echo $form->label($model, 'guest');
Route::get('category/delete/{id}', 'CategoriesController@delete'); Route::resource('categories', 'CategoriesController'); Route::get('admin/ad_placements', 'AdminController@ad_placements'); Route::post('admin/ad_placements', 'AdminController@update_ad_placements'); Route::get('admin/plugins', 'AdminController@plugins'); Route::get('admin/plugin/deactivate/{plugin_name}', 'AdminController@plugin_deactivate'); Route::get('admin/plugin/activate/{plugin_name}', 'AdminController@plugin_activate'); Route::get('admin/pages', 'AdminController@pages'); Route::post('admin/pages/update/{id}', 'AdminController@update_pages'); Route::get('admin/pages/delete/{id}', 'AdminController@delete_pages'); Route::post('admin/pages/create', 'AdminController@create_pages'); Route::get('admin/update', 'AdminController@update'); }); Route::get('pages/{slug}', function ($slug) { $page = Page::where('url', '=', $slug)->first(); $data = array('page_content' => $page, 'page' => $page, 'categories' => Category::all(), 'pages' => Page::all(), 'settings' => Setting::first()); return View::make('Theme::page', $data); }); Route::get('view/list', function () { $cookie = Cookie::make('media_view', 'list', 30); return Redirect::to('/')->withCookie($cookie); }); Route::get('view/grid_large', function () { $cookie = Cookie::make('media_view', 'grid_large', 30); return Redirect::to('/')->withCookie($cookie); }); Route::get('view/grid', function () { $cookie = Cookie::make('media_view', 'grid', 30); return Redirect::to('/')->withCookie($cookie); }); Route::get('sidebar/hide', function () {
/** * Display a listing of the resource. * * @return Response */ public function index() { $pages = Page::all(); $this->layout->title = 'Liste des pages'; $this->layout->main = View::make('dash')->nest('content', 'pages.index', compact('pages')); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $pages = Page::all(); return View::make('modules.page.admin', compact('pages')); }
public function index() { return View::make("admin.{$this->name}.{$this->action}", ['items' => Page::all(), 'name' => $this->name, 'action' => $this->action]); }
/** * Constructeur * * */ public function __construct() { View::share('pages', Page::all()); }
<?php return array('GET /admin, GET /admin/pages' => array('before' => 'auth', function () { $pages = Page::all(); $view = View::of_admin_layout(); $view->content = View::make('admin.pages')->with('pages', $pages); return $view; }), 'GET /admin/media' => array('before' => 'auth', function () { $files = Media::all(); $view = View::of_admin_layout(); $view->content = View::make('admin.media')->with('files', $files); return $view; }), 'GET /admin/users' => array('before' => 'auth', function () { $users = User::all(); $view = View::of_admin_layout(); $view->content = View::make('admin.users')->with('users', $users); return $view; }), 'GET /admin/newpage/(:num?)' => array('before' => 'auth', function ($pageid = NULL) { if ($pageid) { $page = Page::find($pageid); } $view = View::of_admin_layout(); $view->content = View::make('admin.newpage')->with('page', $page); return $view; }), 'GET /admin/newmedia' => array('before' => 'auth', function () { $view = View::of_admin_layout(); $view->content = View::make('admin.newmedia'); return $view; }), 'GET /admin/newuser' => array('before' => 'auth', function () { $roleoptions = array('admin' => 'Admin', 'edit' => 'Editor'); $view = View::of_admin_layout();
public function __construct() { $this->pages = Page::all(); }