@@ -55,7 +55,7 @@ |
||
55 | 55 | if ($helper->isCurrentModule() && isset($res['subMenu']) && is_array($res['subMenu'])) { |
56 | 56 | foreach ($res['subMenu'] as $key => $subMenu) { |
57 | 57 | if (isset($subMenu['name']) && isset($subMenu['link'])) { |
58 | - $subMenu['icon'] = isset($subMenu['icon']) ? $subMenu['icon'] :'glyphicon-menu-right'; |
|
58 | + $subMenu['icon'] = isset($subMenu['icon']) ? $subMenu['icon'] : 'glyphicon-menu-right'; |
|
59 | 59 | $res['subMenu'][$key] = $subMenu; |
60 | 60 | } |
61 | 61 | } |
@@ -17,7 +17,7 @@ |
||
17 | 17 | * @package thumbs |
18 | 18 | * @author Mage Grégory (AKA Mage) |
19 | 19 | */ |
20 | -include __DIR__ . '/header.php'; |
|
20 | +include __DIR__.'/header.php'; |
|
21 | 21 | $xoops = Xoops::getInstance(); |
22 | 22 | $xoops->header(); |
23 | 23 | $aboutAdmin = new \Xoops\Module\Admin(); |
@@ -17,7 +17,7 @@ |
||
17 | 17 | * @package thumbs |
18 | 18 | * @author Mage Grégory (AKA Mage) |
19 | 19 | */ |
20 | -include __DIR__ . '/header.php'; |
|
20 | +include __DIR__.'/header.php'; |
|
21 | 21 | |
22 | 22 | $xoops = Xoops::getInstance(); |
23 | 23 |
@@ -17,4 +17,4 @@ |
||
17 | 17 | * @package thumbs |
18 | 18 | * @author Mage Grégory (AKA Mage) |
19 | 19 | */ |
20 | -require_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php'; |
|
20 | +require_once dirname(dirname(dirname(__DIR__))).'/include/cp_header.php'; |
@@ -33,7 +33,7 @@ |
||
33 | 33 | public static function eventCoreServiceLocateThumbnail(Provider $provider) |
34 | 34 | { |
35 | 35 | if (is_a($provider, '\Xoops\Core\Service\Provider')) { |
36 | - $path = dirname(__DIR__) . '/class/ThumbsProvider.php'; |
|
36 | + $path = dirname(__DIR__).'/class/ThumbsProvider.php'; |
|
37 | 37 | require $path; |
38 | 38 | $object = new ThumbsProvider(); |
39 | 39 | $provider->register($object); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | */ |
20 | 20 | |
21 | 21 | // this is located in include, otherwise normal/anon users do not have authority to run |
22 | -include dirname(dirname(dirname(__DIR__))) . '/mainfile.php'; |
|
22 | +include dirname(dirname(dirname(__DIR__))).'/mainfile.php'; |
|
23 | 23 | |
24 | 24 | $xoops = Xoops::getInstance(); |
25 | 25 | $xoops->logger()->quiet(); |
@@ -28,12 +28,12 @@ discard block |
||
28 | 28 | $imgWidth = Request::getInt('w', 0); |
29 | 29 | $imgHeight = Request::getInt('h', 0); |
30 | 30 | |
31 | -if ($imgWidth==0 && $imgHeight==0) { |
|
31 | +if ($imgWidth == 0 && $imgHeight == 0) { |
|
32 | 32 | $configs = $xoops->getModuleConfigs('thumbs'); |
33 | 33 | $imgWidth = $configs['thumbs_width']; |
34 | 34 | $imgHeight = $configs['thumbs_height']; |
35 | 35 | } |
36 | -$helper = $xoops->getModuleHelper('thumbs'); |
|
36 | +$helper = $xoops->getModuleHelper('thumbs'); |
|
37 | 37 | $thumbPath = $helper->buildThumbPath($imgPath, $imgWidth, $imgHeight); |
38 | 38 | |
39 | 39 | $oldUmask = umask(022); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | if ($image->resize($imgWidth, $imgHeight, ZEBRA_IMAGE_NOT_BOXED, -1)) { |
53 | 53 | header("HTTP/1.1 301 Moved Permanently"); |
54 | - header('Location: ' . $xoops->url($thumbPath)); |
|
54 | + header('Location: '.$xoops->url($thumbPath)); |
|
55 | 55 | } else { |
56 | 56 | header("HTTP/1.0 404 Not Found"); |
57 | 57 | // http_response_code(400); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | public function buildThumbPath($imgPath, $width, $height) |
46 | 46 | { |
47 | 47 | //$xoops = \Xoops::getInstance(); |
48 | - if ($width==0 && $height==0) { |
|
48 | + if ($width == 0 && $height == 0) { |
|
49 | 49 | $width = $this->getConfig('thumbs_width'); |
50 | 50 | $height = $this->getConfig('thumbs_height'); |
51 | 51 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | if ($pathParts['dirname'] === '.') { |
55 | 55 | $pathParts['dirname'] = ''; |
56 | 56 | } |
57 | - $thumbPath = 'assets/thumbs/' . $pathParts['dirname'].$sizeDir.$pathParts['basename']; |
|
57 | + $thumbPath = 'assets/thumbs/'.$pathParts['dirname'].$sizeDir.$pathParts['basename']; |
|
58 | 58 | |
59 | 59 | return $thumbPath; |
60 | 60 | } |
@@ -63,14 +63,14 @@ |
||
63 | 63 | private function getThumbnailUrl($imgPath, $width, $height) |
64 | 64 | { |
65 | 65 | $xoops = \Xoops::getInstance(); |
66 | - $helper = $xoops->getModuleHelper('thumbs'); |
|
66 | + $helper = $xoops->getModuleHelper('thumbs'); |
|
67 | 67 | $thumbPath = $helper->buildThumbPath($imgPath, $width, $height); |
68 | 68 | |
69 | 69 | $originalMtime = filemtime($xoops->path($imgPath)); |
70 | 70 | $thumbMtime = filemtime($xoops->path($thumbPath)); |
71 | - if (false===$thumbMtime || $originalMtime>$thumbMtime) { |
|
71 | + if (false === $thumbMtime || $originalMtime > $thumbMtime) { |
|
72 | 72 | $params = array( |
73 | - 'img' => (string) $imgPath, |
|
73 | + 'img' => (string)$imgPath, |
|
74 | 74 | ); |
75 | 75 | if ($height) { |
76 | 76 | $params['h'] = $height; |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | * @version $Id$ |
23 | 23 | */ |
24 | 24 | |
25 | -include dirname(dirname(__DIR__)) . '/mainfile.php'; |
|
25 | +include dirname(dirname(__DIR__)).'/mainfile.php'; |
|
26 | 26 | |
27 | 27 | $xoops = Xoops::getInstance(); |
28 | 28 | $helper = Images::getInstance(); |
@@ -60,15 +60,15 @@ discard block |
||
60 | 60 | |
61 | 61 | foreach (array_keys($images) as $i) { |
62 | 62 | if ($category->getVar('imgcat_storetype') === 'db') { |
63 | - $lcode = '[img align=left id=' . $images[$i]->getVar('image_id') . ']' . $images[$i]->getVar('image_nicename') . '[/img]'; |
|
64 | - $code = '[img align=center id=' . $images[$i]->getVar('image_id') . ']' . $images[$i]->getVar('image_nicename') . '[/img]'; |
|
65 | - $rcode = '[img align=right id=' . $images[$i]->getVar('image_id') . ']' . $images[$i]->getVar('image_nicename') . '[/img]'; |
|
66 | - $src = $helper->url("image.php?id=" . $images[$i]->getVar('image_id')); |
|
63 | + $lcode = '[img align=left id='.$images[$i]->getVar('image_id').']'.$images[$i]->getVar('image_nicename').'[/img]'; |
|
64 | + $code = '[img align=center id='.$images[$i]->getVar('image_id').']'.$images[$i]->getVar('image_nicename').'[/img]'; |
|
65 | + $rcode = '[img align=right id='.$images[$i]->getVar('image_id').']'.$images[$i]->getVar('image_nicename').'[/img]'; |
|
66 | + $src = $helper->url("image.php?id=".$images[$i]->getVar('image_id')); |
|
67 | 67 | } else { |
68 | - $lcode = '[img align=left]' . \XoopsBaseConfig::get('uploads-url') . '/' . $images[$i]->getVar('image_name') . '[/img]'; |
|
69 | - $code = '[img align=center]' . \XoopsBaseConfig::get('uploads-url') . '/' . $images[$i]->getVar('image_name') . '[/img]'; |
|
70 | - $rcode = '[img align=right]' . \XoopsBaseConfig::get('uploads-url') . '/' . $images[$i]->getVar('image_name') . '[/img]'; |
|
71 | - $src = \XoopsBaseConfig::get('uploads-url') . '/' . $images[$i]->getVar('image_name'); |
|
68 | + $lcode = '[img align=left]'.\XoopsBaseConfig::get('uploads-url').'/'.$images[$i]->getVar('image_name').'[/img]'; |
|
69 | + $code = '[img align=center]'.\XoopsBaseConfig::get('uploads-url').'/'.$images[$i]->getVar('image_name').'[/img]'; |
|
70 | + $rcode = '[img align=right]'.\XoopsBaseConfig::get('uploads-url').'/'.$images[$i]->getVar('image_name').'[/img]'; |
|
71 | + $src = \XoopsBaseConfig::get('uploads-url').'/'.$images[$i]->getVar('image_name'); |
|
72 | 72 | } |
73 | 73 | $xoopsTpl->append('images', array( |
74 | 74 | 'id' => $images[$i]->getVar('image_id'), |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | if ($perm_handler->checkRight('imgcat_write', $imgcat_id, $groups)) { |
91 | 91 | $xoops->simpleHeader(); |
92 | 92 | $xoopsTpl = new XoopsTpl(); |
93 | - $obj = $helper->getHandlerImages()->create(); |
|
93 | + $obj = $helper->getHandlerImages()->create(); |
|
94 | 94 | $obj->setVar('imgcat_id', $imgcat_id); |
95 | 95 | $form = $helper->getForm(array('obj' => $obj, 'target' => $target), 'image_imagemanager'); |
96 | 96 | $xoopsTpl->assign('form', $form->render()); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | |
101 | 101 | case 'save': |
102 | 102 | if (!$xoops->security()->check()) { |
103 | - $xoops->redirect('imagemanager.php?imgcat_id=' . $imgcat_id, 3, implode('<br />', $xoops->security()->getErrors())); |
|
103 | + $xoops->redirect('imagemanager.php?imgcat_id='.$imgcat_id, 3, implode('<br />', $xoops->security()->getErrors())); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | $mimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png'); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $xoops_upload_file = Request::getArray('xoops_upload_file', array()); |
120 | 120 | |
121 | 121 | $uploader = new XoopsMediaUploader( |
122 | - \XoopsBaseConfig::get('uploads-url') . '/images', |
|
122 | + \XoopsBaseConfig::get('uploads-url').'/images', |
|
123 | 123 | $mimetypes, |
124 | 124 | $category->getVar('imgcat_maxsize'), |
125 | 125 | $category->getVar('imgcat_maxwidth'), |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | @fclose($fp); |
140 | 140 | $image_body = $fbinary; |
141 | 141 | } else { |
142 | - $obj->setVar('image_name', 'images/' . $uploader->getSavedFileName()); |
|
142 | + $obj->setVar('image_name', 'images/'.$uploader->getSavedFileName()); |
|
143 | 143 | } |
144 | 144 | } |
145 | 145 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | @unlink($uploader->getSavedDestination()); |
157 | 157 | } |
158 | 158 | } |
159 | - $xoops->redirect('imagemanager.php?target=' . $target . '&imgcat_id=' . $imgcat_id, 2, implode('<br />', $msg)); |
|
159 | + $xoops->redirect('imagemanager.php?target='.$target.'&imgcat_id='.$imgcat_id, 2, implode('<br />', $msg)); |
|
160 | 160 | } |
161 | 161 | echo $xoops->alert('error', $obj->getHtmlErrors()); |
162 | 162 | break; |