@@ -2,5 +2,5 @@ |
||
| 2 | 2 | |
| 3 | 3 | function smarthook_footer_start() |
| 4 | 4 | { |
| 5 | - // code... |
|
| 5 | + // code... |
|
| 6 | 6 | } |
@@ -14,22 +14,22 @@ |
||
| 14 | 14 | * SmartObject library path |
| 15 | 15 | */ |
| 16 | 16 | if (!defined('SMARTOBJECT_URL')) { |
| 17 | - define('SMARTOBJECT_URL', XOOPS_URL . '/modules/smartobject/'); |
|
| 17 | + define('SMARTOBJECT_URL', XOOPS_URL . '/modules/smartobject/'); |
|
| 18 | 18 | } |
| 19 | 19 | if (!defined('SMARTOBJECT_ROOT_PATH')) { |
| 20 | - define('SMARTOBJECT_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/smartobject/'); |
|
| 20 | + define('SMARTOBJECT_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/smartobject/'); |
|
| 21 | 21 | } |
| 22 | 22 | if (!defined('SMARTOBJECT_IMAGES_URL')) { |
| 23 | - define('SMARTOBJECT_IMAGES_URL', SMARTOBJECT_URL . 'assets/images/'); |
|
| 23 | + define('SMARTOBJECT_IMAGES_URL', SMARTOBJECT_URL . 'assets/images/'); |
|
| 24 | 24 | } |
| 25 | 25 | if (!defined('SMARTOBJECT_IMAGES_ROOT_PATH')) { |
| 26 | - define('SMARTOBJECT_IMAGES_ROOT_PATH', SMARTOBJECT_ROOT_PATH . 'assets/images/'); |
|
| 26 | + define('SMARTOBJECT_IMAGES_ROOT_PATH', SMARTOBJECT_ROOT_PATH . 'assets/images/'); |
|
| 27 | 27 | } |
| 28 | 28 | if (!defined('SMARTOBJECT_IMAGES_ACTIONS_URL')) { |
| 29 | - define('SMARTOBJECT_IMAGES_ACTIONS_URL', SMARTOBJECT_URL . 'assets/images/actions/'); |
|
| 29 | + define('SMARTOBJECT_IMAGES_ACTIONS_URL', SMARTOBJECT_URL . 'assets/images/actions/'); |
|
| 30 | 30 | } |
| 31 | 31 | if (!defined('SMARTOBJECT_IMAGES_ACTIONS_ROOT_PATH')) { |
| 32 | - define('SMARTOBJECT_IMAGES_ACTIONS_ROOT_PATH', SMARTOBJECT_ROOT_PATH . 'assets/images/actions/'); |
|
| 32 | + define('SMARTOBJECT_IMAGES_ACTIONS_ROOT_PATH', SMARTOBJECT_ROOT_PATH . 'assets/images/actions/'); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -17,30 +17,30 @@ discard block |
||
| 17 | 17 | * SmartObject library path |
| 18 | 18 | */ |
| 19 | 19 | if (!defined('SMARTOBJECT_URL')) { |
| 20 | - define('SMARTOBJECT_URL', XOOPS_URL . '/modules/smartobject/'); |
|
| 20 | + define('SMARTOBJECT_URL', XOOPS_URL.'/modules/smartobject/'); |
|
| 21 | 21 | } |
| 22 | 22 | if (!defined('SMARTOBJECT_ROOT_PATH')) { |
| 23 | - define('SMARTOBJECT_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/smartobject/'); |
|
| 23 | + define('SMARTOBJECT_ROOT_PATH', XOOPS_ROOT_PATH.'/modules/smartobject/'); |
|
| 24 | 24 | } |
| 25 | 25 | if (!defined('SMARTOBJECT_IMAGES_URL')) { |
| 26 | - define('SMARTOBJECT_IMAGES_URL', SMARTOBJECT_URL . 'assets/images/'); |
|
| 26 | + define('SMARTOBJECT_IMAGES_URL', SMARTOBJECT_URL.'assets/images/'); |
|
| 27 | 27 | } |
| 28 | 28 | if (!defined('SMARTOBJECT_IMAGES_ROOT_PATH')) { |
| 29 | - define('SMARTOBJECT_IMAGES_ROOT_PATH', SMARTOBJECT_ROOT_PATH . 'assets/images/'); |
|
| 29 | + define('SMARTOBJECT_IMAGES_ROOT_PATH', SMARTOBJECT_ROOT_PATH.'assets/images/'); |
|
| 30 | 30 | } |
| 31 | 31 | if (!defined('SMARTOBJECT_IMAGES_ACTIONS_URL')) { |
| 32 | - define('SMARTOBJECT_IMAGES_ACTIONS_URL', SMARTOBJECT_URL . 'assets/images/actions/'); |
|
| 32 | + define('SMARTOBJECT_IMAGES_ACTIONS_URL', SMARTOBJECT_URL.'assets/images/actions/'); |
|
| 33 | 33 | } |
| 34 | 34 | if (!defined('SMARTOBJECT_IMAGES_ACTIONS_ROOT_PATH')) { |
| 35 | - define('SMARTOBJECT_IMAGES_ACTIONS_ROOT_PATH', SMARTOBJECT_ROOT_PATH . 'assets/images/actions/'); |
|
| 35 | + define('SMARTOBJECT_IMAGES_ACTIONS_ROOT_PATH', SMARTOBJECT_ROOT_PATH.'assets/images/actions/'); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * Version of the SmartObject Framework |
| 40 | 40 | */ |
| 41 | -require_once SMARTOBJECT_ROOT_PATH . 'include/version.php'; |
|
| 41 | +require_once SMARTOBJECT_ROOT_PATH.'include/version.php'; |
|
| 42 | 42 | //require_once SMARTOBJECT_ROOT_PATH . 'include/functions.php'; |
| 43 | -require_once SMARTOBJECT_ROOT_PATH . 'include/xoops_core_common_functions.php'; |
|
| 43 | +require_once SMARTOBJECT_ROOT_PATH.'include/xoops_core_common_functions.php'; |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * Some constants used by the SmartObjects |
@@ -69,4 +69,4 @@ discard block |
||
| 69 | 69 | // get previous page |
| 70 | 70 | $smart_previous_page = Smartobject\Utility::getEnv('HTTP_REFERER'); |
| 71 | 71 | |
| 72 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smartloader.php'; |
|
| 72 | +require_once SMARTOBJECT_ROOT_PATH.'class/smartloader.php'; |
|
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | function xoops_debug_dumbQuery($msg = '') |
| 16 | 16 | { |
| 17 | 17 | global $xoopsDB; |
| 18 | - $xoopsDB->query('SELECT * ' . $msg . ' FROM dudewhereismycar2'); |
|
| 18 | + $xoopsDB->query('SELECT * '.$msg.' FROM dudewhereismycar2'); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | function xoops_debug_initiateQueryCount() |
@@ -14,15 +14,15 @@ discard block |
||
| 14 | 14 | */ |
| 15 | 15 | function xoops_debug_dumbQuery($msg = '') |
| 16 | 16 | { |
| 17 | - global $xoopsDB; |
|
| 18 | - $xoopsDB->query('SELECT * ' . $msg . ' FROM dudewhereismycar2'); |
|
| 17 | + global $xoopsDB; |
|
| 18 | + $xoopsDB->query('SELECT * ' . $msg . ' FROM dudewhereismycar2'); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | function xoops_debug_initiateQueryCount() |
| 22 | 22 | { |
| 23 | - global $smartfactory_query_count_activated, $smartfactory_query_count; |
|
| 24 | - $smartfactory_query_count_activated = true; |
|
| 25 | - $smartfactory_query_count = 0; |
|
| 23 | + global $smartfactory_query_count_activated, $smartfactory_query_count; |
|
| 24 | + $smartfactory_query_count_activated = true; |
|
| 25 | + $smartfactory_query_count = 0; |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | /** |
@@ -30,9 +30,9 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | function xoops_debug_getQueryCount($msg = '') |
| 32 | 32 | { |
| 33 | - global $smartfactory_query_count; |
|
| 33 | + global $smartfactory_query_count; |
|
| 34 | 34 | |
| 35 | - return xoops_debug("xoops debug Query count ($msg): $smartfactory_query_count"); |
|
| 35 | + return xoops_debug("xoops debug Query count ($msg): $smartfactory_query_count"); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -41,10 +41,10 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | function xoops_debug($msg, $exit = false) |
| 43 | 43 | { |
| 44 | - echo "<div style='padding: 5px; color: red; font-weight: bold;'>debug:: $msg</div>"; |
|
| 45 | - if ($exit) { |
|
| 46 | - die(); |
|
| 47 | - } |
|
| 44 | + echo "<div style='padding: 5px; color: red; font-weight: bold;'>debug:: $msg</div>"; |
|
| 45 | + if ($exit) { |
|
| 46 | + die(); |
|
| 47 | + } |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | function xoops_comment($msg) |
| 54 | 54 | { |
| 55 | - echo "<div style='padding: 5px; color: green; font-weight: bold;'>=> $msg</div>"; |
|
| 55 | + echo "<div style='padding: 5px; color: green; font-weight: bold;'>=> $msg</div>"; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
@@ -60,10 +60,10 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | function xoops_debug_vardump($var) |
| 62 | 62 | { |
| 63 | - if (class_exists('MyTextSanitizer')) { |
|
| 64 | - $myts = \MyTextSanitizer::getInstance(); |
|
| 65 | - xoops_debug($myts->displayTarea(var_export($var, true))); |
|
| 66 | - } else { |
|
| 67 | - xoops_debug(var_export($var, true)); |
|
| 68 | - } |
|
| 63 | + if (class_exists('MyTextSanitizer')) { |
|
| 64 | + $myts = \MyTextSanitizer::getInstance(); |
|
| 65 | + xoops_debug($myts->displayTarea(var_export($var, true))); |
|
| 66 | + } else { |
|
| 67 | + xoops_debug(var_export($var, true)); |
|
| 68 | + } |
|
| 69 | 69 | } |
@@ -178,7 +178,7 @@ |
||
| 178 | 178 | define('_CO_SOBJECT_BLOCKS_ADDTO_LAYOUT_OPTION2', 'Vertical with icons'); |
| 179 | 179 | define('_CO_SOBJECT_BLOCKS_ADDTO_LAYOUT_OPTION3', 'Vertical no icon'); |
| 180 | 180 | define('_CO_SOBJECT_CURRENT_FILE', 'Current file: '); |
| 181 | -define('_CO_SOBJECT_URL_FILE_DSC', "Alternatively, you can use an URL. If you select a file via 'Browse' button, URL will be ignored. You can use the tag {XOOPS_URL} to print " . XOOPS_URL); |
|
| 181 | +define('_CO_SOBJECT_URL_FILE_DSC', "Alternatively, you can use an URL. If you select a file via 'Browse' button, URL will be ignored. You can use the tag {XOOPS_URL} to print ".XOOPS_URL); |
|
| 182 | 182 | define('_CO_SOBJECT_URL_FILE', 'URL: '); |
| 183 | 183 | define('_CO_SOBJECT_UPLOAD', 'Select a file to upload: '); |
| 184 | 184 | |
@@ -152,16 +152,16 @@ |
||
| 152 | 152 | define('_CO_SOBJECT_UPLOAD_IMAGE', 'Upload a new image:'); |
| 153 | 153 | define('_CO_SOBJECT_VERSION_HISTORY', 'Version History'); |
| 154 | 154 | define( |
| 155 | - '_CO_SOBJECT_WARNING_BETA', |
|
| 156 | - 'This module comes as is, without any guarantees whatsoever. This module is BETA, meaning it is still under active development. This release is meant for <b>testing purposes only</b> and we <b>strongly</b> recommend that you do not use it on a live website or in a production environment.' |
|
| 155 | + '_CO_SOBJECT_WARNING_BETA', |
|
| 156 | + 'This module comes as is, without any guarantees whatsoever. This module is BETA, meaning it is still under active development. This release is meant for <b>testing purposes only</b> and we <b>strongly</b> recommend that you do not use it on a live website or in a production environment.' |
|
| 157 | 157 | ); |
| 158 | 158 | define( |
| 159 | - '_CO_SOBJECT_WARNING_FINAL', |
|
| 160 | - 'This module comes as is, without any guarantees whatsoever. Although this module is not beta, it is still under active development. This release can be used in a live website or a production environment, but its use is under your own responsibility, which means the author is not responsible.' |
|
| 159 | + '_CO_SOBJECT_WARNING_FINAL', |
|
| 160 | + 'This module comes as is, without any guarantees whatsoever. Although this module is not beta, it is still under active development. This release can be used in a live website or a production environment, but its use is under your own responsibility, which means the author is not responsible.' |
|
| 161 | 161 | ); |
| 162 | 162 | define( |
| 163 | - '_CO_SOBJECT_WARNING_RC', |
|
| 164 | - 'This module comes as is, without any guarantees whatsoever. This module is a Release Candidate and should not be used on a production web site. The module is still under active development and its use is under your own responsibility, which means the author is not responsible.' |
|
| 163 | + '_CO_SOBJECT_WARNING_RC', |
|
| 164 | + 'This module comes as is, without any guarantees whatsoever. This module is a Release Candidate and should not be used on a production web site. The module is still under active development and its use is under your own responsibility, which means the author is not responsible.' |
|
| 165 | 165 | ); |
| 166 | 166 | define('_CO_SOBJECT_WEIGHT_FORM_CAPTION', 'Weight'); |
| 167 | 167 | define('_CO_SOBJECT_WEIGHT_FORM_DSC', ''); |
@@ -18,6 +18,6 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | |
| 20 | 20 | $pathIcon32 = \Xmf\Module\Admin::iconUrl('', 32); |
| 21 | -echo "<div class='adminfooter'>\n" . " <div style='text-align: center;'>\n" . " <a href='https://xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n" . " </div>\n" . ' ' . _AM_MODULEADMIN_ADMIN_FOOTER . "\n" . '</div>'; |
|
| 21 | +echo "<div class='adminfooter'>\n"." <div style='text-align: center;'>\n"." <a href='https://xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n"." </div>\n".' '._AM_MODULEADMIN_ADMIN_FOOTER."\n".'</div>'; |
|
| 22 | 22 | |
| 23 | 23 | xoops_cp_footer(); |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | public function button_to_function($name, $function = null) |
| 24 | 24 | { |
| 25 | - return '<input type="button" value="' . $name . '" onclick="' . $function . '">'; |
|
| 25 | + return '<input type="button" value="'.$name.'" onclick="'.$function.'">'; |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | /** |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public function tag($content) |
| 45 | 45 | { |
| 46 | - return '<script type="text/javascript">' . $content . '</script>'; |
|
| 46 | + return '<script type="text/javascript">'.$content.'</script>'; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | public function link_to_function($name, $function, $html_options = null) |
| 56 | 56 | { |
| 57 | - return '<a href="' . (isset($html_options['href']) ? $html_options['href'] : '#') . '" onclick="' . (isset($html_options['onclick']) ? $html_options['onclick'] . ';' : '') . $function . '; return false;">' . $name . '</a>'; |
|
| 57 | + return '<a href="'.(isset($html_options['href']) ? $html_options['href'] : '#').'" onclick="'.(isset($html_options['onclick']) ? $html_options['onclick'].';' : '').$function.'; return false;">'.$name.'</a>'; |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | ///////////////////////////////////////////////////////////////////////////////////// |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | $return_val .= $value; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - return '[' . $return_val . ']'; |
|
| 79 | + return '['.$return_val.']'; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | return "'$option'"; |
@@ -99,6 +99,6 @@ discard block |
||
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | - return '{' . $return_val . '}'; |
|
| 102 | + return '{'.$return_val.'}'; |
|
| 103 | 103 | } |
| 104 | 104 | } |
@@ -15,90 +15,90 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | class JavaScript |
| 17 | 17 | { |
| 18 | - /** |
|
| 19 | - * @param $name |
|
| 20 | - * @param null $function |
|
| 21 | - * @return string |
|
| 22 | - */ |
|
| 23 | - public function button_to_function($name, $function = null) |
|
| 24 | - { |
|
| 25 | - return '<input type="button" value="' . $name . '" onclick="' . $function . '">'; |
|
| 26 | - } |
|
| 18 | + /** |
|
| 19 | + * @param $name |
|
| 20 | + * @param null $function |
|
| 21 | + * @return string |
|
| 22 | + */ |
|
| 23 | + public function button_to_function($name, $function = null) |
|
| 24 | + { |
|
| 25 | + return '<input type="button" value="' . $name . '" onclick="' . $function . '">'; |
|
| 26 | + } |
|
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * @param $javascript |
|
| 30 | - * @return mixed|string |
|
| 31 | - */ |
|
| 32 | - public function escape($javascript) |
|
| 33 | - { |
|
| 34 | - $javascript = addslashes($javascript); |
|
| 35 | - $javascript = str_replace(["\r\n", "\n", "\r"], ["\n"], $javascript); |
|
| 28 | + /** |
|
| 29 | + * @param $javascript |
|
| 30 | + * @return mixed|string |
|
| 31 | + */ |
|
| 32 | + public function escape($javascript) |
|
| 33 | + { |
|
| 34 | + $javascript = addslashes($javascript); |
|
| 35 | + $javascript = str_replace(["\r\n", "\n", "\r"], ["\n"], $javascript); |
|
| 36 | 36 | |
| 37 | - return $javascript; |
|
| 38 | - } |
|
| 37 | + return $javascript; |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * @param $content |
|
| 42 | - * @return string |
|
| 43 | - */ |
|
| 44 | - public function tag($content) |
|
| 45 | - { |
|
| 46 | - return '<script type="text/javascript">' . $content . '</script>'; |
|
| 47 | - } |
|
| 40 | + /** |
|
| 41 | + * @param $content |
|
| 42 | + * @return string |
|
| 43 | + */ |
|
| 44 | + public function tag($content) |
|
| 45 | + { |
|
| 46 | + return '<script type="text/javascript">' . $content . '</script>'; |
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | - /** |
|
| 50 | - * @param $name |
|
| 51 | - * @param $function |
|
| 52 | - * @param null $html_options |
|
| 53 | - * @return string |
|
| 54 | - */ |
|
| 55 | - public function link_to_function($name, $function, $html_options = null) |
|
| 56 | - { |
|
| 57 | - return '<a href="' . (isset($html_options['href']) ? $html_options['href'] : '#') . '" onclick="' . (isset($html_options['onclick']) ? $html_options['onclick'] . ';' : '') . $function . '; return false;">' . $name . '</a>'; |
|
| 58 | - } |
|
| 49 | + /** |
|
| 50 | + * @param $name |
|
| 51 | + * @param $function |
|
| 52 | + * @param null $html_options |
|
| 53 | + * @return string |
|
| 54 | + */ |
|
| 55 | + public function link_to_function($name, $function, $html_options = null) |
|
| 56 | + { |
|
| 57 | + return '<a href="' . (isset($html_options['href']) ? $html_options['href'] : '#') . '" onclick="' . (isset($html_options['onclick']) ? $html_options['onclick'] . ';' : '') . $function . '; return false;">' . $name . '</a>'; |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - ///////////////////////////////////////////////////////////////////////////////////// |
|
| 61 | - // Private functions |
|
| 62 | - ///////////////////////////////////////////////////////////////////////////////////// |
|
| 60 | + ///////////////////////////////////////////////////////////////////////////////////// |
|
| 61 | + // Private functions |
|
| 62 | + ///////////////////////////////////////////////////////////////////////////////////// |
|
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * @param $option |
|
| 66 | - * @return string |
|
| 67 | - */ |
|
| 68 | - public function _array_or_string_for_javascript($option) |
|
| 69 | - { |
|
| 70 | - $return_val = ''; |
|
| 71 | - if (is_array($option)) { |
|
| 72 | - foreach ($option as $value) { |
|
| 73 | - if (!empty($return_val)) { |
|
| 74 | - $ret_val .= ', '; |
|
| 75 | - } |
|
| 76 | - $return_val .= $value; |
|
| 77 | - } |
|
| 64 | + /** |
|
| 65 | + * @param $option |
|
| 66 | + * @return string |
|
| 67 | + */ |
|
| 68 | + public function _array_or_string_for_javascript($option) |
|
| 69 | + { |
|
| 70 | + $return_val = ''; |
|
| 71 | + if (is_array($option)) { |
|
| 72 | + foreach ($option as $value) { |
|
| 73 | + if (!empty($return_val)) { |
|
| 74 | + $ret_val .= ', '; |
|
| 75 | + } |
|
| 76 | + $return_val .= $value; |
|
| 77 | + } |
|
| 78 | 78 | |
| 79 | - return '[' . $return_val . ']'; |
|
| 80 | - } |
|
| 79 | + return '[' . $return_val . ']'; |
|
| 80 | + } |
|
| 81 | 81 | |
| 82 | - return "'$option'"; |
|
| 83 | - } |
|
| 82 | + return "'$option'"; |
|
| 83 | + } |
|
| 84 | 84 | |
| 85 | - /** |
|
| 86 | - * @param $options |
|
| 87 | - * @return string |
|
| 88 | - */ |
|
| 89 | - public function _options_for_javascript($options) |
|
| 90 | - { |
|
| 91 | - $return_val = ''; |
|
| 85 | + /** |
|
| 86 | + * @param $options |
|
| 87 | + * @return string |
|
| 88 | + */ |
|
| 89 | + public function _options_for_javascript($options) |
|
| 90 | + { |
|
| 91 | + $return_val = ''; |
|
| 92 | 92 | |
| 93 | - if (is_array($options)) { |
|
| 94 | - foreach ($options as $var => $val) { |
|
| 95 | - if (!empty($return_val)) { |
|
| 96 | - $return_val .= ', '; |
|
| 97 | - } |
|
| 98 | - $return_val .= "$var:$val"; |
|
| 99 | - } |
|
| 100 | - } |
|
| 93 | + if (is_array($options)) { |
|
| 94 | + foreach ($options as $var => $val) { |
|
| 95 | + if (!empty($return_val)) { |
|
| 96 | + $return_val .= ', '; |
|
| 97 | + } |
|
| 98 | + $return_val .= "$var:$val"; |
|
| 99 | + } |
|
| 100 | + } |
|
| 101 | 101 | |
| 102 | - return '{' . $return_val . '}'; |
|
| 103 | - } |
|
| 102 | + return '{' . $return_val . '}'; |
|
| 103 | + } |
|
| 104 | 104 | } |
@@ -14,16 +14,16 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | 16 | if (!class_exists('Projax')) { |
| 17 | - include __DIR__ . '/classes/JavaScript.php'; |
|
| 18 | - include __DIR__ . '/classes/Prototype.php'; |
|
| 19 | - include __DIR__ . '/classes/Scriptaculous.php'; |
|
| 17 | + include __DIR__ . '/classes/JavaScript.php'; |
|
| 18 | + include __DIR__ . '/classes/Prototype.php'; |
|
| 19 | + include __DIR__ . '/classes/Scriptaculous.php'; |
|
| 20 | 20 | |
| 21 | - // For $projax = new Projax(); |
|
| 21 | + // For $projax = new Projax(); |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * Class projax |
|
| 25 | - */ |
|
| 26 | - class projax extends Scriptaculous |
|
| 27 | - { |
|
| 28 | - } |
|
| 23 | + /** |
|
| 24 | + * Class projax |
|
| 25 | + */ |
|
| 26 | + class projax extends Scriptaculous |
|
| 27 | + { |
|
| 28 | + } |
|
| 29 | 29 | } |
@@ -14,9 +14,9 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | 16 | if (!class_exists('Projax')) { |
| 17 | - include __DIR__ . '/classes/JavaScript.php'; |
|
| 18 | - include __DIR__ . '/classes/Prototype.php'; |
|
| 19 | - include __DIR__ . '/classes/Scriptaculous.php'; |
|
| 17 | + include __DIR__.'/classes/JavaScript.php'; |
|
| 18 | + include __DIR__.'/classes/Prototype.php'; |
|
| 19 | + include __DIR__.'/classes/Scriptaculous.php'; |
|
| 20 | 20 | |
| 21 | 21 | // For $projax = new Projax(); |
| 22 | 22 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | public function setCode() |
| 44 | 44 | { |
| 45 | - $_SESSION['XoopsCaptcha_sessioncode'] = (string)$this->code; |
|
| 45 | + $_SESSION['XoopsCaptcha_sessioncode'] = (string) $this->code; |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function render() |
| 52 | 52 | { |
| 53 | - $form = $this->loadText() . " <input type='text' name='" . $this->config['name'] . "' id='" . $this->config['name'] . "' size='" . $this->config['num_chars'] . "' maxlength='" . $this->config['num_chars'] . "' value=''>"; |
|
| 53 | + $form = $this->loadText()." <input type='text' name='".$this->config['name']."' id='".$this->config['name']."' size='".$this->config['num_chars']."' maxlength='".$this->config['num_chars']."' value=''>"; |
|
| 54 | 54 | $rule = constant('XOOPS_CAPTCHA_RULE_TEXT'); |
| 55 | 55 | if (!empty($rule)) { |
| 56 | 56 | $form .= " <small>{$rule}</small>"; |
@@ -7,75 +7,75 @@ |
||
| 7 | 7 | */ |
| 8 | 8 | class XoopsCaptchaText |
| 9 | 9 | { |
| 10 | - public $config = []; |
|
| 11 | - public $code; |
|
| 10 | + public $config = []; |
|
| 11 | + public $code; |
|
| 12 | 12 | |
| 13 | - /** |
|
| 14 | - * XoopsCaptchaText constructor. |
|
| 15 | - */ |
|
| 16 | - public function __construct() |
|
| 17 | - { |
|
| 18 | - } |
|
| 13 | + /** |
|
| 14 | + * XoopsCaptchaText constructor. |
|
| 15 | + */ |
|
| 16 | + public function __construct() |
|
| 17 | + { |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | - /** |
|
| 21 | - * @return XoopsCaptchaText |
|
| 22 | - */ |
|
| 23 | - public static function getInstance() |
|
| 24 | - { |
|
| 25 | - static $instance; |
|
| 26 | - if (null === $instance) { |
|
| 27 | - $instance = new static(); |
|
| 28 | - } |
|
| 20 | + /** |
|
| 21 | + * @return XoopsCaptchaText |
|
| 22 | + */ |
|
| 23 | + public static function getInstance() |
|
| 24 | + { |
|
| 25 | + static $instance; |
|
| 26 | + if (null === $instance) { |
|
| 27 | + $instance = new static(); |
|
| 28 | + } |
|
| 29 | 29 | |
| 30 | - return $instance; |
|
| 31 | - } |
|
| 30 | + return $instance; |
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * Loading configs from CAPTCHA class |
|
| 35 | - * @param array $config |
|
| 36 | - */ |
|
| 37 | - public function loadConfig($config = []) |
|
| 38 | - { |
|
| 39 | - // Loading default preferences |
|
| 40 | - $this->config = $config; |
|
| 41 | - } |
|
| 33 | + /** |
|
| 34 | + * Loading configs from CAPTCHA class |
|
| 35 | + * @param array $config |
|
| 36 | + */ |
|
| 37 | + public function loadConfig($config = []) |
|
| 38 | + { |
|
| 39 | + // Loading default preferences |
|
| 40 | + $this->config = $config; |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - public function setCode() |
|
| 44 | - { |
|
| 45 | - $_SESSION['XoopsCaptcha_sessioncode'] = (string)$this->code; |
|
| 46 | - } |
|
| 43 | + public function setCode() |
|
| 44 | + { |
|
| 45 | + $_SESSION['XoopsCaptcha_sessioncode'] = (string)$this->code; |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - /** |
|
| 49 | - * @return string |
|
| 50 | - */ |
|
| 51 | - public function render() |
|
| 52 | - { |
|
| 53 | - $form = $this->loadText() . " <input type='text' name='" . $this->config['name'] . "' id='" . $this->config['name'] . "' size='" . $this->config['num_chars'] . "' maxlength='" . $this->config['num_chars'] . "' value=''>"; |
|
| 54 | - $rule = constant('XOOPS_CAPTCHA_RULE_TEXT'); |
|
| 55 | - if (!empty($rule)) { |
|
| 56 | - $form .= " <small>{$rule}</small>"; |
|
| 57 | - } |
|
| 48 | + /** |
|
| 49 | + * @return string |
|
| 50 | + */ |
|
| 51 | + public function render() |
|
| 52 | + { |
|
| 53 | + $form = $this->loadText() . " <input type='text' name='" . $this->config['name'] . "' id='" . $this->config['name'] . "' size='" . $this->config['num_chars'] . "' maxlength='" . $this->config['num_chars'] . "' value=''>"; |
|
| 54 | + $rule = constant('XOOPS_CAPTCHA_RULE_TEXT'); |
|
| 55 | + if (!empty($rule)) { |
|
| 56 | + $form .= " <small>{$rule}</small>"; |
|
| 57 | + } |
|
| 58 | 58 | |
| 59 | - $this->setCode(); |
|
| 59 | + $this->setCode(); |
|
| 60 | 60 | |
| 61 | - return $form; |
|
| 62 | - } |
|
| 61 | + return $form; |
|
| 62 | + } |
|
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * @return string |
|
| 66 | - */ |
|
| 67 | - public function loadText() |
|
| 68 | - { |
|
| 69 | - $val_a = mt_rand(0, 9); |
|
| 70 | - $val_b = mt_rand(0, 9); |
|
| 71 | - if ($val_a > $val_b) { |
|
| 72 | - $expression = "{$val_a} - {$val_b} = ?"; |
|
| 73 | - $this->code = $val_a - $val_b; |
|
| 74 | - } else { |
|
| 75 | - $expression = "{$val_a} + {$val_b} = ?"; |
|
| 76 | - $this->code = $val_a + $val_b; |
|
| 77 | - } |
|
| 64 | + /** |
|
| 65 | + * @return string |
|
| 66 | + */ |
|
| 67 | + public function loadText() |
|
| 68 | + { |
|
| 69 | + $val_a = mt_rand(0, 9); |
|
| 70 | + $val_b = mt_rand(0, 9); |
|
| 71 | + if ($val_a > $val_b) { |
|
| 72 | + $expression = "{$val_a} - {$val_b} = ?"; |
|
| 73 | + $this->code = $val_a - $val_b; |
|
| 74 | + } else { |
|
| 75 | + $expression = "{$val_a} + {$val_b} = ?"; |
|
| 76 | + $this->code = $val_a + $val_b; |
|
| 77 | + } |
|
| 78 | 78 | |
| 79 | - return "<span style='font-style: normal; font-weight: bold; font-size: 100%; font-color: #333; border: 1px solid #333; padding: 1px 5px;'>{$expression}</span>"; |
|
| 80 | - } |
|
| 79 | + return "<span style='font-style: normal; font-weight: bold; font-size: 100%; font-color: #333; border: 1px solid #333; padding: 1px 5px;'>{$expression}</span>"; |
|
| 80 | + } |
|
| 81 | 81 | } |
@@ -45,10 +45,10 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | public function render() |
| 47 | 47 | { |
| 48 | - $form = "<input type='text' name='" . $this->config['name'] . "' id='" . $this->config['name'] . "' size='" . $this->config['num_chars'] . "' maxlength='" . $this->config['num_chars'] . "' value=''> " . $this->loadImage(); |
|
| 48 | + $form = "<input type='text' name='".$this->config['name']."' id='".$this->config['name']."' size='".$this->config['num_chars']."' maxlength='".$this->config['num_chars']."' value=''> ".$this->loadImage(); |
|
| 49 | 49 | $rule = htmlspecialchars(XOOPS_CAPTCHA_REFRESH, ENT_QUOTES); |
| 50 | 50 | if ($this->config['maxattempt']) { |
| 51 | - $rule .= ' | ' . sprintf(constant('XOOPS_CAPTCHA_MAXATTEMPTS'), $this->config['maxattempt']); |
|
| 51 | + $rule .= ' | '.sprintf(constant('XOOPS_CAPTCHA_MAXATTEMPTS'), $this->config['maxattempt']); |
|
| 52 | 52 | } |
| 53 | 53 | $form .= " <small>{$rule}</small>"; |
| 54 | 54 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | public function loadImage() |
| 62 | 62 | { |
| 63 | 63 | $rule = $this->config['casesensitive'] ? constant('XOOPS_CAPTCHA_RULE_CASESENSITIVE') : constant('XOOPS_CAPTCHA_RULE_CASEINSENSITIVE'); |
| 64 | - $ret = "<img id='captcha' src='" . XOOPS_URL . '/' . $this->config['imageurl'] . "' onclick=\"this.src='" . XOOPS_URL . '/' . $this->config['imageurl'] . "?refresh='+Math.random()" . "\" align='absmiddle' style='cursor: pointer;' alt='" . htmlspecialchars($rule, ENT_QUOTES) . "'>"; |
|
| 64 | + $ret = "<img id='captcha' src='".XOOPS_URL.'/'.$this->config['imageurl']."' onclick=\"this.src='".XOOPS_URL.'/'.$this->config['imageurl']."?refresh='+Math.random()"."\" align='absmiddle' style='cursor: pointer;' alt='".htmlspecialchars($rule, ENT_QUOTES)."'>"; |
|
| 65 | 65 | |
| 66 | 66 | return $ret; |
| 67 | 67 | } |
@@ -7,62 +7,62 @@ |
||
| 7 | 7 | */ |
| 8 | 8 | class XoopsCaptchaImage |
| 9 | 9 | { |
| 10 | - public $config = []; |
|
| 10 | + public $config = []; |
|
| 11 | 11 | |
| 12 | - /** |
|
| 13 | - * XoopsCaptchaImage constructor. |
|
| 14 | - */ |
|
| 15 | - public function __construct() |
|
| 16 | - { |
|
| 17 | - //$this->name = md5( session_id() ); |
|
| 18 | - } |
|
| 12 | + /** |
|
| 13 | + * XoopsCaptchaImage constructor. |
|
| 14 | + */ |
|
| 15 | + public function __construct() |
|
| 16 | + { |
|
| 17 | + //$this->name = md5( session_id() ); |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | - /** |
|
| 21 | - * @return XoopsCaptchaImage |
|
| 22 | - */ |
|
| 23 | - public static function getInstance() |
|
| 24 | - { |
|
| 25 | - static $instance; |
|
| 26 | - if (null === $instance) { |
|
| 27 | - $instance = new static(); |
|
| 28 | - } |
|
| 20 | + /** |
|
| 21 | + * @return XoopsCaptchaImage |
|
| 22 | + */ |
|
| 23 | + public static function getInstance() |
|
| 24 | + { |
|
| 25 | + static $instance; |
|
| 26 | + if (null === $instance) { |
|
| 27 | + $instance = new static(); |
|
| 28 | + } |
|
| 29 | 29 | |
| 30 | - return $instance; |
|
| 31 | - } |
|
| 30 | + return $instance; |
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * Loading configs from CAPTCHA class |
|
| 35 | - * @param array $config |
|
| 36 | - */ |
|
| 37 | - public function loadConfig($config = []) |
|
| 38 | - { |
|
| 39 | - // Loading default preferences |
|
| 40 | - $this->config = $config; |
|
| 41 | - } |
|
| 33 | + /** |
|
| 34 | + * Loading configs from CAPTCHA class |
|
| 35 | + * @param array $config |
|
| 36 | + */ |
|
| 37 | + public function loadConfig($config = []) |
|
| 38 | + { |
|
| 39 | + // Loading default preferences |
|
| 40 | + $this->config = $config; |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * @return string |
|
| 45 | - */ |
|
| 46 | - public function render() |
|
| 47 | - { |
|
| 48 | - $form = "<input type='text' name='" . $this->config['name'] . "' id='" . $this->config['name'] . "' size='" . $this->config['num_chars'] . "' maxlength='" . $this->config['num_chars'] . "' value=''> " . $this->loadImage(); |
|
| 49 | - $rule = htmlspecialchars(XOOPS_CAPTCHA_REFRESH, ENT_QUOTES); |
|
| 50 | - if ($this->config['maxattempt']) { |
|
| 51 | - $rule .= ' | ' . sprintf(constant('XOOPS_CAPTCHA_MAXATTEMPTS'), $this->config['maxattempt']); |
|
| 52 | - } |
|
| 53 | - $form .= " <small>{$rule}</small>"; |
|
| 43 | + /** |
|
| 44 | + * @return string |
|
| 45 | + */ |
|
| 46 | + public function render() |
|
| 47 | + { |
|
| 48 | + $form = "<input type='text' name='" . $this->config['name'] . "' id='" . $this->config['name'] . "' size='" . $this->config['num_chars'] . "' maxlength='" . $this->config['num_chars'] . "' value=''> " . $this->loadImage(); |
|
| 49 | + $rule = htmlspecialchars(XOOPS_CAPTCHA_REFRESH, ENT_QUOTES); |
|
| 50 | + if ($this->config['maxattempt']) { |
|
| 51 | + $rule .= ' | ' . sprintf(constant('XOOPS_CAPTCHA_MAXATTEMPTS'), $this->config['maxattempt']); |
|
| 52 | + } |
|
| 53 | + $form .= " <small>{$rule}</small>"; |
|
| 54 | 54 | |
| 55 | - return $form; |
|
| 56 | - } |
|
| 55 | + return $form; |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - /** |
|
| 59 | - * @return string |
|
| 60 | - */ |
|
| 61 | - public function loadImage() |
|
| 62 | - { |
|
| 63 | - $rule = $this->config['casesensitive'] ? constant('XOOPS_CAPTCHA_RULE_CASESENSITIVE') : constant('XOOPS_CAPTCHA_RULE_CASEINSENSITIVE'); |
|
| 64 | - $ret = "<img id='captcha' src='" . XOOPS_URL . '/' . $this->config['imageurl'] . "' onclick=\"this.src='" . XOOPS_URL . '/' . $this->config['imageurl'] . "?refresh='+Math.random()" . "\" align='absmiddle' style='cursor: pointer;' alt='" . htmlspecialchars($rule, ENT_QUOTES) . "'>"; |
|
| 58 | + /** |
|
| 59 | + * @return string |
|
| 60 | + */ |
|
| 61 | + public function loadImage() |
|
| 62 | + { |
|
| 63 | + $rule = $this->config['casesensitive'] ? constant('XOOPS_CAPTCHA_RULE_CASESENSITIVE') : constant('XOOPS_CAPTCHA_RULE_CASEINSENSITIVE'); |
|
| 64 | + $ret = "<img id='captcha' src='" . XOOPS_URL . '/' . $this->config['imageurl'] . "' onclick=\"this.src='" . XOOPS_URL . '/' . $this->config['imageurl'] . "?refresh='+Math.random()" . "\" align='absmiddle' style='cursor: pointer;' alt='" . htmlspecialchars($rule, ENT_QUOTES) . "'>"; |
|
| 65 | 65 | |
| 66 | - return $ret; |
|
| 67 | - } |
|
| 66 | + return $ret; |
|
| 67 | + } |
|
| 68 | 68 | } |