@@ -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; |
@@ -63,10 +63,10 @@ discard block |
||
| 63 | 63 | // check for minimum PHP version |
| 64 | 64 | $success = true; |
| 65 | 65 | $verNum = PHP_VERSION; |
| 66 | - $reqVer =& $module->getInfo('min_php'); |
|
| 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 | } |
@@ -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; |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | throw new \RuntimeException(sprintf('Unable to create the %s directory', $folder)); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - file_put_contents($folder . '/index.html', '<script>history.go(-1);</script>'); |
|
| 36 | + file_put_contents($folder.'/index.html', '<script>history.go(-1);</script>'); |
|
| 37 | 37 | } |
| 38 | 38 | } catch (\Exception $e) { |
| 39 | 39 | echo 'Caught exception: ', $e->getMessage(), "\n", '<br>'; |
@@ -61,10 +61,10 @@ discard block |
||
| 61 | 61 | if (!mkdir($dst) && !is_dir($dst)) { |
| 62 | 62 | while (false !== ($file = readdir($dir))) { |
| 63 | 63 | if (('.' !== $file) && ('..' !== $file)) { |
| 64 | - if (is_dir($src . '/' . $file)) { |
|
| 65 | - self::recurseCopy($src . '/' . $file, $dst . '/' . $file); |
|
| 64 | + if (is_dir($src.'/'.$file)) { |
|
| 65 | + self::recurseCopy($src.'/'.$file, $dst.'/'.$file); |
|
| 66 | 66 | } else { |
| 67 | - copy($src . '/' . $file, $dst . '/' . $file); |
|
| 67 | + copy($src.'/'.$file, $dst.'/'.$file); |
|
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | } |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | self::rrmdir($fObj->getPathname()); |
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | - $iterator = null; // clear iterator Obj to close file/directory |
|
| 162 | + $iterator = null; // clear iterator Obj to close file/directory |
|
| 163 | 163 | return rmdir($src); // remove the directory & return results |
| 164 | 164 | } |
| 165 | 165 | |
@@ -192,14 +192,14 @@ discard block |
||
| 192 | 192 | $iterator = new \DirectoryIterator($src); |
| 193 | 193 | foreach ($iterator as $fObj) { |
| 194 | 194 | if ($fObj->isFile()) { |
| 195 | - rename($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
| 195 | + rename($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
| 196 | 196 | } elseif (!$fObj->isDot() && $fObj->isDir()) { |
| 197 | 197 | // Try recursively on directory |
| 198 | - self::rmove($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
| 198 | + self::rmove($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
| 199 | 199 | // rmdir($fObj->getPath()); // now delete the directory |
| 200 | 200 | } |
| 201 | 201 | } |
| 202 | - $iterator = null; // clear iterator Obj to close file/directory |
|
| 202 | + $iterator = null; // clear iterator Obj to close file/directory |
|
| 203 | 203 | return rmdir($src); // remove the directory & return results |
| 204 | 204 | } |
| 205 | 205 | |
@@ -235,9 +235,9 @@ discard block |
||
| 235 | 235 | $iterator = new \DirectoryIterator($src); |
| 236 | 236 | foreach ($iterator as $fObj) { |
| 237 | 237 | if ($fObj->isFile()) { |
| 238 | - copy($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
| 238 | + copy($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
| 239 | 239 | } elseif (!$fObj->isDot() && $fObj->isDir()) { |
| 240 | - self::rcopy($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
| 240 | + self::rcopy($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
| 241 | 241 | } |
| 242 | 242 | } |
| 243 | 243 | return true; |
@@ -6,9 +6,9 @@ |
||
| 6 | 6 | * Licence: GNU |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -require_once __DIR__ . '/header.php'; |
|
| 10 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smartloader.php'; |
|
| 11 | -require_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
| 9 | +require_once __DIR__.'/header.php'; |
|
| 10 | +require_once SMARTOBJECT_ROOT_PATH.'class/smartloader.php'; |
|
| 11 | +require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
| 12 | 12 | |
| 13 | 13 | $xoopsTpl = new \XoopsTpl(); |
| 14 | 14 | $myts = \MyTextSanitizer::getInstance(); |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | class XoopsCaptcha |
| 15 | 15 | { |
| 16 | 16 | public $active = true; |
| 17 | - public $mode = 'text'; // potential values: image, text |
|
| 17 | + public $mode = 'text'; // potential values: image, text |
|
| 18 | 18 | public $config = []; |
| 19 | 19 | |
| 20 | 20 | public $message = []; // Logging error messages |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | public function __construct() |
| 26 | 26 | { |
| 27 | 27 | // Loading default preferences |
| 28 | - $this->config = @include __DIR__ . '/config.php'; |
|
| 28 | + $this->config = @include __DIR__.'/config.php'; |
|
| 29 | 29 | |
| 30 | 30 | $this->setMode($this->config['mode']); |
| 31 | 31 | } |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | { |
| 142 | 142 | $sessionName = @$_SESSION['XoopsCaptcha_name']; |
| 143 | 143 | $skipMember = (null === $skipMember) ? @$_SESSION['XoopsCaptcha_skipmember'] : $skipMember; |
| 144 | - $maxAttempts = (int)(@$_SESSION['XoopsCaptcha_maxattempts']); |
|
| 144 | + $maxAttempts = (int) (@$_SESSION['XoopsCaptcha_maxattempts']); |
|
| 145 | 145 | |
| 146 | 146 | $is_valid = false; |
| 147 | 147 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | if (is_object($GLOBALS['xoopsUser']) && !empty($skipMember)) { |
| 150 | 150 | $is_valid = true; |
| 151 | 151 | // Kill too many attempts |
| 152 | - } elseif (!empty($maxAttempts) && $_SESSION['XoopsCaptcha_attempt_' . $sessionName] > $maxAttempts) { |
|
| 152 | + } elseif (!empty($maxAttempts) && $_SESSION['XoopsCaptcha_attempt_'.$sessionName] > $maxAttempts) { |
|
| 153 | 153 | $this->message[] = XOOPS_CAPTCHA_TOOMANYATTEMPTS; |
| 154 | 154 | |
| 155 | 155 | // Verify the code |
@@ -161,13 +161,13 @@ discard block |
||
| 161 | 161 | if (!empty($maxAttempts)) { |
| 162 | 162 | if (!$is_valid) { |
| 163 | 163 | // Increase the attempt records on failure |
| 164 | - $_SESSION['XoopsCaptcha_attempt_' . $sessionName]++; |
|
| 164 | + $_SESSION['XoopsCaptcha_attempt_'.$sessionName]++; |
|
| 165 | 165 | // Log the error message |
| 166 | 166 | $this->message[] = XOOPS_CAPTCHA_INVALID_CODE; |
| 167 | 167 | } else { |
| 168 | 168 | |
| 169 | 169 | // reset attempt records on success |
| 170 | - $_SESSION['XoopsCaptcha_attempt_' . $sessionName] = null; |
|
| 170 | + $_SESSION['XoopsCaptcha_attempt_'.$sessionName] = null; |
|
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | 173 | $this->destroyGarbage(true); |
@@ -198,8 +198,8 @@ discard block |
||
| 198 | 198 | */ |
| 199 | 199 | public function destroyGarbage($clearSession = false) |
| 200 | 200 | { |
| 201 | - require_once __DIR__ . '/' . $this->mode . '.php'; |
|
| 202 | - $class = 'XoopsCaptcha' . ucfirst($this->mode); |
|
| 201 | + require_once __DIR__.'/'.$this->mode.'.php'; |
|
| 202 | + $class = 'XoopsCaptcha'.ucfirst($this->mode); |
|
| 203 | 203 | $captchaHandler = new $class(); |
| 204 | 204 | if (method_exists($captchaHandler, 'destroyGarbage')) { |
| 205 | 205 | $captchaHandler->loadConfig($this->config); |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | */ |
| 239 | 239 | |
| 240 | 240 | // Fail on too many attempts |
| 241 | - if (!empty($maxAttempts) && @$_SESSION['XoopsCaptcha_attempt_' . $this->config['name']] > $maxAttempts) { |
|
| 241 | + if (!empty($maxAttempts) && @$_SESSION['XoopsCaptcha_attempt_'.$this->config['name']] > $maxAttempts) { |
|
| 242 | 242 | $form = XOOPS_CAPTCHA_TOOMANYATTEMPTS; |
| 243 | 243 | // Load the form element |
| 244 | 244 | } else { |
@@ -253,8 +253,8 @@ discard block |
||
| 253 | 253 | */ |
| 254 | 254 | public function loadForm() |
| 255 | 255 | { |
| 256 | - require_once __DIR__ . '/' . $this->mode . '.php'; |
|
| 257 | - $class = 'XoopsCaptcha' . ucfirst($this->mode); |
|
| 256 | + require_once __DIR__.'/'.$this->mode.'.php'; |
|
| 257 | + $class = 'XoopsCaptcha'.ucfirst($this->mode); |
|
| 258 | 258 | $captchaHandler = new $class(); |
| 259 | 259 | $captchaHandler->loadConfig($this->config); |
| 260 | 260 | |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
| 15 | 15 | |
| 16 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formelement.php'; |
|
| 16 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formelement.php'; |
|
| 17 | 17 | |
| 18 | 18 | /* |
| 19 | 19 | * Usage |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $backgroundnum = null |
| 63 | 63 | ) { |
| 64 | 64 | if (!class_exists('XoopsCaptcaha')) { |
| 65 | - require_once SMARTOBJECT_ROOT_PATH . '/include/captcha/captcha.php'; |
|
| 65 | + require_once SMARTOBJECT_ROOT_PATH.'/include/captcha/captcha.php'; |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | $this->_captchaHandler = XoopsCaptcha::getInstance(); |
@@ -21,26 +21,26 @@ discard block |
||
| 21 | 21 | { |
| 22 | 22 | $moduleDirName = basename(dirname(__DIR__)); |
| 23 | 23 | $moduleDirNameUpper = strtoupper($moduleDirName); |
| 24 | - return (object)[ |
|
| 25 | - 'name' => strtoupper($moduleDirName) . ' Module Configurator', |
|
| 24 | + return (object) [ |
|
| 25 | + 'name' => strtoupper($moduleDirName).' Module Configurator', |
|
| 26 | 26 | 'paths' => [ |
| 27 | 27 | 'dirname' => $moduleDirName, |
| 28 | - 'admin' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin', |
|
| 29 | - 'modPath' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName, |
|
| 30 | - 'modUrl' => XOOPS_URL . '/modules/' . $moduleDirName, |
|
| 31 | - 'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
| 32 | - 'uploadUrl' => XOOPS_UPLOAD_URL . '/' . $moduleDirName, |
|
| 28 | + 'admin' => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/admin', |
|
| 29 | + 'modPath' => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName, |
|
| 30 | + 'modUrl' => XOOPS_URL.'/modules/'.$moduleDirName, |
|
| 31 | + 'uploadPath' => XOOPS_UPLOAD_PATH.'/'.$moduleDirName, |
|
| 32 | + 'uploadUrl' => XOOPS_UPLOAD_URL.'/'.$moduleDirName, |
|
| 33 | 33 | ], |
| 34 | 34 | 'uploadFolders' => [ |
| 35 | - constant($moduleDirNameUpper . '_UPLOAD_PATH'), |
|
| 36 | - constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/category', |
|
| 37 | - constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/screenshots', |
|
| 35 | + constant($moduleDirNameUpper.'_UPLOAD_PATH'), |
|
| 36 | + constant($moduleDirNameUpper.'_UPLOAD_PATH').'/category', |
|
| 37 | + constant($moduleDirNameUpper.'_UPLOAD_PATH').'/screenshots', |
|
| 38 | 38 | //XOOPS_UPLOAD_PATH . '/flags' |
| 39 | 39 | ], |
| 40 | 40 | 'copyBlankFiles' => [ |
| 41 | - constant($moduleDirNameUpper . '_UPLOAD_PATH'), |
|
| 42 | - constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/category', |
|
| 43 | - constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/screenshots', |
|
| 41 | + constant($moduleDirNameUpper.'_UPLOAD_PATH'), |
|
| 42 | + constant($moduleDirNameUpper.'_UPLOAD_PATH').'/category', |
|
| 43 | + constant($moduleDirNameUpper.'_UPLOAD_PATH').'/screenshots', |
|
| 44 | 44 | //XOOPS_UPLOAD_PATH . '/flags' |
| 45 | 45 | ], |
| 46 | 46 | |
@@ -75,6 +75,6 @@ discard block |
||
| 75 | 75 | '/images', |
| 76 | 76 | ], |
| 77 | 77 | 'modCopyright' => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'> |
| 78 | - <img src='" . constant($moduleDirNameUpper . '_AUTHOR_LOGOIMG') . '\' alt=\'XOOPS Project\' /></a>', |
|
| 78 | + <img src='" . constant($moduleDirNameUpper.'_AUTHOR_LOGOIMG').'\' alt=\'XOOPS Project\' /></a>', |
|
| 79 | 79 | ]; |
| 80 | 80 | } |
@@ -9,17 +9,17 @@ discard block |
||
| 9 | 9 | |
| 10 | 10 | use XoopsModules\Smartobject\ObjectController; |
| 11 | 11 | |
| 12 | -require_once __DIR__ . '/header.php'; |
|
| 12 | +require_once __DIR__.'/header.php'; |
|
| 13 | 13 | //require_once SMARTOBJECT_ROOT_PATH . 'class/smartloader.php'; |
| 14 | 14 | //require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectlink.php'; |
| 15 | -require_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
| 15 | +require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
| 16 | 16 | |
| 17 | 17 | $xoopsTpl = new \XoopsTpl(); |
| 18 | 18 | $myts = \MyTextSanitizer::getInstance(); |
| 19 | 19 | $xoopsConfig['sitename'] = $myts->displayTarea($xoopsConfig['sitename']); |
| 20 | 20 | |
| 21 | 21 | xoops_header(false); |
| 22 | -echo Smartobject\Utility::getCssLink(SMARTOBJECT_URL . 'assets/css/module.css'); |
|
| 22 | +echo Smartobject\Utility::getCssLink(SMARTOBJECT_URL.'assets/css/module.css'); |
|
| 23 | 23 | echo '</head><body>'; |
| 24 | 24 | |
| 25 | 25 | $smartobjectLinkHandler = Smartobject\Helper::getInstance()->getHandler('link', 'smartobject'); |
@@ -42,13 +42,13 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | $xoopsMailer = xoops_getMailer(); |
| 44 | 44 | $xoopsMailer->useMail(); |
| 45 | - $xoopsMailer->setTemplateDir('language/' . $xoopsConfig['language'] . '/mail_template'); |
|
| 45 | + $xoopsMailer->setTemplateDir('language/'.$xoopsConfig['language'].'/mail_template'); |
|
| 46 | 46 | |
| 47 | 47 | $xoopsMailer->setTemplate('sendlink.tpl'); |
| 48 | 48 | $xoopsMailer->assign('X_SITENAME', $xoopsConfig['sitename']); |
| 49 | 49 | $xoopsMailer->assign('TO_NAME', $linkObj->getVar('to_name')); |
| 50 | 50 | $xoopsMailer->assign('FROM_NAME', $linkObj->getVar('from_name')); |
| 51 | - $xoopsMailer->assign('SITEURL', XOOPS_URL . '/'); |
|
| 51 | + $xoopsMailer->assign('SITEURL', XOOPS_URL.'/'); |
|
| 52 | 52 | $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']); |
| 53 | 53 | $xoopsMailer->assign('MESSAGE', $_POST['body']); |
| 54 | 54 | $xoopsMailer->setToEmails($linkObj->getVar('to_email')); |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $xoopsMailer->setSubject(sprintf(_CO_SOBJECT_SUBJECT_DEFAULT, $myts->oopsStripSlashesGPC($xoopsConfig['sitename']))); |
| 58 | 58 | |
| 59 | 59 | if (!$xoopsMailer->send(true)) { |
| 60 | - $xoopsTpl->assign('send_error', sprintf(_CO_SOBJECT_SEND_ERROR, $xoopsConfig['adminmail']) . '<br>' . $xoopsMailer->getErrors(true)); |
|
| 60 | + $xoopsTpl->assign('send_error', sprintf(_CO_SOBJECT_SEND_ERROR, $xoopsConfig['adminmail']).'<br>'.$xoopsMailer->getErrors(true)); |
|
| 61 | 61 | } else { |
| 62 | 62 | $xoopsTpl->assign('send_success', _CO_SOBJECT_SEND_SUCCESS); |
| 63 | 63 | } |
@@ -63,8 +63,8 @@ |
||
| 63 | 63 | $granted_ids = $smartobjectPermissionsHandler->getGrantedItems('view'); |
| 64 | 64 | |
| 65 | 65 | if ($granted_ids && count($granted_ids) > 0) { |
| 66 | - $criteria->add(new \Criteria('customtagid', '(' . implode(', ', $granted_ids) . ')', 'IN')); |
|
| 67 | - $customtagsObj =& $this->getObjects($criteria, true); |
|
| 66 | + $criteria->add(new \Criteria('customtagid', '('.implode(', ', $granted_ids).')', 'IN')); |
|
| 67 | + $customtagsObj = & $this->getObjects($criteria, true); |
|
| 68 | 68 | foreach ($customtagsObj as $customtagObj) { |
| 69 | 69 | $ret[$customtagObj->getVar('name')] = $customtagObj; |
| 70 | 70 | } |