@@ -11,7 +11,7 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | 13 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
| 14 | -require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobject.php'; |
|
| 14 | +require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobject.php'; |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * SmartObject base SEO-enabled class |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | * @todo make the output XHTML compliant |
| 43 | 43 | */ |
| 44 | 44 | |
| 45 | - require_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
| 45 | + require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
| 46 | 46 | |
| 47 | 47 | $this->_tpl = new XoopsTpl(); |
| 48 | 48 | |
@@ -354,7 +354,7 @@ |
||
| 354 | 354 | public function createMetaKeywords() |
| 355 | 355 | { |
| 356 | 356 | global $xoopsModuleConfig; |
| 357 | - $keywords = $this->findMetaKeywords($this->_original_title . ' ' . $this->_description, $this->_minChar); |
|
| 357 | + $keywords = $this->findMetaKeywords($this->_original_title.' '.$this->_description, $this->_minChar); |
|
| 358 | 358 | if (isset($xoopsModuleConfig) && isset($xoopsModuleConfig['moduleMetaKeywords']) |
| 359 | 359 | && $xoopsModuleConfig['moduleMetaKeywords'] !== '') { |
| 360 | 360 | $moduleKeywords = explode(',', $xoopsModuleConfig['moduleMetaKeywords']); |
@@ -13,23 +13,23 @@ |
||
| 13 | 13 | |
| 14 | 14 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
| 15 | 15 | |
| 16 | -require_once XOOPS_ROOT_PATH . '/modules/smartobject/include/common.php'; |
|
| 16 | +require_once XOOPS_ROOT_PATH.'/modules/smartobject/include/common.php'; |
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * Include other classes used by the SmartObject |
| 20 | 20 | */ |
| 21 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecthandler.php'; |
|
| 22 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smartobject.php'; |
|
| 23 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectsregistry.php'; |
|
| 21 | +require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecthandler.php'; |
|
| 22 | +require_once SMARTOBJECT_ROOT_PATH.'class/smartobject.php'; |
|
| 23 | +require_once SMARTOBJECT_ROOT_PATH.'class/smartobjectsregistry.php'; |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * Including SmartHook feature |
| 27 | 27 | */ |
| 28 | 28 | |
| 29 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smarthookhandler.php'; |
|
| 29 | +require_once SMARTOBJECT_ROOT_PATH.'class/smarthookhandler.php'; |
|
| 30 | 30 | $smarthookHandler = SmartHookHandler::getInstance(); |
| 31 | 31 | |
| 32 | 32 | if (!class_exists('smartmetagen')) { |
| 33 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartmetagen.php'; |
|
| 33 | + require_once SMARTOBJECT_ROOT_PATH.'class/smartmetagen.php'; |
|
| 34 | 34 | } |
| 35 | 35 | //$smartobjectConfig = smart_getModuleConfig('smartobject'); |
@@ -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 | -require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobject.php'; |
|
| 27 | -require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjecthandler.php'; |
|
| 26 | +require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobject.php'; |
|
| 27 | +require_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') === '' |
| 89 | 89 | && $fileObj->getVar('url') === '')) { |
| 90 | 90 | $res = $smartObj->storeFileObj($fileObj); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $value = strtotime($_POST[$key]); |
| 109 | 109 | //if strtotime returns false, the value is already a time stamp |
| 110 | 110 | if (!$value) { |
| 111 | - $value = (int)$_POST[$key]; |
|
| 111 | + $value = (int) $_POST[$key]; |
|
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | $smartObj->setVar($key, $value); |
@@ -151,13 +151,13 @@ discard block |
||
| 151 | 151 | |
| 152 | 152 | // Check if there were uploaded files |
| 153 | 153 | if (isset($_POST['smart_upload_image']) || isset($_POST['smart_upload_file'])) { |
| 154 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartuploader.php'; |
|
| 154 | + require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartuploader.php'; |
|
| 155 | 155 | $uploaderObj = new SmartUploader($smartObj->getImageDir(true), $this->handler->_allowedMimeTypes, $this->handler->_maxFileSize, $this->handler->_maxWidth, $this->handler->_maxHeight); |
| 156 | 156 | foreach ($_FILES as $name => $file_array) { |
| 157 | 157 | if (isset($file_array['name']) && $file_array['name'] !== '' |
| 158 | 158 | && in_array(str_replace('upload_', '', $name), array_keys($smartObj->vars))) { |
| 159 | 159 | if ($uploaderObj->fetchMedia($name)) { |
| 160 | - $uploaderObj->setTargetFileName(time() . '_' . $uploaderObj->getMediaName()); |
|
| 160 | + $uploaderObj->setTargetFileName(time().'_'.$uploaderObj->getMediaName()); |
|
| 161 | 161 | if ($uploaderObj->upload()) { |
| 162 | 162 | // Find the related field in the SmartObject |
| 163 | 163 | $related_field = str_replace('upload_', '', $name); |
@@ -166,14 +166,14 @@ discard block |
||
| 166 | 166 | if ($smartObj->vars[$related_field]['data_type'] === XOBJ_DTYPE_FILE) { |
| 167 | 167 | $object_fileurl = $smartObj->getUploadDir(); |
| 168 | 168 | $fileObj = $smartObj->getFileObj($related_field); |
| 169 | - $fileObj->setVar('url', $object_fileurl . $uploaderObj->getSavedFileName()); |
|
| 170 | - $fileObj->setVar('caption', $_POST['caption_' . $related_field]); |
|
| 171 | - $fileObj->setVar('description', $_POST['desc_' . $related_field]); |
|
| 169 | + $fileObj->setVar('url', $object_fileurl.$uploaderObj->getSavedFileName()); |
|
| 170 | + $fileObj->setVar('caption', $_POST['caption_'.$related_field]); |
|
| 171 | + $fileObj->setVar('description', $_POST['desc_'.$related_field]); |
|
| 172 | 172 | $smartObj->storeFileObj($fileObj); |
| 173 | 173 | //todo: catch errors |
| 174 | 174 | $smartObj->setVar($related_field, $fileObj->getVar('fileid')); |
| 175 | 175 | } else { |
| 176 | - $old_file = $smartObj->getUploadDir(true) . $smartObj->getVar($related_field); |
|
| 176 | + $old_file = $smartObj->getUploadDir(true).$smartObj->getVar($related_field); |
|
| 177 | 177 | unlink($old_file); |
| 178 | 178 | $smartObj->setVar($related_field, $uploaderObj->getSavedFileName()); |
| 179 | 179 | } |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | return $smartObj; |
| 205 | 205 | } else { |
| 206 | 206 | if (!$storeResult) { |
| 207 | - redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $smartObj->getHtmlErrors()); |
|
| 207 | + redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR.$smartObj->getHtmlErrors()); |
|
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | $redirect_page = $redirect_page ?: smart_get_page_before_form(); |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | $debug = false, |
| 234 | 234 | $x_param = false |
| 235 | 235 | ) { |
| 236 | - $objectid = isset($_POST[$this->handler->keyName]) ? (int)$_POST[$this->handler->keyName] : 0; |
|
| 236 | + $objectid = isset($_POST[$this->handler->keyName]) ? (int) $_POST[$this->handler->keyName] : 0; |
|
| 237 | 237 | if ($debug) { |
| 238 | 238 | if ($x_param) { |
| 239 | 239 | $smartObj = $this->handler->getD($objectid, true, $x_param); |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | { |
| 310 | 310 | global $smart_previous_page; |
| 311 | 311 | |
| 312 | - $objectid = isset($_REQUEST[$this->handler->keyName]) ? (int)$_REQUEST[$this->handler->keyName] : 0; |
|
| 312 | + $objectid = isset($_REQUEST[$this->handler->keyName]) ? (int) $_REQUEST[$this->handler->keyName] : 0; |
|
| 313 | 313 | $smartObj = $this->handler->get($objectid); |
| 314 | 314 | |
| 315 | 315 | if ($smartObj->isNew()) { |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0; |
| 320 | 320 | if ($confirm) { |
| 321 | 321 | if (!$this->handler->delete($smartObj)) { |
| 322 | - redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_ERROR . $smartObj->getHtmlErrors()); |
|
| 322 | + redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_ERROR.$smartObj->getHtmlErrors()); |
|
| 323 | 323 | exit; |
| 324 | 324 | } |
| 325 | 325 | |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | { |
| 354 | 354 | global $smart_previous_page, $xoopsTpl; |
| 355 | 355 | |
| 356 | - $objectid = isset($_REQUEST[$this->handler->keyName]) ? (int)$_REQUEST[$this->handler->keyName] : 0; |
|
| 356 | + $objectid = isset($_REQUEST[$this->handler->keyName]) ? (int) $_REQUEST[$this->handler->keyName] : 0; |
|
| 357 | 357 | $smartObj = $this->handler->get($objectid); |
| 358 | 358 | |
| 359 | 359 | if ($smartObj->isNew()) { |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0; |
| 364 | 364 | if ($confirm) { |
| 365 | 365 | if (!$this->handler->delete($smartObj)) { |
| 366 | - redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_ERROR . $smartObj->getHtmlErrors()); |
|
| 366 | + redirect_header($_POST['redirect_page'], 3, _CO_SOBJECT_DELETE_ERROR.$smartObj->getHtmlErrors()); |
|
| 367 | 367 | exit; |
| 368 | 368 | } |
| 369 | 369 | |
@@ -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 ($seoMode === 'rewrite') { |
| 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 ($seoMode === 'pathinfo') { |
| 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 = smart_getModuleInfo($smartObj->handler->_moduleName); |
| 513 | 513 | $link = smart_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 | } |
@@ -8,8 +8,8 @@ discard block |
||
| 8 | 8 | */ |
| 9 | 9 | function smartobject_addto_show($options) |
| 10 | 10 | { |
| 11 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/include/common.php'; |
|
| 12 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartaddto.php'; |
|
| 11 | + require_once XOOPS_ROOT_PATH.'/modules/smartobject/include/common.php'; |
|
| 12 | + require_once SMARTOBJECT_ROOT_PATH.'class/smartaddto.php'; |
|
| 13 | 13 | $smartaddto = new SmartAddTo($options[0]); |
| 14 | 14 | $block = $smartaddto->renderForBlock(); |
| 15 | 15 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | function smartobject_addto_edit($options) |
| 24 | 24 | { |
| 25 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 25 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 26 | 26 | |
| 27 | 27 | $form = ''; |
| 28 | 28 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | $layout_select->addOption(1, _MB_SOBJECT_BLOCKS_ADDTO_LAYOUT_OPTION1); |
| 32 | 32 | $layout_select->addOption(2, _MB_SOBJECT_BLOCKS_ADDTO_LAYOUT_OPTION2); |
| 33 | 33 | $layout_select->addOption(3, _MB_SOBJECT_BLOCKS_ADDTO_LAYOUT_OPTION3); |
| 34 | - $form .= $layout_select->getCaption() . ' ' . $layout_select->render() . '<br>'; |
|
| 34 | + $form .= $layout_select->getCaption().' '.$layout_select->render().'<br>'; |
|
| 35 | 35 | |
| 36 | 36 | return $form; |
| 37 | 37 | } |
@@ -7,17 +7,17 @@ discard block |
||
| 7 | 7 | * Licence: GNU |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -require_once __DIR__ . '/header.php'; |
|
| 11 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smartloader.php'; |
|
| 12 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectlink.php'; |
|
| 13 | -require_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
| 10 | +require_once __DIR__.'/header.php'; |
|
| 11 | +require_once SMARTOBJECT_ROOT_PATH.'class/smartloader.php'; |
|
| 12 | +require_once SMARTOBJECT_ROOT_PATH.'class/smartobjectlink.php'; |
|
| 13 | +require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
| 14 | 14 | |
| 15 | 15 | $xoopsTpl = new XoopsTpl(); |
| 16 | 16 | $myts = MyTextSanitizer::getInstance(); |
| 17 | 17 | $xoopsConfig['sitename'] = $myts->displayTarea($xoopsConfig['sitename']); |
| 18 | 18 | |
| 19 | 19 | xoops_header(false); |
| 20 | -echo smart_get_css_link(SMARTOBJECT_URL . 'assets/css/module.css'); |
|
| 20 | +echo smart_get_css_link(SMARTOBJECT_URL.'assets/css/module.css'); |
|
| 21 | 21 | echo '</head><body>'; |
| 22 | 22 | |
| 23 | 23 | $smartobjectLinkHandler = xoops_getModuleHandler('link', 'smartobject'); |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | switch ($op) { |
| 29 | 29 | case 'sendlink': |
| 30 | 30 | |
| 31 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 31 | + require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 32 | 32 | $controller = new SmartObjectController($smartobjectLinkHandler); |
| 33 | 33 | |
| 34 | 34 | $linkObj = $controller->storeSmartObject(); |
@@ -40,13 +40,13 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | $xoopsMailer = xoops_getMailer(); |
| 42 | 42 | $xoopsMailer->useMail(); |
| 43 | - $xoopsMailer->setTemplateDir('language/' . $xoopsConfig['language'] . '/mail_template'); |
|
| 43 | + $xoopsMailer->setTemplateDir('language/'.$xoopsConfig['language'].'/mail_template'); |
|
| 44 | 44 | |
| 45 | 45 | $xoopsMailer->setTemplate('sendlink.tpl'); |
| 46 | 46 | $xoopsMailer->assign('X_SITENAME', $xoopsConfig['sitename']); |
| 47 | 47 | $xoopsMailer->assign('TO_NAME', $linkObj->getVar('to_name')); |
| 48 | 48 | $xoopsMailer->assign('FROM_NAME', $linkObj->getVar('from_name')); |
| 49 | - $xoopsMailer->assign('SITEURL', XOOPS_URL . '/'); |
|
| 49 | + $xoopsMailer->assign('SITEURL', XOOPS_URL.'/'); |
|
| 50 | 50 | $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']); |
| 51 | 51 | $xoopsMailer->assign('MESSAGE', $_POST['body']); |
| 52 | 52 | $xoopsMailer->setToEmails($linkObj->getVar('to_email')); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $xoopsMailer->setSubject(sprintf(_CO_SOBJECT_SUBJECT_DEFAULT, $myts->oopsStripSlashesGPC($xoopsConfig['sitename']))); |
| 56 | 56 | |
| 57 | 57 | if (!$xoopsMailer->send(true)) { |
| 58 | - $xoopsTpl->assign('send_error', sprintf(_CO_SOBJECT_SEND_ERROR, $xoopsConfig['adminmail']) . '<br>' . $xoopsMailer->getErrors(true)); |
|
| 58 | + $xoopsTpl->assign('send_error', sprintf(_CO_SOBJECT_SEND_ERROR, $xoopsConfig['adminmail']).'<br>'.$xoopsMailer->getErrors(true)); |
|
| 59 | 59 | } else { |
| 60 | 60 | $xoopsTpl->assign('send_success', _CO_SOBJECT_SEND_SUCCESS); |
| 61 | 61 | } |
@@ -40,9 +40,9 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | -require_once __DIR__ . '/admin_header.php'; |
|
| 44 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 45 | -require_once SMARTOBJECT_ROOT_PATH . 'class/adsense.php'; |
|
| 43 | +require_once __DIR__.'/admin_header.php'; |
|
| 44 | +require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecttable.php'; |
|
| 45 | +require_once SMARTOBJECT_ROOT_PATH.'class/adsense.php'; |
|
| 46 | 46 | $smartobjectAdsenseHandler = xoops_getModuleHandler('adsense'); |
| 47 | 47 | smart_loadLanguageFile('smartobject', 'adsense'); |
| 48 | 48 | $adminObject = \Xmf\Module\Admin::getInstance(); |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | switch ($op) { |
| 60 | 60 | case 'mod': |
| 61 | 61 | |
| 62 | - $adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0; |
|
| 62 | + $adsenseid = isset($_GET['adsenseid']) ? (int) $_GET['adsenseid'] : 0; |
|
| 63 | 63 | |
| 64 | 64 | smart_xoops_cp_header(); |
| 65 | 65 | $adminObject->displayNavigation(basename(__FILE__)); |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | case 'clone': |
| 71 | 71 | |
| 72 | - $adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0; |
|
| 72 | + $adsenseid = isset($_GET['adsenseid']) ? (int) $_GET['adsenseid'] : 0; |
|
| 73 | 73 | |
| 74 | 74 | smart_xoops_cp_header(); |
| 75 | 75 | $adminObject->displayNavigation(basename(__FILE__)); |
@@ -78,21 +78,21 @@ discard block |
||
| 78 | 78 | break; |
| 79 | 79 | |
| 80 | 80 | case 'addadsense': |
| 81 | - if (@require_once SMARTOBJECT_ROOT_PATH . 'include/captcha/captcha.php') { |
|
| 81 | + if (@require_once SMARTOBJECT_ROOT_PATH.'include/captcha/captcha.php') { |
|
| 82 | 82 | $xoopsCaptcha = XoopsCaptcha::getInstance(); |
| 83 | 83 | if (!$xoopsCaptcha->verify()) { |
| 84 | 84 | redirect_header('javascript:history.go(-1);', 3, $xoopsCaptcha->getMessage()); |
| 85 | 85 | exit; |
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 88 | + require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 89 | 89 | $controller = new SmartObjectController($smartobjectAdsenseHandler); |
| 90 | 90 | $controller->storeFromDefaultForm(_AM_SOBJECT_ADSENSES_CREATED, _AM_SOBJECT_ADSENSES_MODIFIED); |
| 91 | 91 | break; |
| 92 | 92 | |
| 93 | 93 | case 'del': |
| 94 | 94 | |
| 95 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 95 | + require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 96 | 96 | $controller = new SmartObjectController($smartobjectAdsenseHandler); |
| 97 | 97 | $controller->handleObjectDeletion(); |
| 98 | 98 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | smart_collapsableBar('createdadsenses', _AM_SOBJECT_ADSENSES, _AM_SOBJECT_ADSENSES_DSC); |
| 109 | 109 | |
| 110 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 110 | + require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecttable.php'; |
|
| 111 | 111 | $objectTable = new SmartObjectTable($smartobjectAdsenseHandler); |
| 112 | 112 | $objectTable->addColumn(new SmartObjectColumn('description', 'left')); |
| 113 | 113 | $objectTable->addColumn(new SmartObjectColumn(_AM_SOBJECT_ADSENSE_TAG, 'center', 200, 'getXoopsCode')); |
@@ -154,4 +154,4 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | //smart_modFooter(); |
| 156 | 156 | //xoops_cp_footer(); |
| 157 | -require_once __DIR__ . '/admin_footer.php'; |
|
| 157 | +require_once __DIR__.'/admin_footer.php'; |
|
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | * Licence: GNU |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -require_once __DIR__ . '/../../../include/cp_header.php'; |
|
| 10 | +require_once __DIR__.'/../../../include/cp_header.php'; |
|
| 11 | 11 | |
| 12 | -require_once XOOPS_ROOT_PATH . '/modules/smartobject/include/common.php'; |
|
| 12 | +require_once XOOPS_ROOT_PATH.'/modules/smartobject/include/common.php'; |
|
| 13 | 13 | smart_loadCommonLanguageFile(); |