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
48f5cadf
Commit
48f5cadf
authored
Feb 17, 2023
by
Bagus Pambudi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug auto translate diatas 5rb karakter(update)
parent
bbf8871f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
15 deletions
+26
-15
app/Http/Controllers/Webprofile/Backend/GalleryController.php
+2
-2
app/Http/Controllers/Webprofile/Backend/PageController.php
+12
-8
app/Http/Controllers/Webprofile/Backend/PostController.php
+12
-5
No files found.
app/Http/Controllers/Webprofile/Backend/GalleryController.php
View file @
48f5cadf
...
@@ -50,11 +50,11 @@ class GalleryController extends Controller
...
@@ -50,11 +50,11 @@ class GalleryController extends Controller
// dd($request);
// dd($request);
$request
->
validate
([
$request
->
validate
([
'title'
=>
'required'
,
'title'
=>
'required'
,
'gallery'
=>
'
required|
mimes:jpg,jpeg,png|max : 3072'
'gallery'
=>
'mimes:jpg,jpeg,png|max : 3072'
],
[
],
[
'title.required'
=>
'Nama gallery wajib diisi'
,
'title.required'
=>
'Nama gallery wajib diisi'
,
// 'title.max' => 'Nama gallery terlalu panjang',
// 'title.max' => 'Nama gallery terlalu panjang',
'gallery.required'
=>
'Gambar wajib diupload'
,
//
'gallery.required' => 'Gambar wajib diupload',
'gallery.mimes'
=>
'File yang diupload harus berupa JPG, JPEG, dan PNG'
,
'gallery.mimes'
=>
'File yang diupload harus berupa JPG, JPEG, dan PNG'
,
'gallery.max'
=>
'Ukuran gambar maksimal 3 MB'
'gallery.max'
=>
'Ukuran gambar maksimal 3 MB'
]);
]);
...
...
app/Http/Controllers/Webprofile/Backend/PageController.php
View file @
48f5cadf
...
@@ -303,10 +303,11 @@ class PageController extends Controller
...
@@ -303,10 +303,11 @@ class PageController extends Controller
$trans
=
new
GoogleTranslate
();
$trans
=
new
GoogleTranslate
();
$title
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGET
,
strip_tags
(
$data
[
'title'
]));
$title
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGET
,
strip_tags
(
$data
[
'title'
]));
if
(
strlen
(
$data
[
'content'
])
<
5000
)
{
$content
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGET
,
strip_tags
(
$data
[
'content'
],
[
'a'
,
'br'
,
'p'
,
'b'
,
'i'
,
'u'
,
'ul'
,
'li'
,
'ol'
,
'img'
,
'table'
,
'td'
,
'th'
,
'tr'
,
'iframe'
,
'section'
,
'small'
,
'button'
]));
$content
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGET
,
strip_tags
(
$data
[
'content'
],
[
'a'
,
'br'
,
'p'
,
'b'
,
'i'
,
'u'
,
'ul'
,
'li'
,
'ol'
,
'img'
,
'table'
,
'td'
,
'th'
,
'tr'
,
'iframe'
,
'section'
,
'small'
,
'button'
]));
$dataEn
[
'title'
]
=
$title
;
$dataEn
[
'content'
]
=
$content
;
$dataEn
[
'content'
]
=
$content
;
}
$dataEn
[
'title'
]
=
$title
;
}
}
$this
->
repoEn
->
update
(
$dataEn
,
$page
);
$this
->
repoEn
->
update
(
$dataEn
,
$page
);
...
@@ -324,10 +325,11 @@ class PageController extends Controller
...
@@ -324,10 +325,11 @@ class PageController extends Controller
}
}
$trans
=
new
GoogleTranslate
();
$trans
=
new
GoogleTranslate
();
$title
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETDE
,
strip_tags
(
$data
[
'title'
]));
$title
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETDE
,
strip_tags
(
$data
[
'title'
]));
if
(
strlen
(
$data
[
'content'
])
<
5000
)
{
$content
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETDE
,
strip_tags
(
$data
[
'content'
],
[
'a'
,
'br'
,
'p'
,
'b'
,
'i'
,
'u'
,
'ul'
,
'li'
,
'ol'
,
'img'
,
'table'
,
'td'
,
'th'
,
'tr'
,
'iframe'
,
'section'
,
'small'
,
'button'
]));
$content
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETDE
,
strip_tags
(
$data
[
'content'
],
[
'a'
,
'br'
,
'p'
,
'b'
,
'i'
,
'u'
,
'ul'
,
'li'
,
'ol'
,
'img'
,
'table'
,
'td'
,
'th'
,
'tr'
,
'iframe'
,
'section'
,
'small'
,
'button'
]));
$dataDe
[
'title'
]
=
$title
;
$dataDe
[
'content'
]
=
$content
;
$dataDe
[
'content'
]
=
$content
;
}
$dataDe
[
'title'
]
=
$title
;
}
}
$this
->
repoDe
->
update
(
$dataDe
,
$page
);
$this
->
repoDe
->
update
(
$dataDe
,
$page
);
...
@@ -346,10 +348,11 @@ class PageController extends Controller
...
@@ -346,10 +348,11 @@ class PageController extends Controller
$trans
=
new
GoogleTranslate
();
$trans
=
new
GoogleTranslate
();
$title
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETSA
,
strip_tags
(
$data
[
'title'
]));
$title
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETSA
,
strip_tags
(
$data
[
'title'
]));
if
(
strlen
(
$data
[
'content'
])
<
5000
)
{
$content
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETSA
,
strip_tags
(
$data
[
'content'
],
[
'a'
,
'br'
,
'p'
,
'b'
,
'i'
,
'u'
,
'ul'
,
'li'
,
'ol'
,
'img'
,
'table'
,
'td'
,
'th'
,
'tr'
,
'iframe'
,
'section'
,
'small'
,
'button'
]));
$content
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETSA
,
strip_tags
(
$data
[
'content'
],
[
'a'
,
'br'
,
'p'
,
'b'
,
'i'
,
'u'
,
'ul'
,
'li'
,
'ol'
,
'img'
,
'table'
,
'td'
,
'th'
,
'tr'
,
'iframe'
,
'section'
,
'small'
,
'button'
]));
$dataSa
[
'title'
]
=
$title
;
$dataSa
[
'content'
]
=
$content
;
$dataSa
[
'content'
]
=
$content
;
}
$dataSa
[
'title'
]
=
$title
;
}
}
$this
->
repoSa
->
update
(
$dataSa
,
$page
);
$this
->
repoSa
->
update
(
$dataSa
,
$page
);
...
@@ -368,10 +371,11 @@ class PageController extends Controller
...
@@ -368,10 +371,11 @@ class PageController extends Controller
$trans
=
new
GoogleTranslate
();
$trans
=
new
GoogleTranslate
();
$title
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETZH
,
strip_tags
(
$data
[
'title'
]));
$title
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETZH
,
strip_tags
(
$data
[
'title'
]));
if
(
strlen
(
$data
[
'content'
])
<
5000
)
{
$content
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETZH
,
strip_tags
(
$data
[
'content'
],
[
'a'
,
'br'
,
'p'
,
'b'
,
'i'
,
'u'
,
'ul'
,
'li'
,
'ol'
,
'img'
,
'table'
,
'td'
,
'th'
,
'tr'
,
'iframe'
,
'section'
,
'small'
,
'button'
]));
$content
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETZH
,
strip_tags
(
$data
[
'content'
],
[
'a'
,
'br'
,
'p'
,
'b'
,
'i'
,
'u'
,
'ul'
,
'li'
,
'ol'
,
'img'
,
'table'
,
'td'
,
'th'
,
'tr'
,
'iframe'
,
'section'
,
'small'
,
'button'
]));
$dataZh
[
'title'
]
=
$title
;
$dataZh
[
'content'
]
=
$content
;
$dataZh
[
'content'
]
=
$content
;
}
$dataZh
[
'title'
]
=
$title
;
}
}
$this
->
repoZh
->
update
(
$dataZh
,
$page
);
$this
->
repoZh
->
update
(
$dataZh
,
$page
);
...
...
app/Http/Controllers/Webprofile/Backend/PostController.php
View file @
48f5cadf
...
@@ -426,10 +426,11 @@ class PostController extends Controller
...
@@ -426,10 +426,11 @@ class PostController extends Controller
$trans
=
new
GoogleTranslate
();
$trans
=
new
GoogleTranslate
();
$title
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGET
,
strip_tags
(
$data
[
'title'
]));
$title
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGET
,
strip_tags
(
$data
[
'title'
]));
if
(
strlen
(
$data
[
'content'
])
<
5000
)
{
$content
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGET
,
strip_tags
(
$data
[
'content'
],
[
'a'
,
'br'
,
'p'
,
'b'
,
'i'
,
'u'
,
'ul'
,
'li'
,
'ol'
,
'img'
,
'table'
,
'tr'
,
'td'
,
'th'
,
'iframe'
,
'section'
]));
$content
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGET
,
strip_tags
(
$data
[
'content'
],
[
'a'
,
'br'
,
'p'
,
'b'
,
'i'
,
'u'
,
'ul'
,
'li'
,
'ol'
,
'img'
,
'table'
,
'tr'
,
'td'
,
'th'
,
'iframe'
,
'section'
]));
$dataEn
[
'title'
]
=
$title
;
$dataEn
[
'content'
]
=
$content
;
$dataEn
[
'content'
]
=
$content
;
}
$dataEn
[
'title'
]
=
$title
;
}
}
$this
->
repoEn
->
update
(
$dataEn
,
$post
);
$this
->
repoEn
->
update
(
$dataEn
,
$post
);
}
}
...
@@ -448,9 +449,11 @@ class PostController extends Controller
...
@@ -448,9 +449,11 @@ class PostController extends Controller
$trans
=
new
GoogleTranslate
();
$trans
=
new
GoogleTranslate
();
$title
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETDE
,
strip_tags
(
$data
[
'title'
]));
$title
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETDE
,
strip_tags
(
$data
[
'title'
]));
if
(
strlen
(
$data
[
'content'
])
<
5000
)
{
$content
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETDE
,
strip_tags
(
$data
[
'content'
],
[
'a'
,
'br'
,
'p'
,
'b'
,
'i'
,
'u'
,
'ul'
,
'li'
,
'ol'
,
'img'
,
'table'
,
'tr'
,
'td'
,
'th'
,
'iframe'
,
'section'
]));
$content
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETDE
,
strip_tags
(
$data
[
'content'
],
[
'a'
,
'br'
,
'p'
,
'b'
,
'i'
,
'u'
,
'ul'
,
'li'
,
'ol'
,
'img'
,
'table'
,
'tr'
,
'td'
,
'th'
,
'iframe'
,
'section'
]));
$dataDe
[
'title'
]
=
$title
;
$dataDe
[
'content'
]
=
$content
;
$dataDe
[
'content'
]
=
$content
;
}
$dataDe
[
'title'
]
=
$title
;
}
}
$this
->
repoDe
->
update
(
$dataDe
,
$post
);
$this
->
repoDe
->
update
(
$dataDe
,
$post
);
}
}
...
@@ -469,9 +472,11 @@ class PostController extends Controller
...
@@ -469,9 +472,11 @@ class PostController extends Controller
$trans
=
new
GoogleTranslate
();
$trans
=
new
GoogleTranslate
();
$title
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETSA
,
strip_tags
(
$data
[
'title'
]));
$title
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETSA
,
strip_tags
(
$data
[
'title'
]));
if
(
strlen
(
$data
[
'content'
])
<
5000
)
{
$content
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETSA
,
strip_tags
(
$data
[
'content'
],
[
'a'
,
'br'
,
'p'
,
'b'
,
'i'
,
'u'
,
'ul'
,
'li'
,
'ol'
,
'img'
,
'table'
,
'tr'
,
'td'
,
'th'
,
'iframe'
,
'section'
]));
$content
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETSA
,
strip_tags
(
$data
[
'content'
],
[
'a'
,
'br'
,
'p'
,
'b'
,
'i'
,
'u'
,
'ul'
,
'li'
,
'ol'
,
'img'
,
'table'
,
'tr'
,
'td'
,
'th'
,
'iframe'
,
'section'
]));
$dataSa
[
'title'
]
=
$title
;
$dataSa
[
'content'
]
=
$content
;
$dataSa
[
'content'
]
=
$content
;
}
$dataSa
[
'title'
]
=
$title
;
}
}
$this
->
repoSa
->
update
(
$dataSa
,
$post
);
$this
->
repoSa
->
update
(
$dataSa
,
$post
);
}
}
...
@@ -489,9 +494,11 @@ class PostController extends Controller
...
@@ -489,9 +494,11 @@ class PostController extends Controller
$trans
=
new
GoogleTranslate
();
$trans
=
new
GoogleTranslate
();
$title
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETZH
,
strip_tags
(
$data
[
'title'
]));
$title
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETZH
,
strip_tags
(
$data
[
'title'
]));
if
(
strlen
(
$data
[
'content'
])
<
5000
)
{
$content
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETZH
,
strip_tags
(
$data
[
'content'
],
[
'a'
,
'br'
,
'p'
,
'b'
,
'i'
,
'u'
,
'ul'
,
'li'
,
'ol'
,
'img'
,
'table'
,
'tr'
,
'td'
,
'th'
,
'iframe'
,
'section'
]));
$content
=
$trans
->
translate
(
$this
->
SOURCE
,
$this
->
TARGETZH
,
strip_tags
(
$data
[
'content'
],
[
'a'
,
'br'
,
'p'
,
'b'
,
'i'
,
'u'
,
'ul'
,
'li'
,
'ol'
,
'img'
,
'table'
,
'tr'
,
'td'
,
'th'
,
'iframe'
,
'section'
]));
$dataZh
[
'title'
]
=
$title
;
$dataZh
[
'content'
]
=
$content
;
$dataZh
[
'content'
]
=
$content
;
}
$dataZh
[
'title'
]
=
$title
;
}
}
$this
->
repoZh
->
update
(
$dataZh
,
$post
);
$this
->
repoZh
->
update
(
$dataZh
,
$post
);
}
}
...
...
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