REFACTORING #1880 @4h30m: another ugly refactoring commit

This commit is contained in:
Michal Kváček
2016-10-25 16:50:04 +02:00
parent 28f67ffe3c
commit cc999dd24e
71 changed files with 827 additions and 608 deletions
+9 -9
View File
@@ -29,7 +29,7 @@ class Gallery implements AppHandler
public function render(Content $content, $parameters)
{
// get directory ID
$directoryId = $content->module_settings->directoryId;
$directoryId = $content->moduleSettings->directoryId;
// get all images in given directory
$images = File::where('directory_id', $directoryId)
@@ -56,12 +56,12 @@ class Gallery implements AppHandler
*/
public static function loadExtraData(Content $content)
{
if (is_string($content->module_settings)) {
$content->module_settings = json_decode($content->module_settings);
if (is_string($content->moduleSettings)) {
$content->moduleSettings = json_decode($content->moduleSettings);
}
$extra = [
'slider' => isset($content->module_settings->slider) ? $content->module_settings->slider : false
'slider' => isset($content->moduleSettings->slider) ? $content->moduleSettings->slider : false
];
return $extra;
@@ -91,7 +91,7 @@ class Gallery implements AppHandler
$settings = ['directoryId' => $directory->id];
// save settings
$content->module_settings = json_encode($settings);
$content->moduleSettings = json_encode($settings);
}
/**
@@ -224,13 +224,13 @@ class Gallery implements AppHandler
*/
public static function delete(Content $content)
{
// try to convert module_settings into something more accessible
if (is_string($content->module_settings)) {
$content->module_settings = json_decode($content->module_settings);
// try to convert moduleSettings into something more accessible
if (is_string($content->moduleSettings)) {
$content->moduleSettings = json_decode($content->moduleSettings);
}
// get directory id
$directoryId = $content->module_settings->directoryId;
$directoryId = $content->moduleSettings->directoryId;
$directory = Directory::find($directoryId);
@@ -1,5 +1,5 @@
<div class="row column">
<a href="{{route('upload.overview', ['id' => $page->module_settings->directoryId])}}" class="button large expanded success">@lang('gallery::admin/content.upload')</a>
<a href="{{route('upload.overview', ['id' => $page->moduleSettings->directoryId])}}" class="button large expanded success">@lang('gallery::admin/content.upload')</a>
</div>
<div class="row column text-center">