@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | function smart_get_css_link($cssfile) |
| 13 | 13 | { |
| 14 | - $ret = '<link rel="stylesheet" type="text/css" href="' . $cssfile . '">'; |
|
| 14 | + $ret = '<link rel="stylesheet" type="text/css" href="'.$cssfile.'">'; |
|
| 15 | 15 | |
| 16 | 16 | return $ret; |
| 17 | 17 | } |
@@ -102,14 +102,14 @@ discard block |
||
| 102 | 102 | $seoMode = smart_getModuleModeSEO($moduleName); |
| 103 | 103 | if ('rewrite' === $seoMode) { |
| 104 | 104 | $seoModuleName = smart_getModuleNameForSEO($moduleName); |
| 105 | - $ret = XOOPS_URL . '/' . $seoModuleName . '/'; |
|
| 105 | + $ret = XOOPS_URL.'/'.$seoModuleName.'/'; |
|
| 106 | 106 | } elseif ('pathinfo' === $seoMode) { |
| 107 | - $ret = XOOPS_URL . '/modules/' . $moduleName . '/seo.php/' . $seoModuleName . '/'; |
|
| 107 | + $ret = XOOPS_URL.'/modules/'.$moduleName.'/seo.php/'.$seoModuleName.'/'; |
|
| 108 | 108 | } else { |
| 109 | - $ret = XOOPS_URL . '/modules/' . $moduleName . '/'; |
|
| 109 | + $ret = XOOPS_URL.'/modules/'.$moduleName.'/'; |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - return '<a href="' . $ret . '">' . $smartModule->getVar('name') . '</a>'; |
|
| 112 | + return '<a href="'.$ret.'">'.$smartModule->getVar('name').'</a>'; |
|
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | |
@@ -172,11 +172,11 @@ discard block |
||
| 172 | 172 | /** |
| 173 | 173 | * include SmartObject admin language file |
| 174 | 174 | */ |
| 175 | - $fileName = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/admin.php'; |
|
| 175 | + $fileName = XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/'.$xoopsConfig['language'].'/admin.php'; |
|
| 176 | 176 | if (file_exists($fileName)) { |
| 177 | 177 | require_once $fileName; |
| 178 | 178 | } else { |
| 179 | - require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/english/admin.php'; |
|
| 179 | + require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/english/admin.php'; |
|
| 180 | 180 | } ?> |
| 181 | 181 | <script type='text/javascript'> |
| 182 | 182 | <!-- |
@@ -193,9 +193,9 @@ discard block |
||
| 193 | 193 | /** |
| 194 | 194 | * Include the admin language constants for the SmartObject Framework |
| 195 | 195 | */ |
| 196 | - $admin_file = SMARTOBJECT_ROOT_PATH . 'language/' . $xoopsConfig['language'] . '/admin.php'; |
|
| 196 | + $admin_file = SMARTOBJECT_ROOT_PATH.'language/'.$xoopsConfig['language'].'/admin.php'; |
|
| 197 | 197 | if (!file_exists($admin_file)) { |
| 198 | - $admin_file = SMARTOBJECT_ROOT_PATH . 'language/english/admin.php'; |
|
| 198 | + $admin_file = SMARTOBJECT_ROOT_PATH.'language/english/admin.php'; |
|
| 199 | 199 | } |
| 200 | 200 | require_once $admin_file; |
| 201 | 201 | } |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | //Verifies that a MySQL table exists |
| 216 | 216 | $xoopsDB = XoopsDatabaseFactory::getDatabaseConnection(); |
| 217 | 217 | $realname = $xoopsDB->prefix($table); |
| 218 | - $sql = 'SHOW TABLES FROM ' . XOOPS_DB_NAME; |
|
| 218 | + $sql = 'SHOW TABLES FROM '.XOOPS_DB_NAME; |
|
| 219 | 219 | $ret = $xoopsDB->queryF($sql); |
| 220 | 220 | while (list($m_table) = $xoopsDB->fetchRow($ret)) { |
| 221 | 221 | if ($m_table == $realname) { |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | $moduleName = smart_getCurrentModuleName(); |
| 245 | 245 | } |
| 246 | 246 | $xoopsDB = XoopsDatabaseFactory::getDatabaseConnection(); |
| 247 | - $sql = sprintf('SELECT metavalue FROM %s WHERE metakey=%s', $xoopsDB->prefix($moduleName . '_meta'), $xoopsDB->quoteString($key)); |
|
| 247 | + $sql = sprintf('SELECT metavalue FROM %s WHERE metakey=%s', $xoopsDB->prefix($moduleName.'_meta'), $xoopsDB->quoteString($key)); |
|
| 248 | 248 | $ret = $xoopsDB->query($sql); |
| 249 | 249 | if (!$ret) { |
| 250 | 250 | $value = false; |
@@ -287,9 +287,9 @@ discard block |
||
| 287 | 287 | $xoopsDB = XoopsDatabaseFactory::getDatabaseConnection(); |
| 288 | 288 | $ret = smart_GetMeta($key, $moduleName); |
| 289 | 289 | if ('0' === $ret || $ret > 0) { |
| 290 | - $sql = sprintf('UPDATE %s SET metavalue = %s WHERE metakey = %s', $xoopsDB->prefix($moduleName . '_meta'), $xoopsDB->quoteString($value), $xoopsDB->quoteString($key)); |
|
| 290 | + $sql = sprintf('UPDATE %s SET metavalue = %s WHERE metakey = %s', $xoopsDB->prefix($moduleName.'_meta'), $xoopsDB->quoteString($value), $xoopsDB->quoteString($key)); |
|
| 291 | 291 | } else { |
| 292 | - $sql = sprintf('INSERT INTO %s (metakey, metavalue) VALUES (%s, %s)', $xoopsDB->prefix($moduleName . '_meta'), $xoopsDB->quoteString($key), $xoopsDB->quoteString($value)); |
|
| 292 | + $sql = sprintf('INSERT INTO %s (metakey, metavalue) VALUES (%s, %s)', $xoopsDB->prefix($moduleName.'_meta'), $xoopsDB->quoteString($key), $xoopsDB->quoteString($value)); |
|
| 293 | 293 | } |
| 294 | 294 | $ret = $xoopsDB->queryF($sql); |
| 295 | 295 | if (!$ret) { |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | { |
| 470 | 470 | static $smartModules; |
| 471 | 471 | if (isset($smartModules[$moduleName])) { |
| 472 | - $ret =& $smartModules[$moduleName]; |
|
| 472 | + $ret = & $smartModules[$moduleName]; |
|
| 473 | 473 | |
| 474 | 474 | return $ret; |
| 475 | 475 | } |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | { |
| 506 | 506 | static $smartConfigs; |
| 507 | 507 | if (isset($smartConfigs[$moduleName])) { |
| 508 | - $ret =& $smartConfigs[$moduleName]; |
|
| 508 | + $ret = & $smartConfigs[$moduleName]; |
|
| 509 | 509 | |
| 510 | 510 | return $ret; |
| 511 | 511 | } |
@@ -533,7 +533,7 @@ discard block |
||
| 533 | 533 | return $ret; |
| 534 | 534 | } |
| 535 | 535 | $hModConfig = xoops_getHandler('config'); |
| 536 | - $smartConfigs[$moduleName] =& $hModConfig->getConfigsByCat(0, $module->getVar('mid')); |
|
| 536 | + $smartConfigs[$moduleName] = & $hModConfig->getConfigsByCat(0, $module->getVar('mid')); |
|
| 537 | 537 | } |
| 538 | 538 | |
| 539 | 539 | return $smartConfigs[$moduleName]; |
@@ -559,7 +559,7 @@ discard block |
||
| 559 | 559 | { |
| 560 | 560 | $ret = ''; |
| 561 | 561 | foreach ($errors as $key => $value) { |
| 562 | - $ret .= '<br> - ' . $value; |
|
| 562 | + $ret .= '<br> - '.$value; |
|
| 563 | 563 | } |
| 564 | 564 | |
| 565 | 565 | return $ret; |
@@ -579,17 +579,17 @@ discard block |
||
| 579 | 579 | if (!is_numeric($userid)) { |
| 580 | 580 | return $userid; |
| 581 | 581 | } |
| 582 | - $userid = (int)$userid; |
|
| 582 | + $userid = (int) $userid; |
|
| 583 | 583 | if ($userid > 0) { |
| 584 | 584 | if ($users == []) { |
| 585 | 585 | //fetching users |
| 586 | 586 | $memberHandler = xoops_getHandler('member'); |
| 587 | - $user =& $memberHandler->getUser($userid); |
|
| 587 | + $user = & $memberHandler->getUser($userid); |
|
| 588 | 588 | } else { |
| 589 | 589 | if (!isset($users[$userid])) { |
| 590 | 590 | return $GLOBALS['xoopsConfig']['anonymous']; |
| 591 | 591 | } |
| 592 | - $user =& $users[$userid]; |
|
| 592 | + $user = & $users[$userid]; |
|
| 593 | 593 | } |
| 594 | 594 | if (is_object($user)) { |
| 595 | 595 | $ts = MyTextSanitizer:: getInstance(); |
@@ -600,15 +600,15 @@ discard block |
||
| 600 | 600 | $fullname = $user->getVar('name'); |
| 601 | 601 | } |
| 602 | 602 | if (!empty($fullname)) { |
| 603 | - $linkeduser = "$fullname [<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . $ts->htmlSpecialChars($username) . '</a>]'; |
|
| 603 | + $linkeduser = "$fullname [<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".$ts->htmlSpecialChars($username).'</a>]'; |
|
| 604 | 604 | } else { |
| 605 | - $linkeduser = "<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . ucwords($ts->htmlSpecialChars($username)) . '</a>'; |
|
| 605 | + $linkeduser = "<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".ucwords($ts->htmlSpecialChars($username)).'</a>'; |
|
| 606 | 606 | } |
| 607 | 607 | // add contact info: email + PM |
| 608 | 608 | if ($withContact) { |
| 609 | - $linkeduser .= ' <a href="mailto:' . $user->getVar('email') . '"><img style="vertical-align: middle;" src="' . XOOPS_URL . '/images/icons/email.gif' . '" alt="' . _CO_SOBJECT_SEND_EMAIL . '" title="' . _CO_SOBJECT_SEND_EMAIL . '"></a>'; |
|
| 610 | - $js = "javascript:openWithSelfMain('" . XOOPS_URL . '/pmlite.php?send2=1&to_userid=' . $userid . "', 'pmlite',450,370);"; |
|
| 611 | - $linkeduser .= ' <a href="' . $js . '"><img style="vertical-align: middle;" src="' . XOOPS_URL . '/images/icons/pm.gif' . '" alt="' . _CO_SOBJECT_SEND_PM . '" title="' . _CO_SOBJECT_SEND_PM . '"></a>'; |
|
| 609 | + $linkeduser .= ' <a href="mailto:'.$user->getVar('email').'"><img style="vertical-align: middle;" src="'.XOOPS_URL.'/images/icons/email.gif'.'" alt="'._CO_SOBJECT_SEND_EMAIL.'" title="'._CO_SOBJECT_SEND_EMAIL.'"></a>'; |
|
| 610 | + $js = "javascript:openWithSelfMain('".XOOPS_URL.'/pmlite.php?send2=1&to_userid='.$userid."', 'pmlite',450,370);"; |
|
| 611 | + $linkeduser .= ' <a href="'.$js.'"><img style="vertical-align: middle;" src="'.XOOPS_URL.'/images/icons/pm.gif'.'" alt="'._CO_SOBJECT_SEND_PM.'" title="'._CO_SOBJECT_SEND_PM.'"></a>'; |
|
| 612 | 612 | } |
| 613 | 613 | |
| 614 | 614 | return $linkeduser; |
@@ -627,20 +627,20 @@ discard block |
||
| 627 | 627 | function smart_adminMenu($currentoption = 0, $breadcrumb = '', $submenus = false, $currentsub = -1) |
| 628 | 628 | { |
| 629 | 629 | global $xoopsModule, $xoopsConfig; |
| 630 | - require_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
| 631 | - if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/modinfo.php')) { |
|
| 632 | - require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/modinfo.php'; |
|
| 630 | + require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
| 631 | + if (file_exists(XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/'.$xoopsConfig['language'].'/modinfo.php')) { |
|
| 632 | + require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/'.$xoopsConfig['language'].'/modinfo.php'; |
|
| 633 | 633 | } else { |
| 634 | - require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/english/modinfo.php'; |
|
| 634 | + require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/english/modinfo.php'; |
|
| 635 | 635 | } |
| 636 | - if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/admin.php')) { |
|
| 637 | - require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/admin.php'; |
|
| 636 | + if (file_exists(XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/'.$xoopsConfig['language'].'/admin.php')) { |
|
| 637 | + require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/'.$xoopsConfig['language'].'/admin.php'; |
|
| 638 | 638 | } else { |
| 639 | - require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/english/admin.php'; |
|
| 639 | + require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/english/admin.php'; |
|
| 640 | 640 | } |
| 641 | 641 | $headermenu = []; |
| 642 | 642 | $adminObject = []; |
| 643 | - include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/menu.php'; |
|
| 643 | + include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/admin/menu.php'; |
|
| 644 | 644 | $tpl = new XoopsTpl(); |
| 645 | 645 | $tpl->assign([ |
| 646 | 646 | 'headermenu' => $headermenu, |
@@ -663,11 +663,11 @@ discard block |
||
| 663 | 663 | function smart_collapsableBar($id = '', $title = '', $dsc = '') |
| 664 | 664 | { |
| 665 | 665 | global $xoopsModule; |
| 666 | - echo "<h3 style=\"color: #2F5376; font-weight: bold; font-size: 14px; margin: 6px 0 0 0; \"><a href='javascript:;' onclick=\"togglecollapse('" . $id . "'); toggleIcon('" . $id . "_icon')\";>"; |
|
| 667 | - echo "<img id='" . $id . "_icon' src=" . SMARTOBJECT_URL . "assets/images/close12.gif alt=''></a> " . $title . '</h3>'; |
|
| 668 | - echo "<div id='" . $id . "'>"; |
|
| 666 | + echo "<h3 style=\"color: #2F5376; font-weight: bold; font-size: 14px; margin: 6px 0 0 0; \"><a href='javascript:;' onclick=\"togglecollapse('".$id."'); toggleIcon('".$id."_icon')\";>"; |
|
| 667 | + echo "<img id='".$id."_icon' src=".SMARTOBJECT_URL."assets/images/close12.gif alt=''></a> ".$title.'</h3>'; |
|
| 668 | + echo "<div id='".$id."'>"; |
|
| 669 | 669 | if ('' !== $dsc) { |
| 670 | - echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . $dsc . '</span>'; |
|
| 670 | + echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">".$dsc.'</span>'; |
|
| 671 | 671 | } |
| 672 | 672 | } |
| 673 | 673 | |
@@ -681,11 +681,11 @@ discard block |
||
| 681 | 681 | global $xoopsModule; |
| 682 | 682 | $onClick = "ajaxtogglecollapse('$id')"; |
| 683 | 683 | //$onClick = "togglecollapse('$id'); toggleIcon('" . $id . "_icon')"; |
| 684 | - echo '<h3 style="border: 1px solid; color: #2F5376; font-weight: bold; font-size: 14px; margin: 6px 0 0 0; " onclick="' . $onClick . '">'; |
|
| 685 | - echo "<img id='" . $id . "_icon' src=" . SMARTOBJECT_URL . "assets/images/close12.gif alt=''></a> " . $title . '</h3>'; |
|
| 686 | - echo "<div id='" . $id . "'>"; |
|
| 684 | + echo '<h3 style="border: 1px solid; color: #2F5376; font-weight: bold; font-size: 14px; margin: 6px 0 0 0; " onclick="'.$onClick.'">'; |
|
| 685 | + echo "<img id='".$id."_icon' src=".SMARTOBJECT_URL."assets/images/close12.gif alt=''></a> ".$title.'</h3>'; |
|
| 686 | + echo "<div id='".$id."'>"; |
|
| 687 | 687 | if ('' !== $dsc) { |
| 688 | - echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . $dsc . '</span>'; |
|
| 688 | + echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">".$dsc.'</span>'; |
|
| 689 | 689 | } |
| 690 | 690 | } |
| 691 | 691 | |
@@ -715,13 +715,13 @@ discard block |
||
| 715 | 715 | { |
| 716 | 716 | $urls = smart_getCurrentUrls(); |
| 717 | 717 | $path = $urls['phpself']; |
| 718 | - $cookie_name = $path . '_smart_collaps_' . $name; |
|
| 718 | + $cookie_name = $path.'_smart_collaps_'.$name; |
|
| 719 | 719 | $cookie_name = str_replace('.', '_', $cookie_name); |
| 720 | 720 | $cookie = smart_getCookieVar($cookie_name, ''); |
| 721 | 721 | if ('none' === $cookie) { |
| 722 | 722 | echo ' |
| 723 | 723 | <script type="text/javascript"><!-- |
| 724 | - togglecollapse("' . $name . '"); toggleIcon("' . $name . '_icon"); |
|
| 724 | + togglecollapse("' . $name.'"); toggleIcon("'.$name.'_icon"); |
|
| 725 | 725 | //--> |
| 726 | 726 | </script> |
| 727 | 727 | '; |
@@ -787,17 +787,17 @@ discard block |
||
| 787 | 787 | $httphost = $_SERVER['HTTP_HOST']; |
| 788 | 788 | $querystring = $_SERVER['QUERY_STRING']; |
| 789 | 789 | if ('' !== $querystring) { |
| 790 | - $querystring = '?' . $querystring; |
|
| 790 | + $querystring = '?'.$querystring; |
|
| 791 | 791 | } |
| 792 | - $currenturl = $http . $httphost . $phpself . $querystring; |
|
| 792 | + $currenturl = $http.$httphost.$phpself.$querystring; |
|
| 793 | 793 | $urls = []; |
| 794 | 794 | $urls['http'] = $http; |
| 795 | 795 | $urls['httphost'] = $httphost; |
| 796 | 796 | $urls['phpself'] = $phpself; |
| 797 | 797 | $urls['querystring'] = $querystring; |
| 798 | - $urls['full_phpself'] = $http . $httphost . $phpself; |
|
| 798 | + $urls['full_phpself'] = $http.$httphost.$phpself; |
|
| 799 | 799 | $urls['full'] = $currenturl; |
| 800 | - $urls['isHomePage'] = (XOOPS_URL . '/index.php') == ($http . $httphost . $phpself); |
|
| 800 | + $urls['isHomePage'] = (XOOPS_URL.'/index.php') == ($http.$httphost.$phpself); |
|
| 801 | 801 | |
| 802 | 802 | return $urls; |
| 803 | 803 | } |
@@ -874,13 +874,13 @@ discard block |
||
| 874 | 874 | { |
| 875 | 875 | global $xoopsConfig, $xoopsModule, $xoopsModuleConfig; |
| 876 | 876 | |
| 877 | - require_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
| 877 | + require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
| 878 | 878 | $tpl = new XoopsTpl(); |
| 879 | 879 | |
| 880 | 880 | $hModule = xoops_getHandler('module'); |
| 881 | - $versioninfo =& $hModule->get($xoopsModule->getVar('mid')); |
|
| 882 | - $modfootertxt = 'Module ' . $versioninfo->getInfo('name') . ' - Version ' . $versioninfo->getInfo('version') . ''; |
|
| 883 | - $modfooter = "<a href='" . $versioninfo->getInfo('support_site_url') . "' target='_blank'><img src='" . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/assets/images/cssbutton.gif' title='" . $modfootertxt . "' alt='" . $modfootertxt . "'></a>"; |
|
| 881 | + $versioninfo = & $hModule->get($xoopsModule->getVar('mid')); |
|
| 882 | + $modfootertxt = 'Module '.$versioninfo->getInfo('name').' - Version '.$versioninfo->getInfo('version').''; |
|
| 883 | + $modfooter = "<a href='".$versioninfo->getInfo('support_site_url')."' target='_blank'><img src='".XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/assets/images/cssbutton.gif' title='".$modfootertxt."' alt='".$modfootertxt."'></a>"; |
|
| 884 | 884 | $tpl->assign('modfooter', $modfooter); |
| 885 | 885 | |
| 886 | 886 | if (!defined('_AM_SOBJECT_XOOPS_PRO')) { |
@@ -888,7 +888,7 @@ discard block |
||
| 888 | 888 | } |
| 889 | 889 | $smartobjectConfig = smart_getModuleConfig('smartobject'); |
| 890 | 890 | $tpl->assign('smartobject_enable_admin_footer', $smartobjectConfig['enable_admin_footer']); |
| 891 | - $tpl->display(SMARTOBJECT_ROOT_PATH . 'templates/smartobject_admin_footer.tpl'); |
|
| 891 | + $tpl->display(SMARTOBJECT_ROOT_PATH.'templates/smartobject_admin_footer.tpl'); |
|
| 892 | 892 | } |
| 893 | 893 | |
| 894 | 894 | function smart_xoops_cp_footer() |
@@ -915,7 +915,7 @@ discard block |
||
| 915 | 915 | */ |
| 916 | 916 | function smart_addScript($src) |
| 917 | 917 | { |
| 918 | - echo '<script src="' . $src . '" type="text/javascript"></script>'; |
|
| 918 | + echo '<script src="'.$src.'" type="text/javascript"></script>'; |
|
| 919 | 919 | } |
| 920 | 920 | |
| 921 | 921 | /** |
@@ -924,16 +924,16 @@ discard block |
||
| 924 | 924 | function smart_addStyle($src) |
| 925 | 925 | { |
| 926 | 926 | if ('smartobject' === $src) { |
| 927 | - $src = SMARTOBJECT_URL . 'assets/css/module.css'; |
|
| 927 | + $src = SMARTOBJECT_URL.'assets/css/module.css'; |
|
| 928 | 928 | } |
| 929 | 929 | echo smart_get_css_link($src); |
| 930 | 930 | } |
| 931 | 931 | |
| 932 | 932 | function smart_addAdminAjaxSupport() |
| 933 | 933 | { |
| 934 | - smart_addScript(SMARTOBJECT_URL . 'include/scriptaculous/lib/prototype.js'); |
|
| 935 | - smart_addScript(SMARTOBJECT_URL . 'include/scriptaculous/src/scriptaculous.js'); |
|
| 936 | - smart_addScript(SMARTOBJECT_URL . 'include/scriptaculous/src/smart.js'); |
|
| 934 | + smart_addScript(SMARTOBJECT_URL.'include/scriptaculous/lib/prototype.js'); |
|
| 935 | + smart_addScript(SMARTOBJECT_URL.'include/scriptaculous/src/scriptaculous.js'); |
|
| 936 | + smart_addScript(SMARTOBJECT_URL.'include/scriptaculous/src/smart.js'); |
|
| 937 | 937 | } |
| 938 | 938 | |
| 939 | 939 | /** |
@@ -993,8 +993,8 @@ discard block |
||
| 993 | 993 | function smart_htmlnumericentities($str) |
| 994 | 994 | { |
| 995 | 995 | // return preg_replace('/[^!-%\x27-;=?-~ ]/e', '"&#".ord("$0").chr(59)', $str); |
| 996 | - return preg_replace_callback('/[^!-%\x27-;=?-~ ]/', function ($m) { |
|
| 997 | - return '&#' . ord($m[0]) . chr(59); |
|
| 996 | + return preg_replace_callback('/[^!-%\x27-;=?-~ ]/', function($m) { |
|
| 997 | + return '&#'.ord($m[0]).chr(59); |
|
| 998 | 998 | }, $str); |
| 999 | 999 | } |
| 1000 | 1000 | |
@@ -1008,16 +1008,16 @@ discard block |
||
| 1008 | 1008 | static $handlers; |
| 1009 | 1009 | $name = strtolower(trim($name)); |
| 1010 | 1010 | if (!isset($handlers[$name])) { |
| 1011 | - if (file_exists($hnd_file = XOOPS_ROOT_PATH . '/kernel/' . $name . '.php')) { |
|
| 1011 | + if (file_exists($hnd_file = XOOPS_ROOT_PATH.'/kernel/'.$name.'.php')) { |
|
| 1012 | 1012 | require_once $hnd_file; |
| 1013 | 1013 | } |
| 1014 | - $class = 'Xoops' . ucfirst($name) . 'Handler'; |
|
| 1014 | + $class = 'Xoops'.ucfirst($name).'Handler'; |
|
| 1015 | 1015 | if (class_exists($class)) { |
| 1016 | 1016 | $handlers[$name] = new $class($GLOBALS['xoopsDB'], 'xoops'); |
| 1017 | 1017 | } |
| 1018 | 1018 | } |
| 1019 | 1019 | if (!isset($handlers[$name]) && !$optional) { |
| 1020 | - trigger_error('Class <b>' . $class . '</b> does not exist<br>Handler Name: ' . $name, E_USER_ERROR); |
|
| 1020 | + trigger_error('Class <b>'.$class.'</b> does not exist<br>Handler Name: '.$name, E_USER_ERROR); |
|
| 1021 | 1021 | } |
| 1022 | 1022 | if (isset($handlers[$name])) { |
| 1023 | 1023 | return $handlers[$name]; |
@@ -1097,9 +1097,9 @@ discard block |
||
| 1097 | 1097 | { |
| 1098 | 1098 | global $xoopsConfig; |
| 1099 | 1099 | |
| 1100 | - $filename = XOOPS_ROOT_PATH . '/modules/' . $module . '/language/' . $xoopsConfig['language'] . '/' . $file . '.php'; |
|
| 1100 | + $filename = XOOPS_ROOT_PATH.'/modules/'.$module.'/language/'.$xoopsConfig['language'].'/'.$file.'.php'; |
|
| 1101 | 1101 | if (!file_exists($filename)) { |
| 1102 | - $filename = XOOPS_ROOT_PATH . '/modules/' . $module . '/language/english/' . $file . '.php'; |
|
| 1102 | + $filename = XOOPS_ROOT_PATH.'/modules/'.$module.'/language/english/'.$file.'.php'; |
|
| 1103 | 1103 | } |
| 1104 | 1104 | if (file_exists($filename)) { |
| 1105 | 1105 | require_once $filename; |
@@ -1195,7 +1195,7 @@ discard block |
||
| 1195 | 1195 | |
| 1196 | 1196 | $text = preg_replace($search, $replace, $document); |
| 1197 | 1197 | |
| 1198 | - preg_replace_callback('/&#(\d+);/', function ($matches) { |
|
| 1198 | + preg_replace_callback('/&#(\d+);/', function($matches) { |
|
| 1199 | 1199 | return chr($matches[1]); |
| 1200 | 1200 | }, $document); |
| 1201 | 1201 | |
@@ -1218,21 +1218,21 @@ discard block |
||
| 1218 | 1218 | $str = $match[0]; |
| 1219 | 1219 | if (false !== strpos($str, ',')) { |
| 1220 | 1220 | // A comma exists, that makes it easy, cos we assume it separates the decimal part. |
| 1221 | - $str = str_replace('.', '', $str); // Erase thousand seps |
|
| 1222 | - $str = str_replace(',', '.', $str); // Convert , to . for floatval command |
|
| 1221 | + $str = str_replace('.', '', $str); // Erase thousand seps |
|
| 1222 | + $str = str_replace(',', '.', $str); // Convert , to . for floatval command |
|
| 1223 | 1223 | |
| 1224 | - return (float)$str; |
|
| 1224 | + return (float) $str; |
|
| 1225 | 1225 | } else { |
| 1226 | 1226 | // No comma exists, so we have to decide, how a single dot shall be treated |
| 1227 | 1227 | if (true === preg_match("/^[0-9\-]*[\.]{1}[0-9-]+$/", $str) && true === $set['single_dot_as_decimal']) { |
| 1228 | 1228 | // Treat single dot as decimal separator |
| 1229 | - return (float)$str; |
|
| 1229 | + return (float) $str; |
|
| 1230 | 1230 | } else { |
| 1231 | 1231 | //echo "str: ".$str; echo "ret: ".str_replace('.', '', $str); echo "<br><br> "; |
| 1232 | 1232 | // Else, treat all dots as thousand seps |
| 1233 | - $str = str_replace('.', '', $str); // Erase thousand seps |
|
| 1233 | + $str = str_replace('.', '', $str); // Erase thousand seps |
|
| 1234 | 1234 | |
| 1235 | - return (float)$str; |
|
| 1235 | + return (float) $str; |
|
| 1236 | 1236 | } |
| 1237 | 1237 | } |
| 1238 | 1238 | } else { |
@@ -1264,7 +1264,7 @@ discard block |
||
| 1264 | 1264 | $ret .= '.00'; |
| 1265 | 1265 | } |
| 1266 | 1266 | if ($currencyObj) { |
| 1267 | - $ret = $ret . ' ' . $currencyObj->getCode(); |
|
| 1267 | + $ret = $ret.' '.$currencyObj->getCode(); |
|
| 1268 | 1268 | } |
| 1269 | 1269 | |
| 1270 | 1270 | return $ret; |
@@ -1291,7 +1291,7 @@ discard block |
||
| 1291 | 1291 | } |
| 1292 | 1292 | $ret = ''; |
| 1293 | 1293 | if ($moduleName) { |
| 1294 | - $ret = "<a href='" . XOOPS_URL . "/modules/$moduleName/admin/index.php'>" . _CO_SOBJECT_ADMIN_PAGE . '</a>'; |
|
| 1294 | + $ret = "<a href='".XOOPS_URL."/modules/$moduleName/admin/index.php'>"._CO_SOBJECT_ADMIN_PAGE.'</a>'; |
|
| 1295 | 1295 | } |
| 1296 | 1296 | |
| 1297 | 1297 | return $ret; |
@@ -1302,7 +1302,7 @@ discard block |
||
| 1302 | 1302 | */ |
| 1303 | 1303 | function smart_getEditors() |
| 1304 | 1304 | { |
| 1305 | - $filename = XOOPS_ROOT_PATH . '/class/xoopseditor/xoopseditor.php'; |
|
| 1305 | + $filename = XOOPS_ROOT_PATH.'/class/xoopseditor/xoopseditor.php'; |
|
| 1306 | 1306 | if (!file_exists($filename)) { |
| 1307 | 1307 | return false; |
| 1308 | 1308 | } |
@@ -1326,9 +1326,9 @@ discard block |
||
| 1326 | 1326 | { |
| 1327 | 1327 | $ret = []; |
| 1328 | 1328 | foreach ($items as $item) { |
| 1329 | - $ret[] = $moduleName . '_' . $item; |
|
| 1329 | + $ret[] = $moduleName.'_'.$item; |
|
| 1330 | 1330 | } |
| 1331 | - $ret[] = $moduleName . '_meta'; |
|
| 1331 | + $ret[] = $moduleName.'_meta'; |
|
| 1332 | 1332 | |
| 1333 | 1333 | return $ret; |
| 1334 | 1334 | } |
@@ -5,11 +5,11 @@ discard block |
||
| 5 | 5 | * D.J. |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | -include dirname(dirname(dirname(dirname(dirname(__DIR__))))) . '/mainfile.php'; |
|
| 8 | +include dirname(dirname(dirname(dirname(dirname(__DIR__))))).'/mainfile.php'; |
|
| 9 | 9 | error_reporting(0); |
| 10 | 10 | $xoopsLogger->activated = false; |
| 11 | 11 | |
| 12 | -if (empty($_SERVER['HTTP_REFERER']) || !preg_match('/^' . preg_quote(XOOPS_URL, '/') . '/', $_SERVER['HTTP_REFERER'])) { |
|
| 12 | +if (empty($_SERVER['HTTP_REFERER']) || !preg_match('/^'.preg_quote(XOOPS_URL, '/').'/', $_SERVER['HTTP_REFERER'])) { |
|
| 13 | 13 | exit(); |
| 14 | 14 | } |
| 15 | 15 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | if ('bmp' === $this->mode) { |
| 87 | 87 | $this->config['num_chars'] = 4; |
| 88 | - $this->code = mt_rand(pow(10, $this->config['num_chars'] - 1), (int)str_pad('9', $this->config['num_chars'], '9')); |
|
| 88 | + $this->code = mt_rand(pow(10, $this->config['num_chars'] - 1), (int) str_pad('9', $this->config['num_chars'], '9')); |
|
| 89 | 89 | } else { |
| 90 | 90 | $this->code = substr(md5(uniqid(mt_rand(), 1)), 0, $this->config['num_chars']); |
| 91 | 91 | if (!$this->config['casesensitive']) { |
@@ -100,13 +100,13 @@ discard block |
||
| 100 | 100 | return; |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - $_SESSION['XoopsCaptcha_sessioncode'] = (string)$this->code; |
|
| 104 | - $maxAttempts = (int)(@$_SESSION['XoopsCaptcha_maxattempts']); |
|
| 103 | + $_SESSION['XoopsCaptcha_sessioncode'] = (string) $this->code; |
|
| 104 | + $maxAttempts = (int) (@$_SESSION['XoopsCaptcha_maxattempts']); |
|
| 105 | 105 | |
| 106 | 106 | // Increase the attempt records on refresh |
| 107 | 107 | if (!empty($maxAttempts)) { |
| 108 | - $_SESSION['XoopsCaptcha_attempt_' . $_SESSION['XoopsCaptcha_name']]++; |
|
| 109 | - if ($_SESSION['XoopsCaptcha_attempt_' . $_SESSION['XoopsCaptcha_name']] > $maxAttempts) { |
|
| 108 | + $_SESSION['XoopsCaptcha_attempt_'.$_SESSION['XoopsCaptcha_name']]++; |
|
| 109 | + if ($_SESSION['XoopsCaptcha_attempt_'.$_SESSION['XoopsCaptcha_name']] > $maxAttempts) { |
|
| 110 | 110 | $this->invalid = true; |
| 111 | 111 | } |
| 112 | 112 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | { |
| 121 | 121 | if ($this->invalid) { |
| 122 | 122 | header('Content-type: image/gif'); |
| 123 | - readfile(XOOPS_ROOT_PATH . '/images/subject/icon2.gif'); |
|
| 123 | + readfile(XOOPS_ROOT_PATH.'/images/subject/icon2.gif'); |
|
| 124 | 124 | |
| 125 | 125 | return; |
| 126 | 126 | } |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | header('Content-type: image/jpeg'); |
| 191 | 191 | imagejpeg($this->oImage); |
| 192 | 192 | } else { |
| 193 | - imagejpeg($this->oImage, XOOPS_ROOT_PATH . '/' . $this->config['imagepath'] . '/' . $file . '.jpg'); |
|
| 193 | + imagejpeg($this->oImage, XOOPS_ROOT_PATH.'/'.$this->config['imagepath'].'/'.$file.'.jpg'); |
|
| 194 | 194 | } |
| 195 | 195 | imagedestroy($this->oImage); |
| 196 | 196 | } |
@@ -211,8 +211,8 @@ discard block |
||
| 211 | 211 | } |
| 212 | 212 | } |
| 213 | 213 | */ |
| 214 | - require_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; |
|
| 215 | - $file_path = $this->config['rootpath'] . "/{$name}"; |
|
| 214 | + require_once XOOPS_ROOT_PATH.'/class/xoopslists.php'; |
|
| 215 | + $file_path = $this->config['rootpath']."/{$name}"; |
|
| 216 | 216 | $files = XoopsLists::getFileListAsArray($file_path); |
| 217 | 217 | foreach ($files as $item) { |
| 218 | 218 | if (empty($extension) || preg_match("/(\.{$extension})$/i", $item)) { |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | public function loadFont() |
| 230 | 230 | { |
| 231 | 231 | $fonts = $this->_getList('fonts', 'ttf'); |
| 232 | - $this->font = $this->config['rootpath'] . '/fonts/' . $fonts[array_rand($fonts)]; |
|
| 232 | + $this->font = $this->config['rootpath'].'/fonts/'.$fonts[array_rand($fonts)]; |
|
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | public function setImageSize() |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | imagedestroy($oImage); |
| 256 | 256 | |
| 257 | 257 | $this->height = $MaxCharHeight + 2; |
| 258 | - $this->spacing = (int)(($this->config['num_chars'] * $MaxCharWidth) / $this->config['num_chars']); |
|
| 258 | + $this->spacing = (int) (($this->config['num_chars'] * $MaxCharWidth) / $this->config['num_chars']); |
|
| 259 | 259 | $this->width = ($this->config['num_chars'] * $MaxCharWidth) + ($this->spacing / 2); |
| 260 | 260 | } |
| 261 | 261 | |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | { |
| 269 | 269 | $RandBackground = null; |
| 270 | 270 | if ($backgrounds = $this->_getList('backgrounds', '(gif|jpg|png)')) { |
| 271 | - $RandBackground = $this->config['rootpath'] . '/backgrounds/' . $backgrounds[array_rand($backgrounds)]; |
|
| 271 | + $RandBackground = $this->config['rootpath'].'/backgrounds/'.$backgrounds[array_rand($backgrounds)]; |
|
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | return $RandBackground; |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | } |
| 439 | 439 | } |
| 440 | 440 | |
| 441 | -$config = @include __DIR__ . '/../config.php'; |
|
| 441 | +$config = @include __DIR__.'/../config.php'; |
|
| 442 | 442 | $imageHandler = new XoopsCaptchaImageHandler(); |
| 443 | 443 | $imageHandler->setConfig($config); |
| 444 | 444 | $imageHandler->loadImage(); |
@@ -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 | |
@@ -354,7 +354,7 @@ |
||
| 354 | 354 | public function createMetaKeywords() |
| 355 | 355 | { |
| 356 | 356 | global $xoopsModuleConfig; |
| 357 | - $keywords = $this->findMetaKeywords($this->_original_title . ' ' . $this->_description, $this->_minChar); |
|
| 357 | + $keywords = $this->findMetaKeywords($this->_original_title.' '.$this->_description, $this->_minChar); |
|
| 358 | 358 | if (isset($xoopsModuleConfig) && isset($xoopsModuleConfig['moduleMetaKeywords']) |
| 359 | 359 | && '' !== $xoopsModuleConfig['moduleMetaKeywords']) { |
| 360 | 360 | $moduleKeywords = explode(',', $xoopsModuleConfig['moduleMetaKeywords']); |
@@ -18,15 +18,15 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
| 20 | 20 | if (!defined('SMARTOBJECT_ROOT_PATH')) { |
| 21 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/include/common.php'; |
|
| 21 | + require_once XOOPS_ROOT_PATH.'/modules/smartobject/include/common.php'; |
|
| 22 | 22 | } |
| 23 | 23 | /** |
| 24 | 24 | * Include the language constants for the SmartObjectDBUpdater |
| 25 | 25 | */ |
| 26 | 26 | global $xoopsConfig; |
| 27 | -$common_file = SMARTOBJECT_ROOT_PATH . 'language/' . $xoopsConfig['language'] . '/smartdbupdater.php'; |
|
| 27 | +$common_file = SMARTOBJECT_ROOT_PATH.'language/'.$xoopsConfig['language'].'/smartdbupdater.php'; |
|
| 28 | 28 | if (!file_exists($common_file)) { |
| 29 | - $common_file = SMARTOBJECT_ROOT_PATH . 'language/english/smartdbupdater.php'; |
|
| 29 | + $common_file = SMARTOBJECT_ROOT_PATH.'language/english/smartdbupdater.php'; |
|
| 30 | 30 | } |
| 31 | 31 | include $common_file; |
| 32 | 32 | |
@@ -123,20 +123,20 @@ discard block |
||
| 123 | 123 | public function getExistingFieldsArray() |
| 124 | 124 | { |
| 125 | 125 | global $xoopsDB; |
| 126 | - $result = $xoopsDB->query('SHOW COLUMNS FROM ' . $this->name()); |
|
| 126 | + $result = $xoopsDB->query('SHOW COLUMNS FROM '.$this->name()); |
|
| 127 | 127 | while ($existing_field = $xoopsDB->fetchArray($result)) { |
| 128 | 128 | $fields[$existing_field['Field']] = $existing_field['Type']; |
| 129 | 129 | if ('YES' !== $existing_field['Null']) { |
| 130 | 130 | $fields[$existing_field['Field']] .= ' NOT NULL'; |
| 131 | 131 | } |
| 132 | 132 | if ($existing_field['Extra']) { |
| 133 | - $fields[$existing_field['Field']] .= ' ' . $existing_field['Extra']; |
|
| 133 | + $fields[$existing_field['Field']] .= ' '.$existing_field['Extra']; |
|
| 134 | 134 | } |
| 135 | 135 | if (!(null === $existing_field['Default']) |
| 136 | 136 | && ($existing_field['Default'] |
| 137 | 137 | || '' === $existing_field['Default'] |
| 138 | 138 | || 0 == $existing_field['Default'])) { |
| 139 | - $fields[$existing_field['Field']] .= " default '" . $existing_field['Default'] . "'"; |
|
| 139 | + $fields[$existing_field['Field']] .= " default '".$existing_field['Default']."'"; |
|
| 140 | 140 | } |
| 141 | 141 | } |
| 142 | 142 | |
@@ -222,9 +222,9 @@ discard block |
||
| 222 | 222 | $query = sprintf('INSERT INTO %s VALUES (%s)', $this->name(), $data); |
| 223 | 223 | $ret = $xoopsDB->query($query); |
| 224 | 224 | if (!$ret) { |
| 225 | - echo ' ' . sprintf(_SDU_MSG_ADD_DATA_ERR, $this->name()) . '<br>'; |
|
| 225 | + echo ' '.sprintf(_SDU_MSG_ADD_DATA_ERR, $this->name()).'<br>'; |
|
| 226 | 226 | } else { |
| 227 | - echo ' ' . sprintf(_SDU_MSG_ADD_DATA, $this->name()) . '<br>'; |
|
| 227 | + echo ' '.sprintf(_SDU_MSG_ADD_DATA, $this->name()).'<br>'; |
|
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | 230 | |
@@ -376,13 +376,13 @@ discard block |
||
| 376 | 376 | { |
| 377 | 377 | global $xoopsDB; |
| 378 | 378 | $query = $this->getStructure(); |
| 379 | - $query = 'CREATE TABLE `' . $this->name() . '` (' . $query . ") ENGINE=MyISAM COMMENT='The SmartFactory <www.smartfactory.ca>'"; |
|
| 379 | + $query = 'CREATE TABLE `'.$this->name().'` ('.$query.") ENGINE=MyISAM COMMENT='The SmartFactory <www.smartfactory.ca>'"; |
|
| 380 | 380 | //xoops_debug($query); |
| 381 | 381 | $ret = $xoopsDB->query($query); |
| 382 | 382 | if (!$ret) { |
| 383 | - echo ' ' . sprintf(_SDU_MSG_CREATE_TABLE_ERR, $this->name()) . ' (' . $xoopsDB->error() . ')<br>'; |
|
| 383 | + echo ' '.sprintf(_SDU_MSG_CREATE_TABLE_ERR, $this->name()).' ('.$xoopsDB->error().')<br>'; |
|
| 384 | 384 | } else { |
| 385 | - echo ' ' . sprintf(_SDU_MSG_CREATE_TABLE, $this->name()) . '<br>'; |
|
| 385 | + echo ' '.sprintf(_SDU_MSG_CREATE_TABLE, $this->name()).'<br>'; |
|
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | return $ret; |
@@ -400,11 +400,11 @@ discard block |
||
| 400 | 400 | $query = sprintf('DROP TABLE %s', $this->name()); |
| 401 | 401 | $ret = $xoopsDB->query($query); |
| 402 | 402 | if (!$ret) { |
| 403 | - echo ' ' . sprintf(_SDU_MSG_DROP_TABLE_ERR, $this->name()) . ' (' . $xoopsDB->error() . ')<br>'; |
|
| 403 | + echo ' '.sprintf(_SDU_MSG_DROP_TABLE_ERR, $this->name()).' ('.$xoopsDB->error().')<br>'; |
|
| 404 | 404 | |
| 405 | 405 | return false; |
| 406 | 406 | } else { |
| 407 | - echo ' ' . sprintf(_SDU_MSG_DROP_TABLE, $this->name()) . '<br>'; |
|
| 407 | + echo ' '.sprintf(_SDU_MSG_DROP_TABLE, $this->name()).'<br>'; |
|
| 408 | 408 | |
| 409 | 409 | return true; |
| 410 | 410 | } |
@@ -430,9 +430,9 @@ discard block |
||
| 430 | 430 | $ret = $ret && $xoopsDB->query($query); |
| 431 | 431 | if ($alteredField['showerror']) { |
| 432 | 432 | if (!$ret) { |
| 433 | - echo ' ' . sprintf(_SDU_MSG_CHGFIELD_ERR, $alteredField['name'], $this->name()) . ' (' . $xoopsDB->error() . ')<br>'; |
|
| 433 | + echo ' '.sprintf(_SDU_MSG_CHGFIELD_ERR, $alteredField['name'], $this->name()).' ('.$xoopsDB->error().')<br>'; |
|
| 434 | 434 | } else { |
| 435 | - echo ' ' . sprintf(_SDU_MSG_CHGFIELD, $alteredField['name'], $this->name()) . '<br>'; |
|
| 435 | + echo ' '.sprintf(_SDU_MSG_CHGFIELD, $alteredField['name'], $this->name()).'<br>'; |
|
| 436 | 436 | } |
| 437 | 437 | } |
| 438 | 438 | } |
@@ -455,9 +455,9 @@ discard block |
||
| 455 | 455 | //echo $query; |
| 456 | 456 | $ret = $ret && $xoopsDB->query($query); |
| 457 | 457 | if (!$ret) { |
| 458 | - echo ' ' . sprintf(_SDU_MSG_NEWFIELD_ERR, $newField['name'], $this->name()) . '<br>'; |
|
| 458 | + echo ' '.sprintf(_SDU_MSG_NEWFIELD_ERR, $newField['name'], $this->name()).'<br>'; |
|
| 459 | 459 | } else { |
| 460 | - echo ' ' . sprintf(_SDU_MSG_NEWFIELD, $newField['name'], $this->name()) . '<br>'; |
|
| 460 | + echo ' '.sprintf(_SDU_MSG_NEWFIELD, $newField['name'], $this->name()).'<br>'; |
|
| 461 | 461 | } |
| 462 | 462 | } |
| 463 | 463 | |
@@ -478,9 +478,9 @@ discard block |
||
| 478 | 478 | $query = sprintf('UPDATE %s SET %s = %s', $this->name(), $updatedField['name'], $updatedField['value']); |
| 479 | 479 | $ret = $ret && $xoopsDB->query($query); |
| 480 | 480 | if (!$ret) { |
| 481 | - echo ' ' . sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()) . ' (' . $xoopsDB->error() . ')<br>'; |
|
| 481 | + echo ' '.sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()).' ('.$xoopsDB->error().')<br>'; |
|
| 482 | 482 | } else { |
| 483 | - echo ' ' . sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()) . '<br>'; |
|
| 483 | + echo ' '.sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()).'<br>'; |
|
| 484 | 484 | } |
| 485 | 485 | } |
| 486 | 486 | |
@@ -501,9 +501,9 @@ discard block |
||
| 501 | 501 | //echo $query."<br>"; |
| 502 | 502 | $ret = $ret && $xoopsDB->query($query); |
| 503 | 503 | if (!$ret) { |
| 504 | - echo ' ' . sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()) . ' (' . $xoopsDB->error() . ')<br>'; |
|
| 504 | + echo ' '.sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()).' ('.$xoopsDB->error().')<br>'; |
|
| 505 | 505 | } else { |
| 506 | - echo ' ' . sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()) . '<br>'; |
|
| 506 | + echo ' '.sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()).'<br>'; |
|
| 507 | 507 | } |
| 508 | 508 | } |
| 509 | 509 | |
@@ -524,9 +524,9 @@ discard block |
||
| 524 | 524 | $query = sprintf('ALTER TABLE %s DROP %s', $this->name(), $droppedField); |
| 525 | 525 | $ret = $ret && $xoopsDB->query($query); |
| 526 | 526 | if (!$ret) { |
| 527 | - echo ' ' . sprintf(_SDU_MSG_DROPFIELD_ERR, $droppedField, $this->name()) . ' (' . $xoopsDB->error() . ')<br>'; |
|
| 527 | + echo ' '.sprintf(_SDU_MSG_DROPFIELD_ERR, $droppedField, $this->name()).' ('.$xoopsDB->error().')<br>'; |
|
| 528 | 528 | } else { |
| 529 | - echo ' ' . sprintf(_SDU_MSG_DROPFIELD, $droppedField, $this->name()) . '<br>'; |
|
| 529 | + echo ' '.sprintf(_SDU_MSG_DROPFIELD, $droppedField, $this->name()).'<br>'; |
|
| 530 | 530 | } |
| 531 | 531 | } |
| 532 | 532 | |
@@ -613,11 +613,11 @@ discard block |
||
| 613 | 613 | $query = sprintf('ALTER TABLE %s RENAME %s', $from, $to); |
| 614 | 614 | $ret = $xoopsDB->query($query); |
| 615 | 615 | if (!$ret) { |
| 616 | - echo ' ' . sprintf(_SDU_MSG_RENAME_TABLE_ERR, $from) . '<br>'; |
|
| 616 | + echo ' '.sprintf(_SDU_MSG_RENAME_TABLE_ERR, $from).'<br>'; |
|
| 617 | 617 | |
| 618 | 618 | return false; |
| 619 | 619 | } else { |
| 620 | - echo ' ' . sprintf(_SDU_MSG_RENAME_TABLE, $from, $to) . '<br>'; |
|
| 620 | + echo ' '.sprintf(_SDU_MSG_RENAME_TABLE, $from, $to).'<br>'; |
|
| 621 | 621 | |
| 622 | 622 | return true; |
| 623 | 623 | } |
@@ -737,7 +737,7 @@ discard block |
||
| 737 | 737 | return false; |
| 738 | 738 | } |
| 739 | 739 | |
| 740 | - $table = new SmartDbTable($module . '_' . $item); |
|
| 740 | + $table = new SmartDbTable($module.'_'.$item); |
|
| 741 | 741 | $object = $moduleHandler->create(); |
| 742 | 742 | $objectVars = $object->getVars(); |
| 743 | 743 | |
@@ -758,7 +758,7 @@ discard block |
||
| 758 | 758 | "; |
| 759 | 759 | } |
| 760 | 760 | } |
| 761 | - $structure .= 'PRIMARY KEY (`' . $moduleHandler->keyName . '`) |
|
| 761 | + $structure .= 'PRIMARY KEY (`'.$moduleHandler->keyName.'`) |
|
| 762 | 762 | '; |
| 763 | 763 | $table->setStructure($structure); |
| 764 | 764 | if (!$this->updateTable($table)) { |
@@ -818,7 +818,7 @@ discard block |
||
| 818 | 818 | |
| 819 | 819 | ob_start(); |
| 820 | 820 | |
| 821 | - $table = new SmartDbTable($dirname . '_meta'); |
|
| 821 | + $table = new SmartDbTable($dirname.'_meta'); |
|
| 822 | 822 | if (!$table->exists()) { |
| 823 | 823 | $table->setStructure(" |
| 824 | 824 | `metakey` varchar(50) NOT NULL default '', |
@@ -836,20 +836,20 @@ discard block |
||
| 836 | 836 | if (!$dbVersion) { |
| 837 | 837 | $dbVersion = 0; |
| 838 | 838 | } |
| 839 | - $newDbVersion = constant(strtoupper($dirname . '_db_version')) ?: 0; |
|
| 840 | - echo 'Database version: ' . $dbVersion . '<br>'; |
|
| 841 | - echo 'New database version: ' . $newDbVersion . '<br>'; |
|
| 839 | + $newDbVersion = constant(strtoupper($dirname.'_db_version')) ?: 0; |
|
| 840 | + echo 'Database version: '.$dbVersion.'<br>'; |
|
| 841 | + echo 'New database version: '.$newDbVersion.'<br>'; |
|
| 842 | 842 | |
| 843 | 843 | if ($newDbVersion > $dbVersion) { |
| 844 | 844 | for ($i = $dbVersion + 1; $i <= $newDbVersion; ++$i) { |
| 845 | - $upgrade_function = $dirname . '_db_upgrade_' . $i; |
|
| 845 | + $upgrade_function = $dirname.'_db_upgrade_'.$i; |
|
| 846 | 846 | if (function_exists($upgrade_function)) { |
| 847 | 847 | $upgrade_function(); |
| 848 | 848 | } |
| 849 | 849 | } |
| 850 | 850 | } |
| 851 | 851 | |
| 852 | - echo '<code>' . _SDU_UPDATE_UPDATING_DATABASE . '<br>'; |
|
| 852 | + echo '<code>'._SDU_UPDATE_UPDATING_DATABASE.'<br>'; |
|
| 853 | 853 | |
| 854 | 854 | // if there is a function to execute for this DB version, let's do it |
| 855 | 855 | //$function_ |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | if (!mkdir($folder) && !is_dir($folder)) { |
| 30 | 30 | throw new \RuntimeException(sprintf('Unable to create the %s directory', $folder)); |
| 31 | 31 | } else { |
| 32 | - file_put_contents($folder . '/index.html', '<script>history.go(-1);</script>'); |
|
| 32 | + file_put_contents($folder.'/index.html', '<script>history.go(-1);</script>'); |
|
| 33 | 33 | } |
| 34 | 34 | } |
| 35 | 35 | } catch (Exception $e) { |
@@ -67,10 +67,10 @@ discard block |
||
| 67 | 67 | // @mkdir($dst); |
| 68 | 68 | while (false !== ($file = readdir($dir))) { |
| 69 | 69 | if (('.' !== $file) && ('..' !== $file)) { |
| 70 | - if (is_dir($src . '/' . $file)) { |
|
| 71 | - self::recurseCopy($src . '/' . $file, $dst . '/' . $file); |
|
| 70 | + if (is_dir($src.'/'.$file)) { |
|
| 71 | + self::recurseCopy($src.'/'.$file, $dst.'/'.$file); |
|
| 72 | 72 | } else { |
| 73 | - copy($src . '/' . $file, $dst . '/' . $file); |
|
| 73 | + copy($src.'/'.$file, $dst.'/'.$file); |
|
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $currentVer = substr(XOOPS_VERSION, 6); // get the numeric part of string |
| 98 | 98 | $currArray = explode('.', $currentVer); |
| 99 | 99 | if (null === $requiredVer) { |
| 100 | - $requiredVer = '' . $module->getInfo('min_xoops'); //making sure it's a string |
|
| 100 | + $requiredVer = ''.$module->getInfo('min_xoops'); //making sure it's a string |
|
| 101 | 101 | } |
| 102 | 102 | $reqArray = explode('.', $requiredVer); |
| 103 | 103 | $success = true; |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | break; |
| 113 | 113 | } |
| 114 | 114 | } else { |
| 115 | - if ((int)$v > 0) { // handles versions like x.x.x.0_RC2 |
|
| 115 | + if ((int) $v > 0) { // handles versions like x.x.x.0_RC2 |
|
| 116 | 116 | $success = false; |
| 117 | 117 | break; |
| 118 | 118 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $ret = false; |
| 51 | 51 | foreach ($this->_infoArray['items'] as $k => $v) { |
| 52 | 52 | $search_str = str_replace('%u', '', $v['url']); |
| 53 | - if (strpos($_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'], $search_str) > 0) { |
|
| 53 | + if (strpos($_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'], $search_str) > 0) { |
|
| 54 | 54 | $ret = $k; |
| 55 | 55 | break; |
| 56 | 56 | } |
@@ -82,10 +82,10 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | public function getPlugin($dirname) |
| 84 | 84 | { |
| 85 | - $pluginName = SMARTOBJECT_ROOT_PATH . 'plugins/' . $dirname . '.php'; |
|
| 85 | + $pluginName = SMARTOBJECT_ROOT_PATH.'plugins/'.$dirname.'.php'; |
|
| 86 | 86 | if (file_exists($pluginName)) { |
| 87 | 87 | require_once $pluginName; |
| 88 | - $function = 'smartobject_plugin_' . $dirname; |
|
| 88 | + $function = 'smartobject_plugin_'.$dirname; |
|
| 89 | 89 | if (function_exists($function)) { |
| 90 | 90 | $array = $function(); |
| 91 | 91 | $ret = new SmartPlugin($array); |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public function getPluginsArray() |
| 104 | 104 | { |
| 105 | - require_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; |
|
| 105 | + require_once XOOPS_ROOT_PATH.'/class/xoopslists.php'; |
|
| 106 | 106 | |
| 107 | 107 | $moduleHandler = xoops_getHandler('module'); |
| 108 | 108 | $criteria = new CriteriaCompo(); |
@@ -113,12 +113,12 @@ discard block |
||
| 113 | 113 | $modulesObj[$moduleObj->getVar('dirname')] = $moduleObj; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - $aFiles = XoopsLists::getFileListAsArray(SMARTOBJECT_ROOT_PATH . 'plugins/'); |
|
| 116 | + $aFiles = XoopsLists::getFileListAsArray(SMARTOBJECT_ROOT_PATH.'plugins/'); |
|
| 117 | 117 | $ret = []; |
| 118 | 118 | foreach ($aFiles as $file) { |
| 119 | 119 | if ('.php' === substr($file, strlen($file) - 4, 4)) { |
| 120 | 120 | $pluginName = str_replace('.php', '', $file); |
| 121 | - $module_xoops_version_file = XOOPS_ROOT_PATH . "/modules/$pluginName/xoops_version.php"; |
|
| 121 | + $module_xoops_version_file = XOOPS_ROOT_PATH."/modules/$pluginName/xoops_version.php"; |
|
| 122 | 122 | if (file_exists($module_xoops_version_file) && isset($modulesObj[$pluginName])) { |
| 123 | 123 | $ret[$pluginName] = $modulesObj[$pluginName]->getVar('name'); |
| 124 | 124 | } |
@@ -30,12 +30,12 @@ |
||
| 30 | 30 | { |
| 31 | 31 | $ret = ''; |
| 32 | 32 | if ('' !== $this->object->getVar($this->key)) { |
| 33 | - $ret .= '<div>' . _CO_SOBJECT_CURRENT_FILE . $this->object->getVar($this->key) . '</div>'; |
|
| 33 | + $ret .= '<div>'._CO_SOBJECT_CURRENT_FILE.$this->object->getVar($this->key).'</div>'; |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - $ret .= "<div><input type='hidden' name='MAX_FILE_SIZE' value='" . $this->getMaxFileSize() . "'> |
|
| 37 | - <input type='file' name='" . $this->getName() . "' id='" . $this->getName() . "'" . $this->getExtra() . "> |
|
| 38 | - <input type='hidden' name='smart_upload_file[]' id='smart_upload_file[]' value='" . $this->getName() . "'></div>"; |
|
| 36 | + $ret .= "<div><input type='hidden' name='MAX_FILE_SIZE' value='".$this->getMaxFileSize()."'> |
|
| 37 | + <input type='file' name='" . $this->getName()."' id='".$this->getName()."'".$this->getExtra()."> |
|
| 38 | + <input type='hidden' name='smart_upload_file[]' id='smart_upload_file[]' value='" . $this->getName()."'></div>"; |
|
| 39 | 39 | |
| 40 | 40 | return $ret; |
| 41 | 41 | } |
@@ -21,18 +21,18 @@ |
||
| 21 | 21 | { |
| 22 | 22 | parent::__construct($form_caption, ' '); |
| 23 | 23 | |
| 24 | - $this->addElement(new XoopsFormLabel('', '<br>' . _CO_SOBJECT_URLLINK_URL)); |
|
| 25 | - $this->addElement(new SmartFormTextElement($object, 'url_' . $key)); |
|
| 24 | + $this->addElement(new XoopsFormLabel('', '<br>'._CO_SOBJECT_URLLINK_URL)); |
|
| 25 | + $this->addElement(new SmartFormTextElement($object, 'url_'.$key)); |
|
| 26 | 26 | |
| 27 | - $this->addElement(new XoopsFormLabel('', '<br>' . _CO_SOBJECT_CAPTION)); |
|
| 28 | - $this->addElement(new SmartFormTextElement($object, 'caption_' . $key)); |
|
| 27 | + $this->addElement(new XoopsFormLabel('', '<br>'._CO_SOBJECT_CAPTION)); |
|
| 28 | + $this->addElement(new SmartFormTextElement($object, 'caption_'.$key)); |
|
| 29 | 29 | |
| 30 | - $this->addElement(new XoopsFormLabel('', '<br>' . _CO_SOBJECT_DESC . '<br>')); |
|
| 31 | - $this->addElement(new XoopsFormTextArea('', 'desc_' . $key, $object->getVar('description'))); |
|
| 30 | + $this->addElement(new XoopsFormLabel('', '<br>'._CO_SOBJECT_DESC.'<br>')); |
|
| 31 | + $this->addElement(new XoopsFormTextArea('', 'desc_'.$key, $object->getVar('description'))); |
|
| 32 | 32 | |
| 33 | - $this->addElement(new XoopsFormLabel('', '<br>' . _CO_SOBJECT_URLLINK_TARGET)); |
|
| 33 | + $this->addElement(new XoopsFormLabel('', '<br>'._CO_SOBJECT_URLLINK_TARGET)); |
|
| 34 | 34 | $targ_val = $object->getVar('target'); |
| 35 | - $targetRadio = new XoopsFormRadio('', 'target_' . $key, '' !== $targ_val ? $targ_val : '_blank'); |
|
| 35 | + $targetRadio = new XoopsFormRadio('', 'target_'.$key, '' !== $targ_val ? $targ_val : '_blank'); |
|
| 36 | 36 | $control = $object->getControl('target'); |
| 37 | 37 | $targetRadio->addOptionArray($control['options']); |
| 38 | 38 | |