@@ -37,10 +37,10 @@ |
||
| 37 | 37 | public function executeHook($hook_name) |
| 38 | 38 | { |
| 39 | 39 | $lower_hook_name = strtolower($hook_name); |
| 40 | - $filename = SMARTOBJECT_ROOT_PATH . 'include/custom_code/' . $lower_hook_name . '.php'; |
|
| 40 | + $filename = SMARTOBJECT_ROOT_PATH.'include/custom_code/'.$lower_hook_name.'.php'; |
|
| 41 | 41 | if (file_exists($filename)) { |
| 42 | 42 | include_once($filename); |
| 43 | - $function = 'smarthook_' . $lower_hook_name; |
|
| 43 | + $function = 'smarthook_'.$lower_hook_name; |
|
| 44 | 44 | if (function_exists($function)) { |
| 45 | 45 | $function(); |
| 46 | 46 | } |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | public function valToCsvHelper($val, $separator, $trimFunction) |
| 204 | 204 | { |
| 205 | 205 | if ($trimFunction) { |
| 206 | - $val = $trimFunction ($val); |
|
| 206 | + $val = $trimFunction($val); |
|
| 207 | 207 | } |
| 208 | 208 | //If there is a separator (;) or a quote (") or a linebreak in the string, we need to quote it. |
| 209 | 209 | $needQuote = false; |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | } |
| 224 | 224 | } while (false); |
| 225 | 225 | if ($needQuote) { |
| 226 | - $val = '"' . $val . '"'; |
|
| 226 | + $val = '"'.$val.'"'; |
|
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | return $val; |
@@ -237,10 +237,10 @@ discard block |
||
| 237 | 237 | case 'csv': |
| 238 | 238 | $separator = isset($this->options['separator']) ? $this->options['separator'] : ';'; |
| 239 | 239 | $firstRow = implode($separator, $this->data['columnsHeaders']); |
| 240 | - $exportFileData .= $firstRow . "\r\n"; |
|
| 240 | + $exportFileData .= $firstRow."\r\n"; |
|
| 241 | 241 | |
| 242 | 242 | foreach ($this->data['rows'] as $cols) { |
| 243 | - $exportFileData .= $this->arrayToCsvString($cols, $separator) . "\r\n"; |
|
| 243 | + $exportFileData .= $this->arrayToCsvString($cols, $separator)."\r\n"; |
|
| 244 | 244 | } |
| 245 | 245 | break; |
| 246 | 246 | } |
@@ -265,19 +265,19 @@ discard block |
||
| 265 | 265 | public function saveCsv($content) |
| 266 | 266 | { |
| 267 | 267 | if (!$this->filepath) { |
| 268 | - $this->filepath = XOOPS_UPLOAD_PATH . '/'; |
|
| 268 | + $this->filepath = XOOPS_UPLOAD_PATH.'/'; |
|
| 269 | 269 | } |
| 270 | 270 | if (!$this->filename) { |
| 271 | 271 | $this->filename .= time(); |
| 272 | 272 | $this->filename .= '.csv'; |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | - $fullFileName = $this->filepath . $this->filename; |
|
| 275 | + $fullFileName = $this->filepath.$this->filename; |
|
| 276 | 276 | |
| 277 | 277 | if (!$handle = fopen($fullFileName, 'a+')) { |
| 278 | - trigger_error('Unable to open ' . $fullFileName, E_USER_WARNING); |
|
| 278 | + trigger_error('Unable to open '.$fullFileName, E_USER_WARNING); |
|
| 279 | 279 | } elseif (fwrite($handle, $content) === false) { |
| 280 | - trigger_error('Unable to write in ' . $fullFileName, E_USER_WARNING); |
|
| 280 | + trigger_error('Unable to write in '.$fullFileName, E_USER_WARNING); |
|
| 281 | 281 | } else { |
| 282 | 282 | $mimeType = 'text/csv'; |
| 283 | 283 | $file = strrev($this->filename); |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | } else { |
| 288 | 288 | $file_name = $temp_name; |
| 289 | 289 | } |
| 290 | - $fullFileName = $this->filepath . stripslashes(trim($this->filename)); |
|
| 290 | + $fullFileName = $this->filepath.stripslashes(trim($this->filename)); |
|
| 291 | 291 | |
| 292 | 292 | if (ini_get('zlib.output_compression')) { |
| 293 | 293 | ini_set('zlib.output_compression', 'Off'); |
@@ -298,10 +298,10 @@ discard block |
||
| 298 | 298 | header('Cache-Control: private', false); |
| 299 | 299 | header('Content-Transfer-Encoding: binary'); |
| 300 | 300 | if (isset($mimeType)) { |
| 301 | - header('Content-Type: ' . $mimeType); |
|
| 301 | + header('Content-Type: '.$mimeType); |
|
| 302 | 302 | } |
| 303 | 303 | |
| 304 | - header('Content-Disposition: attachment; filename=' . $file_name); |
|
| 304 | + header('Content-Disposition: attachment; filename='.$file_name); |
|
| 305 | 305 | |
| 306 | 306 | if (isset($mimeType) && false !== strpos($mimeType, 'text/')) { |
| 307 | 307 | $fp = fopen($fullFileName, 'r'); |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | // -------------------------------------------------------------------------// |
| 29 | 29 | |
| 30 | 30 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
| 31 | -include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartmlobject.php'; |
|
| 31 | +include_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartmlobject.php'; |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * Class SmartobjectTag |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public function getLanguages() |
| 71 | 71 | { |
| 72 | - include_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; |
|
| 72 | + include_once XOOPS_ROOT_PATH.'/class/xoopslists.php'; |
|
| 73 | 73 | $aLanguages = XoopsLists::getLangList(); |
| 74 | 74 | $ret['default'] = _CO_SOBJECT_ALL; |
| 75 | 75 | foreach ($aLanguages as $lang) { |
@@ -325,7 +325,7 @@ |
||
| 325 | 325 | public function createMetaKeywords() |
| 326 | 326 | { |
| 327 | 327 | global $xoopsModuleConfig; |
| 328 | - $keywords = $this->findMetaKeywords($this->_original_title . ' ' . $this->_description, $this->_minChar); |
|
| 328 | + $keywords = $this->findMetaKeywords($this->_original_title.' '.$this->_description, $this->_minChar); |
|
| 329 | 329 | if (isset($xoopsModuleConfig) && isset($xoopsModuleConfig['moduleMetaKeywords']) && $xoopsModuleConfig['moduleMetaKeywords'] !== '') { |
| 330 | 330 | $moduleKeywords = explode(',', $xoopsModuleConfig['moduleMetaKeywords']); |
| 331 | 331 | $keywords = array_merge($keywords, $moduleKeywords); |
@@ -20,13 +20,13 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | public function __construct($layout = 0, $method = 1) |
| 22 | 22 | { |
| 23 | - $layout = (int)$layout; |
|
| 23 | + $layout = (int) $layout; |
|
| 24 | 24 | if ($layout < 0 || $layout > 3) { |
| 25 | 25 | $layout = 0; |
| 26 | 26 | } |
| 27 | 27 | $this->_layout = $layout; |
| 28 | 28 | |
| 29 | - $method = (int)$method; |
|
| 29 | + $method = (int) $method; |
|
| 30 | 30 | if ($method < 0 || $method > 1) { |
| 31 | 31 | $method = 1; |
| 32 | 32 | } |
@@ -41,12 +41,12 @@ discard block |
||
| 41 | 41 | { |
| 42 | 42 | global $xoTheme, $xoopsTpl; |
| 43 | 43 | |
| 44 | - $xoTheme->addStylesheet(SMARTOBJECT_URL . 'include/addto/addto.css'); |
|
| 44 | + $xoTheme->addStylesheet(SMARTOBJECT_URL.'include/addto/addto.css'); |
|
| 45 | 45 | |
| 46 | 46 | $xoopsTpl->assign('smartobject_addto_method', $this->_method); |
| 47 | 47 | $xoopsTpl->assign('smartobject_addto_layout', $this->_layout); |
| 48 | 48 | |
| 49 | - $xoopsTpl->assign('smartobject_addto_url', SMARTOBJECT_URL . 'include/addto/'); |
|
| 49 | + $xoopsTpl->assign('smartobject_addto_url', SMARTOBJECT_URL.'include/addto/'); |
|
| 50 | 50 | |
| 51 | 51 | if ($fetchOnly) { |
| 52 | 52 | return $xoopsTpl->fetch('db:smartobject_addto.tpl'); |
@@ -62,12 +62,12 @@ discard block |
||
| 62 | 62 | { |
| 63 | 63 | global $xoTheme; |
| 64 | 64 | |
| 65 | - $xoTheme->addStylesheet(SMARTOBJECT_URL . 'include/addto/addto.css'); |
|
| 65 | + $xoTheme->addStylesheet(SMARTOBJECT_URL.'include/addto/addto.css'); |
|
| 66 | 66 | |
| 67 | 67 | $block = array(); |
| 68 | 68 | $block['smartobject_addto_method'] = $this->_method; |
| 69 | 69 | $block['smartobject_addto_layout'] = $this->_layout; |
| 70 | - $block['smartobject_addto_url'] = SMARTOBJECT_URL . 'include/addto/'; |
|
| 70 | + $block['smartobject_addto_url'] = SMARTOBJECT_URL.'include/addto/'; |
|
| 71 | 71 | |
| 72 | 72 | return $block; |
| 73 | 73 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
| 31 | 31 | |
| 32 | -include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobject.php'; |
|
| 32 | +include_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobject.php'; |
|
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * Class SmartobjectAdsense |
@@ -111,23 +111,23 @@ discard block |
||
| 111 | 111 | { |
| 112 | 112 | global $smartobjectAdsenseHandler; |
| 113 | 113 | if ($this->getVar('style', 'n') !== '') { |
| 114 | - $ret = '<div style="' . $this->getVar('style', 'n') . '">'; |
|
| 114 | + $ret = '<div style="'.$this->getVar('style', 'n').'">'; |
|
| 115 | 115 | } else { |
| 116 | 116 | $ret = '<div>'; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | $ret .= '<script type="text/javascript"><!-- |
| 120 | -google_ad_client = "' . $this->getVar('client_id', 'n') . '"; |
|
| 121 | -google_ad_width = ' . $smartobjectAdsenseHandler->adFormats[$this->getVar('format', 'n')]['width'] . '; |
|
| 122 | -google_ad_height = ' . $smartobjectAdsenseHandler->adFormats[$this->getVar('format', 'n')]['height'] . '; |
|
| 123 | -google_ad_format = "' . $this->getVar('format', 'n') . '"; |
|
| 120 | +google_ad_client = "' . $this->getVar('client_id', 'n').'"; |
|
| 121 | +google_ad_width = ' . $smartobjectAdsenseHandler->adFormats[$this->getVar('format', 'n')]['width'].'; |
|
| 122 | +google_ad_height = ' . $smartobjectAdsenseHandler->adFormats[$this->getVar('format', 'n')]['height'].'; |
|
| 123 | +google_ad_format = "' . $this->getVar('format', 'n').'"; |
|
| 124 | 124 | google_ad_type = "text"; |
| 125 | 125 | google_ad_channel =""; |
| 126 | -google_color_border = "' . $this->getVar('border_color', 'n') . '"; |
|
| 127 | -google_color_bg = "' . $this->getVar('background_color', 'n') . '"; |
|
| 128 | -google_color_link = "' . $this->getVar('link_color', 'n') . '"; |
|
| 129 | -google_color_url = "' . $this->getVar('url_color', 'n') . '"; |
|
| 130 | -google_color_text = "' . $this->getVar('text_color', 'n') . '"; |
|
| 126 | +google_color_border = "' . $this->getVar('border_color', 'n').'"; |
|
| 127 | +google_color_bg = "' . $this->getVar('background_color', 'n').'"; |
|
| 128 | +google_color_link = "' . $this->getVar('link_color', 'n').'"; |
|
| 129 | +google_color_url = "' . $this->getVar('url_color', 'n').'"; |
|
| 130 | +google_color_text = "' . $this->getVar('text_color', 'n').'"; |
|
| 131 | 131 | //--></script> |
| 132 | 132 | <script type="text/javascript" |
| 133 | 133 | src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | */ |
| 143 | 143 | public function getXoopsCode() |
| 144 | 144 | { |
| 145 | - $ret = '[adsense]' . $this->getVar('tag', 'n') . '[/adsense]'; |
|
| 145 | + $ret = '[adsense]'.$this->getVar('tag', 'n').'[/adsense]'; |
|
| 146 | 146 | |
| 147 | 147 | return $ret; |
| 148 | 148 | } |
@@ -234,16 +234,16 @@ discard block |
||
| 234 | 234 | */ |
| 235 | 235 | public function getCloneLink() |
| 236 | 236 | { |
| 237 | - $ret = '<a href="' . |
|
| 238 | - SMARTOBJECT_URL . |
|
| 239 | - 'admin/adsense.php?op=clone&adsenseid=' . |
|
| 240 | - $this->getVar('adsenseid') . |
|
| 241 | - '"><img src="' . |
|
| 242 | - SMARTOBJECT_IMAGES_ACTIONS_URL . |
|
| 243 | - 'editcopy.png" alt="' . |
|
| 244 | - _CO_SOBJECT_ADSENSE_CLONE . |
|
| 245 | - '" title="' . |
|
| 246 | - _CO_SOBJECT_ADSENSE_CLONE . |
|
| 237 | + $ret = '<a href="'. |
|
| 238 | + SMARTOBJECT_URL. |
|
| 239 | + 'admin/adsense.php?op=clone&adsenseid='. |
|
| 240 | + $this->getVar('adsenseid'). |
|
| 241 | + '"><img src="'. |
|
| 242 | + SMARTOBJECT_IMAGES_ACTIONS_URL. |
|
| 243 | + 'editcopy.png" alt="'. |
|
| 244 | + _CO_SOBJECT_ADSENSE_CLONE. |
|
| 245 | + '" title="'. |
|
| 246 | + _CO_SOBJECT_ADSENSE_CLONE. |
|
| 247 | 247 | '" /></a>'; |
| 248 | 248 | |
| 249 | 249 | return $ret; |
@@ -15,9 +15,9 @@ discard block |
||
| 15 | 15 | /** |
| 16 | 16 | * Including the XoopsFormLoader classes |
| 17 | 17 | */ |
| 18 | -include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 19 | -include_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformsection.php'; |
|
| 20 | -include_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformsectionclose.php'; |
|
| 18 | +include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 19 | +include_once SMARTOBJECT_ROOT_PATH.'class/form/elements/smartformsection.php'; |
|
| 20 | +include_once SMARTOBJECT_ROOT_PATH.'class/form/elements/smartformsectionclose.php'; |
|
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * SmartForm base class |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function __construct(&$target, $form_name, $form_caption, $form_action, $form_fields = null, $submit_button_caption = false, $cancel_js_action = false, $captcha = false) |
| 54 | 54 | { |
| 55 | - $this->targetObject =& $target; |
|
| 55 | + $this->targetObject = & $target; |
|
| 56 | 56 | $this->form_fields = $form_fields; |
| 57 | 57 | $this->_cancel_js_action = $cancel_js_action; |
| 58 | 58 | $this->_captcha = $captcha; |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | public function addCaptcha() |
| 82 | 82 | { |
| 83 | - include_once(SMARTOBJECT_ROOT_PATH . 'include/captcha/formcaptcha.php'); |
|
| 83 | + include_once(SMARTOBJECT_ROOT_PATH.'include/captcha/formcaptcha.php'); |
|
| 84 | 84 | $this->addElement(new XoopsFormCaptcha(), true); |
| 85 | 85 | } |
| 86 | 86 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | public function addCustomButton($name, $caption, $onclick = false) |
| 93 | 93 | { |
| 94 | - $custom_button_array = array( |
|
| 94 | + $custom_button_array = array( |
|
| 95 | 95 | 'name' => $name, |
| 96 | 96 | 'caption' => $caption, |
| 97 | 97 | 'onclick' => $onclick |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | if ($key) { |
| 113 | 113 | if ($this->targetObject->vars[$key]['readonly']) { |
| 114 | 114 | $formElement->setExtra('disabled="disabled"'); |
| 115 | - $formElement->setName($key . '-readonly'); |
|
| 115 | + $formElement->setName($key.'-readonly'); |
|
| 116 | 116 | // Since this element is disable, we still want to pass it's value in the form |
| 117 | 117 | $hidden = new XoopsFormHidden($key, $this->targetObject->vars[$key]['value']); |
| 118 | 118 | $this->addElement($hidden); |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $this->addElement($hidden); |
| 124 | 124 | $otherExtra = isset($var['form_extra']) ? $var['form_extra'] : ''; |
| 125 | 125 | $onchangedString = "this.form.elements.changedField.value='$key'; this.form.elements.op.value='changedField'; submit()"; |
| 126 | - $formElement->setExtra('onchange="' . $onchangedString . '"' . ' ' . $otherExtra); |
|
| 126 | + $formElement->setExtra('onchange="'.$onchangedString.'"'.' '.$otherExtra); |
|
| 127 | 127 | } else { |
| 128 | 128 | if (isset($var['form_extra'])) { |
| 129 | 129 | $formElement->setExtra($var['form_extra']); |
@@ -290,8 +290,8 @@ discard block |
||
| 290 | 290 | asort($group_list); |
| 291 | 291 | foreach ($permissions as $permission) { |
| 292 | 292 | if ($this->targetObject->isNew()) { |
| 293 | - if (isset($smartModuleConfig['def_perm_' . $permission['perm_name']])) { |
|
| 294 | - $groups_value = $smartModuleConfig['def_perm_' . $permission['perm_name']]; |
|
| 293 | + if (isset($smartModuleConfig['def_perm_'.$permission['perm_name']])) { |
|
| 294 | + $groups_value = $smartModuleConfig['def_perm_'.$permission['perm_name']]; |
|
| 295 | 295 | } |
| 296 | 296 | } else { |
| 297 | 297 | $groups_value = $this->targetObject->getGroupPerm($permission['perm_name']); |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | } else { |
| 324 | 324 | $butt_create = new XoopsFormButton('', 'modify_button', $submit_button_caption, 'submit'); |
| 325 | 325 | } |
| 326 | - $butt_create->setExtra('onclick="this.form.elements.op.value=\'' . $form_name . '\'"'); |
|
| 326 | + $butt_create->setExtra('onclick="this.form.elements.op.value=\''.$form_name.'\'"'); |
|
| 327 | 327 | $button_tray->addElement($butt_create); |
| 328 | 328 | |
| 329 | 329 | //creating custom buttons |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | foreach ($this->_custom_button as $custom_button) { |
| 332 | 332 | $butt_custom = new XoopsFormButton('', $custom_button['name'], $custom_button['caption'], 'submit'); |
| 333 | 333 | if ($custom_button['onclick']) { |
| 334 | - $butt_custom->setExtra('onclick="' . $custom_button['onclick'] . '"'); |
|
| 334 | + $butt_custom->setExtra('onclick="'.$custom_button['onclick'].'"'); |
|
| 335 | 335 | } |
| 336 | 336 | $button_tray->addElement($butt_custom); |
| 337 | 337 | unset($butt_custom); |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | // creating the "cancel" button |
| 342 | 342 | $butt_cancel = new XoopsFormButton('', 'cancel_button', _CO_SOBJECT_CANCEL, 'button'); |
| 343 | 343 | if ($this->_cancel_js_action) { |
| 344 | - $butt_cancel->setExtra('onclick="' . $this->_cancel_js_action . '"'); |
|
| 344 | + $butt_cancel->setExtra('onclick="'.$this->_cancel_js_action.'"'); |
|
| 345 | 345 | } else { |
| 346 | 346 | $butt_cancel->setExtra('onclick="history.go(-1)"'); |
| 347 | 347 | } |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | { |
| 360 | 360 | switch ($controlName) { |
| 361 | 361 | case 'check': |
| 362 | - include_once(SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformcheckelement.php'); |
|
| 362 | + include_once(SMARTOBJECT_ROOT_PATH.'class/form/elements/smartformcheckelement.php'); |
|
| 363 | 363 | $control = $this->targetObject->getControl($key); |
| 364 | 364 | $controlObj = new SmartFormCheckElement($this->targetObject->vars[$key]['form_caption'], $key, $this->targetObject->getVar($key)); |
| 365 | 365 | $controlObj->addOptionArray($control['options']); |
@@ -426,38 +426,38 @@ discard block |
||
| 426 | 426 | break; |
| 427 | 427 | |
| 428 | 428 | case 'urllink': |
| 429 | - include_once(SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformurllinkelement.php'); |
|
| 429 | + include_once(SMARTOBJECT_ROOT_PATH.'class/form/elements/smartformurllinkelement.php'); |
|
| 430 | 430 | |
| 431 | 431 | return new SmartFormUrlLinkElement($this->targetObject->vars[$key]['form_caption'], $key, $this->targetObject->getUrlLinkObj($key)); |
| 432 | 432 | break; |
| 433 | 433 | |
| 434 | 434 | case 'richfile': |
| 435 | - include_once(SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformrichfileelement.php'); |
|
| 435 | + include_once(SMARTOBJECT_ROOT_PATH.'class/form/elements/smartformrichfileelement.php'); |
|
| 436 | 436 | |
| 437 | 437 | return new SmartFormRichFileElement($this->targetObject->vars[$key]['form_caption'], $key, $this->targetObject->getFileObj($key)); |
| 438 | 438 | break; |
| 439 | 439 | case 'section': |
| 440 | - include_once(SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformsection.php'); |
|
| 440 | + include_once(SMARTOBJECT_ROOT_PATH.'class/form/elements/smartformsection.php'); |
|
| 441 | 441 | |
| 442 | 442 | return new SmartFormSection($key, $this->targetObject->vars[$key]['form_caption']); |
| 443 | 443 | break; |
| 444 | 444 | |
| 445 | 445 | default: |
| 446 | - $classname = 'SmartForm' . ucfirst($controlName) . 'Element'; |
|
| 446 | + $classname = 'SmartForm'.ucfirst($controlName).'Element'; |
|
| 447 | 447 | if (!class_exists($classname)) { |
| 448 | - if (file_exists(SMARTOBJECT_ROOT_PATH . 'class/form/elements/' . strtolower($classname) . '.php')) { |
|
| 449 | - include_once(SMARTOBJECT_ROOT_PATH . 'class/form/elements/' . strtolower($classname) . '.php'); |
|
| 448 | + if (file_exists(SMARTOBJECT_ROOT_PATH.'class/form/elements/'.strtolower($classname).'.php')) { |
|
| 449 | + include_once(SMARTOBJECT_ROOT_PATH.'class/form/elements/'.strtolower($classname).'.php'); |
|
| 450 | 450 | } else { |
| 451 | 451 | // perhaps this is a control created by the module |
| 452 | 452 | $moduleName = $this->targetObject->handler->_moduleName; |
| 453 | - $moduleFormElementsPath = $this->targetObject->handler->_modulePath . 'class/form/elements/'; |
|
| 454 | - $classname = ucfirst($moduleName) . ucfirst($controlName) . 'Element'; |
|
| 455 | - $classFileName = strtolower($classname) . '.php'; |
|
| 453 | + $moduleFormElementsPath = $this->targetObject->handler->_modulePath.'class/form/elements/'; |
|
| 454 | + $classname = ucfirst($moduleName).ucfirst($controlName).'Element'; |
|
| 455 | + $classFileName = strtolower($classname).'.php'; |
|
| 456 | 456 | |
| 457 | - if (file_exists($moduleFormElementsPath . $classFileName)) { |
|
| 458 | - include_once($moduleFormElementsPath . $classFileName); |
|
| 457 | + if (file_exists($moduleFormElementsPath.$classFileName)) { |
|
| 458 | + include_once($moduleFormElementsPath.$classFileName); |
|
| 459 | 459 | } else { |
| 460 | - trigger_error($classname . ' Not found', E_USER_WARNING); |
|
| 460 | + trigger_error($classname.' Not found', E_USER_WARNING); |
|
| 461 | 461 | |
| 462 | 462 | return new XoopsFormLabel(); //Empty object |
| 463 | 463 | } |
@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | $editor_configs['height'] = '400px'; |
| 527 | 527 | |
| 528 | 528 | $dhtml = true; |
| 529 | - $xoopseditorclass = XOOPS_ROOT_PATH . '/class/xoopsform/formeditor.php'; |
|
| 529 | + $xoopseditorclass = XOOPS_ROOT_PATH.'/class/xoopsform/formeditor.php'; |
|
| 530 | 530 | |
| 531 | 531 | if (file_exists($xoopseditorclass)) { |
| 532 | 532 | include_once($xoopseditorclass); |
@@ -536,8 +536,8 @@ discard block |
||
| 536 | 536 | |
| 537 | 537 | case 'tiny': |
| 538 | 538 | if (!$xoops22) { |
| 539 | - if (is_readable(XOOPS_ROOT_PATH . '/class/xoopseditor/tinyeditor/formtinytextarea.php')) { |
|
| 540 | - include_once(XOOPS_ROOT_PATH . '/class/xoopseditor/tinyeditor/formtinytextarea.php'); |
|
| 539 | + if (is_readable(XOOPS_ROOT_PATH.'/class/xoopseditor/tinyeditor/formtinytextarea.php')) { |
|
| 540 | + include_once(XOOPS_ROOT_PATH.'/class/xoopseditor/tinyeditor/formtinytextarea.php'); |
|
| 541 | 541 | $editor = new XoopsFormTinyTextArea(array('caption' => $caption, 'name' => $name, 'value' => $value, 'width' => '100%', 'height' => '300px'), true); |
| 542 | 542 | } else { |
| 543 | 543 | if ($dhtml) { |
@@ -561,8 +561,8 @@ discard block |
||
| 561 | 561 | |
| 562 | 562 | case 'fckeditor': |
| 563 | 563 | if (!$xoops22) { |
| 564 | - if (is_readable(XOOPS_ROOT_PATH . '/class/xoopseditor/fckeditor/formfckeditor.php')) { |
|
| 565 | - include_once(XOOPS_ROOT_PATH . '/class/xoopseditor/fckeditor/formfckeditor.php'); |
|
| 564 | + if (is_readable(XOOPS_ROOT_PATH.'/class/xoopseditor/fckeditor/formfckeditor.php')) { |
|
| 565 | + include_once(XOOPS_ROOT_PATH.'/class/xoopseditor/fckeditor/formfckeditor.php'); |
|
| 566 | 566 | $editor = new XoopsFormFckeditor(array('caption' => $caption, 'name' => $name, 'value' => $value, 'width' => '100%', 'height' => '300px'), true); |
| 567 | 567 | } else { |
| 568 | 568 | if ($dhtml) { |
@@ -578,8 +578,8 @@ discard block |
||
| 578 | 578 | |
| 579 | 579 | case 'inbetween': |
| 580 | 580 | if (!$xoops22) { |
| 581 | - if (is_readable(XOOPS_ROOT_PATH . '/class/xoopseditor/inbetween/forminbetweentextarea.php')) { |
|
| 582 | - include_once(XOOPS_ROOT_PATH . '/class/xoopseditor/inbetween/forminbetweentextarea.php'); |
|
| 581 | + if (is_readable(XOOPS_ROOT_PATH.'/class/xoopseditor/inbetween/forminbetweentextarea.php')) { |
|
| 582 | + include_once(XOOPS_ROOT_PATH.'/class/xoopseditor/inbetween/forminbetweentextarea.php'); |
|
| 583 | 583 | $editor = new XoopsFormInbetweenTextArea(array('caption' => $caption, 'name' => $name, 'value' => $value, 'width' => '100%', 'height' => '300px'), true); |
| 584 | 584 | } else { |
| 585 | 585 | if ($dhtml) { |
@@ -595,8 +595,8 @@ discard block |
||
| 595 | 595 | |
| 596 | 596 | case 'koivi': |
| 597 | 597 | if (!$xoops22) { |
| 598 | - if (is_readable(XOOPS_ROOT_PATH . '/class/wysiwyg/formwysiwygtextarea.php')) { |
|
| 599 | - include_once(XOOPS_ROOT_PATH . '/class/wysiwyg/formwysiwygtextarea.php'); |
|
| 598 | + if (is_readable(XOOPS_ROOT_PATH.'/class/wysiwyg/formwysiwygtextarea.php')) { |
|
| 599 | + include_once(XOOPS_ROOT_PATH.'/class/wysiwyg/formwysiwygtextarea.php'); |
|
| 600 | 600 | $editor = new XoopsFormWysiwygTextArea($caption, $name, $value, '100%', '400px'); |
| 601 | 601 | } else { |
| 602 | 602 | if ($dhtml) { |
@@ -612,8 +612,8 @@ discard block |
||
| 612 | 612 | |
| 613 | 613 | case 'spaw': |
| 614 | 614 | if (!$xoops22) { |
| 615 | - if (is_readable(XOOPS_ROOT_PATH . '/class/spaw/formspaw.php')) { |
|
| 616 | - include_once(XOOPS_ROOT_PATH . '/class/spaw/formspaw.php'); |
|
| 615 | + if (is_readable(XOOPS_ROOT_PATH.'/class/spaw/formspaw.php')) { |
|
| 616 | + include_once(XOOPS_ROOT_PATH.'/class/spaw/formspaw.php'); |
|
| 617 | 617 | $editor = new XoopsFormSpaw($caption, $name, $value); |
| 618 | 618 | } |
| 619 | 619 | } else { |
@@ -623,8 +623,8 @@ discard block |
||
| 623 | 623 | |
| 624 | 624 | case 'htmlarea': |
| 625 | 625 | if (!$xoops22) { |
| 626 | - if (is_readable(XOOPS_ROOT_PATH . '/class/htmlarea/formhtmlarea.php')) { |
|
| 627 | - include_once(XOOPS_ROOT_PATH . '/class/htmlarea/formhtmlarea.php'); |
|
| 626 | + if (is_readable(XOOPS_ROOT_PATH.'/class/htmlarea/formhtmlarea.php')) { |
|
| 627 | + include_once(XOOPS_ROOT_PATH.'/class/htmlarea/formhtmlarea.php'); |
|
| 628 | 628 | $editor = new XoopsFormHtmlarea($caption, $name, $value); |
| 629 | 629 | } |
| 630 | 630 | } else { |
@@ -660,10 +660,10 @@ discard block |
||
| 660 | 660 | $size = $multiple ? 5 : 1; |
| 661 | 661 | $theme_select = new XoopsFormSelect($var['form_caption'], $key, $this->targetObject->getVar($key), $size, $multiple); |
| 662 | 662 | |
| 663 | - $handle = opendir(XOOPS_THEME_PATH . '/'); |
|
| 663 | + $handle = opendir(XOOPS_THEME_PATH.'/'); |
|
| 664 | 664 | $dirlist = array(); |
| 665 | 665 | while (false !== ($file = readdir($handle))) { |
| 666 | - if (is_dir(XOOPS_THEME_PATH . '/' . $file) && !preg_match("/^[.]{1,2}$/", $file) && strtolower($file) !== 'cvs') { |
|
| 666 | + if (is_dir(XOOPS_THEME_PATH.'/'.$file) && !preg_match("/^[.]{1,2}$/", $file) && strtolower($file) !== 'cvs') { |
|
| 667 | 667 | $dirlist[$file] = $file; |
| 668 | 668 | } |
| 669 | 669 | } |
@@ -684,7 +684,7 @@ discard block |
||
| 684 | 684 | { |
| 685 | 685 | foreach ($this->_elements as $eleObj) { |
| 686 | 686 | if ($eleObj->getName() == $keyname) { |
| 687 | - $ret =& $eleObj; |
|
| 687 | + $ret = & $eleObj; |
|
| 688 | 688 | break; |
| 689 | 689 | } |
| 690 | 690 | } |
@@ -702,21 +702,21 @@ discard block |
||
| 702 | 702 | $required = $this->getRequired(); |
| 703 | 703 | $ret = " |
| 704 | 704 | <form name='" . |
| 705 | - $this->getName() . |
|
| 706 | - "' id='" . |
|
| 707 | - $this->getName() . |
|
| 708 | - "' action='" . |
|
| 709 | - $this->getAction() . |
|
| 710 | - "' method='" . |
|
| 711 | - $this->getMethod() . |
|
| 712 | - "' onsubmit='return xoopsFormValidate_" . |
|
| 713 | - $this->getName() . |
|
| 714 | - "(this);'" . |
|
| 715 | - $this->getExtra() . |
|
| 705 | + $this->getName(). |
|
| 706 | + "' id='". |
|
| 707 | + $this->getName(). |
|
| 708 | + "' action='". |
|
| 709 | + $this->getAction(). |
|
| 710 | + "' method='". |
|
| 711 | + $this->getMethod(). |
|
| 712 | + "' onsubmit='return xoopsFormValidate_". |
|
| 713 | + $this->getName(). |
|
| 714 | + "(this);'". |
|
| 715 | + $this->getExtra(). |
|
| 716 | 716 | "> |
| 717 | 717 | <table width='100%' class='outer' cellspacing='1'> |
| 718 | 718 | <tr><th colspan='2'>" . |
| 719 | - $this->getTitle() . |
|
| 719 | + $this->getTitle(). |
|
| 720 | 720 | '</th></tr> |
| 721 | 721 | '; |
| 722 | 722 | $hidden = ''; |
@@ -726,11 +726,11 @@ discard block |
||
| 726 | 726 | $ret .= $ele; |
| 727 | 727 | } elseif (!$ele->isHidden()) { |
| 728 | 728 | //$class = ( $class == 'even' ) ? 'odd': 'even'; |
| 729 | - $ret .= "<tr id='" . $ele->getName() . "' valign='top' align='left'><td class='head'>" . $ele->getCaption(); |
|
| 729 | + $ret .= "<tr id='".$ele->getName()."' valign='top' align='left'><td class='head'>".$ele->getCaption(); |
|
| 730 | 730 | if ($ele->getDescription() !== '') { |
| 731 | - $ret .= '<br><br><span style="font-weight: normal;">' . $ele->getDescription() . '</span>'; |
|
| 731 | + $ret .= '<br><br><span style="font-weight: normal;">'.$ele->getDescription().'</span>'; |
|
| 732 | 732 | } |
| 733 | - $ret .= "</td><td class='$class'>" . $ele->render() . "</td></tr>\n"; |
|
| 733 | + $ret .= "</td><td class='$class'>".$ele->render()."</td></tr>\n"; |
|
| 734 | 734 | } else { |
| 735 | 735 | $hidden .= $ele->render(); |
| 736 | 736 | } |
@@ -776,7 +776,7 @@ discard block |
||
| 776 | 776 | 'name' => $this->getName(), |
| 777 | 777 | 'action' => $this->getAction(), |
| 778 | 778 | 'method' => $this->getMethod(), |
| 779 | - 'extra' => 'onsubmit="return xoopsFormValidate_' . $this->getName() . '(this);"' . $this->getExtra(), |
|
| 779 | + 'extra' => 'onsubmit="return xoopsFormValidate_'.$this->getName().'(this);"'.$this->getExtra(), |
|
| 780 | 780 | 'javascript' => $js, |
| 781 | 781 | 'elements' => $elements |
| 782 | 782 | )); |
@@ -844,15 +844,15 @@ discard block |
||
| 844 | 844 | window.alert(\"{$eltmsg}\"); myform['{$eltname}'][0].focus(); return false; }\n"; |
| 845 | 845 | } |
| 846 | 846 | } else { |
| 847 | - $js .= "if ( myform.{$eltname}.value == \"\" ) " . "{ window.alert(\"{$eltmsg}\"); myform.{$eltname}.focus(); return false; }\n"; |
|
| 847 | + $js .= "if ( myform.{$eltname}.value == \"\" ) "."{ window.alert(\"{$eltmsg}\"); myform.{$eltname}.focus(); return false; }\n"; |
|
| 848 | 848 | } |
| 849 | 849 | } |
| 850 | 850 | // Now, handle custom validation code |
| 851 | - $elements =& $this->getElements(true); |
|
| 851 | + $elements = & $this->getElements(true); |
|
| 852 | 852 | foreach ($elements as $elt) { |
| 853 | 853 | if (method_exists($elt, 'renderValidationJS') && strtolower(get_class($elt)) !== 'xoopsformcheckbox') { |
| 854 | 854 | if ($eltjs = $elt->renderValidationJS()) { |
| 855 | - $js .= $eltjs . "\n"; |
|
| 855 | + $js .= $eltjs."\n"; |
|
| 856 | 856 | } |
| 857 | 857 | } |
| 858 | 858 | } |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | global $xoopsDB; |
| 33 | 33 | $ret = array(); |
| 34 | 34 | $limit = $start = 0; |
| 35 | - $sql = 'SELECT uid, uname FROM ' . $xoopsDB->prefix('users'); |
|
| 35 | + $sql = 'SELECT uid, uname FROM '.$xoopsDB->prefix('users'); |
|
| 36 | 36 | $sql .= ' ORDER BY uname ASC'; |
| 37 | 37 | |
| 38 | 38 | $result = $xoopsDB->query($sql); |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | $var = $object->vars[$key]; |
| 23 | 23 | $control = $object->controls[$key]; |
| 24 | 24 | |
| 25 | - parent::__construct($var['form_caption'], '<br><br>', $key . '_signature_tray'); |
|
| 25 | + parent::__construct($var['form_caption'], '<br><br>', $key.'_signature_tray'); |
|
| 26 | 26 | |
| 27 | 27 | $signature_textarea = new XoopsFormDhtmlTextArea('', $key, $object->getVar($key, 'e')); |
| 28 | 28 | $this->addElement($signature_textarea); |