Skip to content

Commit

Permalink
Input facade removed
Browse files Browse the repository at this point in the history
  • Loading branch information
shunmugam committed Jul 21, 2020
1 parent 704efff commit 2d4a16a
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 59 deletions.
2 changes: 1 addition & 1 deletion src/stubs/cms/core/blog/Controllers/BlogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Input;


use Yajra\DataTables\Facades\DataTables;

Expand Down
17 changes: 11 additions & 6 deletions src/stubs/cms/core/configurations/helpers/Configurations.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use cms\core\module\Models\ModuleModel;
use Session;
use Cms;
use Schema;
//models
use cms\core\user\Models\UserModel;
use cms\core\configurations\Models\ConfigurationModel;
Expand Down Expand Up @@ -55,15 +56,19 @@ public static function getAllConfig()

public static function getCurrentTheme()
{
$data = ConfigurationModel::where('name','=','site')->first();
if(Schema::hasTable('configurations')) {
$data = ConfigurationModel::where('name','=','site')->first();

if(count((array) $data)>0 && isset($data->parm)) {
$data = json_decode($data->parm);
if(count((array) $data)>0 && isset($data->parm)) {
$data = json_decode($data->parm);

if(isset($data->active_theme))
return $data->active_theme;
}
if(isset($data->active_theme))
return $data->active_theme;
}


}

return Cms::getThemeConfig()['active'];

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Input;

use Yajra\DataTables\Facades\DataTables;

Expand Down
1 change: 0 additions & 1 deletion src/stubs/cms/core/menu/Controllers/MenuController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Input;

use Yajra\DataTables\Facades\DataTables;

Expand Down
55 changes: 27 additions & 28 deletions src/stubs/cms/core/menu/Controllers/WmenuController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
namespace cms\core\menu\Controllers;
use cms\core\menu\Models\MenuItem;
use cms\core\menu\Models\Menu;

use Illuminate\Support\Facades\Input;
use Illuminate\Http\Request;
use View;
use CGate;

Expand All @@ -12,7 +11,7 @@

class WmenuController extends BaseController {

public function wmenuindex() {
public function wmenuindex(Request $request) {
CGate::authorize('view-menu');

$menuitems = new MenuItem();
Expand All @@ -25,87 +24,87 @@ public function wmenuindex() {
//print_r($routes[0]->middleware());exit;

$pages = PageModel::where('status','=',1)->select('url','title','id')->get();
if (Input::has("action")) {
if ($request->has("action")) {

return View::make('wmenu::admin.menu') -> with("menulist", $menulist)->with('pages',$pages)->with('routes',$routes);

} else {

$menu = Menu::find(Input::get("menu"));
$menus = $menuitems -> getall(Input::get("menu"));
$menu = Menu::find($request->input("menu"));
$menus = $menuitems -> getall($request->input("menu"));
return View::make('wmenu::admin.menu') -> with("menus", $menus) -> with("indmenu", $menu) -> with("menulist", $menulist)->with('pages',$pages)->with('routes',$routes);

}
}
public function createnewmenu() {
public function createnewmenu(Request $request) {
CGate::authorize('create-menu');

$menu = new Menu();
$menu -> name = Input::get("menuname");
$menu -> name = $request->input("menuname");
$menu -> save();
return json_encode(array("resp" => $menu -> id));

}
public function deleteitemmenu() {
public function deleteitemmenu(Request $request) {
CGate::authorize('delete-menu');

$menuitem = MenuItem::find(Input::get("id"));
$menuitem = MenuItem::find($request->input("id"));
$menuitem -> delete();
}
public function deletemenug() {
public function deletemenug(Request $request) {
CGate::authorize('delete-menu');
$menus = new MenuItem();
$getall = $menus -> getall(Input::get("id"));
$getall = $menus -> getall($request->input("id"));
if (count((array) $getall) == 0) {
$menudelete = Menu::find(Input::get("id"));
$menudelete = Menu::find($request->input("id"));
$menudelete -> delete();
return json_encode(array("resp" => "you delete this item"));
} else {
return json_encode(array("resp" => "You have to delete all items first", "error" => 1));
}
}
public function updateitem() {
public function updateitem(Request $request) {
CGate::authorize('edit-menu');
$menuitem = MenuItem::find(Input::get("id"));
$menuitem -> label = Input::get("label");
$menuitem -> link = Input::get("url");
$menuitem ->class = Input::get("clases");
$menuitem = MenuItem::find($request->input("id"));
$menuitem -> label = $request->input("label");
$menuitem -> link = $request->input("url");
$menuitem ->class = $request->input("clases");
$menuitem -> save();
}
public function addcustommenu() {
public function addcustommenu(Request $request) {
CGate::authorize('create-menu');
$menuitem = new MenuItem();
$menuitem -> label = Input::get("labelmenu");
$menuitem -> link = Input::get("linkmenu");
$menuitem -> menu = Input::get("idmenu");
$menuitem -> label = $request->input("labelmenu");
$menuitem -> link = $request->input("linkmenu");
$menuitem -> menu = $request->input("idmenu");
$menuitem -> save();
}
public function addcustompagemenu() {

CGate::authorize('create-menu');

$obj = Input::get("obj");
$obj = $request->input("obj");

foreach ($obj as $ob) {
$menuitem = new MenuItem();
$menuitem->label = $ob['title'];
$menuitem->link = url('/').'/'.$ob['url'];
$menuitem->menu = Input::get("idmenu");
$menuitem->menu = $request->input("idmenu");
$menuitem->save();
}
}
public function generatemenucontrol() {

CGate::authorize('create-menu');

if(Input::get("idmenu")) {
$menu = Menu::find(Input::get("idmenu"));
if($request->input("idmenu")) {
$menu = Menu::find($request->input("idmenu"));
}
else
$menu = new Menu;
$menu -> name = Input::get("menuname");
$menu -> name = $request->input("menuname");
$menu -> save();
foreach (Input::get("arraydata") as $value) {
foreach ($request->input("arraydata") as $value) {
$menuitem = MenuItem::find($value["id"]);
$menuitem -> parent = $value["parent"];
$menuitem -> sort = $value["sort"];
Expand Down
16 changes: 6 additions & 10 deletions src/stubs/cms/core/menu/resources/views/admin/menu.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
@php
use Illuminate\Support\Facades\Input;
@endphp

@extends('layout::admin.master')

@section('title','user')
Expand Down Expand Up @@ -45,7 +41,7 @@
</div>
<div id="nav-menus-frame">

@if(Input::has('menu'))
@if(request()->has('menu'))
<div id="menu-settings-column" class="metabox-holder">

<div class="clear"></div>
Expand Down Expand Up @@ -143,11 +139,11 @@
<input type="hidden" id="idmenu" value="@if(isset($indmenu)){{$indmenu->id}}@endif" />
</label>

@if(Input::has('action'))
@if(request()->has('action'))
<div class="publishing-action">
<a onclick="createnewmenu()" name="save_menu" id="save_menu_header" class="button button-primary menu-save">Create menu</a>
</div>
@elseif(Input::has("menu"))
@elseif(request()->has("menu"))
<div class="publishing-action">
<a onclick="getmenus()" name="save_menu" id="save_menu_header" class="button button-primary menu-save">Save menu</a>
</div>
Expand All @@ -162,7 +158,7 @@
<div id="post-body">
<div id="post-body-content">

@if(Input::has("menu"))
@if(request()->has("menu"))
<h3>Menu Structure</h3>
<div class="drag-instructions post-body-plain" style="">
<p>
Expand Down Expand Up @@ -240,11 +236,11 @@
<div id="nav-menu-footer">
<div class="major-publishing-actions">

@if(Input::has('action'))
@if(request()->has('action'))
<div class="publishing-action">
<a onclick="createnewmenu()" name="save_menu" id="save_menu_header" class="button button-primary menu-save">Create menu</a>
</div>
@elseif(Input::has("menu"))
@elseif(request()->has("menu"))
<span class="delete-action"> <a class="submitdelete deletion menu-delete" onclick="deletemenu()" href="javascript:void(9)">Delete menu</a> </span>
<div class="publishing-action">
<a onclick="getmenus()" name="save_menu" id="save_menu_header" class="button button-primary menu-save">Save menu</a>
Expand Down
15 changes: 6 additions & 9 deletions src/stubs/cms/core/menu/resources/views/wmenuindex.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
@php
use Illuminate\Support\Facades\Input;
@endphp
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="es-MX">
<head>
Expand Down Expand Up @@ -52,7 +49,7 @@
</div>
<div id="nav-menus-frame">

@if(Input::has('menu'))
@if(request()->has('menu'))
<div id="menu-settings-column" class="metabox-holder">

<div class="clear"></div>
Expand Down Expand Up @@ -105,11 +102,11 @@
<input type="hidden" id="idmenu" value="@if(isset($indmenu)){{$indmenu->id}}@endif" />
</label>

@if(Input::has('action'))
@if(request()->has('action'))
<div class="publishing-action">
<a onclick="createnewmenu()" name="save_menu" id="save_menu_header" class="button button-primary menu-save">Create menu</a>
</div>
@elseif(Input::has("menu"))
@elseif(request()->has("menu"))
<div class="publishing-action">
<a onclick="getmenus()" name="save_menu" id="save_menu_header" class="button button-primary menu-save">Save menu</a>
</div>
Expand All @@ -124,7 +121,7 @@
<div id="post-body">
<div id="post-body-content">

@if(Input::has("menu"))
@if(request()->has("menu"))
<h3>Menu Structure</h3>
<div class="drag-instructions post-body-plain" style="">
<p>
Expand Down Expand Up @@ -202,11 +199,11 @@
<div id="nav-menu-footer">
<div class="major-publishing-actions">

@if(Input::has('action'))
@if(request()->has('action'))
<div class="publishing-action">
<a onclick="createnewmenu()" name="save_menu" id="save_menu_header" class="button button-primary menu-save">Create menu</a>
</div>
@elseif(Input::has("menu"))
@elseif(request()->has("menu"))
<span class="delete-action"> <a class="submitdelete deletion menu-delete" onclick="deletemenu()" href="javascript:void(9)">Delete menu</a> </span>
<div class="publishing-action">
<a onclick="getmenus()" name="save_menu" id="save_menu_header" class="button button-primary menu-save">Save menu</a>
Expand Down
1 change: 0 additions & 1 deletion src/stubs/cms/core/page/Controllers/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Input;

use Yajra\DataTables\Facades\DataTables;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Input;

use Yajra\DataTables\Facades\DataTables;

Expand Down
1 change: 0 additions & 1 deletion src/stubs/cms/core/user/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Input;

use Yajra\DataTables\Facades\DataTables;

Expand Down

0 comments on commit 2d4a16a

Please sign in to comment.