1
|
|
|
<?php namespace XoopsModules\Smartobject; |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* Contains the basis classes for managing any objects derived from SmartObjects |
5
|
|
|
* |
6
|
|
|
* @license GNU |
7
|
|
|
* @author marcan <[email protected]> |
8
|
|
|
* @link http://smartfactory.ca The SmartFactory |
9
|
|
|
* @package SmartObject |
10
|
|
|
* @subpackage SmartObjectCore |
11
|
|
|
*/ |
12
|
|
|
|
13
|
|
|
|
14
|
|
|
use XoopsModules\Smartobject; |
15
|
|
|
|
16
|
|
|
|
17
|
|
|
// defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
18
|
|
|
//require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobject.php'; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* SmartObject base SEO-enabled class |
22
|
|
|
* |
23
|
|
|
* Base class representing a single SmartObject with "search engine optimisation" capabilities |
24
|
|
|
* |
25
|
|
|
* @package SmartObject |
26
|
|
|
* @author marcan <[email protected]> |
27
|
|
|
* @link http://smartfactory.ca The SmartFactory |
28
|
|
|
*/ |
29
|
|
|
class SeoObject extends Smartobject\BaseSmartObject |
30
|
|
|
{ |
31
|
|
|
/** |
32
|
|
|
* SmartSeoObject constructor. |
33
|
|
|
*/ |
34
|
|
|
public function __construct() |
35
|
|
|
{ |
36
|
|
|
$this->initCommonVar('meta_keywords'); |
37
|
|
|
$this->initCommonVar('meta_description'); |
38
|
|
|
$this->initCommonVar('short_url'); |
39
|
|
|
$this->seoEnabled = true; |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* Return the value of the short_url field of this object |
44
|
|
|
* |
45
|
|
|
* @return string |
46
|
|
|
*/ |
47
|
|
|
public function short_url() |
48
|
|
|
{ |
49
|
|
|
return $this->getVar('short_url'); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* Return the value of the meta_keywords field of this object |
54
|
|
|
* |
55
|
|
|
* @return string |
56
|
|
|
*/ |
57
|
|
|
public function meta_keywords() |
58
|
|
|
{ |
59
|
|
|
return $this->getVar('meta_keywords'); |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* Return the value of the meta_description field of this object |
64
|
|
|
* |
65
|
|
|
* @return string |
66
|
|
|
*/ |
67
|
|
|
public function meta_description() |
68
|
|
|
{ |
69
|
|
|
return $this->getVar('meta_description'); |
70
|
|
|
} |
71
|
|
|
} |
72
|
|
|
|