@@ -16,14 +16,14 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | class SmartFormSelect_multiElement extends SmartFormSelectElement |
| 18 | 18 | { |
| 19 | - /** |
|
| 20 | - * SmartFormSelect_multiElement constructor. |
|
| 21 | - * @param string $object |
|
| 22 | - * @param string $key |
|
| 23 | - */ |
|
| 24 | - public function __construct($object, $key) |
|
| 25 | - { |
|
| 26 | - $this->multiple = true; |
|
| 27 | - parent::__construct($object, $key); |
|
| 28 | - } |
|
| 19 | + /** |
|
| 20 | + * SmartFormSelect_multiElement constructor. |
|
| 21 | + * @param string $object |
|
| 22 | + * @param string $key |
|
| 23 | + */ |
|
| 24 | + public function __construct($object, $key) |
|
| 25 | + { |
|
| 26 | + $this->multiple = true; |
|
| 27 | + parent::__construct($object, $key); |
|
| 28 | + } |
|
| 29 | 29 | } |
@@ -11,18 +11,18 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | class SmartFormAutocompleteElement extends SmartAutocompleteElement |
| 13 | 13 | { |
| 14 | - /** |
|
| 15 | - * SmartFormAutocompleteElement constructor. |
|
| 16 | - * @param string $object |
|
| 17 | - * @param string $key |
|
| 18 | - */ |
|
| 19 | - public function __construct($object, $key) |
|
| 20 | - { |
|
| 21 | - $var = $object->vars[$key]; |
|
| 22 | - $control = $object->controls[$key]; |
|
| 23 | - $form_maxlength = isset($control['maxlength']) ? $control['maxlength'] : (isset($var['maxlength']) ? $var['maxlength'] : 255); |
|
| 14 | + /** |
|
| 15 | + * SmartFormAutocompleteElement constructor. |
|
| 16 | + * @param string $object |
|
| 17 | + * @param string $key |
|
| 18 | + */ |
|
| 19 | + public function __construct($object, $key) |
|
| 20 | + { |
|
| 21 | + $var = $object->vars[$key]; |
|
| 22 | + $control = $object->controls[$key]; |
|
| 23 | + $form_maxlength = isset($control['maxlength']) ? $control['maxlength'] : (isset($var['maxlength']) ? $var['maxlength'] : 255); |
|
| 24 | 24 | |
| 25 | - $form_size = isset($control['size']) ? $control['size'] : 50; |
|
| 26 | - parent::__construct($var['form_caption'], $key, $form_size, $form_maxlength, $object->getVar($key, 'e')); |
|
| 27 | - } |
|
| 25 | + $form_size = isset($control['size']) ? $control['size'] : 50; |
|
| 26 | + parent::__construct($var['form_caption'], $key, $form_size, $form_maxlength, $object->getVar($key, 'e')); |
|
| 27 | + } |
|
| 28 | 28 | } |
@@ -11,13 +11,13 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | class SmartFormYesnoElement extends XoopsFormRadioYN |
| 13 | 13 | { |
| 14 | - /** |
|
| 15 | - * SmartFormYesnoElement constructor. |
|
| 16 | - * @param string $object |
|
| 17 | - * @param string $key |
|
| 18 | - */ |
|
| 19 | - public function __construct($object, $key) |
|
| 20 | - { |
|
| 21 | - parent::__construct($object->vars[$key]['form_caption'], $key, $object->getVar($key, 'e')); |
|
| 22 | - } |
|
| 14 | + /** |
|
| 15 | + * SmartFormYesnoElement constructor. |
|
| 16 | + * @param string $object |
|
| 17 | + * @param string $key |
|
| 18 | + */ |
|
| 19 | + public function __construct($object, $key) |
|
| 20 | + { |
|
| 21 | + parent::__construct($object->vars[$key]['form_caption'], $key, $object->getVar($key, 'e')); |
|
| 22 | + } |
|
| 23 | 23 | } |
@@ -11,38 +11,38 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | class SmartAutocompleteElement extends XoopsFormText |
| 13 | 13 | { |
| 14 | - public $_include_file; |
|
| 14 | + public $_include_file; |
|
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * SmartAutocompleteElement constructor. |
|
| 18 | - * @param string $caption |
|
| 19 | - * @param string $name |
|
| 20 | - * @param int $include_file |
|
| 21 | - * @param int $size |
|
| 22 | - * @param string $maxlength |
|
| 23 | - * @param string $value |
|
| 24 | - */ |
|
| 25 | - public function __construct($caption, $name, $include_file, $size, $maxlength, $value = '') |
|
| 26 | - { |
|
| 27 | - $this->_include_file = $include_file; |
|
| 28 | - parent::__construct($caption, $name, $size, $maxlength, $value); |
|
| 29 | - } |
|
| 16 | + /** |
|
| 17 | + * SmartAutocompleteElement constructor. |
|
| 18 | + * @param string $caption |
|
| 19 | + * @param string $name |
|
| 20 | + * @param int $include_file |
|
| 21 | + * @param int $size |
|
| 22 | + * @param string $maxlength |
|
| 23 | + * @param string $value |
|
| 24 | + */ |
|
| 25 | + public function __construct($caption, $name, $include_file, $size, $maxlength, $value = '') |
|
| 26 | + { |
|
| 27 | + $this->_include_file = $include_file; |
|
| 28 | + parent::__construct($caption, $name, $size, $maxlength, $value); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * Prepare HTML for output |
|
| 33 | - * |
|
| 34 | - * @return string HTML |
|
| 35 | - */ |
|
| 36 | - public function render() |
|
| 37 | - { |
|
| 38 | - $ret = "<input type='text' name='" . $this->getName() . "' id='" . $this->getName() . "' size='" . $this->getSize() . "' maxlength='" . $this->getMaxlength() . "' value='" . $this->getValue() . "'" . $this->getExtra() . ' />'; |
|
| 31 | + /** |
|
| 32 | + * Prepare HTML for output |
|
| 33 | + * |
|
| 34 | + * @return string HTML |
|
| 35 | + */ |
|
| 36 | + public function render() |
|
| 37 | + { |
|
| 38 | + $ret = "<input type='text' name='" . $this->getName() . "' id='" . $this->getName() . "' size='" . $this->getSize() . "' maxlength='" . $this->getMaxlength() . "' value='" . $this->getValue() . "'" . $this->getExtra() . ' />'; |
|
| 39 | 39 | |
| 40 | - $ret .= ' <div class="smartobject_autocomplete_hint" id="smartobject_autocomplete_hint' . $this->getName() . '"></div> |
|
| 40 | + $ret .= ' <div class="smartobject_autocomplete_hint" id="smartobject_autocomplete_hint' . $this->getName() . '"></div> |
|
| 41 | 41 | |
| 42 | 42 | <script type="text/javascript"> |
| 43 | 43 | new Ajax.Autocompleter("' . $this->getName() . '","smartobject_autocomplete_hint' . $this->getName() . '","' . $this->_include_file . '?key=' . $this->getName() . '"); |
| 44 | 44 | </script>'; |
| 45 | 45 | |
| 46 | - return $ret; |
|
| 47 | - } |
|
| 46 | + return $ret; |
|
| 47 | + } |
|
| 48 | 48 | } |
@@ -30,11 +30,11 @@ |
||
| 30 | 30 | // ------------------------------------------------------------------------- // |
| 31 | 31 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
| 32 | 32 | /** |
| 33 | - * Class for users |
|
| 34 | - * @author Kazumi Ono <[email protected]> |
|
| 35 | - * @copyright copyright (c) 2000-2003 XOOPS.org |
|
| 36 | - * @package kernel |
|
| 37 | - */ |
|
| 33 | + * Class for users |
|
| 34 | + * @author Kazumi Ono <[email protected]> |
|
| 35 | + * @copyright copyright (c) 2000-2003 XOOPS.org |
|
| 36 | + * @package kernel |
|
| 37 | + */ |
|
| 38 | 38 | class SmartobjectUser extends XoopsUser |
| 39 | 39 | { |
| 40 | 40 | } |
@@ -36,29 +36,29 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | class SmartobjectBasedUrl extends SmartObject |
| 38 | 38 | { |
| 39 | - /** |
|
| 40 | - * SmartobjectBasedUrl constructor. |
|
| 41 | - */ |
|
| 42 | - public function __construct() |
|
| 43 | - { |
|
| 44 | - $this->quickInitVar('caption', XOBJ_DTYPE_TXTBOX, false); |
|
| 45 | - $this->quickInitVar('description', XOBJ_DTYPE_TXTBOX, false); |
|
| 46 | - $this->quickInitVar('url', XOBJ_DTYPE_TXTBOX, false); |
|
| 47 | - } |
|
| 39 | + /** |
|
| 40 | + * SmartobjectBasedUrl constructor. |
|
| 41 | + */ |
|
| 42 | + public function __construct() |
|
| 43 | + { |
|
| 44 | + $this->quickInitVar('caption', XOBJ_DTYPE_TXTBOX, false); |
|
| 45 | + $this->quickInitVar('description', XOBJ_DTYPE_TXTBOX, false); |
|
| 46 | + $this->quickInitVar('url', XOBJ_DTYPE_TXTBOX, false); |
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | - /** |
|
| 50 | - * @param string $key |
|
| 51 | - * @param string $format |
|
| 52 | - * @return mixed |
|
| 53 | - */ |
|
| 54 | - public function getVar($key, $format = 'e') |
|
| 55 | - { |
|
| 56 | - if (0 === strpos($key, 'url_')) { |
|
| 57 | - return parent::getVar('url', $format); |
|
| 58 | - } elseif (0 === strpos($key, 'caption_')) { |
|
| 59 | - return parent::getVar('caption', $format); |
|
| 60 | - } else { |
|
| 61 | - return parent::getVar($key, $format); |
|
| 62 | - } |
|
| 63 | - } |
|
| 49 | + /** |
|
| 50 | + * @param string $key |
|
| 51 | + * @param string $format |
|
| 52 | + * @return mixed |
|
| 53 | + */ |
|
| 54 | + public function getVar($key, $format = 'e') |
|
| 55 | + { |
|
| 56 | + if (0 === strpos($key, 'url_')) { |
|
| 57 | + return parent::getVar('url', $format); |
|
| 58 | + } elseif (0 === strpos($key, 'caption_')) { |
|
| 59 | + return parent::getVar('caption', $format); |
|
| 60 | + } else { |
|
| 61 | + return parent::getVar($key, $format); |
|
| 62 | + } |
|
| 63 | + } |
|
| 64 | 64 | } |
@@ -37,115 +37,115 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | class SmartobjectCurrency extends SmartObject |
| 39 | 39 | { |
| 40 | - public $_modulePlugin = false; |
|
| 41 | - |
|
| 42 | - /** |
|
| 43 | - * SmartobjectCurrency constructor. |
|
| 44 | - */ |
|
| 45 | - public function __construct() |
|
| 46 | - { |
|
| 47 | - $this->quickInitVar('currencyid', XOBJ_DTYPE_INT, true); |
|
| 48 | - $this->quickInitVar('iso4217', XOBJ_DTYPE_TXTBOX, true, _CO_SOBJECT_CURRENCY_ISO4217, _CO_SOBJECT_CURRENCY_ISO4217_DSC); |
|
| 49 | - $this->quickInitVar('name', XOBJ_DTYPE_TXTBOX, true, _CO_SOBJECT_CURRENCY_NAME); |
|
| 50 | - $this->quickInitVar('symbol', XOBJ_DTYPE_TXTBOX, true, _CO_SOBJECT_CURRENCY_SYMBOL); |
|
| 51 | - $this->quickInitVar('rate', XOBJ_DTYPE_FLOAT, true, _CO_SOBJECT_CURRENCY_RATE, '', '1.0'); |
|
| 52 | - $this->quickInitVar('default_currency', XOBJ_DTYPE_INT, false, _CO_SOBJECT_CURRENCY_DEFAULT, '', false); |
|
| 53 | - |
|
| 54 | - $this->setControl('symbol', array( |
|
| 55 | - 'name' => 'text', |
|
| 56 | - 'size' => '15', |
|
| 57 | - 'maxlength' => '15' |
|
| 58 | - )); |
|
| 59 | - |
|
| 60 | - $this->setControl('iso4217', array( |
|
| 61 | - 'name' => 'text', |
|
| 62 | - 'size' => '5', |
|
| 63 | - 'maxlength' => '5' |
|
| 64 | - )); |
|
| 65 | - |
|
| 66 | - $this->setControl('rate', array( |
|
| 67 | - 'name' => 'text', |
|
| 68 | - 'size' => '5', |
|
| 69 | - 'maxlength' => '5' |
|
| 70 | - )); |
|
| 71 | - |
|
| 72 | - $this->setControl('rate', array( |
|
| 73 | - 'name' => 'text', |
|
| 74 | - 'size' => '5', |
|
| 75 | - 'maxlength' => '5' |
|
| 76 | - )); |
|
| 77 | - |
|
| 78 | - $this->hideFieldFromForm('default_currency'); |
|
| 79 | - } |
|
| 80 | - |
|
| 81 | - /** |
|
| 82 | - * @param string $key |
|
| 83 | - * @param string $format |
|
| 84 | - * @return mixed |
|
| 85 | - */ |
|
| 86 | - public function getVar($key, $format = 's') |
|
| 87 | - { |
|
| 88 | - if ($format === 's' && in_array($key, array('rate', 'default_currency'))) { |
|
| 89 | - // return call_user_func(array($this, $key)); |
|
| 90 | - return $this->{$key}(); |
|
| 91 | - } |
|
| 92 | - |
|
| 93 | - return parent::getVar($key, $format); |
|
| 94 | - } |
|
| 95 | - |
|
| 96 | - /** |
|
| 97 | - * @return mixed |
|
| 98 | - */ |
|
| 99 | - public function getCurrencyLink() |
|
| 100 | - { |
|
| 101 | - $ret = $this->getVar('name', 'e'); |
|
| 102 | - |
|
| 103 | - return $ret; |
|
| 104 | - } |
|
| 105 | - |
|
| 106 | - /** |
|
| 107 | - * @return mixed |
|
| 108 | - */ |
|
| 109 | - public function getCode() |
|
| 110 | - { |
|
| 111 | - $ret = $this->getVar('iso4217', 'e'); |
|
| 112 | - |
|
| 113 | - return $ret; |
|
| 114 | - } |
|
| 115 | - |
|
| 116 | - /** |
|
| 117 | - * @return float|int|mixed|string |
|
| 118 | - */ |
|
| 119 | - public function rate() |
|
| 120 | - { |
|
| 121 | - return smart_currency($this->getVar('rate', 'e')); |
|
| 122 | - } |
|
| 123 | - |
|
| 124 | - /** |
|
| 125 | - * @return string |
|
| 126 | - */ |
|
| 127 | - public function defaultCurrency() |
|
| 128 | - { |
|
| 129 | - if ($this->getVar('default_currency', 'e') == true) { |
|
| 130 | - return _YES; |
|
| 131 | - } else { |
|
| 132 | - return _NO; |
|
| 133 | - } |
|
| 134 | - } |
|
| 135 | - |
|
| 136 | - /** |
|
| 137 | - * @return string |
|
| 138 | - */ |
|
| 139 | - public function getDefaultCurrencyControl() |
|
| 140 | - { |
|
| 141 | - $radio_box = '<input name="default_currency" value="' . $this->getVar('currencyid') . '" type="radio"'; |
|
| 142 | - if ($this->getVar('default_currency', 'e')) { |
|
| 143 | - $radio_box .= 'checked="checked"'; |
|
| 144 | - } |
|
| 145 | - $radio_box .= '>'; |
|
| 146 | - |
|
| 147 | - return $radio_box; |
|
| 148 | - } |
|
| 40 | + public $_modulePlugin = false; |
|
| 41 | + |
|
| 42 | + /** |
|
| 43 | + * SmartobjectCurrency constructor. |
|
| 44 | + */ |
|
| 45 | + public function __construct() |
|
| 46 | + { |
|
| 47 | + $this->quickInitVar('currencyid', XOBJ_DTYPE_INT, true); |
|
| 48 | + $this->quickInitVar('iso4217', XOBJ_DTYPE_TXTBOX, true, _CO_SOBJECT_CURRENCY_ISO4217, _CO_SOBJECT_CURRENCY_ISO4217_DSC); |
|
| 49 | + $this->quickInitVar('name', XOBJ_DTYPE_TXTBOX, true, _CO_SOBJECT_CURRENCY_NAME); |
|
| 50 | + $this->quickInitVar('symbol', XOBJ_DTYPE_TXTBOX, true, _CO_SOBJECT_CURRENCY_SYMBOL); |
|
| 51 | + $this->quickInitVar('rate', XOBJ_DTYPE_FLOAT, true, _CO_SOBJECT_CURRENCY_RATE, '', '1.0'); |
|
| 52 | + $this->quickInitVar('default_currency', XOBJ_DTYPE_INT, false, _CO_SOBJECT_CURRENCY_DEFAULT, '', false); |
|
| 53 | + |
|
| 54 | + $this->setControl('symbol', array( |
|
| 55 | + 'name' => 'text', |
|
| 56 | + 'size' => '15', |
|
| 57 | + 'maxlength' => '15' |
|
| 58 | + )); |
|
| 59 | + |
|
| 60 | + $this->setControl('iso4217', array( |
|
| 61 | + 'name' => 'text', |
|
| 62 | + 'size' => '5', |
|
| 63 | + 'maxlength' => '5' |
|
| 64 | + )); |
|
| 65 | + |
|
| 66 | + $this->setControl('rate', array( |
|
| 67 | + 'name' => 'text', |
|
| 68 | + 'size' => '5', |
|
| 69 | + 'maxlength' => '5' |
|
| 70 | + )); |
|
| 71 | + |
|
| 72 | + $this->setControl('rate', array( |
|
| 73 | + 'name' => 'text', |
|
| 74 | + 'size' => '5', |
|
| 75 | + 'maxlength' => '5' |
|
| 76 | + )); |
|
| 77 | + |
|
| 78 | + $this->hideFieldFromForm('default_currency'); |
|
| 79 | + } |
|
| 80 | + |
|
| 81 | + /** |
|
| 82 | + * @param string $key |
|
| 83 | + * @param string $format |
|
| 84 | + * @return mixed |
|
| 85 | + */ |
|
| 86 | + public function getVar($key, $format = 's') |
|
| 87 | + { |
|
| 88 | + if ($format === 's' && in_array($key, array('rate', 'default_currency'))) { |
|
| 89 | + // return call_user_func(array($this, $key)); |
|
| 90 | + return $this->{$key}(); |
|
| 91 | + } |
|
| 92 | + |
|
| 93 | + return parent::getVar($key, $format); |
|
| 94 | + } |
|
| 95 | + |
|
| 96 | + /** |
|
| 97 | + * @return mixed |
|
| 98 | + */ |
|
| 99 | + public function getCurrencyLink() |
|
| 100 | + { |
|
| 101 | + $ret = $this->getVar('name', 'e'); |
|
| 102 | + |
|
| 103 | + return $ret; |
|
| 104 | + } |
|
| 105 | + |
|
| 106 | + /** |
|
| 107 | + * @return mixed |
|
| 108 | + */ |
|
| 109 | + public function getCode() |
|
| 110 | + { |
|
| 111 | + $ret = $this->getVar('iso4217', 'e'); |
|
| 112 | + |
|
| 113 | + return $ret; |
|
| 114 | + } |
|
| 115 | + |
|
| 116 | + /** |
|
| 117 | + * @return float|int|mixed|string |
|
| 118 | + */ |
|
| 119 | + public function rate() |
|
| 120 | + { |
|
| 121 | + return smart_currency($this->getVar('rate', 'e')); |
|
| 122 | + } |
|
| 123 | + |
|
| 124 | + /** |
|
| 125 | + * @return string |
|
| 126 | + */ |
|
| 127 | + public function defaultCurrency() |
|
| 128 | + { |
|
| 129 | + if ($this->getVar('default_currency', 'e') == true) { |
|
| 130 | + return _YES; |
|
| 131 | + } else { |
|
| 132 | + return _NO; |
|
| 133 | + } |
|
| 134 | + } |
|
| 135 | + |
|
| 136 | + /** |
|
| 137 | + * @return string |
|
| 138 | + */ |
|
| 139 | + public function getDefaultCurrencyControl() |
|
| 140 | + { |
|
| 141 | + $radio_box = '<input name="default_currency" value="' . $this->getVar('currencyid') . '" type="radio"'; |
|
| 142 | + if ($this->getVar('default_currency', 'e')) { |
|
| 143 | + $radio_box .= 'checked="checked"'; |
|
| 144 | + } |
|
| 145 | + $radio_box .= '>'; |
|
| 146 | + |
|
| 147 | + return $radio_box; |
|
| 148 | + } |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | /** |
@@ -153,22 +153,22 @@ discard block |
||
| 153 | 153 | */ |
| 154 | 154 | class SmartObjectCurrencyHandler extends SmartPersistableObjectHandler |
| 155 | 155 | { |
| 156 | - /** |
|
| 157 | - * SmartObjectCurrencyHandler constructor. |
|
| 158 | - * @param object|XoopsDatabase $db |
|
| 159 | - */ |
|
| 160 | - public function __construct($db) |
|
| 161 | - { |
|
| 162 | - parent::__construct($db, 'currency', 'currencyid', 'name', '', 'smartobject'); |
|
| 163 | - } |
|
| 164 | - |
|
| 165 | - /** |
|
| 166 | - * @return array |
|
| 167 | - */ |
|
| 168 | - public function getCurrencies() |
|
| 169 | - { |
|
| 170 | - $currenciesObj = $this->getObjects(null, true); |
|
| 171 | - |
|
| 172 | - return $currenciesObj; |
|
| 173 | - } |
|
| 156 | + /** |
|
| 157 | + * SmartObjectCurrencyHandler constructor. |
|
| 158 | + * @param object|XoopsDatabase $db |
|
| 159 | + */ |
|
| 160 | + public function __construct($db) |
|
| 161 | + { |
|
| 162 | + parent::__construct($db, 'currency', 'currencyid', 'name', '', 'smartobject'); |
|
| 163 | + } |
|
| 164 | + |
|
| 165 | + /** |
|
| 166 | + * @return array |
|
| 167 | + */ |
|
| 168 | + public function getCurrencies() |
|
| 169 | + { |
|
| 170 | + $currenciesObj = $this->getObjects(null, true); |
|
| 171 | + |
|
| 172 | + return $currenciesObj; |
|
| 173 | + } |
|
| 174 | 174 | } |
@@ -8,22 +8,22 @@ discard block |
||
| 8 | 8 | */ |
| 9 | 9 | class SmartobjectUrlLink extends SmartobjectBasedUrl |
| 10 | 10 | { |
| 11 | - /** |
|
| 12 | - * SmartobjectUrlLink constructor. |
|
| 13 | - */ |
|
| 14 | - public function __construct() |
|
| 15 | - { |
|
| 16 | - parent::__construct(); |
|
| 17 | - $this->quickInitVar('urllinkid', XOBJ_DTYPE_TXTBOX, true); |
|
| 18 | - $this->quickInitVar('target', XOBJ_DTYPE_TXTBOX, true); |
|
| 11 | + /** |
|
| 12 | + * SmartobjectUrlLink constructor. |
|
| 13 | + */ |
|
| 14 | + public function __construct() |
|
| 15 | + { |
|
| 16 | + parent::__construct(); |
|
| 17 | + $this->quickInitVar('urllinkid', XOBJ_DTYPE_TXTBOX, true); |
|
| 18 | + $this->quickInitVar('target', XOBJ_DTYPE_TXTBOX, true); |
|
| 19 | 19 | |
| 20 | - $this->setControl('target', array( |
|
| 21 | - 'options' => array( |
|
| 22 | - '_self' => _CO_SOBJECT_URLLINK_SELF, |
|
| 23 | - '_blank' => _CO_SOBJECT_URLLINK_BLANK |
|
| 24 | - ) |
|
| 25 | - )); |
|
| 26 | - } |
|
| 20 | + $this->setControl('target', array( |
|
| 21 | + 'options' => array( |
|
| 22 | + '_self' => _CO_SOBJECT_URLLINK_SELF, |
|
| 23 | + '_blank' => _CO_SOBJECT_URLLINK_BLANK |
|
| 24 | + ) |
|
| 25 | + )); |
|
| 26 | + } |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /** |
@@ -31,12 +31,12 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | class SmartobjectUrlLinkHandler extends SmartPersistableObjectHandler |
| 33 | 33 | { |
| 34 | - /** |
|
| 35 | - * SmartobjectUrlLinkHandler constructor. |
|
| 36 | - * @param object|XoopsDatabase $db |
|
| 37 | - */ |
|
| 38 | - public function __construct($db) |
|
| 39 | - { |
|
| 40 | - parent::__construct($db, 'urllink', 'urllinkid', 'caption', 'desc', 'smartobject'); |
|
| 41 | - } |
|
| 34 | + /** |
|
| 35 | + * SmartobjectUrlLinkHandler constructor. |
|
| 36 | + * @param object|XoopsDatabase $db |
|
| 37 | + */ |
|
| 38 | + public function __construct($db) |
|
| 39 | + { |
|
| 40 | + parent::__construct($db, 'urllink', 'urllinkid', 'caption', 'desc', 'smartobject'); |
|
| 41 | + } |
|
| 42 | 42 | } |
@@ -15,65 +15,65 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | class SmartPrinterFriendly |
| 17 | 17 | { |
| 18 | - public $_title; |
|
| 19 | - public $_dsc; |
|
| 20 | - public $_content; |
|
| 21 | - public $_tpl; |
|
| 22 | - public $_pageTitle = false; |
|
| 23 | - public $_width = 680; |
|
| 18 | + public $_title; |
|
| 19 | + public $_dsc; |
|
| 20 | + public $_content; |
|
| 21 | + public $_tpl; |
|
| 22 | + public $_pageTitle = false; |
|
| 23 | + public $_width = 680; |
|
| 24 | 24 | |
| 25 | - /** |
|
| 26 | - * SmartPrinterFriendly constructor. |
|
| 27 | - * @param $content |
|
| 28 | - * @param bool $title |
|
| 29 | - * @param bool $dsc |
|
| 30 | - */ |
|
| 31 | - public function __construct($content, $title = false, $dsc = false) |
|
| 32 | - { |
|
| 33 | - $this->_title = $title; |
|
| 34 | - $this->_dsc = $dsc; |
|
| 35 | - $this->_content = $content; |
|
| 36 | - } |
|
| 25 | + /** |
|
| 26 | + * SmartPrinterFriendly constructor. |
|
| 27 | + * @param $content |
|
| 28 | + * @param bool $title |
|
| 29 | + * @param bool $dsc |
|
| 30 | + */ |
|
| 31 | + public function __construct($content, $title = false, $dsc = false) |
|
| 32 | + { |
|
| 33 | + $this->_title = $title; |
|
| 34 | + $this->_dsc = $dsc; |
|
| 35 | + $this->_content = $content; |
|
| 36 | + } |
|
| 37 | 37 | |
| 38 | - public function render() |
|
| 39 | - { |
|
| 40 | - /** |
|
| 41 | - * @todo move the output to a template |
|
| 42 | - * @todo make the output XHTML compliant |
|
| 43 | - */ |
|
| 38 | + public function render() |
|
| 39 | + { |
|
| 40 | + /** |
|
| 41 | + * @todo move the output to a template |
|
| 42 | + * @todo make the output XHTML compliant |
|
| 43 | + */ |
|
| 44 | 44 | |
| 45 | - include_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
| 45 | + include_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
| 46 | 46 | |
| 47 | - $this->_tpl = new XoopsTpl(); |
|
| 47 | + $this->_tpl = new XoopsTpl(); |
|
| 48 | 48 | |
| 49 | - $this->_tpl->assign('smartobject_print_pageTitle', $this->_pageTitle ?: $this->_title); |
|
| 50 | - $this->_tpl->assign('smartobject_print_title', $this->_title); |
|
| 51 | - $this->_tpl->assign('smartobject_print_dsc', $this->_dsc); |
|
| 52 | - $this->_tpl->assign('smartobject_print_content', $this->_content); |
|
| 53 | - $this->_tpl->assign('smartobject_print_width', $this->_width); |
|
| 49 | + $this->_tpl->assign('smartobject_print_pageTitle', $this->_pageTitle ?: $this->_title); |
|
| 50 | + $this->_tpl->assign('smartobject_print_title', $this->_title); |
|
| 51 | + $this->_tpl->assign('smartobject_print_dsc', $this->_dsc); |
|
| 52 | + $this->_tpl->assign('smartobject_print_content', $this->_content); |
|
| 53 | + $this->_tpl->assign('smartobject_print_width', $this->_width); |
|
| 54 | 54 | |
| 55 | - $current_urls = smart_getCurrentUrls(); |
|
| 56 | - $current_url = $current_urls['full']; |
|
| 55 | + $current_urls = smart_getCurrentUrls(); |
|
| 56 | + $current_url = $current_urls['full']; |
|
| 57 | 57 | |
| 58 | - $this->_tpl->assign('smartobject_print_currenturl', $current_url); |
|
| 59 | - $this->_tpl->assign('smartobject_print_url', $this->url); |
|
| 58 | + $this->_tpl->assign('smartobject_print_currenturl', $current_url); |
|
| 59 | + $this->_tpl->assign('smartobject_print_url', $this->url); |
|
| 60 | 60 | |
| 61 | - $this->_tpl->display('db:smartobject_print.tpl'); |
|
| 62 | - } |
|
| 61 | + $this->_tpl->display('db:smartobject_print.tpl'); |
|
| 62 | + } |
|
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * @param $text |
|
| 66 | - */ |
|
| 67 | - public function setPageTitle($text) |
|
| 68 | - { |
|
| 69 | - $this->_pageTitle = $text; |
|
| 70 | - } |
|
| 64 | + /** |
|
| 65 | + * @param $text |
|
| 66 | + */ |
|
| 67 | + public function setPageTitle($text) |
|
| 68 | + { |
|
| 69 | + $this->_pageTitle = $text; |
|
| 70 | + } |
|
| 71 | 71 | |
| 72 | - /** |
|
| 73 | - * @param $width |
|
| 74 | - */ |
|
| 75 | - public function setWidth($width) |
|
| 76 | - { |
|
| 77 | - $this->_width = $width; |
|
| 78 | - } |
|
| 72 | + /** |
|
| 73 | + * @param $width |
|
| 74 | + */ |
|
| 75 | + public function setWidth($width) |
|
| 76 | + { |
|
| 77 | + $this->_width = $width; |
|
| 78 | + } |
|
| 79 | 79 | } |