REFACTORING #1880 @4h30m: another ugly refactoring commit
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user