@@ -19,11 +19,11 @@ |
||
| 19 | 19 | |
| 20 | 20 | use XoopsModules\Smartobject; |
| 21 | 21 | |
| 22 | -require_once __DIR__ . '/../../../include/cp_header.php'; |
|
| 22 | +require_once __DIR__.'/../../../include/cp_header.php'; |
|
| 23 | 23 | //require_once $GLOBALS['xoops']->path('www/class/xoopsformloader.php'); |
| 24 | 24 | |
| 25 | 25 | //require_once __DIR__ . '/../class/Utility.php'; |
| 26 | -require_once __DIR__ . '/../include/common.php'; |
|
| 26 | +require_once __DIR__.'/../include/common.php'; |
|
| 27 | 27 | |
| 28 | 28 | $moduleDirName = basename(dirname(__DIR__)); |
| 29 | 29 | $helper = Smartobject\Helper::getInstance(); |
@@ -47,9 +47,9 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | -require_once __DIR__ . '/admin_header.php'; |
|
| 50 | +require_once __DIR__.'/admin_header.php'; |
|
| 51 | 51 | //require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
| 52 | -require_once SMARTOBJECT_ROOT_PATH . 'class/adsense.php'; |
|
| 52 | +require_once SMARTOBJECT_ROOT_PATH.'class/adsense.php'; |
|
| 53 | 53 | |
| 54 | 54 | //$helper = \XoopsModules\Smartobject\Helper::getInstance(); |
| 55 | 55 | //$helper = Smartobject\Helper::getInstance(); |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | break; |
| 90 | 90 | |
| 91 | 91 | case 'addadsense': |
| 92 | - if (@require_once SMARTOBJECT_ROOT_PATH . 'include/captcha/captcha.php') { |
|
| 92 | + if (@require_once SMARTOBJECT_ROOT_PATH.'include/captcha/captcha.php') { |
|
| 93 | 93 | $xoopsCaptcha = XoopsCaptcha::getInstance(); |
| 94 | 94 | if (!$xoopsCaptcha->verify()) { |
| 95 | 95 | redirect_header('javascript:history.go(-1);', 3, $xoopsCaptcha->getMessage()); |
@@ -164,4 +164,4 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | //Smartobject\Utility::getModFooter(); |
| 166 | 166 | //xoops_cp_footer(); |
| 167 | -require_once __DIR__ . '/admin_footer.php'; |
|
| 167 | +require_once __DIR__.'/admin_footer.php'; |
|
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | -require_once __DIR__ . '/admin_header.php'; |
|
| 43 | +require_once __DIR__.'/admin_header.php'; |
|
| 44 | 44 | //require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
| 45 | 45 | //require_once SMARTOBJECT_ROOT_PATH . 'class/currency.php'; |
| 46 | 46 | $smartobjectCurrencyHandler = Smartobject\Helper::getInstance()->getHandler('Currency'); |
@@ -71,9 +71,9 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | if (isset($_POST['default_currency'])) { |
| 73 | 73 | $newDefaultCurrency = $_POST['default_currency']; |
| 74 | - $sql = 'UPDATE ' . $smartobjectCurrencyHandler->table . ' SET default_currency=0'; |
|
| 74 | + $sql = 'UPDATE '.$smartobjectCurrencyHandler->table.' SET default_currency=0'; |
|
| 75 | 75 | $smartobjectCurrencyHandler->query($sql); |
| 76 | - $sql = 'UPDATE ' . $smartobjectCurrencyHandler->table . ' SET default_currency=1 WHERE currencyid=' . $newDefaultCurrency; |
|
| 76 | + $sql = 'UPDATE '.$smartobjectCurrencyHandler->table.' SET default_currency=1 WHERE currencyid='.$newDefaultCurrency; |
|
| 77 | 77 | $smartobjectCurrencyHandler->query($sql); |
| 78 | 78 | } |
| 79 | 79 | |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | case 'addcurrency': |
| 94 | 94 | // require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
| 95 | 95 | $controller = new ObjectController($smartobjectCurrencyHandler); |
| 96 | - $controller->storeFromDefaultForm(_AM_SOBJECT_CURRENCIES_CREATED, _AM_SOBJECT_CURRENCIES_MODIFIED, SMARTOBJECT_URL . 'admin/currency.php'); |
|
| 96 | + $controller->storeFromDefaultForm(_AM_SOBJECT_CURRENCIES_CREATED, _AM_SOBJECT_CURRENCIES_MODIFIED, SMARTOBJECT_URL.'admin/currency.php'); |
|
| 97 | 97 | |
| 98 | 98 | break; |
| 99 | 99 | |
@@ -134,4 +134,4 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | //Smartobject\Utility::getModFooter(); |
| 136 | 136 | //xoops_cp_footer(); |
| 137 | -require_once __DIR__ . '/admin_footer.php'; |
|
| 137 | +require_once __DIR__.'/admin_footer.php'; |
|
@@ -10,8 +10,8 @@ discard block |
||
| 10 | 10 | use XoopsModules\Wfdownloads; |
| 11 | 11 | use XoopsModules\Smartobject; |
| 12 | 12 | |
| 13 | -require_once __DIR__ . '/admin_header.php'; |
|
| 14 | -require_once SMARTCONTENT_ROOT_PATH . 'class/dbupdater.php'; |
|
| 13 | +require_once __DIR__.'/admin_header.php'; |
|
| 14 | +require_once SMARTCONTENT_ROOT_PATH.'class/dbupdater.php'; |
|
| 15 | 15 | |
| 16 | 16 | smartcontent_xoops_cp_header(); |
| 17 | 17 | |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | global $xoopsDB; |
| 220 | 220 | $helperWfdownloads = \Xmf\Module\Helper::getHelper('wfdownloads'); |
| 221 | 221 | $catHandler = $helperWfdownloads->getHandler('Category'); |
| 222 | - $result = $xoopsDB->query('SHOW COLUMNS FROM ' . $catHandler->table); |
|
| 222 | + $result = $xoopsDB->query('SHOW COLUMNS FROM '.$catHandler->table); |
|
| 223 | 223 | while (false !== ($existing_field = $xoopsDB->fetchArray($result))) { |
| 224 | 224 | $fields[$existing_field['field']] = $existing_field['type']; |
| 225 | 225 | } |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | //$xoopsDB->query("ALTER TABLE ".$table." ADD ".$field." ".$type); |
| 279 | 279 | //echo $field."(".$type.") <FONT COLOR='##22DD51'>Added</FONT><br>"; |
| 280 | 280 | } elseif ($existing_fields[$field] != $type) { |
| 281 | - $table->addAlteredField($field, $field . ' ' . $type); |
|
| 281 | + $table->addAlteredField($field, $field.' '.$type); |
|
| 282 | 282 | // check $fields[$field]['type'] for things like "int(10) unsigned" |
| 283 | 283 | //$xoopsDB->query("ALTER TABLE ".$table." CHANGE ".$field." ".$field." ".$type); |
| 284 | 284 | //echo $field." <FONT COLOR='#FF6600'>Changed to</FONT> ".$type."<br>"; |
@@ -299,17 +299,17 @@ discard block |
||
| 299 | 299 | function get_table_info($table, $default_fields) |
| 300 | 300 | { |
| 301 | 301 | global $xoopsDB; |
| 302 | - $result = $xoopsDB->query('SHOW COLUMNS FROM ' . $table); |
|
| 302 | + $result = $xoopsDB->query('SHOW COLUMNS FROM '.$table); |
|
| 303 | 303 | while (false !== ($existing_field = $xoopsDB->fetchArray($result))) { |
| 304 | 304 | $fields[$existing_field['Field']] = $existing_field['Type']; |
| 305 | 305 | if ('YES' !== $existing_field['Null']) { |
| 306 | 306 | $fields[$existing_field['Field']] .= ' NOT NULL'; |
| 307 | 307 | } |
| 308 | 308 | if ($existing_field['Extra']) { |
| 309 | - $fields[$existing_field['Field']] .= ' ' . $existing_field['Extra']; |
|
| 309 | + $fields[$existing_field['Field']] .= ' '.$existing_field['Extra']; |
|
| 310 | 310 | } |
| 311 | 311 | if ($default_fields[$existing_field['Field']]['Default']) { |
| 312 | - $fields[$existing_field['Field']] .= " default '" . $existing_field['Default'] . "'"; |
|
| 312 | + $fields[$existing_field['Field']] .= " default '".$existing_field['Default']."'"; |
|
| 313 | 313 | } |
| 314 | 314 | } |
| 315 | 315 | |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | if (in_array($field, array_keys($renamed_fields))) { |
| 332 | 332 | $new_field_name = $renamed_fields[$field]; |
| 333 | 333 | $new_field_type = $new_fields[$new_field_name]['Type']; |
| 334 | - $table->addAltered($field, $new_field_name . ' ' . $new_field_type); |
|
| 334 | + $table->addAltered($field, $new_field_name.' '.$new_field_type); |
|
| 335 | 335 | //$xoopsDB->query("ALTER TABLE ".$table." CHANGE ".$field." ".$new_field_name." ".$new_field_type); |
| 336 | 336 | //echo $field." Renamed to ".$new_field_name."<br>"; |
| 337 | 337 | $fields[$new_field_name] = $new_field_type; |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | |
| 360 | 360 | default: |
| 361 | 361 | //ask what to do |
| 362 | - include XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 362 | + include XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 363 | 363 | $form = new \XoopsThemeForm('Upgrade WF-Downloads', 'form', $_SERVER['REQUEST_URI']); |
| 364 | 364 | |
| 365 | 365 | //Is MyDownloads installed? |
@@ -384,4 +384,4 @@ discard block |
||
| 384 | 384 | } |
| 385 | 385 | //wfdownloads_modFooter(); |
| 386 | 386 | //xoops_cp_footer(); |
| 387 | -require_once __DIR__ . '/admin_footer.php'; |
|
| 387 | +require_once __DIR__.'/admin_footer.php'; |
|
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | -require_once __DIR__ . '/admin_header.php'; |
|
| 48 | +require_once __DIR__.'/admin_header.php'; |
|
| 49 | 49 | Smartobject\Utility::loadLanguageFile('smartobject', 'customtag'); |
| 50 | 50 | |
| 51 | 51 | //require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
@@ -158,4 +158,4 @@ discard block |
||
| 158 | 158 | |
| 159 | 159 | //Smartobject\Utility::getModFooter(); |
| 160 | 160 | //xoops_cp_footer(); |
| 161 | -require_once __DIR__ . '/admin_footer.php'; |
|
| 161 | +require_once __DIR__.'/admin_footer.php'; |
|
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | -require_once __DIR__ . '/admin_header.php'; |
|
| 59 | +require_once __DIR__.'/admin_header.php'; |
|
| 60 | 60 | //require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
| 61 | 61 | //require_once SMARTOBJECT_ROOT_PATH . 'class/rating.php'; |
| 62 | 62 | $smartobjectRatingHandler = Smartobject\Helper::getInstance()->getHandler('Rating'); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | case 'addrating': |
| 87 | 87 | // require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
| 88 | 88 | $controller = new XoopsModules\Smartobject\ObjectController($smartobjectRatingHandler); |
| 89 | - $controller->storeFromDefaultForm(_AM_SOBJECT_RATINGS_CREATED, _AM_SOBJECT_RATINGS_MODIFIED, SMARTOBJECT_URL . 'admin/rating.php'); |
|
| 89 | + $controller->storeFromDefaultForm(_AM_SOBJECT_RATINGS_CREATED, _AM_SOBJECT_RATINGS_MODIFIED, SMARTOBJECT_URL.'admin/rating.php'); |
|
| 90 | 90 | |
| 91 | 91 | break; |
| 92 | 92 | |
@@ -154,4 +154,4 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | //Smartobject\Utility::getModFooter(); |
| 156 | 156 | //xoops_cp_footer(); |
| 157 | -require_once __DIR__ . '/admin_footer.php'; |
|
| 157 | +require_once __DIR__.'/admin_footer.php'; |
|
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | |
| 214 | 214 | $titleTag = []; |
| 215 | 215 | |
| 216 | - $show_mod_name_breadcrumb = null !==($helper->getConfig('show_mod_name_breadcrumb')) ? $helper->getConfig('show_mod_name_breadcrumb') : true; |
|
| 216 | + $show_mod_name_breadcrumb = null !== ($helper->getConfig('show_mod_name_breadcrumb')) ? $helper->getConfig('show_mod_name_breadcrumb') : true; |
|
| 217 | 217 | |
| 218 | 218 | if ($moduleName && $show_mod_name_breadcrumb) { |
| 219 | 219 | $titleTag['module'] = $moduleName; |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | /** @var Smartobject\Helper $helper */ |
| 271 | 271 | $helper = Smartobject\Helper::getInstance(); |
| 272 | 272 | |
| 273 | - if (null !== ($helper->getConfig('module_meta_description'))) { |
|
| 273 | + if (null !== ($helper->getConfig('module_meta_description'))) { |
|
| 274 | 274 | $description = $helper->getConfig('module_meta_description'); |
| 275 | 275 | } |
| 276 | 276 | } |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | /** @var Smartobject\Helper $helper */ |
| 366 | 366 | $helper = Smartobject\Helper::getInstance(); |
| 367 | 367 | |
| 368 | - $keywords = $this->findMetaKeywords($this->_original_title . ' ' . $this->_description, $this->_minChar); |
|
| 368 | + $keywords = $this->findMetaKeywords($this->_original_title.' '.$this->_description, $this->_minChar); |
|
| 369 | 369 | if (null !== ($helper->getModule()) && null !== ($helper->getConfig('moduleMetaKeywords')) |
| 370 | 370 | && '' !== $helper->getConfig('moduleMetaKeywords')) { |
| 371 | 371 | $moduleKeywords = explode(',', $helper->getConfig('moduleMetaKeywords')); |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
| 19 | 19 | |
| 20 | -require_once XOOPS_ROOT_PATH . '/modules/smartobject/include/common.php'; |
|
| 20 | +require_once XOOPS_ROOT_PATH.'/modules/smartobject/include/common.php'; |
|
| 21 | 21 | |
| 22 | 22 | if (!defined('XOBJ_DTYPE_SIMPLE_ARRAY')) { |
| 23 | 23 | define('XOBJ_DTYPE_SIMPLE_ARRAY', 101); |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | public function closeSection($section_name) |
| 118 | 118 | { |
| 119 | - $this->initVar('close_section_' . $section_name, XOBJ_DTYPE_FORM_SECTION_CLOSE, '', false, null, '', false, '', '', false, false, true); |
|
| 119 | + $this->initVar('close_section_'.$section_name, XOBJ_DTYPE_FORM_SECTION_CLOSE, '', false, null, '', false, '', '', false, false, true); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /** |
@@ -154,13 +154,13 @@ discard block |
||
| 154 | 154 | } |
| 155 | 155 | parent::initVar($key, $data_type, $value, $required, $maxlength, $options); |
| 156 | 156 | if ($this->handler && (!$form_caption || '' === $form_caption)) { |
| 157 | - $dyn_form_caption = strtoupper('_CO_' . $this->handler->_moduleName . '_' . $this->handler->_itemname . '_' . $key); |
|
| 157 | + $dyn_form_caption = strtoupper('_CO_'.$this->handler->_moduleName.'_'.$this->handler->_itemname.'_'.$key); |
|
| 158 | 158 | if (defined($dyn_form_caption)) { |
| 159 | 159 | $form_caption = constant($dyn_form_caption); |
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | 162 | if ($this->handler && (!$form_dsc || '' === $form_dsc)) { |
| 163 | - $dyn_form_dsc = strtoupper('_CO_' . $this->handler->_moduleName . '_' . $this->handler->_itemname . '_' . $key . '_DSC'); |
|
| 163 | + $dyn_form_dsc = strtoupper('_CO_'.$this->handler->_moduleName.'_'.$this->handler->_itemname.'_'.$key.'_DSC'); |
|
| 164 | 164 | if (defined($dyn_form_dsc)) { |
| 165 | 165 | $form_dsc = constant($dyn_form_dsc); |
| 166 | 166 | } |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | public function toArray() |
| 457 | 457 | { |
| 458 | 458 | $ret = []; |
| 459 | - $vars =& $this->getVars(); |
|
| 459 | + $vars = & $this->getVars(); |
|
| 460 | 460 | foreach ($vars as $key => $var) { |
| 461 | 461 | $value = $this->getVar($key); |
| 462 | 462 | $ret[$key] = $value; |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | } |
| 506 | 506 | } else { |
| 507 | 507 | if ($prefix) { |
| 508 | - $err_str = '[' . $prefix . '] ' . $err_str; |
|
| 508 | + $err_str = '['.$prefix.'] '.$err_str; |
|
| 509 | 509 | } |
| 510 | 510 | parent::setErrors($err_str); |
| 511 | 511 | } |
@@ -789,7 +789,7 @@ discard block |
||
| 789 | 789 | /** @var Smartmedia\Helper $helper */ |
| 790 | 790 | $helper = Smartmedia\Helper::getInstance(); |
| 791 | 791 | |
| 792 | - $form_editor = null !==($helper->getConfig('default_editor')) ? $helper->getConfig('default_editor') : 'textarea'; |
|
| 792 | + $form_editor = null !== ($helper->getConfig('default_editor')) ? $helper->getConfig('default_editor') : 'textarea'; |
|
| 793 | 793 | } |
| 794 | 794 | |
| 795 | 795 | if ($editor) { |
@@ -836,8 +836,8 @@ discard block |
||
| 836 | 836 | $this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k)); |
| 837 | 837 | continue 2; |
| 838 | 838 | } |
| 839 | - if (isset($v['maxlength']) && strlen($cleanv) > (int)$v['maxlength']) { |
|
| 840 | - $this->setErrors(sprintf(_XOBJ_ERR_SHORTERTHAN, $k, (int)$v['maxlength'])); |
|
| 839 | + if (isset($v['maxlength']) && strlen($cleanv) > (int) $v['maxlength']) { |
|
| 840 | + $this->setErrors(sprintf(_XOBJ_ERR_SHORTERTHAN, $k, (int) $v['maxlength'])); |
|
| 841 | 841 | continue 2; |
| 842 | 842 | } |
| 843 | 843 | if (!$v['not_gpc']) { |
@@ -866,7 +866,7 @@ discard block |
||
| 866 | 866 | break; |
| 867 | 867 | case XOBJ_DTYPE_INT: |
| 868 | 868 | case XOBJ_DTYPE_TIME_ONLY: |
| 869 | - $cleanv = (int)$cleanv; |
|
| 869 | + $cleanv = (int) $cleanv; |
|
| 870 | 870 | break; |
| 871 | 871 | |
| 872 | 872 | case XOBJ_DTYPE_CURRENCY: |
@@ -897,10 +897,10 @@ discard block |
||
| 897 | 897 | continue 2; |
| 898 | 898 | } |
| 899 | 899 | if ('' !== $cleanv && !preg_match("/^http[s]*:\/\//i", $cleanv)) { |
| 900 | - $cleanv = 'http://' . $cleanv; |
|
| 900 | + $cleanv = 'http://'.$cleanv; |
|
| 901 | 901 | } |
| 902 | 902 | if (!$v['not_gpc']) { |
| 903 | - $cleanv =& $ts->stripSlashesGPC($cleanv); |
|
| 903 | + $cleanv = & $ts->stripSlashesGPC($cleanv); |
|
| 904 | 904 | } |
| 905 | 905 | break; |
| 906 | 906 | case XOBJ_DTYPE_SIMPLE_ARRAY: |
@@ -912,7 +912,7 @@ discard block |
||
| 912 | 912 | case XOBJ_DTYPE_STIME: |
| 913 | 913 | case XOBJ_DTYPE_MTIME: |
| 914 | 914 | case XOBJ_DTYPE_LTIME: |
| 915 | - $cleanv = !is_string($cleanv) ? (int)$cleanv : strtotime($cleanv); |
|
| 915 | + $cleanv = !is_string($cleanv) ? (int) $cleanv : strtotime($cleanv); |
|
| 916 | 916 | if (!($cleanv > 0)) { |
| 917 | 917 | $cleanv = strtotime($cleanv); |
| 918 | 918 | } |
@@ -921,7 +921,7 @@ discard block |
||
| 921 | 921 | break; |
| 922 | 922 | } |
| 923 | 923 | } |
| 924 | - $this->cleanVars[$k] =& $cleanv; |
|
| 924 | + $this->cleanVars[$k] = & $cleanv; |
|
| 925 | 925 | unset($cleanv); |
| 926 | 926 | } |
| 927 | 927 | if (count($this->_errors) > 0) { |
@@ -1146,10 +1146,10 @@ discard block |
||
| 1146 | 1146 | } |
| 1147 | 1147 | break; |
| 1148 | 1148 | case XOBJ_DTYPE_SIMPLE_ARRAY: |
| 1149 | - $ret =& explode('|', $ret); |
|
| 1149 | + $ret = & explode('|', $ret); |
|
| 1150 | 1150 | break; |
| 1151 | 1151 | case XOBJ_DTYPE_ARRAY: |
| 1152 | - $ret =& unserialize($ret); |
|
| 1152 | + $ret = & unserialize($ret); |
|
| 1153 | 1153 | break; |
| 1154 | 1154 | case XOBJ_DTYPE_SOURCE: |
| 1155 | 1155 | switch (strtolower($format)) { |
@@ -52,15 +52,15 @@ discard block |
||
| 52 | 52 | foreach (array_keys($smartObj->vars) as $key) { |
| 53 | 53 | switch ($smartObj->vars[$key]['data_type']) { |
| 54 | 54 | case XOBJ_DTYPE_IMAGE: |
| 55 | - if (isset($_POST['url_' . $key]) && '' !== $_POST['url_' . $key]) { |
|
| 56 | - $oldFile = $smartObj->getUploadDir(true) . $smartObj->getVar($key, 'e'); |
|
| 57 | - $smartObj->setVar($key, $_POST['url_' . $key]); |
|
| 55 | + if (isset($_POST['url_'.$key]) && '' !== $_POST['url_'.$key]) { |
|
| 56 | + $oldFile = $smartObj->getUploadDir(true).$smartObj->getVar($key, 'e'); |
|
| 57 | + $smartObj->setVar($key, $_POST['url_'.$key]); |
|
| 58 | 58 | if (file_exists($oldFile)) { |
| 59 | 59 | unlink($oldFile); |
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | - if (isset($_POST['delete_' . $key]) && '1' == $_POST['delete_' . $key]) { |
|
| 63 | - $oldFile = $smartObj->getUploadDir(true) . $smartObj->getVar($key, 'e'); |
|
| 62 | + if (isset($_POST['delete_'.$key]) && '1' == $_POST['delete_'.$key]) { |
|
| 63 | + $oldFile = $smartObj->getUploadDir(true).$smartObj->getVar($key, 'e'); |
|
| 64 | 64 | $smartObj->setVar($key, ''); |
| 65 | 65 | if (file_exists($oldFile)) { |
| 66 | 66 | unlink($oldFile); |
@@ -70,10 +70,10 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | case XOBJ_DTYPE_URLLINK: |
| 72 | 72 | $linkObj = $smartObj->getUrlLinkObj($key); |
| 73 | - $linkObj->setVar('caption', $_POST['caption_' . $key]); |
|
| 74 | - $linkObj->setVar('description', $_POST['desc_' . $key]); |
|
| 75 | - $linkObj->setVar('target', $_POST['target_' . $key]); |
|
| 76 | - $linkObj->setVar('url', $_POST['url_' . $key]); |
|
| 73 | + $linkObj->setVar('caption', $_POST['caption_'.$key]); |
|
| 74 | + $linkObj->setVar('description', $_POST['desc_'.$key]); |
|
| 75 | + $linkObj->setVar('target', $_POST['target_'.$key]); |
|
| 76 | + $linkObj->setVar('url', $_POST['url_'.$key]); |
|
| 77 | 77 | if ('' !== $linkObj->getVar('url')) { |
| 78 | 78 | $smartObj->storeUrlLinkObj($linkObj); |
| 79 | 79 | } |
@@ -82,11 +82,11 @@ discard block |
||
| 82 | 82 | break; |
| 83 | 83 | |
| 84 | 84 | case XOBJ_DTYPE_FILE: |
| 85 | - if (!isset($_FILES['upload_' . $key]['name']) || '' === $_FILES['upload_' . $key]['name']) { |
|
| 85 | + if (!isset($_FILES['upload_'.$key]['name']) || '' === $_FILES['upload_'.$key]['name']) { |
|
| 86 | 86 | $fileObj = $smartObj->getFileObj($key); |
| 87 | - $fileObj->setVar('caption', $_POST['caption_' . $key]); |
|
| 88 | - $fileObj->setVar('description', $_POST['desc_' . $key]); |
|
| 89 | - $fileObj->setVar('url', $_POST['url_' . $key]); |
|
| 87 | + $fileObj->setVar('caption', $_POST['caption_'.$key]); |
|
| 88 | + $fileObj->setVar('description', $_POST['desc_'.$key]); |
|
| 89 | + $fileObj->setVar('url', $_POST['url_'.$key]); |
|
| 90 | 90 | if (!('' === $fileObj->getVar('url') && '' === $fileObj->getVar('url') |
| 91 | 91 | && '' === $fileObj->getVar('url'))) { |
| 92 | 92 | $res = $smartObj->storeFileObj($fileObj); |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | $value = strtotime($_POST[$key]); |
| 111 | 111 | //if strtotime returns false, the value is already a time stamp |
| 112 | 112 | if (!$value) { |
| 113 | - $value = (int)$_POST[$key]; |
|
| 113 | + $value = (int) $_POST[$key]; |
|
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | $smartObj->setVar($key, $value); |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | if (isset($file_array['name']) && '' !== $file_array['name'] |
| 160 | 160 | && in_array(str_replace('upload_', '', $name), array_keys($smartObj->vars))) { |
| 161 | 161 | if ($uploaderObj->fetchMedia($name)) { |
| 162 | - $uploaderObj->setTargetFileName(time() . '_' . $uploaderObj->getMediaName()); |
|
| 162 | + $uploaderObj->setTargetFileName(time().'_'.$uploaderObj->getMediaName()); |
|
| 163 | 163 | if ($uploaderObj->upload()) { |
| 164 | 164 | // Find the related field in the SmartObject |
| 165 | 165 | $related_field = str_replace('upload_', '', $name); |
@@ -168,14 +168,14 @@ discard block |
||
| 168 | 168 | if (XOBJ_DTYPE_FILE === $smartObj->vars[$related_field]['data_type']) { |
| 169 | 169 | $object_fileurl = $smartObj->getUploadDir(); |
| 170 | 170 | $fileObj = $smartObj->getFileObj($related_field); |
| 171 | - $fileObj->setVar('url', $object_fileurl . $uploaderObj->getSavedFileName()); |
|
| 172 | - $fileObj->setVar('caption', $_POST['caption_' . $related_field]); |
|
| 173 | - $fileObj->setVar('description', $_POST['desc_' . $related_field]); |
|
| 171 | + $fileObj->setVar('url', $object_fileurl.$uploaderObj->getSavedFileName()); |
|
| 172 | + $fileObj->setVar('caption', $_POST['caption_'.$related_field]); |
|
| 173 | + $fileObj->setVar('description', $_POST['desc_'.$related_field]); |
|
| 174 | 174 | $smartObj->storeFileObj($fileObj); |
| 175 | 175 | //todo: catch errors |
| 176 | 176 | $smartObj->setVar($related_field, $fileObj->getVar('fileid')); |
| 177 | 177 | } else { |
| 178 | - $old_file = $smartObj->getUploadDir(true) . $smartObj->getVar($related_field); |
|
| 178 | + $old_file = $smartObj->getUploadDir(true).$smartObj->getVar($related_field); |
|
| 179 | 179 | unlink($old_file); |
| 180 | 180 | $smartObj->setVar($related_field, $uploaderObj->getSavedFileName()); |
| 181 | 181 | } |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | return $smartObj; |
| 207 | 207 | } else { |
| 208 | 208 | if (!$storeResult) { |
| 209 | - redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $smartObj->getHtmlErrors()); |
|
| 209 | + redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR.$smartObj->getHtmlErrors()); |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | $redirect_page = $redirect_page ?: Smartobject\Utility::getPageBeforeForm(); |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | $debug = false, |
| 236 | 236 | $x_param = false |
| 237 | 237 | ) { |
| 238 | - $objectid = isset($_POST[$this->handler->keyName]) ? (int)$_POST[$this->handler->keyName] : 0; |
|
| 238 | + $objectid = isset($_POST[$this->handler->keyName]) ? (int) $_POST[$this->handler->keyName] : 0; |
|
| 239 | 239 | if ($debug) { |
| 240 | 240 | if ($x_param) { |
| 241 | 241 | $smartObj = $this->handler->getD($objectid, true, $x_param); |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | { |
| 312 | 312 | global $smart_previous_page; |
| 313 | 313 | |
| 314 | - $objectid = isset($_REQUEST[$this->handler->keyName]) ? (int)$_REQUEST[$this->handler->keyName] : 0; |
|
| 314 | + $objectid = isset($_REQUEST[$this->handler->keyName]) ? (int) $_REQUEST[$this->handler->keyName] : 0; |
|
| 315 | 315 | $smartObj = $this->handler->get($objectid); |
| 316 | 316 | |
| 317 | 317 | if ($smartObj->isNew()) { |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | $confirm = \Xmf\Request::getInt('confirm', 0, POST); |
| 322 | 322 | if ($confirm) { |
| 323 | 323 | if (!$this->handler->delete($smartObj)) { |
| 324 | - redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_ERROR . $smartObj->getHtmlErrors()); |
|
| 324 | + redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_ERROR.$smartObj->getHtmlErrors()); |
|
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_SUCCESS); |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | { |
| 355 | 355 | global $smart_previous_page, $xoopsTpl; |
| 356 | 356 | |
| 357 | - $objectid = isset($_REQUEST[$this->handler->keyName]) ? (int)$_REQUEST[$this->handler->keyName] : 0; |
|
| 357 | + $objectid = isset($_REQUEST[$this->handler->keyName]) ? (int) $_REQUEST[$this->handler->keyName] : 0; |
|
| 358 | 358 | $smartObj = $this->handler->get($objectid); |
| 359 | 359 | |
| 360 | 360 | if ($smartObj->isNew()) { |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | $confirm = \Xmf\Request::getInt('confirm', 0, POST); |
| 365 | 365 | if ($confirm) { |
| 366 | 366 | if (!$this->handler->delete($smartObj)) { |
| 367 | - redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_ERROR . $smartObj->getHtmlErrors()); |
|
| 367 | + redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_ERROR.$smartObj->getHtmlErrors()); |
|
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_SUCCESS); |
@@ -396,14 +396,14 @@ discard block |
||
| 396 | 396 | */ |
| 397 | 397 | public function getAdminViewItemLink(SmartObject $smartObj, $onlyUrl = false, $withimage = false) |
| 398 | 398 | { |
| 399 | - $ret = $this->handler->_moduleUrl . 'admin/' . $this->handler->_page . '?op=view&' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName); |
|
| 399 | + $ret = $this->handler->_moduleUrl.'admin/'.$this->handler->_page.'?op=view&'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName); |
|
| 400 | 400 | if ($onlyUrl) { |
| 401 | 401 | return $ret; |
| 402 | 402 | } elseif ($withimage) { |
| 403 | - return "<a href='" . $ret . "'><img src='" . SMARTOBJECT_IMAGES_ACTIONS_URL . "viewmag.png' style='vertical-align: middle;' alt='" . _CO_SOBJECT_ADMIN_VIEW . "' title='" . _CO_SOBJECT_ADMIN_VIEW . "'></a>"; |
|
| 403 | + return "<a href='".$ret."'><img src='".SMARTOBJECT_IMAGES_ACTIONS_URL."viewmag.png' style='vertical-align: middle;' alt='"._CO_SOBJECT_ADMIN_VIEW."' title='"._CO_SOBJECT_ADMIN_VIEW."'></a>"; |
|
| 404 | 404 | } |
| 405 | 405 | |
| 406 | - return "<a href='" . $ret . "'>" . $smartObj->getVar($this->handler->identifierName) . '</a>'; |
|
| 406 | + return "<a href='".$ret."'>".$smartObj->getVar($this->handler->identifierName).'</a>'; |
|
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | /** |
@@ -425,15 +425,15 @@ discard block |
||
| 425 | 425 | $seoIncludeId = true; |
| 426 | 426 | |
| 427 | 427 | if ('rewrite' === $seoMode) { |
| 428 | - $ret = XOOPS_URL . '/' . $seoModuleName . '.' . $this->handler->_itemname . ($seoIncludeId ? '.' . $smartObj->getVar($this->handler->keyName) : '') . '/' . $smartObj->getVar('short_url') . '.html'; |
|
| 428 | + $ret = XOOPS_URL.'/'.$seoModuleName.'.'.$this->handler->_itemname.($seoIncludeId ? '.'.$smartObj->getVar($this->handler->keyName) : '').'/'.$smartObj->getVar('short_url').'.html'; |
|
| 429 | 429 | } elseif ('pathinfo' === $seoMode) { |
| 430 | - $ret = SMARTOBJECT_URL . 'seo.php/' . $seoModuleName . '.' . $this->handler->_itemname . ($seoIncludeId ? '.' . $smartObj->getVar($this->handler->keyName) : '') . '/' . $smartObj->getVar('short_url') . '.html'; |
|
| 430 | + $ret = SMARTOBJECT_URL.'seo.php/'.$seoModuleName.'.'.$this->handler->_itemname.($seoIncludeId ? '.'.$smartObj->getVar($this->handler->keyName) : '').'/'.$smartObj->getVar('short_url').'.html'; |
|
| 431 | 431 | } else { |
| 432 | - $ret = $this->handler->_moduleUrl . $this->handler->_page . '?' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName); |
|
| 432 | + $ret = $this->handler->_moduleUrl.$this->handler->_page.'?'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName); |
|
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | if (!$onlyUrl) { |
| 436 | - $ret = "<a href='" . $ret . "'>" . $smartObj->getVar($this->handler->identifierName) . '</a>'; |
|
| 436 | + $ret = "<a href='".$ret."'>".$smartObj->getVar($this->handler->identifierName).'</a>'; |
|
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | return $ret; |
@@ -447,14 +447,14 @@ discard block |
||
| 447 | 447 | */ |
| 448 | 448 | public function getEditLanguageLink($smartObj, $onlyUrl = false, $withimage = true) |
| 449 | 449 | { |
| 450 | - $ret = $this->handler->_moduleUrl . 'admin/' . $this->handler->_page . '?op=mod&' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName) . '&language=' . $smartObj->getVar('language'); |
|
| 450 | + $ret = $this->handler->_moduleUrl.'admin/'.$this->handler->_page.'?op=mod&'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName).'&language='.$smartObj->getVar('language'); |
|
| 451 | 451 | if ($onlyUrl) { |
| 452 | 452 | return $ret; |
| 453 | 453 | } elseif ($withimage) { |
| 454 | - return "<a href='" . $ret . "'><img src='" . SMARTOBJECT_IMAGES_ACTIONS_URL . "wizard.png' style='vertical-align: middle;' alt='" . _CO_SOBJECT_LANGUAGE_MODIFY . "' title='" . _CO_SOBJECT_LANGUAGE_MODIFY . "'></a>"; |
|
| 454 | + return "<a href='".$ret."'><img src='".SMARTOBJECT_IMAGES_ACTIONS_URL."wizard.png' style='vertical-align: middle;' alt='"._CO_SOBJECT_LANGUAGE_MODIFY."' title='"._CO_SOBJECT_LANGUAGE_MODIFY."'></a>"; |
|
| 455 | 455 | } |
| 456 | 456 | |
| 457 | - return "<a href='" . $ret . "'>" . $smartObj->getVar($this->handler->identifierName) . '</a>'; |
|
| 457 | + return "<a href='".$ret."'>".$smartObj->getVar($this->handler->identifierName).'</a>'; |
|
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | /** |
@@ -467,14 +467,14 @@ discard block |
||
| 467 | 467 | public function getEditItemLink($smartObj, $onlyUrl = false, $withimage = true, $userSide = false) |
| 468 | 468 | { |
| 469 | 469 | $admin_side = $userSide ? '' : 'admin/'; |
| 470 | - $ret = $this->handler->_moduleUrl . $admin_side . $this->handler->_page . '?op=mod&' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName); |
|
| 470 | + $ret = $this->handler->_moduleUrl.$admin_side.$this->handler->_page.'?op=mod&'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName); |
|
| 471 | 471 | if ($onlyUrl) { |
| 472 | 472 | return $ret; |
| 473 | 473 | } elseif ($withimage) { |
| 474 | - return "<a href='" . $ret . "'><img src='" . SMARTOBJECT_IMAGES_ACTIONS_URL . "edit.png' style='vertical-align: middle;' alt='" . _CO_SOBJECT_MODIFY . "' title='" . _CO_SOBJECT_MODIFY . "'></a>"; |
|
| 474 | + return "<a href='".$ret."'><img src='".SMARTOBJECT_IMAGES_ACTIONS_URL."edit.png' style='vertical-align: middle;' alt='"._CO_SOBJECT_MODIFY."' title='"._CO_SOBJECT_MODIFY."'></a>"; |
|
| 475 | 475 | } |
| 476 | 476 | |
| 477 | - return "<a href='" . $ret . "'>" . $smartObj->getVar($this->handler->identifierName) . '</a>'; |
|
| 477 | + return "<a href='".$ret."'>".$smartObj->getVar($this->handler->identifierName).'</a>'; |
|
| 478 | 478 | } |
| 479 | 479 | |
| 480 | 480 | /** |
@@ -487,14 +487,14 @@ discard block |
||
| 487 | 487 | public function getDeleteItemLink($smartObj, $onlyUrl = false, $withimage = true, $userSide = false) |
| 488 | 488 | { |
| 489 | 489 | $admin_side = $userSide ? '' : 'admin/'; |
| 490 | - $ret = $this->handler->_moduleUrl . $admin_side . $this->handler->_page . '?op=del&' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName); |
|
| 490 | + $ret = $this->handler->_moduleUrl.$admin_side.$this->handler->_page.'?op=del&'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName); |
|
| 491 | 491 | if ($onlyUrl) { |
| 492 | 492 | return $ret; |
| 493 | 493 | } elseif ($withimage) { |
| 494 | - return "<a href='" . $ret . "'><img src='" . SMARTOBJECT_IMAGES_ACTIONS_URL . "editdelete.png' style='vertical-align: middle;' alt='" . _CO_SOBJECT_DELETE . "' title='" . _CO_SOBJECT_DELETE . "'></a>"; |
|
| 494 | + return "<a href='".$ret."'><img src='".SMARTOBJECT_IMAGES_ACTIONS_URL."editdelete.png' style='vertical-align: middle;' alt='"._CO_SOBJECT_DELETE."' title='"._CO_SOBJECT_DELETE."'></a>"; |
|
| 495 | 495 | } |
| 496 | 496 | |
| 497 | - return "<a href='" . $ret . "'>" . $smartObj->getVar($this->handler->identifierName) . '</a>'; |
|
| 497 | + return "<a href='".$ret."'>".$smartObj->getVar($this->handler->identifierName).'</a>'; |
|
| 498 | 498 | } |
| 499 | 499 | |
| 500 | 500 | /** |
@@ -505,9 +505,9 @@ discard block |
||
| 505 | 505 | { |
| 506 | 506 | global $xoopsConfig; |
| 507 | 507 | |
| 508 | - $printlink = $this->handler->_moduleUrl . 'print.php?' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName); |
|
| 509 | - $js = "javascript:openWithSelfMain('" . $printlink . "', 'smartpopup', 700, 519);"; |
|
| 510 | - $printlink = '<a href="' . $js . '"><img src="' . SMARTOBJECT_IMAGES_ACTIONS_URL . 'fileprint.png" alt="" style="vertical-align: middle;"></a>'; |
|
| 508 | + $printlink = $this->handler->_moduleUrl.'print.php?'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName); |
|
| 509 | + $js = "javascript:openWithSelfMain('".$printlink."', 'smartpopup', 700, 519);"; |
|
| 510 | + $printlink = '<a href="'.$js.'"><img src="'.SMARTOBJECT_IMAGES_ACTIONS_URL.'fileprint.png" alt="" style="vertical-align: middle;"></a>'; |
|
| 511 | 511 | |
| 512 | 512 | $smartModule = Smartobject\Utility::getModuleInfo($smartObj->handler->_moduleName); |
| 513 | 513 | $link = Smartobject\Utility::getCurrentPage(); |
@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | . _CO_SOBJECT_EMAIL |
| 527 | 527 | . '" style="vertical-align: middle;"></a>'; |
| 528 | 528 | |
| 529 | - $ret = '<span id="smartobject_print_button">' . $printlink . ' </span>' . '<span id="smartobject_mail_button">' . $friendlink . '</span>'; |
|
| 529 | + $ret = '<span id="smartobject_print_button">'.$printlink.' </span>'.'<span id="smartobject_mail_button">'.$friendlink.'</span>'; |
|
| 530 | 530 | |
| 531 | 531 | return $ret; |
| 532 | 532 | } |
@@ -536,7 +536,7 @@ discard block |
||
| 536 | 536 | */ |
| 537 | 537 | public function getModuleItemString() |
| 538 | 538 | { |
| 539 | - $ret = $this->handler->_moduleName . '_' . $this->handler->_itemname; |
|
| 539 | + $ret = $this->handler->_moduleName.'_'.$this->handler->_itemname; |
|
| 540 | 540 | |
| 541 | 541 | return $ret; |
| 542 | 542 | } |