@@ -18,7 +18,7 @@ |
||
| 18 | 18 | * @author Trabis <[email protected]> |
| 19 | 19 | * @author Hossein Azizabadi (AKA Voltan) |
| 20 | 20 | * @author Mirza (AKA Bleekk) |
| 21 | - */ |
|
| 21 | + */ |
|
| 22 | 22 | |
| 23 | 23 | use XoopsModules\Contact; |
| 24 | 24 | /** @var Contact\Helper $helper */ |
@@ -24,11 +24,11 @@ discard block |
||
| 24 | 24 | /** @var Contact\Helper $helper */ |
| 25 | 25 | $helper = Contact\Helper::getInstance(); |
| 26 | 26 | |
| 27 | -require __DIR__ . '/../../mainfile.php'; |
|
| 28 | -require_once __DIR__ . '/header.php'; |
|
| 27 | +require __DIR__.'/../../mainfile.php'; |
|
| 28 | +require_once __DIR__.'/header.php'; |
|
| 29 | 29 | $GLOBALS['xoopsOption']['template_main'] = 'contact_index.tpl'; |
| 30 | 30 | //unset($_SESSION); |
| 31 | -include XOOPS_ROOT_PATH . '/header.php'; |
|
| 31 | +include XOOPS_ROOT_PATH.'/header.php'; |
|
| 32 | 32 | global $xoopsModuleConfig, $xoopsModule; |
| 33 | 33 | /*Modules Options*/ |
| 34 | 34 | if (1 == $helper->getConfig('form_dept')) { |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $GLOBALS['xoopsTpl']->assign('map', $helper->getConfig('embed_maps')); |
| 56 | 56 | /*end Modules options*/ |
| 57 | 57 | |
| 58 | -$GLOBALS['xoopsTpl']->assign('breadcrumb', '<li><a href="' . XOOPS_URL . '">' . _YOURHOME . '</a></li> <li class="active">' . $xoopsModule->name().'</li>'); |
|
| 58 | +$GLOBALS['xoopsTpl']->assign('breadcrumb', '<li><a href="'.XOOPS_URL.'">'._YOURHOME.'</a></li> <li class="active">'.$xoopsModule->name().'</li>'); |
|
| 59 | 59 | $GLOBALS['xoopsTpl']->assign('info', xoops_getModuleOption('contact_info', 'contact')); |
| 60 | 60 | $GLOBALS['xoopsTpl']->assign('contact_default', xoops_getModuleOption('contact_default', 'contact')); |
| 61 | 61 | |
@@ -86,4 +86,4 @@ discard block |
||
| 86 | 86 | $GLOBALS['xoopsTpl']->assign('lng_subject_info', _MD_CONTACT_SUBJECT_INFO); |
| 87 | 87 | $GLOBALS['xoopsTpl']->assign('lng_message_info', _MD_CONTACT_MESSAGE_INFO); |
| 88 | 88 | |
| 89 | -include XOOPS_ROOT_PATH . '/footer.php'; |
|
| 89 | +include XOOPS_ROOT_PATH.'/footer.php'; |
|
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | { |
| 72 | 72 | $ret = false; |
| 73 | 73 | $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
| 74 | - $class = '\\XoopsModules\\' . ucfirst(strtolower(basename(dirname(__DIR__)))) . '\\' . $name . 'Handler'; |
|
| 74 | + $class = '\\XoopsModules\\'.ucfirst(strtolower(basename(dirname(__DIR__)))).'\\'.$name.'Handler'; |
|
| 75 | 75 | $ret = new $class($db); |
| 76 | 76 | return $ret; |
| 77 | 77 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $form->addElement(new \XoopsFormLabel(_AM_CONTACT_TO, '', '')); |
| 80 | 80 | $form->addElement(new \XoopsFormText(_AM_CONTACT_NAMETO, 'contact_nameto', 50, 255, $this->getVar('contact_name')), true); |
| 81 | 81 | $form->addElement(new \XoopsFormText(_AM_CONTACT_MAILTO, 'contact_mailto', 50, 255, $this->getVar('contact_mail')), true); |
| 82 | - $form->addElement(new \XoopsFormText(_AM_CONTACT_SUBJECT, 'contact_subject', 50, 255, _RE . $this->getVar('contact_subject')), true); |
|
| 82 | + $form->addElement(new \XoopsFormText(_AM_CONTACT_SUBJECT, 'contact_subject', 50, 255, _RE.$this->getVar('contact_subject')), true); |
|
| 83 | 83 | $form->addElement(new \XoopsFormTextArea(_AM_CONTACT_MESSAGE, 'contact_message', '', 5, 60), true); |
| 84 | 84 | $form->addElement(new \XoopsFormButton('', 'submit', _SUBMIT, 'submit')); |
| 85 | 85 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | public function toArray() |
| 95 | 95 | { |
| 96 | 96 | $ret = []; |
| 97 | - $vars =& $this->getVars(); |
|
| 97 | + $vars = & $this->getVars(); |
|
| 98 | 98 | foreach (array_keys($vars) as $i) { |
| 99 | 99 | $ret [$i] = $this->getVar($i); |
| 100 | 100 | } |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | * |
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | -require_once dirname(__DIR__) . '/include/common.php'; |
|
| 23 | +require_once dirname(__DIR__).'/include/common.php'; |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * Class Configurator |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | class Configurator |
| 29 | 29 | { |
| 30 | 30 | public $uploadFolders = []; |
| 31 | - public $blankFiles = []; |
|
| 31 | + public $blankFiles = []; |
|
| 32 | 32 | public $templateFolders = []; |
| 33 | 33 | public $oldFiles = []; |
| 34 | 34 | public $oldFolders = []; |
@@ -43,16 +43,16 @@ discard block |
||
| 43 | 43 | $capsDirName = strtoupper($moduleDirName); |
| 44 | 44 | $this->name = 'Module Configurator'; |
| 45 | 45 | $this->uploadFolders = [ |
| 46 | - constant($capsDirName . '_UPLOAD_PATH'), |
|
| 47 | - constant($capsDirName . '_UPLOAD_PATH') . '/content', |
|
| 48 | - constant($capsDirName . '_UPLOAD_PATH') . '/images', |
|
| 49 | - constant($capsDirName . '_UPLOAD_PATH') . '/images/category', |
|
| 50 | - constant($capsDirName . '_UPLOAD_PATH') . '/images/thumbnails', |
|
| 46 | + constant($capsDirName.'_UPLOAD_PATH'), |
|
| 47 | + constant($capsDirName.'_UPLOAD_PATH').'/content', |
|
| 48 | + constant($capsDirName.'_UPLOAD_PATH').'/images', |
|
| 49 | + constant($capsDirName.'_UPLOAD_PATH').'/images/category', |
|
| 50 | + constant($capsDirName.'_UPLOAD_PATH').'/images/thumbnails', |
|
| 51 | 51 | ]; |
| 52 | 52 | $this->blankFiles = [ |
| 53 | - constant($capsDirName . '_UPLOAD_PATH'), |
|
| 54 | - constant($capsDirName . '_UPLOAD_PATH') . '/images/category', |
|
| 55 | - constant($capsDirName . '_UPLOAD_PATH') . '/images/thumbnails', |
|
| 53 | + constant($capsDirName.'_UPLOAD_PATH'), |
|
| 54 | + constant($capsDirName.'_UPLOAD_PATH').'/images/category', |
|
| 55 | + constant($capsDirName.'_UPLOAD_PATH').'/images/thumbnails', |
|
| 56 | 56 | ]; |
| 57 | 57 | |
| 58 | 58 | $this->templateFolders = [ |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | '/templates/admin/' |
| 62 | 62 | |
| 63 | 63 | ]; |
| 64 | - $this->oldFiles = [ |
|
| 64 | + $this->oldFiles = [ |
|
| 65 | 65 | '/class/request.php', |
| 66 | 66 | '/class/registry.php', |
| 67 | 67 | '/class/utilities.php', |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | '/include/functions.php', |
| 71 | 71 | '/ajaxrating.txt' |
| 72 | 72 | ]; |
| 73 | - $this->oldFolders = [ |
|
| 73 | + $this->oldFolders = [ |
|
| 74 | 74 | '/images', |
| 75 | 75 | '/css', |
| 76 | 76 | '/js', |
@@ -34,19 +34,19 @@ discard block |
||
| 34 | 34 | // $sql .= " WHERE metakey='version' LIMIT 1"; |
| 35 | 35 | // $query = $GLOBALS['xoopsDB']->query($sql); |
| 36 | 36 | // list($meta) = $GLOBALS['xoopsDB']->fetchRow($query); |
| 37 | - $html .= "<fieldset><legend style='font-weight: bold; color: #900;'>" . constant('CO_' . $moduleDirNameUpper . '_IMAGEINFO') . "</legend>\n"; |
|
| 37 | + $html .= "<fieldset><legend style='font-weight: bold; color: #900;'>".constant('CO_'.$moduleDirNameUpper.'_IMAGEINFO')."</legend>\n"; |
|
| 38 | 38 | $html .= "<div style='padding: 8px;'>\n"; |
| 39 | 39 | // $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_METAVERSION') . $meta . "</div>\n"; |
| 40 | 40 | // $html .= "<br>\n"; |
| 41 | 41 | // $html .= "<br>\n"; |
| 42 | - $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_SPHPINI') . "</div>\n"; |
|
| 42 | + $html .= '<div>'.constant('CO_'.$moduleDirNameUpper.'_SPHPINI')."</div>\n"; |
|
| 43 | 43 | $html .= "<ul>\n"; |
| 44 | 44 | // |
| 45 | - $gdlib = function_exists('gd_info') ? '<span style="color: green;">' . constant('CO_' . $moduleDirNameUpper . '_GDON') . '</span>' : '<span style="color: red;">' . constant('CO_' . $moduleDirNameUpper . '_GDOFF') . '</span>'; |
|
| 46 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS') . $gdlib; |
|
| 45 | + $gdlib = function_exists('gd_info') ? '<span style="color: green;">'.constant('CO_'.$moduleDirNameUpper.'_GDON').'</span>' : '<span style="color: red;">'.constant('CO_'.$moduleDirNameUpper.'_GDOFF').'</span>'; |
|
| 46 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_GDLIBSTATUS').$gdlib; |
|
| 47 | 47 | if (function_exists('gd_info')) { |
| 48 | 48 | if (true === ($gdlib = gd_info())) { |
| 49 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBVERSION') . '<b>' . $gdlib['GD Version'] . '</b>'; |
|
| 49 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_GDLIBVERSION').'<b>'.$gdlib['GD Version'].'</b>'; |
|
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | // |
@@ -56,18 +56,18 @@ discard block |
||
| 56 | 56 | // $registerglobals = (!ini_get('register_globals')) ? "<span style=\"color: green;\">" . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>' : "<span style=\"color: red;\">" . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>'; |
| 57 | 57 | // $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_REGISTERGLOBALS . $registerglobals; |
| 58 | 58 | // |
| 59 | - $downloads = ini_get('file_uploads') ? '<span style="color: green;">' . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>' : '<span style="color: red;">' . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>'; |
|
| 60 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS') . $downloads; |
|
| 59 | + $downloads = ini_get('file_uploads') ? '<span style="color: green;">'.constant('CO_'.$moduleDirNameUpper.'_ON').'</span>' : '<span style="color: red;">'.constant('CO_'.$moduleDirNameUpper.'_OFF').'</span>'; |
|
| 60 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_SERVERUPLOADSTATUS').$downloads; |
|
| 61 | 61 | // |
| 62 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE') . ' <b><span style="color: blue;">' . ini_get('upload_max_filesize') . "</span></b>\n"; |
|
| 63 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE') . ' <b><span style="color: blue;">' . ini_get('post_max_size') . "</span></b>\n"; |
|
| 64 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MEMORYLIMIT') . ' <b><span style="color: blue;">' . ini_get('memory_limit') . "</span></b>\n"; |
|
| 62 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_MAXUPLOADSIZE').' <b><span style="color: blue;">'.ini_get('upload_max_filesize')."</span></b>\n"; |
|
| 63 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_MAXPOSTSIZE').' <b><span style="color: blue;">'.ini_get('post_max_size')."</span></b>\n"; |
|
| 64 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_MEMORYLIMIT').' <b><span style="color: blue;">'.ini_get('memory_limit')."</span></b>\n"; |
|
| 65 | 65 | $html .= "</ul>\n"; |
| 66 | 66 | $html .= "<ul>\n"; |
| 67 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERPATH') . ' <b>' . XOOPS_ROOT_PATH . "</b>\n"; |
|
| 67 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_SERVERPATH').' <b>'.XOOPS_ROOT_PATH."</b>\n"; |
|
| 68 | 68 | $html .= "</ul>\n"; |
| 69 | 69 | $html .= "<br>\n"; |
| 70 | - $html .= constant('CO_' . $moduleDirNameUpper . '_UPLOADPATHDSC') . "\n"; |
|
| 70 | + $html .= constant('CO_'.$moduleDirNameUpper.'_UPLOADPATHDSC')."\n"; |
|
| 71 | 71 | $html .= '</div>'; |
| 72 | 72 | $html .= '</fieldset><br>'; |
| 73 | 73 | |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | require_once $GLOBALS['xoops']->path('class/template.php'); |
| 71 | 71 | $breadcrumbTpl = new \XoopsTpl(); |
| 72 | 72 | $breadcrumbTpl->assign('breadcrumb', $this->bread); |
| 73 | - $html = $breadcrumbTpl->fetch('db:' . $this->dirname . '_common_breadcrumb.tpl'); |
|
| 73 | + $html = $breadcrumbTpl->fetch('db:'.$this->dirname.'_common_breadcrumb.tpl'); |
|
| 74 | 74 | unset($breadcrumbTpl); |
| 75 | 75 | |
| 76 | 76 | return $html; |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | throw new \RuntimeException(sprintf('Unable to create the %s directory', $folder)); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - file_put_contents($folder . '/index.html', '<script>history.go(-1);</script>'); |
|
| 35 | + file_put_contents($folder.'/index.html', '<script>history.go(-1);</script>'); |
|
| 36 | 36 | } |
| 37 | 37 | } catch (\Exception $e) { |
| 38 | 38 | echo 'Caught exception: ', $e->getMessage(), "\n", '<br>'; |
@@ -60,10 +60,10 @@ discard block |
||
| 60 | 60 | if (!mkdir($dst) && !is_dir($dst)) { |
| 61 | 61 | while (false !== ($file = readdir($dir))) { |
| 62 | 62 | if (('.' !== $file) && ('..' !== $file)) { |
| 63 | - if (is_dir($src . '/' . $file)) { |
|
| 64 | - self::recurseCopy($src . '/' . $file, $dst . '/' . $file); |
|
| 63 | + if (is_dir($src.'/'.$file)) { |
|
| 64 | + self::recurseCopy($src.'/'.$file, $dst.'/'.$file); |
|
| 65 | 65 | } else { |
| 66 | - copy($src . '/' . $file, $dst . '/' . $file); |
|
| 66 | + copy($src.'/'.$file, $dst.'/'.$file); |
|
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | } |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | self::rrmdir($fObj->getPathname()); |
| 159 | 159 | } |
| 160 | 160 | } |
| 161 | - $iterator = null; // clear iterator Obj to close file/directory |
|
| 161 | + $iterator = null; // clear iterator Obj to close file/directory |
|
| 162 | 162 | return rmdir($src); // remove the directory & return results |
| 163 | 163 | } |
| 164 | 164 | |
@@ -191,14 +191,14 @@ discard block |
||
| 191 | 191 | $iterator = new \DirectoryIterator($src); |
| 192 | 192 | foreach ($iterator as $fObj) { |
| 193 | 193 | if ($fObj->isFile()) { |
| 194 | - rename($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
| 194 | + rename($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
| 195 | 195 | } elseif (!$fObj->isDot() && $fObj->isDir()) { |
| 196 | 196 | // Try recursively on directory |
| 197 | - self::rmove($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
| 197 | + self::rmove($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
| 198 | 198 | // rmdir($fObj->getPath()); // now delete the directory |
| 199 | 199 | } |
| 200 | 200 | } |
| 201 | - $iterator = null; // clear iterator Obj to close file/directory |
|
| 201 | + $iterator = null; // clear iterator Obj to close file/directory |
|
| 202 | 202 | return rmdir($src); // remove the directory & return results |
| 203 | 203 | } |
| 204 | 204 | |
@@ -234,9 +234,9 @@ discard block |
||
| 234 | 234 | $iterator = new \DirectoryIterator($src); |
| 235 | 235 | foreach ($iterator as $fObj) { |
| 236 | 236 | if ($fObj->isFile()) { |
| 237 | - copy($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
| 237 | + copy($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
| 238 | 238 | } elseif (!$fObj->isDot() && $fObj->isDir()) { |
| 239 | - self::rcopy($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
| 239 | + self::rcopy($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
| 240 | 240 | } |
| 241 | 241 | } |
| 242 | 242 | return true; |
@@ -37,13 +37,13 @@ discard block |
||
| 37 | 37 | //check for minimum XOOPS version |
| 38 | 38 | $currentVer = substr(XOOPS_VERSION, 6); // get the numeric part of string |
| 39 | 39 | if (null === $requiredVer) { |
| 40 | - $requiredVer = '' . $module->getInfo('min_xoops'); //making sure it's a string |
|
| 40 | + $requiredVer = ''.$module->getInfo('min_xoops'); //making sure it's a string |
|
| 41 | 41 | } |
| 42 | - $success = true; |
|
| 42 | + $success = true; |
|
| 43 | 43 | |
| 44 | 44 | if (version_compare($currentVer, $requiredVer, '<')) { |
| 45 | - $success = false; |
|
| 46 | - $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_XOOPS'), $requiredVer, $currentVer)); |
|
| 45 | + $success = false; |
|
| 46 | + $module->setErrors(sprintf(constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_XOOPS'), $requiredVer, $currentVer)); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | return $success; |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | $reqVer = $module->getInfo('min_php'); |
| 67 | 67 | if (false !== $reqVer && '' !== $reqVer) { |
| 68 | 68 | if (version_compare($verNum, $reqVer, '<')) { |
| 69 | - $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_PHP'), $reqVer, $verNum)); |
|
| 69 | + $module->setErrors(sprintf(constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_PHP'), $reqVer, $verNum)); |
|
| 70 | 70 | $success = false; |
| 71 | 71 | } |
| 72 | 72 | } |
@@ -138,9 +138,9 @@ |
||
| 138 | 138 | |
| 139 | 139 | $subjectPrefix = ''; |
| 140 | 140 | if ($GLOBALS['xoopsModuleConfig']['form_dept'] && $GLOBALS['xoopsModuleConfig']['subject_prefix'] && $GLOBALS['xoopsModuleConfig']['contact_dept']) { |
| 141 | - $subjectPrefix = '[' . $GLOBALS['xoopsModuleConfig']['prefix_text'] . ' ' . $contact['contact_department'] . ']: '; |
|
| 141 | + $subjectPrefix = '['.$GLOBALS['xoopsModuleConfig']['prefix_text'].' '.$contact['contact_department'].']: '; |
|
| 142 | 142 | } |
| 143 | - $xoopsMailer->setSubject($subjectPrefix . html_entity_decode($contact['contact_subject'], ENT_QUOTES, 'UTF-8')); |
|
| 143 | + $xoopsMailer->setSubject($subjectPrefix.html_entity_decode($contact['contact_subject'], ENT_QUOTES, 'UTF-8')); |
|
| 144 | 144 | $xoopsMailer->setBody(html_entity_decode($contact['contact_message'], ENT_QUOTES, 'UTF-8')); |
| 145 | 145 | if ($xoopsMailer->send()) { |
| 146 | 146 | $message = _MD_CONTACT_MES_SEND; |