@@ -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/include/projax/projax.php'; |
|
| 32 | +include_once XOOPS_ROOT_PATH.'/modules/smartobject/include/projax/projax.php'; |
|
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * Class SmartJax |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | public function initiateFromUserside() |
| 40 | 40 | { |
| 41 | 41 | global $xoTheme; |
| 42 | - $xoTheme->addScript(SMARTOBJECT_URL . 'include/projax/js/prototype.js'); |
|
| 43 | - $xoTheme->addScript(SMARTOBJECT_URL . 'include/projax/js/scriptaculous.js'); |
|
| 42 | + $xoTheme->addScript(SMARTOBJECT_URL.'include/projax/js/prototype.js'); |
|
| 43 | + $xoTheme->addScript(SMARTOBJECT_URL.'include/projax/js/scriptaculous.js'); |
|
| 44 | 44 | } |
| 45 | 45 | } |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | * @subpackage SmartObjectTable |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -include_once(SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'); |
|
| 12 | +include_once(SMARTOBJECT_ROOT_PATH.'class/smartobjecttable.php'); |
|
| 13 | 13 | |
| 14 | 14 | /** |
| 15 | 15 | * SmartObjectTreeTable class |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | $space .= ' '; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - $aColumn['value'] = $space . $value; |
|
| 98 | + $aColumn['value'] = $space.$value; |
|
| 99 | 99 | $aColumn['class'] = $class; |
| 100 | 100 | $aColumn['width'] = $column->getWidth(); |
| 101 | 101 | $aColumn['align'] = $column->getAlign(); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - include_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectcontroller.php'; |
|
| 122 | + include_once SMARTOBJECT_ROOT_PATH.'class/smartobjectcontroller.php'; |
|
| 123 | 123 | $controller = new SmartObjectController($this->_objectHandler); |
| 124 | 124 | |
| 125 | 125 | if (in_array('edit', $this->_actions)) { |
@@ -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/smartobject.php'; |
|
| 31 | +include_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobject.php'; |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * Class SmartobjectLink |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | |
| 118 | 118 | return $ret; |
| 119 | 119 | } else { |
| 120 | - $ret = '<a href="' . $ret . '" alt="' . $this->getVar('link', 'e') . '" title="' . $this->getVar('link', 'e') . '">' . _AM_SOBJECT_SENT_LINKS_GOTO . '</a>'; |
|
| 120 | + $ret = '<a href="'.$ret.'" alt="'.$this->getVar('link', 'e').'" title="'.$this->getVar('link', 'e').'">'._AM_SOBJECT_SENT_LINKS_GOTO.'</a>'; |
|
| 121 | 121 | |
| 122 | 122 | return $ret; |
| 123 | 123 | } |
@@ -128,16 +128,16 @@ discard block |
||
| 128 | 128 | */ |
| 129 | 129 | public function getViewItemLink() |
| 130 | 130 | { |
| 131 | - $ret = '<a href="' . |
|
| 132 | - SMARTOBJECT_URL . |
|
| 133 | - 'admin/link.php?op=view&linkid=' . |
|
| 134 | - $this->getVar('linkid') . |
|
| 135 | - '"><img src="' . |
|
| 136 | - SMARTOBJECT_IMAGES_ACTIONS_URL . |
|
| 137 | - 'mail_find.png" alt="' . |
|
| 138 | - _AM_SOBJECT_SENT_LINK_VIEW . |
|
| 139 | - '" title="' . |
|
| 140 | - _AM_SOBJECT_SENT_LINK_VIEW . |
|
| 131 | + $ret = '<a href="'. |
|
| 132 | + SMARTOBJECT_URL. |
|
| 133 | + 'admin/link.php?op=view&linkid='. |
|
| 134 | + $this->getVar('linkid'). |
|
| 135 | + '"><img src="'. |
|
| 136 | + SMARTOBJECT_IMAGES_ACTIONS_URL. |
|
| 137 | + 'mail_find.png" alt="'. |
|
| 138 | + _AM_SOBJECT_SENT_LINK_VIEW. |
|
| 139 | + '" title="'. |
|
| 140 | + _AM_SOBJECT_SENT_LINK_VIEW. |
|
| 141 | 141 | '" /></a>'; |
| 142 | 142 | |
| 143 | 143 | return $ret; |
@@ -153,10 +153,10 @@ discard block |
||
| 153 | 153 | if ($this->getVar('from_uid')) { |
| 154 | 154 | $user = smart_getLinkedUnameFromId($this->getVar('from_uid')); |
| 155 | 155 | if ($user == $GLOBALS['xoopsConfig']['anonymous']) { |
| 156 | - $user = '<a href="mailto:' . $this->getVar('from_email') . '">' . $this->getVar('from_email') . '</a>'; |
|
| 156 | + $user = '<a href="mailto:'.$this->getVar('from_email').'">'.$this->getVar('from_email').'</a>'; |
|
| 157 | 157 | } |
| 158 | 158 | } else { |
| 159 | - $user = '<a href="mailto:' . $this->getVar('from_email') . '">' . $this->getVar('from_email') . '</a>'; |
|
| 159 | + $user = '<a href="mailto:'.$this->getVar('from_email').'">'.$this->getVar('from_email').'</a>'; |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | return $user; |
@@ -185,10 +185,10 @@ discard block |
||
| 185 | 185 | if ($this->getVar('to_uid')) { |
| 186 | 186 | $user = smart_getLinkedUnameFromId($this->getVar('to_uid')); |
| 187 | 187 | if ($user == $GLOBALS['xoopsConfig']['anonymous']) { |
| 188 | - $user = '<a href="mailto:' . $this->getVar('to_email') . '">' . $this->getVar('to_email') . '</a>'; |
|
| 188 | + $user = '<a href="mailto:'.$this->getVar('to_email').'">'.$this->getVar('to_email').'</a>'; |
|
| 189 | 189 | } |
| 190 | 190 | } else { |
| 191 | - $user = '<a href="mailto:' . $this->getVar('to_email') . '">' . $this->getVar('to_email') . '</a>'; |
|
| 191 | + $user = '<a href="mailto:'.$this->getVar('to_email').'">'.$this->getVar('to_email').'</a>'; |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | return $user; |
@@ -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 SmartobjectCustomtag |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | */ |
| 123 | 123 | public function getXoopsCode() |
| 124 | 124 | { |
| 125 | - $ret = '[customtag]' . $this->getVar('tag', 'n') . '[/customtag]'; |
|
| 125 | + $ret = '[customtag]'.$this->getVar('tag', 'n').'[/customtag]'; |
|
| 126 | 126 | |
| 127 | 127 | return $ret; |
| 128 | 128 | } |
@@ -132,16 +132,16 @@ discard block |
||
| 132 | 132 | */ |
| 133 | 133 | public function getCloneLink() |
| 134 | 134 | { |
| 135 | - $ret = '<a href="' . |
|
| 136 | - SMARTOBJECT_URL . |
|
| 137 | - 'admin/customtag.php?op=clone&customtagid=' . |
|
| 138 | - $this->id() . |
|
| 139 | - '"><img src="' . |
|
| 140 | - SMARTOBJECT_IMAGES_ACTIONS_URL . |
|
| 141 | - 'editcopy.png" style="vertical-align: middle;" alt="' . |
|
| 142 | - _CO_SOBJECT_CUSTOMTAG_CLONE . |
|
| 143 | - '" title="' . |
|
| 144 | - _CO_SOBJECT_CUSTOMTAG_CLONE . |
|
| 135 | + $ret = '<a href="'. |
|
| 136 | + SMARTOBJECT_URL. |
|
| 137 | + 'admin/customtag.php?op=clone&customtagid='. |
|
| 138 | + $this->id(). |
|
| 139 | + '"><img src="'. |
|
| 140 | + SMARTOBJECT_IMAGES_ACTIONS_URL. |
|
| 141 | + 'editcopy.png" style="vertical-align: middle;" alt="'. |
|
| 142 | + _CO_SOBJECT_CUSTOMTAG_CLONE. |
|
| 143 | + '" title="'. |
|
| 144 | + _CO_SOBJECT_CUSTOMTAG_CLONE. |
|
| 145 | 145 | '" /></a>'; |
| 146 | 146 | |
| 147 | 147 | return $ret; |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | $granted_ids = $smartobjectPermissionsHandler->getGrantedItems('view'); |
| 279 | 279 | |
| 280 | 280 | if ($granted_ids && count($granted_ids) > 0) { |
| 281 | - $criteria->add(new Criteria('customtagid', '(' . implode(', ', $granted_ids) . ')', 'IN')); |
|
| 281 | + $criteria->add(new Criteria('customtagid', '('.implode(', ', $granted_ids).')', 'IN')); |
|
| 282 | 282 | $customtagsObj = $this->getObjects($criteria, true); |
| 283 | 283 | foreach ($customtagsObj as $customtagObj) { |
| 284 | 284 | $ret[$customtagObj->getVar('name')] = $customtagObj; |
@@ -49,11 +49,11 @@ discard block |
||
| 49 | 49 | { |
| 50 | 50 | global $xoopsModule, $xoopsConfig; |
| 51 | 51 | |
| 52 | - $fileName = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/modinfo.php'; |
|
| 52 | + $fileName = XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/'.$xoopsConfig['language'].'/modinfo.php'; |
|
| 53 | 53 | if (file_exists($fileName)) { |
| 54 | 54 | include_once $fileName; |
| 55 | 55 | } else { |
| 56 | - include_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/english/modinfo.php'; |
|
| 56 | + include_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/english/modinfo.php'; |
|
| 57 | 57 | } |
| 58 | 58 | $this->_aboutTitle = $aboutTitle; |
| 59 | 59 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | //smart_adminMenu(-1, $this->_aboutTitle . " " . $versioninfo->getInfo('name')); |
| 106 | 106 | |
| 107 | - include_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
| 107 | + include_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
| 108 | 108 | |
| 109 | 109 | // --- |
| 110 | 110 | // 2012-01-01 PHP 5.3: Assigning the return value of new by reference is now deprecated. |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | $this->_tpl = new XoopsTpl(); |
| 113 | 113 | // --- |
| 114 | 114 | |
| 115 | - $this->_tpl->assign('module_url', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/'); |
|
| 115 | + $this->_tpl->assign('module_url', XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/'); |
|
| 116 | 116 | $this->_tpl->assign('module_image', $versioninfo->getInfo('image')); |
| 117 | 117 | $this->_tpl->assign('module_name', $versioninfo->getInfo('name')); |
| 118 | 118 | $this->_tpl->assign('module_version', $versioninfo->getInfo('version')); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | // Left headings... |
| 122 | 122 | if ($versioninfo->getInfo('author_realname') !== '') { |
| 123 | - $author_name = $versioninfo->getInfo('author') . ' (' . $versioninfo->getInfo('author_realname') . ')'; |
|
| 123 | + $author_name = $versioninfo->getInfo('author').' ('.$versioninfo->getInfo('author_realname').')'; |
|
| 124 | 124 | } else { |
| 125 | 125 | $author_name = $versioninfo->getInfo('author'); |
| 126 | 126 | } |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | |
| 166 | 166 | // For changelog thanks to 3Dev |
| 167 | 167 | global $xoopsModule; |
| 168 | - $filename = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/changelog.txt'; |
|
| 168 | + $filename = XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/changelog.txt'; |
|
| 169 | 169 | if (is_file($filename)) { |
| 170 | 170 | $filesize = filesize($filename); |
| 171 | 171 | $handle = fopen($filename, 'r'); |
@@ -18,15 +18,15 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
| 20 | 20 | if (!defined('SMARTOBJECT_ROOT_PATH')) { |
| 21 | - include_once(XOOPS_ROOT_PATH . '/modules/smartobject/include/common.php'); |
|
| 21 | + include_once(XOOPS_ROOT_PATH.'/modules/smartobject/include/common.php'); |
|
| 22 | 22 | } |
| 23 | 23 | /** |
| 24 | 24 | * Include the language constants for the SmartObjectDBUpdater |
| 25 | 25 | */ |
| 26 | 26 | global $xoopsConfig; |
| 27 | -$common_file = SMARTOBJECT_ROOT_PATH . 'language/' . $xoopsConfig['language'] . '/smartdbupdater.php'; |
|
| 27 | +$common_file = SMARTOBJECT_ROOT_PATH.'language/'.$xoopsConfig['language'].'/smartdbupdater.php'; |
|
| 28 | 28 | if (!file_exists($common_file)) { |
| 29 | - $common_file = SMARTOBJECT_ROOT_PATH . 'language/english/smartdbupdater.php'; |
|
| 29 | + $common_file = SMARTOBJECT_ROOT_PATH.'language/english/smartdbupdater.php'; |
|
| 30 | 30 | } |
| 31 | 31 | include($common_file); |
| 32 | 32 | |
@@ -123,17 +123,17 @@ discard block |
||
| 123 | 123 | public function getExistingFieldsArray() |
| 124 | 124 | { |
| 125 | 125 | global $xoopsDB; |
| 126 | - $result = $xoopsDB->query('SHOW COLUMNS FROM ' . $this->name()); |
|
| 126 | + $result = $xoopsDB->query('SHOW COLUMNS FROM '.$this->name()); |
|
| 127 | 127 | while ($existing_field = $xoopsDB->fetchArray($result)) { |
| 128 | 128 | $fields[$existing_field['Field']] = $existing_field['Type']; |
| 129 | 129 | if ($existing_field['Null'] !== 'YES') { |
| 130 | 130 | $fields[$existing_field['Field']] .= ' NOT NULL'; |
| 131 | 131 | } |
| 132 | 132 | if ($existing_field['Extra']) { |
| 133 | - $fields[$existing_field['Field']] .= ' ' . $existing_field['Extra']; |
|
| 133 | + $fields[$existing_field['Field']] .= ' '.$existing_field['Extra']; |
|
| 134 | 134 | } |
| 135 | 135 | if (!($existing_field['Default'] === null) && ($existing_field['Default'] || $existing_field['Default'] === '' || $existing_field['Default'] == 0)) { |
| 136 | - $fields[$existing_field['Field']] .= " default '" . $existing_field['Default'] . "'"; |
|
| 136 | + $fields[$existing_field['Field']] .= " default '".$existing_field['Default']."'"; |
|
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | 139 | |
@@ -219,9 +219,9 @@ discard block |
||
| 219 | 219 | $query = sprintf('INSERT INTO %s VALUES (%s)', $this->name(), $data); |
| 220 | 220 | $ret = $xoopsDB->query($query); |
| 221 | 221 | if (!$ret) { |
| 222 | - echo ' ' . sprintf(_SDU_MSG_ADD_DATA_ERR, $this->name()) . '<br>'; |
|
| 222 | + echo ' '.sprintf(_SDU_MSG_ADD_DATA_ERR, $this->name()).'<br>'; |
|
| 223 | 223 | } else { |
| 224 | - echo ' ' . sprintf(_SDU_MSG_ADD_DATA, $this->name()) . '<br>'; |
|
| 224 | + echo ' '.sprintf(_SDU_MSG_ADD_DATA, $this->name()).'<br>'; |
|
| 225 | 225 | } |
| 226 | 226 | } |
| 227 | 227 | |
@@ -373,13 +373,13 @@ discard block |
||
| 373 | 373 | { |
| 374 | 374 | global $xoopsDB; |
| 375 | 375 | $query = $this->getStructure(); |
| 376 | - $query = 'CREATE TABLE `' . $this->name() . '` (' . $query . ") ENGINE=MyISAM COMMENT='The SmartFactory <www.smartfactory.ca>'"; |
|
| 376 | + $query = 'CREATE TABLE `'.$this->name().'` ('.$query.") ENGINE=MyISAM COMMENT='The SmartFactory <www.smartfactory.ca>'"; |
|
| 377 | 377 | //xoops_debug($query); |
| 378 | 378 | $ret = $xoopsDB->query($query); |
| 379 | 379 | if (!$ret) { |
| 380 | - echo ' ' . sprintf(_SDU_MSG_CREATE_TABLE_ERR, $this->name()) . ' (' . $xoopsDB->error() . ')<br>'; |
|
| 380 | + echo ' '.sprintf(_SDU_MSG_CREATE_TABLE_ERR, $this->name()).' ('.$xoopsDB->error().')<br>'; |
|
| 381 | 381 | } else { |
| 382 | - echo ' ' . sprintf(_SDU_MSG_CREATE_TABLE, $this->name()) . '<br>'; |
|
| 382 | + echo ' '.sprintf(_SDU_MSG_CREATE_TABLE, $this->name()).'<br>'; |
|
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | return $ret; |
@@ -397,11 +397,11 @@ discard block |
||
| 397 | 397 | $query = sprintf('DROP TABLE %s', $this->name()); |
| 398 | 398 | $ret = $xoopsDB->query($query); |
| 399 | 399 | if (!$ret) { |
| 400 | - echo ' ' . sprintf(_SDU_MSG_DROP_TABLE_ERR, $this->name()) . ' (' . $xoopsDB->error() . ')<br>'; |
|
| 400 | + echo ' '.sprintf(_SDU_MSG_DROP_TABLE_ERR, $this->name()).' ('.$xoopsDB->error().')<br>'; |
|
| 401 | 401 | |
| 402 | 402 | return false; |
| 403 | 403 | } else { |
| 404 | - echo ' ' . sprintf(_SDU_MSG_DROP_TABLE, $this->name()) . '<br>'; |
|
| 404 | + echo ' '.sprintf(_SDU_MSG_DROP_TABLE, $this->name()).'<br>'; |
|
| 405 | 405 | |
| 406 | 406 | return true; |
| 407 | 407 | } |
@@ -427,9 +427,9 @@ discard block |
||
| 427 | 427 | $ret = $ret && $xoopsDB->query($query); |
| 428 | 428 | if ($alteredField['showerror']) { |
| 429 | 429 | if (!$ret) { |
| 430 | - echo ' ' . sprintf(_SDU_MSG_CHGFIELD_ERR, $alteredField['name'], $this->name()) . ' (' . $xoopsDB->error() . ')<br>'; |
|
| 430 | + echo ' '.sprintf(_SDU_MSG_CHGFIELD_ERR, $alteredField['name'], $this->name()).' ('.$xoopsDB->error().')<br>'; |
|
| 431 | 431 | } else { |
| 432 | - echo ' ' . sprintf(_SDU_MSG_CHGFIELD, $alteredField['name'], $this->name()) . '<br>'; |
|
| 432 | + echo ' '.sprintf(_SDU_MSG_CHGFIELD, $alteredField['name'], $this->name()).'<br>'; |
|
| 433 | 433 | } |
| 434 | 434 | } |
| 435 | 435 | } |
@@ -452,9 +452,9 @@ discard block |
||
| 452 | 452 | //echo $query; |
| 453 | 453 | $ret = $ret && $xoopsDB->query($query); |
| 454 | 454 | if (!$ret) { |
| 455 | - echo ' ' . sprintf(_SDU_MSG_NEWFIELD_ERR, $newField['name'], $this->name()) . '<br>'; |
|
| 455 | + echo ' '.sprintf(_SDU_MSG_NEWFIELD_ERR, $newField['name'], $this->name()).'<br>'; |
|
| 456 | 456 | } else { |
| 457 | - echo ' ' . sprintf(_SDU_MSG_NEWFIELD, $newField['name'], $this->name()) . '<br>'; |
|
| 457 | + echo ' '.sprintf(_SDU_MSG_NEWFIELD, $newField['name'], $this->name()).'<br>'; |
|
| 458 | 458 | } |
| 459 | 459 | } |
| 460 | 460 | |
@@ -475,9 +475,9 @@ discard block |
||
| 475 | 475 | $query = sprintf('UPDATE %s SET %s = %s', $this->name(), $updatedField['name'], $updatedField['value']); |
| 476 | 476 | $ret = $ret && $xoopsDB->query($query); |
| 477 | 477 | if (!$ret) { |
| 478 | - echo ' ' . sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()) . ' (' . $xoopsDB->error() . ')<br>'; |
|
| 478 | + echo ' '.sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()).' ('.$xoopsDB->error().')<br>'; |
|
| 479 | 479 | } else { |
| 480 | - echo ' ' . sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()) . '<br>'; |
|
| 480 | + echo ' '.sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()).'<br>'; |
|
| 481 | 481 | } |
| 482 | 482 | } |
| 483 | 483 | |
@@ -498,9 +498,9 @@ discard block |
||
| 498 | 498 | //echo $query."<br>"; |
| 499 | 499 | $ret = $ret && $xoopsDB->query($query); |
| 500 | 500 | if (!$ret) { |
| 501 | - echo ' ' . sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()) . ' (' . $xoopsDB->error() . ')<br>'; |
|
| 501 | + echo ' '.sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()).' ('.$xoopsDB->error().')<br>'; |
|
| 502 | 502 | } else { |
| 503 | - echo ' ' . sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()) . '<br>'; |
|
| 503 | + echo ' '.sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()).'<br>'; |
|
| 504 | 504 | } |
| 505 | 505 | } |
| 506 | 506 | |
@@ -521,9 +521,9 @@ discard block |
||
| 521 | 521 | $query = sprintf('ALTER TABLE %s DROP %s', $this->name(), $droppedField); |
| 522 | 522 | $ret = $ret && $xoopsDB->query($query); |
| 523 | 523 | if (!$ret) { |
| 524 | - echo ' ' . sprintf(_SDU_MSG_DROPFIELD_ERR, $droppedField, $this->name()) . ' (' . $xoopsDB->error() . ')<br>'; |
|
| 524 | + echo ' '.sprintf(_SDU_MSG_DROPFIELD_ERR, $droppedField, $this->name()).' ('.$xoopsDB->error().')<br>'; |
|
| 525 | 525 | } else { |
| 526 | - echo ' ' . sprintf(_SDU_MSG_DROPFIELD, $droppedField, $this->name()) . '<br>'; |
|
| 526 | + echo ' '.sprintf(_SDU_MSG_DROPFIELD, $droppedField, $this->name()).'<br>'; |
|
| 527 | 527 | } |
| 528 | 528 | } |
| 529 | 529 | |
@@ -610,11 +610,11 @@ discard block |
||
| 610 | 610 | $query = sprintf('ALTER TABLE %s RENAME %s', $from, $to); |
| 611 | 611 | $ret = $xoopsDB->query($query); |
| 612 | 612 | if (!$ret) { |
| 613 | - echo ' ' . sprintf(_SDU_MSG_RENAME_TABLE_ERR, $from) . '<br>'; |
|
| 613 | + echo ' '.sprintf(_SDU_MSG_RENAME_TABLE_ERR, $from).'<br>'; |
|
| 614 | 614 | |
| 615 | 615 | return false; |
| 616 | 616 | } else { |
| 617 | - echo ' ' . sprintf(_SDU_MSG_RENAME_TABLE, $from, $to) . '<br>'; |
|
| 617 | + echo ' '.sprintf(_SDU_MSG_RENAME_TABLE, $from, $to).'<br>'; |
|
| 618 | 618 | |
| 619 | 619 | return true; |
| 620 | 620 | } |
@@ -734,7 +734,7 @@ discard block |
||
| 734 | 734 | return false; |
| 735 | 735 | } |
| 736 | 736 | |
| 737 | - $table = new SmartDbTable($module . '_' . $item); |
|
| 737 | + $table = new SmartDbTable($module.'_'.$item); |
|
| 738 | 738 | $object = $moduleHandler->create(); |
| 739 | 739 | $objectVars = $object->getVars(); |
| 740 | 740 | |
@@ -755,7 +755,7 @@ discard block |
||
| 755 | 755 | "; |
| 756 | 756 | } |
| 757 | 757 | } |
| 758 | - $structure .= 'PRIMARY KEY (`' . $moduleHandler->keyName . '`) |
|
| 758 | + $structure .= 'PRIMARY KEY (`'.$moduleHandler->keyName.'`) |
|
| 759 | 759 | '; |
| 760 | 760 | $table->setStructure($structure); |
| 761 | 761 | if (!$this->updateTable($table)) { |
@@ -815,7 +815,7 @@ discard block |
||
| 815 | 815 | |
| 816 | 816 | ob_start(); |
| 817 | 817 | |
| 818 | - $table = new SmartDbTable($dirname . '_meta'); |
|
| 818 | + $table = new SmartDbTable($dirname.'_meta'); |
|
| 819 | 819 | if (!$table->exists()) { |
| 820 | 820 | $table->setStructure(" |
| 821 | 821 | `metakey` varchar(50) NOT NULL default '', |
@@ -833,20 +833,20 @@ discard block |
||
| 833 | 833 | if (!$dbVersion) { |
| 834 | 834 | $dbVersion = 0; |
| 835 | 835 | } |
| 836 | - $newDbVersion = constant(strtoupper($dirname . '_db_version')) ?: 0; |
|
| 837 | - echo 'Database version: ' . $dbVersion . '<br>'; |
|
| 838 | - echo 'New database version: ' . $newDbVersion . '<br>'; |
|
| 836 | + $newDbVersion = constant(strtoupper($dirname.'_db_version')) ?: 0; |
|
| 837 | + echo 'Database version: '.$dbVersion.'<br>'; |
|
| 838 | + echo 'New database version: '.$newDbVersion.'<br>'; |
|
| 839 | 839 | |
| 840 | 840 | if ($newDbVersion > $dbVersion) { |
| 841 | 841 | for ($i = $dbVersion + 1; $i <= $newDbVersion; ++$i) { |
| 842 | - $upgrade_function = $dirname . '_db_upgrade_' . $i; |
|
| 842 | + $upgrade_function = $dirname.'_db_upgrade_'.$i; |
|
| 843 | 843 | if (function_exists($upgrade_function)) { |
| 844 | 844 | $upgrade_function(); |
| 845 | 845 | } |
| 846 | 846 | } |
| 847 | 847 | } |
| 848 | 848 | |
| 849 | - echo '<code>' . _SDU_UPDATE_UPDATING_DATABASE . '<br>'; |
|
| 849 | + echo '<code>'._SDU_UPDATE_UPDATING_DATABASE.'<br>'; |
|
| 850 | 850 | |
| 851 | 851 | // if there is a function to execute for this DB version, let's do it |
| 852 | 852 | //$function_ |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | * @todo make the output XHTML compliant |
| 43 | 43 | */ |
| 44 | 44 | |
| 45 | - include_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
| 45 | + include_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
| 46 | 46 | |
| 47 | 47 | $this->_tpl = new XoopsTpl(); |
| 48 | 48 | |
@@ -23,8 +23,8 @@ discard block |
||
| 23 | 23 | * @credit Jan Keller Pedersen <[email protected]> - IDG Danmark A/S <www.idg.dk> |
| 24 | 24 | * @link http://smartfactory.ca The SmartFactory |
| 25 | 25 | */ |
| 26 | -include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobject.php'; |
|
| 27 | -include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjecthandler.php'; |
|
| 26 | +include_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobject.php'; |
|
| 27 | +include_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobjecthandler.php'; |
|
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * Class SmartObjectController |
@@ -50,15 +50,15 @@ discard block |
||
| 50 | 50 | foreach (array_keys($smartObj->vars) as $key) { |
| 51 | 51 | switch ($smartObj->vars[$key]['data_type']) { |
| 52 | 52 | case XOBJ_DTYPE_IMAGE: |
| 53 | - if (isset($_POST['url_' . $key]) && $_POST['url_' . $key] !== '') { |
|
| 54 | - $oldFile = $smartObj->getUploadDir(true) . $smartObj->getVar($key, 'e'); |
|
| 55 | - $smartObj->setVar($key, $_POST['url_' . $key]); |
|
| 53 | + if (isset($_POST['url_'.$key]) && $_POST['url_'.$key] !== '') { |
|
| 54 | + $oldFile = $smartObj->getUploadDir(true).$smartObj->getVar($key, 'e'); |
|
| 55 | + $smartObj->setVar($key, $_POST['url_'.$key]); |
|
| 56 | 56 | if (file_exists($oldFile)) { |
| 57 | 57 | unlink($oldFile); |
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | - if (isset($_POST['delete_' . $key]) && $_POST['delete_' . $key] == '1') { |
|
| 61 | - $oldFile = $smartObj->getUploadDir(true) . $smartObj->getVar($key, 'e'); |
|
| 60 | + if (isset($_POST['delete_'.$key]) && $_POST['delete_'.$key] == '1') { |
|
| 61 | + $oldFile = $smartObj->getUploadDir(true).$smartObj->getVar($key, 'e'); |
|
| 62 | 62 | $smartObj->setVar($key, ''); |
| 63 | 63 | if (file_exists($oldFile)) { |
| 64 | 64 | unlink($oldFile); |
@@ -68,10 +68,10 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | case XOBJ_DTYPE_URLLINK: |
| 70 | 70 | $linkObj = $smartObj->getUrlLinkObj($key); |
| 71 | - $linkObj->setVar('caption', $_POST['caption_' . $key]); |
|
| 72 | - $linkObj->setVar('description', $_POST['desc_' . $key]); |
|
| 73 | - $linkObj->setVar('target', $_POST['target_' . $key]); |
|
| 74 | - $linkObj->setVar('url', $_POST['url_' . $key]); |
|
| 71 | + $linkObj->setVar('caption', $_POST['caption_'.$key]); |
|
| 72 | + $linkObj->setVar('description', $_POST['desc_'.$key]); |
|
| 73 | + $linkObj->setVar('target', $_POST['target_'.$key]); |
|
| 74 | + $linkObj->setVar('url', $_POST['url_'.$key]); |
|
| 75 | 75 | if ($linkObj->getVar('url') !== '') { |
| 76 | 76 | $smartObj->storeUrlLinkObj($linkObj); |
| 77 | 77 | } |
@@ -80,11 +80,11 @@ discard block |
||
| 80 | 80 | break; |
| 81 | 81 | |
| 82 | 82 | case XOBJ_DTYPE_FILE: |
| 83 | - if (!isset($_FILES['upload_' . $key]['name']) || $_FILES['upload_' . $key]['name'] === '') { |
|
| 83 | + if (!isset($_FILES['upload_'.$key]['name']) || $_FILES['upload_'.$key]['name'] === '') { |
|
| 84 | 84 | $fileObj = $smartObj->getFileObj($key); |
| 85 | - $fileObj->setVar('caption', $_POST['caption_' . $key]); |
|
| 86 | - $fileObj->setVar('description', $_POST['desc_' . $key]); |
|
| 87 | - $fileObj->setVar('url', $_POST['url_' . $key]); |
|
| 85 | + $fileObj->setVar('caption', $_POST['caption_'.$key]); |
|
| 86 | + $fileObj->setVar('description', $_POST['desc_'.$key]); |
|
| 87 | + $fileObj->setVar('url', $_POST['url_'.$key]); |
|
| 88 | 88 | if (!($fileObj->getVar('url') === '' && $fileObj->getVar('url') === '' && $fileObj->getVar('url') === '')) { |
| 89 | 89 | $res = $smartObj->storeFileObj($fileObj); |
| 90 | 90 | if ($res) { |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | $value = strtotime($_POST[$key]); |
| 108 | 108 | //if strtotime returns false, the value is already a time stamp |
| 109 | 109 | if (!$value) { |
| 110 | - $value = (int)$_POST[$key]; |
|
| 110 | + $value = (int) $_POST[$key]; |
|
| 111 | 111 | } |
| 112 | 112 | } |
| 113 | 113 | $smartObj->setVar($key, $value); |
@@ -144,12 +144,12 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | // Check if there were uploaded files |
| 146 | 146 | if (isset($_POST['smart_upload_image']) || isset($_POST['smart_upload_file'])) { |
| 147 | - include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartuploader.php'; |
|
| 147 | + include_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartuploader.php'; |
|
| 148 | 148 | $uploaderObj = new SmartUploader($smartObj->getImageDir(true), $this->handler->_allowedMimeTypes, $this->handler->_maxFileSize, $this->handler->_maxWidth, $this->handler->_maxHeight); |
| 149 | 149 | foreach ($_FILES as $name => $file_array) { |
| 150 | 150 | if (isset($file_array['name']) && $file_array['name'] !== '' && in_array(str_replace('upload_', '', $name), array_keys($smartObj->vars))) { |
| 151 | 151 | if ($uploaderObj->fetchMedia($name)) { |
| 152 | - $uploaderObj->setTargetFileName(time() . '_' . $uploaderObj->getMediaName()); |
|
| 152 | + $uploaderObj->setTargetFileName(time().'_'.$uploaderObj->getMediaName()); |
|
| 153 | 153 | if ($uploaderObj->upload()) { |
| 154 | 154 | // Find the related field in the SmartObject |
| 155 | 155 | $related_field = str_replace('upload_', '', $name); |
@@ -158,14 +158,14 @@ discard block |
||
| 158 | 158 | if ($smartObj->vars[$related_field]['data_type'] === XOBJ_DTYPE_FILE) { |
| 159 | 159 | $object_fileurl = $smartObj->getUploadDir(); |
| 160 | 160 | $fileObj = $smartObj->getFileObj($related_field); |
| 161 | - $fileObj->setVar('url', $object_fileurl . $uploaderObj->getSavedFileName()); |
|
| 162 | - $fileObj->setVar('caption', $_POST['caption_' . $related_field]); |
|
| 163 | - $fileObj->setVar('description', $_POST['desc_' . $related_field]); |
|
| 161 | + $fileObj->setVar('url', $object_fileurl.$uploaderObj->getSavedFileName()); |
|
| 162 | + $fileObj->setVar('caption', $_POST['caption_'.$related_field]); |
|
| 163 | + $fileObj->setVar('description', $_POST['desc_'.$related_field]); |
|
| 164 | 164 | $smartObj->storeFileObj($fileObj); |
| 165 | 165 | //todo: catch errors |
| 166 | 166 | $smartObj->setVar($related_field, $fileObj->getVar('fileid')); |
| 167 | 167 | } else { |
| 168 | - $old_file = $smartObj->getUploadDir(true) . $smartObj->getVar($related_field); |
|
| 168 | + $old_file = $smartObj->getUploadDir(true).$smartObj->getVar($related_field); |
|
| 169 | 169 | unlink($old_file); |
| 170 | 170 | $smartObj->setVar($related_field, $uploaderObj->getSavedFileName()); |
| 171 | 171 | } |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | return $smartObj; |
| 197 | 197 | } else { |
| 198 | 198 | if (!$storeResult) { |
| 199 | - redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $smartObj->getHtmlErrors()); |
|
| 199 | + redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR.$smartObj->getHtmlErrors()); |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | $redirect_page = $redirect_page ?: smart_get_page_before_form(); |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | */ |
| 221 | 221 | public function storeFromDefaultForm($created_success_msg, $modified_success_msg, $redirect_page = false, $debug = false, $x_param = false) |
| 222 | 222 | { |
| 223 | - $objectid = isset($_POST[$this->handler->keyName]) ? (int)$_POST[$this->handler->keyName] : 0; |
|
| 223 | + $objectid = isset($_POST[$this->handler->keyName]) ? (int) $_POST[$this->handler->keyName] : 0; |
|
| 224 | 224 | if ($debug) { |
| 225 | 225 | if ($x_param) { |
| 226 | 226 | $smartObj = $this->handler->getD($objectid, true, $x_param); |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | { |
| 297 | 297 | global $smart_previous_page; |
| 298 | 298 | |
| 299 | - $objectid = isset($_REQUEST[$this->handler->keyName]) ? (int)$_REQUEST[$this->handler->keyName] : 0; |
|
| 299 | + $objectid = isset($_REQUEST[$this->handler->keyName]) ? (int) $_REQUEST[$this->handler->keyName] : 0; |
|
| 300 | 300 | $smartObj = $this->handler->get($objectid); |
| 301 | 301 | |
| 302 | 302 | if ($smartObj->isNew()) { |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0; |
| 307 | 307 | if ($confirm) { |
| 308 | 308 | if (!$this->handler->delete($smartObj)) { |
| 309 | - redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_ERROR . $smartObj->getHtmlErrors()); |
|
| 309 | + redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_ERROR.$smartObj->getHtmlErrors()); |
|
| 310 | 310 | exit; |
| 311 | 311 | } |
| 312 | 312 | |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | { |
| 337 | 337 | global $smart_previous_page, $xoopsTpl; |
| 338 | 338 | |
| 339 | - $objectid = isset($_REQUEST[$this->handler->keyName]) ? (int)$_REQUEST[$this->handler->keyName] : 0; |
|
| 339 | + $objectid = isset($_REQUEST[$this->handler->keyName]) ? (int) $_REQUEST[$this->handler->keyName] : 0; |
|
| 340 | 340 | $smartObj = $this->handler->get($objectid); |
| 341 | 341 | |
| 342 | 342 | if ($smartObj->isNew()) { |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0; |
| 347 | 347 | if ($confirm) { |
| 348 | 348 | if (!$this->handler->delete($smartObj)) { |
| 349 | - redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_ERROR . $smartObj->getHtmlErrors()); |
|
| 349 | + redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_ERROR.$smartObj->getHtmlErrors()); |
|
| 350 | 350 | exit; |
| 351 | 351 | } |
| 352 | 352 | |
@@ -375,22 +375,22 @@ discard block |
||
| 375 | 375 | */ |
| 376 | 376 | public function getAdminViewItemLink(SmartObject $smartObj, $onlyUrl = false, $withimage = false) |
| 377 | 377 | { |
| 378 | - $ret = $this->handler->_moduleUrl . 'admin/' . $this->handler->_page . '?op=view&' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName); |
|
| 378 | + $ret = $this->handler->_moduleUrl.'admin/'.$this->handler->_page.'?op=view&'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName); |
|
| 379 | 379 | if ($onlyUrl) { |
| 380 | 380 | return $ret; |
| 381 | 381 | } elseif ($withimage) { |
| 382 | - return "<a href='" . |
|
| 383 | - $ret . |
|
| 384 | - "'><img src='" . |
|
| 385 | - SMARTOBJECT_IMAGES_ACTIONS_URL . |
|
| 386 | - "viewmag.png' style='vertical-align: middle;' alt='" . |
|
| 387 | - _CO_SOBJECT_ADMIN_VIEW . |
|
| 388 | - "' title='" . |
|
| 389 | - _CO_SOBJECT_ADMIN_VIEW . |
|
| 382 | + return "<a href='". |
|
| 383 | + $ret. |
|
| 384 | + "'><img src='". |
|
| 385 | + SMARTOBJECT_IMAGES_ACTIONS_URL. |
|
| 386 | + "viewmag.png' style='vertical-align: middle;' alt='". |
|
| 387 | + _CO_SOBJECT_ADMIN_VIEW. |
|
| 388 | + "' title='". |
|
| 389 | + _CO_SOBJECT_ADMIN_VIEW. |
|
| 390 | 390 | "'/></a>"; |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | - return "<a href='" . $ret . "'>" . $smartObj->getVar($this->handler->identifierName) . '</a>'; |
|
| 393 | + return "<a href='".$ret."'>".$smartObj->getVar($this->handler->identifierName).'</a>'; |
|
| 394 | 394 | } |
| 395 | 395 | |
| 396 | 396 | /** |
@@ -412,31 +412,31 @@ discard block |
||
| 412 | 412 | $seoIncludeId = true; |
| 413 | 413 | |
| 414 | 414 | if ($seoMode === 'rewrite') { |
| 415 | - $ret = XOOPS_URL . |
|
| 416 | - '/' . |
|
| 417 | - $seoModuleName . |
|
| 418 | - '.' . |
|
| 419 | - $this->handler->_itemname . |
|
| 420 | - ($seoIncludeId ? '.' . $smartObj->getVar($this->handler->keyName) : '') . |
|
| 421 | - '/' . |
|
| 422 | - $smartObj->getVar('short_url') . |
|
| 415 | + $ret = XOOPS_URL. |
|
| 416 | + '/'. |
|
| 417 | + $seoModuleName. |
|
| 418 | + '.'. |
|
| 419 | + $this->handler->_itemname. |
|
| 420 | + ($seoIncludeId ? '.'.$smartObj->getVar($this->handler->keyName) : ''). |
|
| 421 | + '/'. |
|
| 422 | + $smartObj->getVar('short_url'). |
|
| 423 | 423 | '.html'; |
| 424 | 424 | } elseif ($seoMode === 'pathinfo') { |
| 425 | - $ret = SMARTOBJECT_URL . |
|
| 426 | - 'seo.php/' . |
|
| 427 | - $seoModuleName . |
|
| 428 | - '.' . |
|
| 429 | - $this->handler->_itemname . |
|
| 430 | - ($seoIncludeId ? '.' . $smartObj->getVar($this->handler->keyName) : '') . |
|
| 431 | - '/' . |
|
| 432 | - $smartObj->getVar('short_url') . |
|
| 425 | + $ret = SMARTOBJECT_URL. |
|
| 426 | + 'seo.php/'. |
|
| 427 | + $seoModuleName. |
|
| 428 | + '.'. |
|
| 429 | + $this->handler->_itemname. |
|
| 430 | + ($seoIncludeId ? '.'.$smartObj->getVar($this->handler->keyName) : ''). |
|
| 431 | + '/'. |
|
| 432 | + $smartObj->getVar('short_url'). |
|
| 433 | 433 | '.html'; |
| 434 | 434 | } else { |
| 435 | - $ret = $this->handler->_moduleUrl . $this->handler->_page . '?' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName); |
|
| 435 | + $ret = $this->handler->_moduleUrl.$this->handler->_page.'?'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName); |
|
| 436 | 436 | } |
| 437 | 437 | |
| 438 | 438 | if (!$onlyUrl) { |
| 439 | - $ret = "<a href='" . $ret . "'>" . $smartObj->getVar($this->handler->identifierName) . '</a>'; |
|
| 439 | + $ret = "<a href='".$ret."'>".$smartObj->getVar($this->handler->identifierName).'</a>'; |
|
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | return $ret; |
@@ -450,30 +450,30 @@ discard block |
||
| 450 | 450 | */ |
| 451 | 451 | public function getEditLanguageLink($smartObj, $onlyUrl = false, $withimage = true) |
| 452 | 452 | { |
| 453 | - $ret = $this->handler->_moduleUrl . |
|
| 454 | - 'admin/' . |
|
| 455 | - $this->handler->_page . |
|
| 456 | - '?op=mod&' . |
|
| 457 | - $this->handler->keyName . |
|
| 458 | - '=' . |
|
| 459 | - $smartObj->getVar($this->handler->keyName) . |
|
| 460 | - '&language=' . |
|
| 453 | + $ret = $this->handler->_moduleUrl. |
|
| 454 | + 'admin/'. |
|
| 455 | + $this->handler->_page. |
|
| 456 | + '?op=mod&'. |
|
| 457 | + $this->handler->keyName. |
|
| 458 | + '='. |
|
| 459 | + $smartObj->getVar($this->handler->keyName). |
|
| 460 | + '&language='. |
|
| 461 | 461 | $smartObj->getVar('language'); |
| 462 | 462 | if ($onlyUrl) { |
| 463 | 463 | return $ret; |
| 464 | 464 | } elseif ($withimage) { |
| 465 | - return "<a href='" . |
|
| 466 | - $ret . |
|
| 467 | - "'><img src='" . |
|
| 468 | - SMARTOBJECT_IMAGES_ACTIONS_URL . |
|
| 469 | - "wizard.png' style='vertical-align: middle;' alt='" . |
|
| 470 | - _CO_SOBJECT_LANGUAGE_MODIFY . |
|
| 471 | - "' title='" . |
|
| 472 | - _CO_SOBJECT_LANGUAGE_MODIFY . |
|
| 465 | + return "<a href='". |
|
| 466 | + $ret. |
|
| 467 | + "'><img src='". |
|
| 468 | + SMARTOBJECT_IMAGES_ACTIONS_URL. |
|
| 469 | + "wizard.png' style='vertical-align: middle;' alt='". |
|
| 470 | + _CO_SOBJECT_LANGUAGE_MODIFY. |
|
| 471 | + "' title='". |
|
| 472 | + _CO_SOBJECT_LANGUAGE_MODIFY. |
|
| 473 | 473 | "'/></a>"; |
| 474 | 474 | } |
| 475 | 475 | |
| 476 | - return "<a href='" . $ret . "'>" . $smartObj->getVar($this->handler->identifierName) . '</a>'; |
|
| 476 | + return "<a href='".$ret."'>".$smartObj->getVar($this->handler->identifierName).'</a>'; |
|
| 477 | 477 | } |
| 478 | 478 | |
| 479 | 479 | /** |
@@ -486,22 +486,22 @@ discard block |
||
| 486 | 486 | public function getEditItemLink($smartObj, $onlyUrl = false, $withimage = true, $userSide = false) |
| 487 | 487 | { |
| 488 | 488 | $admin_side = $userSide ? '' : 'admin/'; |
| 489 | - $ret = $this->handler->_moduleUrl . $admin_side . $this->handler->_page . '?op=mod&' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName); |
|
| 489 | + $ret = $this->handler->_moduleUrl.$admin_side.$this->handler->_page.'?op=mod&'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName); |
|
| 490 | 490 | if ($onlyUrl) { |
| 491 | 491 | return $ret; |
| 492 | 492 | } elseif ($withimage) { |
| 493 | - return "<a href='" . |
|
| 494 | - $ret . |
|
| 495 | - "'><img src='" . |
|
| 496 | - SMARTOBJECT_IMAGES_ACTIONS_URL . |
|
| 497 | - "edit.png' style='vertical-align: middle;' alt='" . |
|
| 498 | - _CO_SOBJECT_MODIFY . |
|
| 499 | - "' title='" . |
|
| 500 | - _CO_SOBJECT_MODIFY . |
|
| 493 | + return "<a href='". |
|
| 494 | + $ret. |
|
| 495 | + "'><img src='". |
|
| 496 | + SMARTOBJECT_IMAGES_ACTIONS_URL. |
|
| 497 | + "edit.png' style='vertical-align: middle;' alt='". |
|
| 498 | + _CO_SOBJECT_MODIFY. |
|
| 499 | + "' title='". |
|
| 500 | + _CO_SOBJECT_MODIFY. |
|
| 501 | 501 | "'/></a>"; |
| 502 | 502 | } |
| 503 | 503 | |
| 504 | - return "<a href='" . $ret . "'>" . $smartObj->getVar($this->handler->identifierName) . '</a>'; |
|
| 504 | + return "<a href='".$ret."'>".$smartObj->getVar($this->handler->identifierName).'</a>'; |
|
| 505 | 505 | } |
| 506 | 506 | |
| 507 | 507 | /** |
@@ -514,22 +514,22 @@ discard block |
||
| 514 | 514 | public function getDeleteItemLink($smartObj, $onlyUrl = false, $withimage = true, $userSide = false) |
| 515 | 515 | { |
| 516 | 516 | $admin_side = $userSide ? '' : 'admin/'; |
| 517 | - $ret = $this->handler->_moduleUrl . $admin_side . $this->handler->_page . '?op=del&' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName); |
|
| 517 | + $ret = $this->handler->_moduleUrl.$admin_side.$this->handler->_page.'?op=del&'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName); |
|
| 518 | 518 | if ($onlyUrl) { |
| 519 | 519 | return $ret; |
| 520 | 520 | } elseif ($withimage) { |
| 521 | - return "<a href='" . |
|
| 522 | - $ret . |
|
| 523 | - "'><img src='" . |
|
| 524 | - SMARTOBJECT_IMAGES_ACTIONS_URL . |
|
| 525 | - "editdelete.png' style='vertical-align: middle;' alt='" . |
|
| 526 | - _CO_SOBJECT_DELETE . |
|
| 527 | - "' title='" . |
|
| 528 | - _CO_SOBJECT_DELETE . |
|
| 521 | + return "<a href='". |
|
| 522 | + $ret. |
|
| 523 | + "'><img src='". |
|
| 524 | + SMARTOBJECT_IMAGES_ACTIONS_URL. |
|
| 525 | + "editdelete.png' style='vertical-align: middle;' alt='". |
|
| 526 | + _CO_SOBJECT_DELETE. |
|
| 527 | + "' title='". |
|
| 528 | + _CO_SOBJECT_DELETE. |
|
| 529 | 529 | "'/></a>"; |
| 530 | 530 | } |
| 531 | 531 | |
| 532 | - return "<a href='" . $ret . "'>" . $smartObj->getVar($this->handler->identifierName) . '</a>'; |
|
| 532 | + return "<a href='".$ret."'>".$smartObj->getVar($this->handler->identifierName).'</a>'; |
|
| 533 | 533 | } |
| 534 | 534 | |
| 535 | 535 | /** |
@@ -540,28 +540,28 @@ discard block |
||
| 540 | 540 | { |
| 541 | 541 | global $xoopsConfig; |
| 542 | 542 | |
| 543 | - $printlink = $this->handler->_moduleUrl . 'print.php?' . $this->handler->keyName . '=' . $smartObj->getVar($this->handler->keyName); |
|
| 544 | - $js = "javascript:openWithSelfMain('" . $printlink . "', 'smartpopup', 700, 519);"; |
|
| 545 | - $printlink = '<a href="' . $js . '"><img src="' . SMARTOBJECT_IMAGES_ACTIONS_URL . 'fileprint.png" alt="" style="vertical-align: middle;"/></a>'; |
|
| 543 | + $printlink = $this->handler->_moduleUrl.'print.php?'.$this->handler->keyName.'='.$smartObj->getVar($this->handler->keyName); |
|
| 544 | + $js = "javascript:openWithSelfMain('".$printlink."', 'smartpopup', 700, 519);"; |
|
| 545 | + $printlink = '<a href="'.$js.'"><img src="'.SMARTOBJECT_IMAGES_ACTIONS_URL.'fileprint.png" alt="" style="vertical-align: middle;"/></a>'; |
|
| 546 | 546 | |
| 547 | 547 | $smartModule = smart_getModuleInfo($smartObj->handler->_moduleName); |
| 548 | 548 | $link = smart_getCurrentPage(); |
| 549 | 549 | $mid = $smartModule->getVar('mid'); |
| 550 | - $friendlink = "<a href=\"javascript:openWithSelfMain('" . |
|
| 551 | - SMARTOBJECT_URL . |
|
| 552 | - 'sendlink.php?link=' . |
|
| 553 | - $link . |
|
| 554 | - '&mid=' . |
|
| 555 | - $mid . |
|
| 556 | - "', ',',',',',','sendmessage', 674, 500);\"><img src=\"" . |
|
| 557 | - SMARTOBJECT_IMAGES_ACTIONS_URL . |
|
| 558 | - "mail_send.png\" alt=\"" . |
|
| 559 | - _CO_SOBJECT_EMAIL . |
|
| 560 | - "\" title=\"" . |
|
| 561 | - _CO_SOBJECT_EMAIL . |
|
| 550 | + $friendlink = "<a href=\"javascript:openWithSelfMain('". |
|
| 551 | + SMARTOBJECT_URL. |
|
| 552 | + 'sendlink.php?link='. |
|
| 553 | + $link. |
|
| 554 | + '&mid='. |
|
| 555 | + $mid. |
|
| 556 | + "', ',',',',',','sendmessage', 674, 500);\"><img src=\"". |
|
| 557 | + SMARTOBJECT_IMAGES_ACTIONS_URL. |
|
| 558 | + "mail_send.png\" alt=\"". |
|
| 559 | + _CO_SOBJECT_EMAIL. |
|
| 560 | + "\" title=\"". |
|
| 561 | + _CO_SOBJECT_EMAIL. |
|
| 562 | 562 | "\" style=\"vertical-align: middle;\"/></a>"; |
| 563 | 563 | |
| 564 | - $ret = '<span id="smartobject_print_button">' . $printlink . ' </span>' . '<span id="smartobject_mail_button">' . $friendlink . '</span>'; |
|
| 564 | + $ret = '<span id="smartobject_print_button">'.$printlink.' </span>'.'<span id="smartobject_mail_button">'.$friendlink.'</span>'; |
|
| 565 | 565 | |
| 566 | 566 | return $ret; |
| 567 | 567 | } |
@@ -571,7 +571,7 @@ discard block |
||
| 571 | 571 | */ |
| 572 | 572 | public function getModuleItemString() |
| 573 | 573 | { |
| 574 | - $ret = $this->handler->_moduleName . '_' . $this->handler->_itemname; |
|
| 574 | + $ret = $this->handler->_moduleName.'_'.$this->handler->_itemname; |
|
| 575 | 575 | |
| 576 | 576 | return $ret; |
| 577 | 577 | } |
@@ -29,8 +29,8 @@ 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'; |
|
| 33 | -include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartplugins.php'; |
|
| 32 | +include_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobject.php'; |
|
| 33 | +include_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartplugins.php'; |
|
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * Class SmartobjectRating |
@@ -124,14 +124,14 @@ discard block |
||
| 124 | 124 | */ |
| 125 | 125 | public function getItemValue() |
| 126 | 126 | { |
| 127 | - $moduleUrl = XOOPS_URL . '/modules/' . $this->getVar('dirname', 'n') . '/'; |
|
| 127 | + $moduleUrl = XOOPS_URL.'/modules/'.$this->getVar('dirname', 'n').'/'; |
|
| 128 | 128 | $plugin = $this->getModulePlugin(); |
| 129 | 129 | $pluginItemInfo = $plugin->getItemInfo($this->getVar('item')); |
| 130 | 130 | if (!$pluginItemInfo) { |
| 131 | 131 | return ''; |
| 132 | 132 | } |
| 133 | 133 | $itemPath = sprintf($pluginItemInfo['url'], $this->getVar('itemid')); |
| 134 | - $ret = '<a href="' . $moduleUrl . $itemPath . '">' . $pluginItemInfo['caption'] . '</a>'; |
|
| 134 | + $ret = '<a href="'.$moduleUrl.$itemPath.'">'.$pluginItemInfo['caption'].'</a>'; |
|
| 135 | 135 | |
| 136 | 136 | return $ret; |
| 137 | 137 | } |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | public function __construct(XoopsDatabase $db) |
| 175 | 175 | { |
| 176 | 176 | parent::__construct($db, 'rating', 'ratingid', 'rate', '', 'smartobject'); |
| 177 | - $this->generalSQL = 'SELECT * FROM ' . $this->table . ' AS ' . $this->_itemname . ' INNER JOIN ' . $this->db->prefix('users') . ' AS user ON ' . $this->_itemname . '.uid=user.uid'; |
|
| 177 | + $this->generalSQL = 'SELECT * FROM '.$this->table.' AS '.$this->_itemname.' INNER JOIN '.$this->db->prefix('users').' AS user ON '.$this->_itemname.'.uid=user.uid'; |
|
| 178 | 178 | |
| 179 | 179 | $this->_rateOptions[1] = 1; |
| 180 | 180 | $this->_rateOptions[2] = 2; |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | */ |
| 218 | 218 | public function getRatingAverageByItemId($itemid, $dirname, $item) |
| 219 | 219 | { |
| 220 | - $sql = 'SELECT AVG(rate), COUNT(ratingid) FROM ' . $this->table . " WHERE itemid=$itemid AND dirname='$dirname' AND item='$item' GROUP BY itemid"; |
|
| 220 | + $sql = 'SELECT AVG(rate), COUNT(ratingid) FROM '.$this->table." WHERE itemid=$itemid AND dirname='$dirname' AND item='$item' GROUP BY itemid"; |
|
| 221 | 221 | $result = $this->db->query($sql); |
| 222 | 222 | if (!$result) { |
| 223 | 223 | return 0; |