@@ -22,11 +22,11 @@ |
||
22 | 22 | 'required' => true |
23 | 23 | ), |
24 | 24 | 'status' => array( |
25 | - 'name' => 'Published', |
|
26 | - 'type' => self::DROPDOWN, |
|
25 | + 'name' => 'Published', |
|
26 | + 'type' => self::DROPDOWN, |
|
27 | 27 | 'options' => ['published' => 'Published', 'unpublished' => 'Unpublished'], |
28 | 28 | 'published' => ['published'] |
29 | - ), |
|
29 | + ), |
|
30 | 30 | |
31 | 31 | ); |
32 | 32 |
@@ -40,7 +40,7 @@ |
||
40 | 40 | /** |
41 | 41 | * generate the route for this asset |
42 | 42 | */ |
43 | - public static function route($record, $path = null){ |
|
43 | + public static function route($record, $path = null) { |
|
44 | 44 | $page = $record->page; |
45 | 45 | return route('frontend.ams.article.category', ['slug' => $page->slug]); |
46 | 46 | } |
@@ -5,12 +5,12 @@ |
||
5 | 5 | |
6 | 6 | class AutoCallBackAsset extends Asset { |
7 | 7 | |
8 | - public $type = AutoCallBackAsset::class; |
|
9 | - public $namespace = 'property'; |
|
8 | + public $type = AutoCallBackAsset::class; |
|
9 | + public $namespace = 'property'; |
|
10 | 10 | |
11 | - public static function html($data) { |
|
11 | + public static function html($data) { |
|
12 | 12 | $content = explode('|', $data['meta']); |
13 | - return '<span>' . $content[1] . '</span>'; |
|
13 | + return '<span>' . $content[1] . '</span>'; |
|
14 | 14 | } |
15 | 15 | |
16 | 16 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | class ImageAsset extends Asset { |
10 | 10 | |
11 | - public $type = ImageAsset::class; |
|
11 | + public $type = ImageAsset::class; |
|
12 | 12 | public $namespace = 'property'; |
13 | 13 | |
14 | 14 | public static function getImageUrl($filename, $width = null, $height = null){ |
@@ -36,10 +36,10 @@ discard block |
||
36 | 36 | |
37 | 37 | } |
38 | 38 | |
39 | - public static function html($data) { |
|
39 | + public static function html($data) { |
|
40 | 40 | |
41 | 41 | return '<img src="' . self::getImageUrl($data['value']) . '" />'; |
42 | - } |
|
42 | + } |
|
43 | 43 | |
44 | 44 | |
45 | 45 |
@@ -11,23 +11,23 @@ |
||
11 | 11 | public $type = ImageAsset::class; |
12 | 12 | public $namespace = 'property'; |
13 | 13 | |
14 | - public static function getImageUrl($filename, $width = null, $height = null){ |
|
14 | + public static function getImageUrl($filename, $width = null, $height = null) { |
|
15 | 15 | |
16 | - $imagePath = public_path().'/vendor/phpsa-datastore/'; |
|
16 | + $imagePath = public_path() . '/vendor/phpsa-datastore/'; |
|
17 | 17 | |
18 | 18 | if ($width || $height) { |
19 | - $path = 'thumbs/' . $width . 'x' . $height . '.' . $filename; |
|
19 | + $path = 'thumbs/' . $width . 'x' . $height . '.' . $filename; |
|
20 | 20 | |
21 | - if(!is_file($imagePath . $path)){ |
|
22 | - try{ |
|
23 | - Image::make(public_path().'/vendor/phpsa-datastore/img/' . $filename)->resize($width,$height, function ($constraint) { |
|
21 | + if (!is_file($imagePath . $path)) { |
|
22 | + try { |
|
23 | + Image::make(public_path() . '/vendor/phpsa-datastore/img/' . $filename)->resize($width, $height, function($constraint) { |
|
24 | 24 | $constraint->aspectRatio(); |
25 | 25 | })->save($imagePath . $path); |
26 | - }catch(Exception $e){ |
|
26 | + }catch (Exception $e) { |
|
27 | 27 | //Silent fallback as the image does not exist! |
28 | 28 | } |
29 | 29 | } |
30 | - }else{ |
|
30 | + }else { |
|
31 | 31 | $path = 'img/' . $filename; |
32 | 32 | } |
33 | 33 | return '/vendor/phpsa-datastore/' . $path; |
@@ -23,11 +23,11 @@ |
||
23 | 23 | Image::make(public_path().'/vendor/phpsa-datastore/img/' . $filename)->resize($width,$height, function ($constraint) { |
24 | 24 | $constraint->aspectRatio(); |
25 | 25 | })->save($imagePath . $path); |
26 | - }catch(Exception $e){ |
|
26 | + } catch(Exception $e){ |
|
27 | 27 | //Silent fallback as the image does not exist! |
28 | 28 | } |
29 | 29 | } |
30 | - }else{ |
|
30 | + } else{ |
|
31 | 31 | $path = 'img/' . $filename; |
32 | 32 | } |
33 | 33 | return '/vendor/phpsa-datastore/' . $path; |
@@ -5,11 +5,11 @@ |
||
5 | 5 | |
6 | 6 | class SubHeadingAsset extends Asset { |
7 | 7 | |
8 | - public $shortname = 'SubHeading'; |
|
9 | - public $type = SubHeadingAsset::class; |
|
10 | - public $namespace = 'property'; |
|
8 | + public $shortname = 'SubHeading'; |
|
9 | + public $type = SubHeadingAsset::class; |
|
10 | + public $namespace = 'property'; |
|
11 | 11 | |
12 | - public static function html($data) { |
|
13 | - return '<h4>' . $data['value'] . '</h4>'; |
|
14 | - } |
|
12 | + public static function html($data) { |
|
13 | + return '<h4>' . $data['value'] . '</h4>'; |
|
14 | + } |
|
15 | 15 | } |
16 | 16 | \ No newline at end of file |
@@ -6,12 +6,12 @@ |
||
6 | 6 | |
7 | 7 | class FileAsset extends Asset { |
8 | 8 | |
9 | - public $type = FileAsset::class; |
|
10 | - public $namespace = 'property'; |
|
9 | + public $type = FileAsset::class; |
|
10 | + public $namespace = 'property'; |
|
11 | 11 | |
12 | - public static function html($data) { |
|
13 | - return Storage::url($data['value']); |
|
14 | - } |
|
12 | + public static function html($data) { |
|
13 | + return Storage::url($data['value']); |
|
14 | + } |
|
15 | 15 | |
16 | 16 | |
17 | 17 | } |
@@ -5,16 +5,16 @@ |
||
5 | 5 | |
6 | 6 | class AutoCallBackAdderAsset extends Asset { |
7 | 7 | |
8 | - public $type = AutoCallBackAdderAsset::class; |
|
9 | - public $namespace = 'property'; |
|
8 | + public $type = AutoCallBackAdderAsset::class; |
|
9 | + public $namespace = 'property'; |
|
10 | 10 | |
11 | - public static function html($data) { |
|
11 | + public static function html($data) { |
|
12 | 12 | $strings = []; |
13 | 13 | |
14 | 14 | foreach($data['meta'] as $k){ |
15 | 15 | $parts = explode("|", $k); |
16 | 16 | $strings[] = $parts[1]; |
17 | 17 | } |
18 | - return '<span>' . implode(", ", $strings) . '</span>'; |
|
19 | - } |
|
18 | + return '<span>' . implode(", ", $strings) . '</span>'; |
|
19 | + } |
|
20 | 20 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | public static function html($data) { |
12 | 12 | $strings = []; |
13 | 13 | |
14 | - foreach($data['meta'] as $k){ |
|
14 | + foreach ($data['meta'] as $k) { |
|
15 | 15 | $parts = explode("|", $k); |
16 | 16 | $strings[] = $parts[1]; |
17 | 17 | } |
@@ -5,10 +5,10 @@ |
||
5 | 5 | |
6 | 6 | class StringAsset extends Asset { |
7 | 7 | |
8 | - public $type = StringAsset::class; |
|
9 | - public $namespace = 'property'; |
|
8 | + public $type = StringAsset::class; |
|
9 | + public $namespace = 'property'; |
|
10 | 10 | |
11 | - public static function html($data) { |
|
12 | - return '<span>' . $data['value'] . '</span> STRING'; |
|
13 | - } |
|
11 | + public static function html($data) { |
|
12 | + return '<span>' . $data['value'] . '</span> STRING'; |
|
13 | + } |
|
14 | 14 | } |
@@ -5,11 +5,11 @@ |
||
5 | 5 | |
6 | 6 | class MetatextAsset extends Asset { |
7 | 7 | |
8 | - public $type = MetatextAsset::class; |
|
9 | - public $namespace = 'property'; |
|
8 | + public $type = MetatextAsset::class; |
|
9 | + public $namespace = 'property'; |
|
10 | 10 | |
11 | - public static function html($data) { |
|
12 | - return '<p>' . $data['value'] . '</p>'; |
|
13 | - } |
|
11 | + public static function html($data) { |
|
12 | + return '<p>' . $data['value'] . '</p>'; |
|
13 | + } |
|
14 | 14 | |
15 | 15 | } |
@@ -5,11 +5,11 @@ |
||
5 | 5 | |
6 | 6 | class HeadingAsset extends Asset { |
7 | 7 | |
8 | - public $shortname = 'Heading'; |
|
9 | - public $type = HeadingAsset::class; |
|
10 | - public $namespace = 'property'; |
|
8 | + public $shortname = 'Heading'; |
|
9 | + public $type = HeadingAsset::class; |
|
10 | + public $namespace = 'property'; |
|
11 | 11 | |
12 | - public static function html($data) { |
|
13 | - return '<h3>' . $data['value'] . '</h3>'; |
|
14 | - } |
|
12 | + public static function html($data) { |
|
13 | + return '<h3>' . $data['value'] . '</h3>'; |
|
14 | + } |
|
15 | 15 | } |
16 | 16 | \ No newline at end of file |