コード例 #1
0
 public function index(Request $request)
 {
     $widgetClasses = WidgetsFacade::all();
     asort($widgetClasses);
     $widgets = [];
     foreach ($widgetClasses as $widgetClass) {
         $widget = new $widgetClass();
         $widgets[$widget->getName()] = $widget->getDisplayName();
     }
     $placeholders = HomeThemeFacade::placeholders();
     asort($placeholders);
     $placeholderNames = array_keys($placeholders);
     $themeWidgets = ThemeWidget::whereIn('placeholder', $placeholderNames)->orderBy('order', 'asc')->orderBy('created_at', 'asc')->get();
     $themePlaceholders = [];
     foreach ($placeholderNames as $placeholderName) {
         $themePlaceholders[$placeholderName] = [];
     }
     foreach ($themeWidgets as $themeWidget) {
         $placeholderName = $themeWidget->placeholder;
         $themePlaceholders[$placeholderName][] = $themeWidget;
     }
     $this->theme->title(trans('pages.admin_widgets_title'));
     $this->theme->description(trans('pages.admin_widgets_desc'));
     return $this->_list(['widgets' => $widgets, 'placeholders' => $placeholders, 'placeholderNames' => $placeholderNames, 'themePlaceholders' => $themePlaceholders, 'rdr_param' => rdrQueryParam($request->fullUrl())]);
 }
コード例 #2
0
ファイル: UserController.php プロジェクト: linhntaim/katniss
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index(Request $request)
 {
     $this->theme->title(trans('pages.admin_users_title'));
     $this->theme->description(trans('pages.admin_users_desc'));
     $users = User::orderBy('created_at', 'desc')->paginate(AppConfig::DEFAULT_ITEMS_PER_PAGE);
     $users_query = new QueryStringBuilder(['page' => $users->currentPage()], adminUrl('users'));
     return $this->_list(['users' => $users, 'users_query' => $users_query, 'page_helper' => new PaginationHelper($users->lastPage(), $users->currentPage(), $users->perPage()), 'rdr_param' => rdrQueryParam($request->fullUrl())]);
 }
コード例 #3
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(Request $request)
 {
     $this->theme->title(trans('pages.admin_link_categories_title'));
     $this->theme->description(trans('pages.admin_link_categories_desc'));
     $categories = Category::where('type', Category::LINK)->orderBy('created_at', 'desc')->paginate(AppConfig::DEFAULT_ITEMS_PER_PAGE);
     $query = new QueryStringBuilder(['page' => $categories->currentPage()], adminUrl('link-categories'));
     return $this->_list(['categories' => $categories, 'query' => $query, 'page_helper' => new PaginationHelper($categories->lastPage(), $categories->currentPage(), $categories->perPage()), 'rdr_param' => rdrQueryParam($request->fullUrl())]);
 }
コード例 #4
0
 public function index(Request $request)
 {
     $this->theme->title(trans('pages.admin_extensions_title'));
     $this->theme->description(trans('pages.admin_extensions_desc'));
     $extensionClasses = ExtensionsFacade::all();
     $extensions = [];
     foreach ($extensionClasses as $extensionClass) {
         $extension = new $extensionClass();
         $extensionName = $extension->getName();
         $extensions[] = ['name' => $extensionName, 'display_name' => $extension->getDisplayName(), 'description' => $extension->getDescription(), 'editable' => $extension->isEditable(), 'activated' => ExtensionsFacade::isActivated($extensionName), 'static' => ExtensionsFacade::isStatic($extensionName)];
     }
     return $this->_list(['extensions' => $extensions, 'rdr_param' => rdrQueryParam($request->fullUrl())]);
 }