| @@ 276-295 (lines=20) @@ | ||
| 273 | * @param string $metaKeywords Page's meta keywords |
|
| 274 | * @return void |
|
| 275 | */ |
|
| 276 | public static function setMetas($pageTitle = '', $metaDescription = '', $metaKeywords = '') |
|
| 277 | { |
|
| 278 | global $xoTheme, $xoTheme, $xoopsTpl; |
|
| 279 | $xoopsTpl->assign('xoops_pagetitle', $pageTitle); |
|
| 280 | if (isset($xoTheme) && is_object($xoTheme)) { |
|
| 281 | if (!empty($metaKeywords)) { |
|
| 282 | $xoTheme->addMeta('meta', 'keywords', $metaKeywords); |
|
| 283 | } |
|
| 284 | if (!empty($metaDescription)) { |
|
| 285 | $xoTheme->addMeta('meta', 'description', $metaDescription); |
|
| 286 | } |
|
| 287 | } elseif (isset($xoopsTpl) && is_object($xoopsTpl)) { // Compatibility for old Xoops versions |
|
| 288 | if (!empty($metaKeywords)) { |
|
| 289 | $xoopsTpl->assign('xoops_meta_keywords', $metaKeywords); |
|
| 290 | } |
|
| 291 | if (!empty($metaDescription)) { |
|
| 292 | $xoopsTpl->assign('xoops_meta_description', $metaDescription); |
|
| 293 | } |
|
| 294 | } |
|
| 295 | } |
|
| 296 | ||
| 297 | /** |
|
| 298 | * Send an email from a template to a list of recipients |
|
| @@ 420-439 (lines=20) @@ | ||
| 417 | * @param string $metaKeywords Page's meta keywords |
|
| 418 | * @return void |
|
| 419 | */ |
|
| 420 | public static function setMetas($pageTitle = '', $metaDescription = '', $metaKeywords = '') |
|
| 421 | { |
|
| 422 | global $xoTheme, $xoTheme, $xoopsTpl; |
|
| 423 | $xoopsTpl->assign('xoops_pagetitle', $pageTitle); |
|
| 424 | if (isset($xoTheme) && is_object($xoTheme)) { |
|
| 425 | if (!empty($metaKeywords)) { |
|
| 426 | $xoTheme->addMeta('meta', 'keywords', $metaKeywords); |
|
| 427 | } |
|
| 428 | if (!empty($metaDescription)) { |
|
| 429 | $xoTheme->addMeta('meta', 'description', $metaDescription); |
|
| 430 | } |
|
| 431 | } elseif (isset($xoopsTpl) && is_object($xoopsTpl)) { // Compatibility for old Xoops versions |
|
| 432 | if (!empty($metaKeywords)) { |
|
| 433 | $xoopsTpl->assign('xoops_meta_keywords', $metaKeywords); |
|
| 434 | } |
|
| 435 | if (!empty($metaDescription)) { |
|
| 436 | $xoopsTpl->assign('xoops_meta_description', $metaDescription); |
|
| 437 | } |
|
| 438 | } |
|
| 439 | } |
|
| 440 | ||
| 441 | /** |
|
| 442 | * Send an email from a template to a list of recipients |
|