@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | protected function setPeriodSelection() |
| 36 | 36 | { |
| 37 | - if (! $this->periodSelection) { |
|
| 37 | + if (!$this->periodSelection) { |
|
| 38 | 38 | $this->periodSelection = []; |
| 39 | 39 | foreach ([1, 2, 3, 4] as $count) { |
| 40 | 40 | $this->periodSelection[$count . ' weeks'] = trans_choice('{1} :count week |[2,*] :count weeks', $count); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | foreach ($this->periodSelection as $key => $period) { |
| 45 | - $default = $key == $this->defaultPeriod? ' (' . __('Default') . ')': ''; |
|
| 45 | + $default = $key == $this->defaultPeriod ? ' (' . __('Default') . ')' : ''; |
|
| 46 | 46 | |
| 47 | 47 | $this->periodSelection[$key] = $period . $default; |
| 48 | 48 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | protected function addContents() |
| 52 | 52 | { |
| 53 | - if (! $this->file) { |
|
| 53 | + if (!$this->file) { |
|
| 54 | 54 | $this->set(__('Wrong parameters for file')); |
| 55 | 55 | return; |
| 56 | 56 | } |
@@ -70,13 +70,13 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | protected function addFileDetails($container = null) |
| 72 | 72 | { |
| 73 | - $container = $container?: $this; |
|
| 73 | + $container = $container ?: $this; |
|
| 74 | 74 | |
| 75 | 75 | $container->add(new FileDetailsLister($this->file)); |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | protected function addFileRemoteLinks($container = null) { |
| 79 | - $container = $container?: $this; |
|
| 79 | + $container = $container ?: $this; |
|
| 80 | 80 | |
| 81 | 81 | foreach ($this->file->userActiveLinks() as $link) { |
| 82 | 82 | $container->add(['View', __('Remote access link expiring :expiry', ['expiry' => $link['expires_at']->format('Y-m-d H:i:s')])]); |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $container->js(true, new jsExpression('new ClipboardJS(".copy-button")')); |
| 91 | 91 | |
| 92 | 92 | $container->on('click', '.delete-link', $this->add(['jsCallback', 'postTrigger' => 'link'])->set(function($j, $linkId) { |
| 93 | - if (! $link = FileRemoteAccess::create()->load($linkId)) return; |
|
| 93 | + if (!$link = FileRemoteAccess::create()->load($linkId)) return; |
|
| 94 | 94 | |
| 95 | 95 | $link->delete(); |
| 96 | 96 | |
@@ -101,19 +101,19 @@ discard block |
||
| 101 | 101 | protected function addFileControlButtons() { |
| 102 | 102 | $urls = FileStorageAccessJoint::getActionUrls($this->file); |
| 103 | 103 | |
| 104 | - if (! $this->actionDisabled('preview') && ($urls['preview']?? null)) { |
|
| 104 | + if (!$this->actionDisabled('preview') && ($urls['preview']?? null)) { |
|
| 105 | 105 | $this->add(['Button', 'class' => ['basic'], 'icon' => 'file alternate outline'])->set(__('View'))->link($urls['preview'])->setAttr(['target' => '_blank']); |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - if (! $this->actionDisabled('download') && ($urls['download']?? null)) { |
|
| 108 | + if (!$this->actionDisabled('download') && ($urls['download']?? null)) { |
|
| 109 | 109 | $this->add(['Button', 'class' => ['basic'], 'icon' => 'file download'])->set(__('Download'))->link($urls['download']); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - if (! $this->actionDisabled('history')) { |
|
| 112 | + if (!$this->actionDisabled('history')) { |
|
| 113 | 113 | $this->add(['Button', 'class' => ['basic'], 'icon' => 'history'])->set(__('Access History'))->link(url('view/filestorage:file-access-history/body') . '?' . http_build_query(['id' => $this->file->id])); |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - if (! $this->actionDisabled('remote')) { |
|
| 116 | + if (!$this->actionDisabled('remote')) { |
|
| 117 | 117 | $linkControl = $this->add(['View', 'ui' => 'basic buttons']); |
| 118 | 118 | |
| 119 | 119 | $linkButton = $linkControl->add(['Button', 'class' => ['basic'], 'icon' => 'linkify'])->set(__('Get Remote Link')); |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $dropdown->setSource($this->periodSelection); |
| 124 | 124 | |
| 125 | 125 | $dropdown->onChange(function($value) { |
| 126 | - $period = array_search($value, $this->periodSelection)?: $this->defaultPeriod; |
|
| 126 | + $period = array_search($value, $this->periodSelection) ?: $this->defaultPeriod; |
|
| 127 | 127 | |
| 128 | 128 | FileRemoteAccess::grant($this->file, $period); |
| 129 | 129 | |
@@ -90,7 +90,9 @@ |
||
| 90 | 90 | $container->js(true, new jsExpression('new ClipboardJS(".copy-button")')); |
| 91 | 91 | |
| 92 | 92 | $container->on('click', '.delete-link', $this->add(['jsCallback', 'postTrigger' => 'link'])->set(function($j, $linkId) { |
| 93 | - if (! $link = FileRemoteAccess::create()->load($linkId)) return; |
|
| 93 | + if (! $link = FileRemoteAccess::create()->load($linkId)) { |
|
| 94 | + return; |
|
| 95 | + } |
|
| 94 | 96 | |
| 95 | 97 | $link->delete(); |
| 96 | 98 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | public function getDefaultSource() |
| 35 | 35 | { |
| 36 | - return $this->file? [ |
|
| 36 | + return $this->file ? [ |
|
| 37 | 37 | 'name' => [ |
| 38 | 38 | 'title'=> __('Name'), |
| 39 | 39 | 'descr'=> $this->file['name'] |
@@ -50,6 +50,6 @@ discard block |
||
| 50 | 50 | 'title'=> __('Stored At'), |
| 51 | 51 | 'descr'=> $this->file['created_at'] |
| 52 | 52 | ] |
| 53 | - ]: []; |
|
| 53 | + ] : []; |
|
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | \ No newline at end of file |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | $fileExists = File::exists($id); |
| 14 | 14 | |
| 15 | 15 | if ($icon) { |
| 16 | - $icon_file = $fileExists ? 'z-attach.png': 'z-attach-off.png'; |
|
| 16 | + $icon_file = $fileExists ? 'z-attach.png' : 'z-attach-off.png'; |
|
| 17 | 17 | $img_src = Base_ThemeCommon::get_template_file(self::module_name(), $icon_file); |
| 18 | 18 | $icon_img = '<img src="' . $img_src . '" style="vertical-align:bottom">'; |
| 19 | 19 | } |
@@ -23,12 +23,12 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | $file = File::get($id); |
| 25 | 25 | |
| 26 | - if (! $fileName = $label) { |
|
| 26 | + if (!$fileName = $label) { |
|
| 27 | 27 | $fileName = ($file['name']?? '') ?: '[' . __('missing file name') . ']'; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - if ($nolink || ! $file) { |
|
| 31 | - return $fileName . ($fileExists ? '': ' [' . __('missing file') . ']'); |
|
| 30 | + if ($nolink || !$file) { |
|
| 31 | + return $fileName . ($fileExists ? '' : ' [' . __('missing file') . ']'); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | $link_href = ''; |
@@ -49,6 +49,6 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | $ret = '<a ' . $link_href . '>' . $icon_img . '<span class="file_name">' . $fileName . '</span></a>'; |
| 51 | 51 | |
| 52 | - return $inline? $ret: '<div class="file_link">'.$ret.'</div>'; |
|
| 52 | + return $inline ? $ret : '<div class="file_link">' . $ret . '</div>'; |
|
| 53 | 53 | } |
| 54 | 54 | } |
@@ -16,8 +16,7 @@ |
||
| 16 | 16 | $icon_file = $fileExists ? 'z-attach.png': 'z-attach-off.png'; |
| 17 | 17 | $img_src = Base_ThemeCommon::get_template_file(self::module_name(), $icon_file); |
| 18 | 18 | $icon_img = '<img src="' . $img_src . '" style="vertical-align:bottom">'; |
| 19 | - } |
|
| 20 | - else { |
|
| 19 | + } else { |
|
| 21 | 20 | $icon_img = ''; |
| 22 | 21 | } |
| 23 | 22 | |