Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
webprofile-jwg2024
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Siti Aisah
webprofile-jwg2024
Commits
0bc32c84
Commit
0bc32c84
authored
Jul 11, 2022
by
Siti Aisah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
memperbaiki halaman full pengumuman agar bisa auto translate
parent
de2ff464
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
94 additions
and
14 deletions
+94
-14
app/Http/Controllers/Webprofile/Backend/InformationController.php
+87
-11
app/Repositories/Webprofile/InformationRepository.php
+3
-1
resources/views/webprofile/backend/informations/edit.blade.php
+3
-2
resources/views/webprofile/backend/informations/edit_per_bahasa.blade.php
+0
-0
routes/webprofile/backend.php
+1
-0
No files found.
app/Http/Controllers/Webprofile/Backend/InformationController.php
View file @
0bc32c84
...
...
@@ -191,14 +191,33 @@ class InformationController extends Controller
{
$data
=
$this
->
repo
->
findId
(
$id
,
[
'rEn'
,
'rDe'
,
'rSa'
,
'rZh'
]);
$categories
=
Categories
::
pluck
(
'name'
,
'id'
);
$manual
=
0
;
$data
=
[
'data'
=>
$data
,
'categories'
=>
$categories
,
'manual'
=>
$manual
,
];
return
view
(
'webprofile.backend.informations.edit'
,
$data
)
->
withTitle
(
trans
(
'feature.edit_information'
));
}
public
function
editPerBahasa
(
$id
)
{
// $setting = webprofilesetting();
$data
=
$this
->
repo
->
findId
(
$id
,
[
'rEn'
,
'rDe'
,
'rSa'
,
'rZh'
]);
$categories
=
Categories
::
pluck
(
'name'
,
'id'
);
$manual
=
1
;
$data
=
[
'data'
=>
$data
,
'categories'
=>
$categories
,
// 'setting' => $setting,
'manual'
=>
$manual
,
];
return
view
(
'webprofile.backend.informations.edit_per_bahasa'
,
$data
)
->
withTitle
(
trans
(
'feature.edit_agenda'
));
}
/**
* Update the specified resource in storage.
...
...
@@ -209,51 +228,108 @@ class InformationController extends Controller
*/
public
function
update
(
Request
$request
,
$id
)
{
$data
=
$request
->
except
([
'_token'
,
'id'
,
'title_en'
,
'content_en'
,
'title_de'
,
'content_de'
,
'title_sa'
,
'content_sa'
,
'title_zh'
,
'content_zh'
]);
$dataEn
=
$request
->
except
([
'_token'
,
'id'
]);
$data
=
$request
->
except
([
'_token'
,
'
manual'
,
'
id'
,
'title_en'
,
'content_en'
,
'title_de'
,
'content_de'
,
'title_sa'
,
'content_sa'
,
'title_zh'
,
'content_zh'
]);
$dataEn
=
$request
->
except
([
'_token'
,
'id'
,
'manual'
]);
array_key_exists
(
'info_status'
,
$data
)
?
$data
[
'info_status'
]
=
1
:
$data
[
'info_status'
]
=
0
;
$data
[
'slug'
]
=
str_slug
(
$request
->
input
(
'title'
));
$information
=
$this
->
repo
->
findId
(
$id
,
[
'rEn'
,
'rDe'
,
'rSa'
,
'rZh'
]);
$edit
=
$this
->
repo
->
update
(
$data
,
$information
);
$this
->
updateEn
(
$dataEn
,
$information
);
$this
->
updateDe
(
$dataEn
,
$information
);
$this
->
updateSa
(
$dataEn
,
$information
);
$this
->
updateZh
(
$dataEn
,
$information
);
$this
->
updateEn
(
$dataEn
,
$information
,
$request
->
manual
);
$this
->
updateDe
(
$dataEn
,
$information
,
$request
->
manual
);
$this
->
updateSa
(
$dataEn
,
$information
,
$request
->
manual
);
$this
->
updateZh
(
$dataEn
,
$information
,
$request
->
manual
);
$this
->
repo
->
update
(
$data
,
$information
);
return
redirect
()
->
route
(
'informations.index'
);
}
public
function
updateEn
(
$data
,
$information
)
public
function
updateEn
(
$data
,
$information
,
$manual
)
{
if
(
$manual
==
1
)
{
$dataEn
[
'title'
]
=
$data
[
'title_en'
];
$dataEn
[
'content'
]
=
$data
[
'content_en'
];
}
else
{
if
(
strip_tags
(
$data
[
'content'
])
==
null
)
{
$data
[
'content'
]
=
'kosong'
;
}
$trans
=
new
GoogleTranslate
();
$title
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGET
,
$data
[
'title'
]);
$content
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGET
,
strip_tags
(
$data
[
'content'
]));
$dataEn
[
'title'
]
=
$title
;
$dataEn
[
'content'
]
=
$content
;
}
$this
->
repoEn
->
update
(
$dataEn
,
$information
);
}
public
function
updateDe
(
$data
,
$information
)
public
function
updateDe
(
$data
,
$information
,
$manual
)
{
if
(
$manual
==
1
)
{
$dataDe
[
'title'
]
=
$data
[
'title_de'
];
$dataDe
[
'content'
]
=
$data
[
'content_de'
];
}
else
{
if
(
strip_tags
(
$data
[
'content'
])
==
null
)
{
$data
[
'content'
]
=
'kosong'
;
}
$trans
=
new
GoogleTranslate
();
$title
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETDE
,
$data
[
'title'
]);
$content
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETDE
,
strip_tags
(
$data
[
'content'
]));
$dataDe
[
'title'
]
=
$title
;
$dataDe
[
'content'
]
=
$content
;
}
$this
->
repoDe
->
update
(
$dataDe
,
$information
);
}
public
function
updateSa
(
$data
,
$information
)
public
function
updateSa
(
$data
,
$information
,
$manual
)
{
if
(
$manual
==
1
)
{
$dataSa
[
'title'
]
=
$data
[
'title_sa'
];
$dataSa
[
'content'
]
=
$data
[
'content_sa'
];
}
else
{
if
(
strip_tags
(
$data
[
'content'
])
==
null
)
{
$data
[
'content'
]
=
'kosong'
;
}
$trans
=
new
GoogleTranslate
();
$title
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETSA
,
$data
[
'title'
]);
$content
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETSA
,
strip_tags
(
$data
[
'content'
]));
$dataSa
[
'title'
]
=
$title
;
$dataSa
[
'content'
]
=
$content
;
}
$this
->
repoSa
->
update
(
$dataSa
,
$information
);
}
public
function
updateZh
(
$data
,
$information
)
public
function
updateZh
(
$data
,
$information
,
$manual
)
{
if
(
$manual
==
1
)
{
$dataZh
[
'title'
]
=
$data
[
'title_zh'
];
$dataZh
[
'content'
]
=
$data
[
'content_zh'
];
}
else
{
if
(
strip_tags
(
$data
[
'content'
])
==
null
)
{
$data
[
'content'
]
=
'kosong'
;
}
$trans
=
new
GoogleTranslate
();
$title
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETZH
,
$data
[
'title'
]);
$content
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETZH
,
strip_tags
(
$data
[
'content'
]));
$dataZh
[
'title'
]
=
$title
;
$dataZh
[
'content'
]
=
$content
;
}
$this
->
repoZh
->
update
(
$dataZh
,
$information
);
}
...
...
app/Repositories/Webprofile/InformationRepository.php
View file @
0bc32c84
...
...
@@ -35,7 +35,9 @@ class InformationRepository extends Repository
return
DataTables
::
of
(
$data
)
->
addIndexColumn
()
->
addColumn
(
'action'
,
function
(
$row
)
{
$btn
=
'<a href="'
.
url
(
'/webprofile/informations/'
.
$row
->
id
.
'/edit'
)
.
'" data-toggle="tooltip" data-id="'
.
$row
->
id
.
'" data-original-title="'
.
trans
(
'label.edit'
)
.
'" class="edit btn btn-warning btn-round btn-sm edit">'
.
trans
(
'label.edit'
)
.
'</a>'
;
$btn
=
'<a href="'
.
url
(
'/webprofile/informations/'
.
$row
->
id
.
'/edit'
)
.
'" data-toggle="tooltip" data-id="'
.
$row
->
id
.
'" data-original-title="'
.
trans
(
'label.editsemuabahasa'
)
.
'" class="edit btn btn-warning btn-round btn-sm edit">'
.
trans
(
'label.editsemuabahasa'
)
.
'</a>'
;
$btn
=
$btn
.
'<a href="'
.
url
(
'/webprofile/informations/'
.
$row
->
id
.
'/editperbahasa'
)
.
'" data-toggle="tooltip" data-id="'
.
$row
->
id
.
'" data-original-title="'
.
trans
(
'label.edittiapbahasa'
)
.
'" class="edit btn btn-warning btn-round btn-sm edit">'
.
trans
(
'label.edittiapbahasa'
)
.
'</a>'
;
$btn
=
$btn
.
' <a href="javascript:void(0)" data-toggle="tooltip" data-id="'
.
$row
->
id
.
'" data-original-title="'
.
trans
(
'label.delete'
)
.
'" class="btn btn-danger btn-round btn-sm delete">'
.
trans
(
'label.delete'
)
.
'</a>'
;
...
...
resources/views/webprofile/backend/informations/edit.blade.php
View file @
0bc32c84
...
...
@@ -46,10 +46,11 @@
<div class="
col
-
md
-
12
">
<div class="
block
">
{{ Form::textarea('content', null, array('id'=>'content')) }}
{{ Form::hidden('manual',
$manual
, array('id'=>'manual')) }}
</div>
</div>
</div>
<div class="
tabs
">
{{--
<div class="
tabs
">
<ul class="
nav
nav
-
tabs
" role="
tablist
">
<li class="
active
"><a href="
#inggris" role="tab" data-toggle="tab" aria-expanded="true">Inggris</a></li>
<
li
class
=""><
a
href
=
"#jerman"
role
=
"tab"
data
-
toggle
=
"tab"
aria
-
expanded
=
"false"
>
Jerman
</
a
></
li
>
...
...
@@ -138,7 +139,7 @@
</div>
</div>
</div>
</div>
</div>
--}}
</div>
</div>
</div>
...
...
resources/views/webprofile/backend/informations/edit_per_bahasa.blade.php
0 → 100644
View file @
0bc32c84
This diff is collapsed.
Click to expand it.
routes/webprofile/backend.php
View file @
0bc32c84
...
...
@@ -24,6 +24,7 @@ Route::group(['middleware' => 'auth'], function () {
Route
::
resource
(
'pages'
,
'PageController'
);
Route
::
get
(
'agendas/{id}/editperbahasa'
,
'AgendaController@editperbahasa'
);
Route
::
resource
(
'agendas'
,
'AgendaController'
);
Route
::
get
(
'informations/{id}/editperbahasa'
,
'InformationController@editperbahasa'
);
Route
::
resource
(
'informations'
,
'InformationController'
);
Route
::
resource
(
'settings'
,
'SettingController'
);
Route
::
resource
(
'sliders'
,
'SliderController'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment