@@ -11,23 +11,23 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | class SmartFormTimeElement extends XoopsFormSelect |
| 13 | 13 | { |
| 14 | - /** |
|
| 15 | - * SmartFormTimeElement constructor. |
|
| 16 | - * @param string $object |
|
| 17 | - * @param string $key |
|
| 18 | - */ |
|
| 19 | - public function __construct($object, $key) |
|
| 20 | - { |
|
| 21 | - $var = $object->vars[$key]; |
|
| 22 | - $timearray = array(); |
|
| 23 | - for ($i = 0; $i < 24; ++$i) { |
|
| 24 | - for ($j = 0; $j < 60; $j += 10) { |
|
| 25 | - $key_t = ($i * 3600) + ($j * 60); |
|
| 26 | - $timearray[$key_t] = ($j != 0) ? $i . ':' . $j : $i . ':0' . $j; |
|
| 27 | - } |
|
| 28 | - } |
|
| 29 | - ksort($timearray); |
|
| 30 | - parent::__construct($var['form_caption'], $key, $object->getVar($key, 'e')); |
|
| 31 | - $this->addOptionArray($timearray); |
|
| 32 | - } |
|
| 14 | + /** |
|
| 15 | + * SmartFormTimeElement constructor. |
|
| 16 | + * @param string $object |
|
| 17 | + * @param string $key |
|
| 18 | + */ |
|
| 19 | + public function __construct($object, $key) |
|
| 20 | + { |
|
| 21 | + $var = $object->vars[$key]; |
|
| 22 | + $timearray = array(); |
|
| 23 | + for ($i = 0; $i < 24; ++$i) { |
|
| 24 | + for ($j = 0; $j < 60; $j += 10) { |
|
| 25 | + $key_t = ($i * 3600) + ($j * 60); |
|
| 26 | + $timearray[$key_t] = ($j != 0) ? $i . ':' . $j : $i . ':0' . $j; |
|
| 27 | + } |
|
| 28 | + } |
|
| 29 | + ksort($timearray); |
|
| 30 | + parent::__construct($var['form_caption'], $key, $object->getVar($key, 'e')); |
|
| 31 | + $this->addOptionArray($timearray); |
|
| 32 | + } |
|
| 33 | 33 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | for ($i = 0; $i < 24; ++$i) { |
| 24 | 24 | for ($j = 0; $j < 60; $j += 10) { |
| 25 | 25 | $key_t = ($i * 3600) + ($j * 60); |
| 26 | - $timearray[$key_t] = ($j != 0) ? $i . ':' . $j : $i . ':0' . $j; |
|
| 26 | + $timearray[$key_t] = ($j != 0) ? $i.':'.$j : $i.':0'.$j; |
|
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | 29 | ksort($timearray); |
@@ -7,41 +7,41 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | class SmartFormCheckElement extends XoopsFormCheckBox |
| 9 | 9 | { |
| 10 | - /** |
|
| 11 | - * |
|
| 12 | - * /** |
|
| 13 | - * prepare HTML for output |
|
| 14 | - * |
|
| 15 | - * @return string |
|
| 16 | - */ |
|
| 17 | - public function render() |
|
| 18 | - { |
|
| 19 | - $ret = ''; |
|
| 20 | - if (count($this->getOptions()) > 1 && substr($this->getName(), -2, 2) !== '[]') { |
|
| 21 | - $newname = $this->getName() . '[]'; |
|
| 22 | - $this->setName($newname); |
|
| 23 | - } |
|
| 24 | - foreach ($this->getOptions() as $value => $name) { |
|
| 25 | - $ret .= "<input type='checkbox' name='" . $this->getName() . "' value='" . $value . "'"; |
|
| 26 | - if (count($this->getValue()) > 0 && in_array($value, $this->getValue())) { |
|
| 27 | - $ret .= " checked='checked'"; |
|
| 28 | - } |
|
| 29 | - $ret .= $this->getExtra() . ' />' . $name . '<br>'; |
|
| 30 | - } |
|
| 10 | + /** |
|
| 11 | + * |
|
| 12 | + * /** |
|
| 13 | + * prepare HTML for output |
|
| 14 | + * |
|
| 15 | + * @return string |
|
| 16 | + */ |
|
| 17 | + public function render() |
|
| 18 | + { |
|
| 19 | + $ret = ''; |
|
| 20 | + if (count($this->getOptions()) > 1 && substr($this->getName(), -2, 2) !== '[]') { |
|
| 21 | + $newname = $this->getName() . '[]'; |
|
| 22 | + $this->setName($newname); |
|
| 23 | + } |
|
| 24 | + foreach ($this->getOptions() as $value => $name) { |
|
| 25 | + $ret .= "<input type='checkbox' name='" . $this->getName() . "' value='" . $value . "'"; |
|
| 26 | + if (count($this->getValue()) > 0 && in_array($value, $this->getValue())) { |
|
| 27 | + $ret .= " checked='checked'"; |
|
| 28 | + } |
|
| 29 | + $ret .= $this->getExtra() . ' />' . $name . '<br>'; |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | - return $ret; |
|
| 33 | - } |
|
| 32 | + return $ret; |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * @return string |
|
| 37 | - */ |
|
| 38 | - public function renderValidationJS() |
|
| 39 | - { |
|
| 40 | - $js .= 'var hasSelections = false;'; |
|
| 41 | - //sometimes, there is an implicit '[]', sometimes not |
|
| 42 | - $eltname = $this->getName(); |
|
| 43 | - if (strpos($eltname, '[') === false) { |
|
| 44 | - $js .= "for (var i = 0; i < myform['{$eltname}[]'].length; i++) { |
|
| 35 | + /** |
|
| 36 | + * @return string |
|
| 37 | + */ |
|
| 38 | + public function renderValidationJS() |
|
| 39 | + { |
|
| 40 | + $js .= 'var hasSelections = false;'; |
|
| 41 | + //sometimes, there is an implicit '[]', sometimes not |
|
| 42 | + $eltname = $this->getName(); |
|
| 43 | + if (strpos($eltname, '[') === false) { |
|
| 44 | + $js .= "for (var i = 0; i < myform['{$eltname}[]'].length; i++) { |
|
| 45 | 45 | if (myform['{$eltname}[]'][i].checked) { |
| 46 | 46 | hasSelections = true; |
| 47 | 47 | } |
@@ -49,8 +49,8 @@ discard block |
||
| 49 | 49 | } |
| 50 | 50 | if (hasSelections == false) { |
| 51 | 51 | window.alert(\"{$eltmsg}\"); myform['{$eltname}[]'][0].focus(); return false; }\n"; |
| 52 | - } else { |
|
| 53 | - $js .= "for (var i = 0; i < myform['" . $eltname . "'].length; i++) { |
|
| 52 | + } else { |
|
| 53 | + $js .= "for (var i = 0; i < myform['" . $eltname . "'].length; i++) { |
|
| 54 | 54 | if (myform['{$eltname}'][i].checked) { |
| 55 | 55 | hasSelections = true; |
| 56 | 56 | } |
@@ -58,8 +58,8 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | if (hasSelections == false) { |
| 60 | 60 | window.alert(\"{$eltmsg}\"); myform['{$eltname}'][0].focus(); return false; }\n"; |
| 61 | - } |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | - return $js; |
|
| 64 | - } |
|
| 63 | + return $js; |
|
| 64 | + } |
|
| 65 | 65 | } |
@@ -18,15 +18,15 @@ discard block |
||
| 18 | 18 | { |
| 19 | 19 | $ret = ''; |
| 20 | 20 | if (count($this->getOptions()) > 1 && substr($this->getName(), -2, 2) !== '[]') { |
| 21 | - $newname = $this->getName() . '[]'; |
|
| 21 | + $newname = $this->getName().'[]'; |
|
| 22 | 22 | $this->setName($newname); |
| 23 | 23 | } |
| 24 | 24 | foreach ($this->getOptions() as $value => $name) { |
| 25 | - $ret .= "<input type='checkbox' name='" . $this->getName() . "' value='" . $value . "'"; |
|
| 25 | + $ret .= "<input type='checkbox' name='".$this->getName()."' value='".$value."'"; |
|
| 26 | 26 | if (count($this->getValue()) > 0 && in_array($value, $this->getValue())) { |
| 27 | 27 | $ret .= " checked='checked'"; |
| 28 | 28 | } |
| 29 | - $ret .= $this->getExtra() . ' />' . $name . '<br>'; |
|
| 29 | + $ret .= $this->getExtra().' />'.$name.'<br>'; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | return $ret; |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | if (hasSelections == false) { |
| 51 | 51 | window.alert(\"{$eltmsg}\"); myform['{$eltname}[]'][0].focus(); return false; }\n"; |
| 52 | 52 | } else { |
| 53 | - $js .= "for (var i = 0; i < myform['" . $eltname . "'].length; i++) { |
|
| 53 | + $js .= "for (var i = 0; i < myform['".$eltname."'].length; i++) { |
|
| 54 | 54 | if (myform['{$eltname}'][i].checked) { |
| 55 | 55 | hasSelections = true; |
| 56 | 56 | } |
@@ -5,38 +5,38 @@ |
||
| 5 | 5 | */ |
| 6 | 6 | class SmartFormFileElement extends XoopsFormFile |
| 7 | 7 | { |
| 8 | - public $object; |
|
| 9 | - public $key; |
|
| 8 | + public $object; |
|
| 9 | + public $key; |
|
| 10 | 10 | |
| 11 | - /** |
|
| 12 | - * SmartFormFileElement constructor. |
|
| 13 | - * @param string $object |
|
| 14 | - * @param string $key |
|
| 15 | - */ |
|
| 16 | - public function __construct($object, $key) |
|
| 17 | - { |
|
| 18 | - $this->object = $object; |
|
| 19 | - $this->key = $key; |
|
| 20 | - parent::__construct($object->vars[$key]['form_caption'], $key, isset($object->vars[$key]['form_maxfilesize']) ? $object->vars[$key]['form_maxfilesize'] : 0); |
|
| 21 | - $this->setExtra(' size=50'); |
|
| 22 | - } |
|
| 11 | + /** |
|
| 12 | + * SmartFormFileElement constructor. |
|
| 13 | + * @param string $object |
|
| 14 | + * @param string $key |
|
| 15 | + */ |
|
| 16 | + public function __construct($object, $key) |
|
| 17 | + { |
|
| 18 | + $this->object = $object; |
|
| 19 | + $this->key = $key; |
|
| 20 | + parent::__construct($object->vars[$key]['form_caption'], $key, isset($object->vars[$key]['form_maxfilesize']) ? $object->vars[$key]['form_maxfilesize'] : 0); |
|
| 21 | + $this->setExtra(' size=50'); |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * prepare HTML for output |
|
| 26 | - * |
|
| 27 | - * @return string HTML |
|
| 28 | - */ |
|
| 29 | - public function render() |
|
| 30 | - { |
|
| 31 | - $ret = ''; |
|
| 32 | - if ($this->object->getVar($this->key) !== '') { |
|
| 33 | - $ret .= '<div>' . _CO_SOBJECT_CURRENT_FILE . $this->object->getVar($this->key) . '</div>'; |
|
| 34 | - } |
|
| 24 | + /** |
|
| 25 | + * prepare HTML for output |
|
| 26 | + * |
|
| 27 | + * @return string HTML |
|
| 28 | + */ |
|
| 29 | + public function render() |
|
| 30 | + { |
|
| 31 | + $ret = ''; |
|
| 32 | + if ($this->object->getVar($this->key) !== '') { |
|
| 33 | + $ret .= '<div>' . _CO_SOBJECT_CURRENT_FILE . $this->object->getVar($this->key) . '</div>'; |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - $ret .= "<div><input type='hidden' name='MAX_FILE_SIZE' value='" . $this->getMaxFileSize() . "' /> |
|
| 36 | + $ret .= "<div><input type='hidden' name='MAX_FILE_SIZE' value='" . $this->getMaxFileSize() . "' /> |
|
| 37 | 37 | <input type='file' name='" . $this->getName() . "' id='" . $this->getName() . "'" . $this->getExtra() . " /> |
| 38 | 38 | <input type='hidden' name='smart_upload_file[]' id='smart_upload_file[]' value='" . $this->getName() . "' /></div>"; |
| 39 | 39 | |
| 40 | - return $ret; |
|
| 41 | - } |
|
| 40 | + return $ret; |
|
| 41 | + } |
|
| 42 | 42 | } |
@@ -30,12 +30,12 @@ |
||
| 30 | 30 | { |
| 31 | 31 | $ret = ''; |
| 32 | 32 | if ($this->object->getVar($this->key) !== '') { |
| 33 | - $ret .= '<div>' . _CO_SOBJECT_CURRENT_FILE . $this->object->getVar($this->key) . '</div>'; |
|
| 33 | + $ret .= '<div>'._CO_SOBJECT_CURRENT_FILE.$this->object->getVar($this->key).'</div>'; |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - $ret .= "<div><input type='hidden' name='MAX_FILE_SIZE' value='" . $this->getMaxFileSize() . "' /> |
|
| 37 | - <input type='file' name='" . $this->getName() . "' id='" . $this->getName() . "'" . $this->getExtra() . " /> |
|
| 38 | - <input type='hidden' name='smart_upload_file[]' id='smart_upload_file[]' value='" . $this->getName() . "' /></div>"; |
|
| 36 | + $ret .= "<div><input type='hidden' name='MAX_FILE_SIZE' value='".$this->getMaxFileSize()."' /> |
|
| 37 | + <input type='file' name='" . $this->getName()."' id='".$this->getName()."'".$this->getExtra()." /> |
|
| 38 | + <input type='hidden' name='smart_upload_file[]' id='smart_upload_file[]' value='" . $this->getName()."' /></div>"; |
|
| 39 | 39 | |
| 40 | 40 | return $ret; |
| 41 | 41 | } |
@@ -11,50 +11,50 @@ |
||
| 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='" . |
|
| 39 | - $this->getName() . |
|
| 40 | - "' id='" . |
|
| 41 | - $this->getName() . |
|
| 42 | - "' size='" . |
|
| 43 | - $this->getSize() . |
|
| 44 | - "' maxlength='" . |
|
| 45 | - $this->getMaxlength() . |
|
| 46 | - "' value='" . |
|
| 47 | - $this->getValue() . |
|
| 48 | - "'" . |
|
| 49 | - $this->getExtra() . |
|
| 50 | - ' />'; |
|
| 31 | + /** |
|
| 32 | + * Prepare HTML for output |
|
| 33 | + * |
|
| 34 | + * @return string HTML |
|
| 35 | + */ |
|
| 36 | + public function render() |
|
| 37 | + { |
|
| 38 | + $ret = "<input type='text' name='" . |
|
| 39 | + $this->getName() . |
|
| 40 | + "' id='" . |
|
| 41 | + $this->getName() . |
|
| 42 | + "' size='" . |
|
| 43 | + $this->getSize() . |
|
| 44 | + "' maxlength='" . |
|
| 45 | + $this->getMaxlength() . |
|
| 46 | + "' value='" . |
|
| 47 | + $this->getValue() . |
|
| 48 | + "'" . |
|
| 49 | + $this->getExtra() . |
|
| 50 | + ' />'; |
|
| 51 | 51 | |
| 52 | - $ret .= ' <div class="smartobject_autocomplete_hint" id="smartobject_autocomplete_hint' . $this->getName() . '"></div> |
|
| 52 | + $ret .= ' <div class="smartobject_autocomplete_hint" id="smartobject_autocomplete_hint' . $this->getName() . '"></div> |
|
| 53 | 53 | |
| 54 | 54 | <script type="text/javascript"> |
| 55 | 55 | new Ajax.Autocompleter("' . $this->getName() . '","smartobject_autocomplete_hint' . $this->getName() . '","' . $this->_include_file . '?key=' . $this->getName() . '"); |
| 56 | 56 | </script>'; |
| 57 | 57 | |
| 58 | - return $ret; |
|
| 59 | - } |
|
| 58 | + return $ret; |
|
| 59 | + } |
|
| 60 | 60 | } |
@@ -35,24 +35,24 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | public function render() |
| 37 | 37 | { |
| 38 | - $ret = "<input type='text' name='" . |
|
| 39 | - $this->getName() . |
|
| 40 | - "' id='" . |
|
| 41 | - $this->getName() . |
|
| 42 | - "' size='" . |
|
| 43 | - $this->getSize() . |
|
| 44 | - "' maxlength='" . |
|
| 45 | - $this->getMaxlength() . |
|
| 46 | - "' value='" . |
|
| 47 | - $this->getValue() . |
|
| 48 | - "'" . |
|
| 49 | - $this->getExtra() . |
|
| 38 | + $ret = "<input type='text' name='". |
|
| 39 | + $this->getName(). |
|
| 40 | + "' id='". |
|
| 41 | + $this->getName(). |
|
| 42 | + "' size='". |
|
| 43 | + $this->getSize(). |
|
| 44 | + "' maxlength='". |
|
| 45 | + $this->getMaxlength(). |
|
| 46 | + "' value='". |
|
| 47 | + $this->getValue(). |
|
| 48 | + "'". |
|
| 49 | + $this->getExtra(). |
|
| 50 | 50 | ' />'; |
| 51 | 51 | |
| 52 | - $ret .= ' <div class="smartobject_autocomplete_hint" id="smartobject_autocomplete_hint' . $this->getName() . '"></div> |
|
| 52 | + $ret .= ' <div class="smartobject_autocomplete_hint" id="smartobject_autocomplete_hint'.$this->getName().'"></div> |
|
| 53 | 53 | |
| 54 | 54 | <script type="text/javascript"> |
| 55 | - new Ajax.Autocompleter("' . $this->getName() . '","smartobject_autocomplete_hint' . $this->getName() . '","' . $this->_include_file . '?key=' . $this->getName() . '"); |
|
| 55 | + new Ajax.Autocompleter("' . $this->getName().'","smartobject_autocomplete_hint'.$this->getName().'","'.$this->_include_file.'?key='.$this->getName().'"); |
|
| 56 | 56 | </script>'; |
| 57 | 57 | |
| 58 | 58 | return $ret; |
@@ -11,37 +11,37 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | class SmartFormImageElement extends XoopsFormElementTray |
| 13 | 13 | { |
| 14 | - /** |
|
| 15 | - * SmartFormImageElement constructor. |
|
| 16 | - * @param string $object |
|
| 17 | - * @param string $key |
|
| 18 | - */ |
|
| 19 | - public function __construct($object, $key) |
|
| 20 | - { |
|
| 21 | - $var = $object->vars[$key]; |
|
| 22 | - $object_imageurl = $object->getImageDir(); |
|
| 23 | - parent::__construct($var['form_caption'], ' '); |
|
| 14 | + /** |
|
| 15 | + * SmartFormImageElement constructor. |
|
| 16 | + * @param string $object |
|
| 17 | + * @param string $key |
|
| 18 | + */ |
|
| 19 | + public function __construct($object, $key) |
|
| 20 | + { |
|
| 21 | + $var = $object->vars[$key]; |
|
| 22 | + $object_imageurl = $object->getImageDir(); |
|
| 23 | + parent::__construct($var['form_caption'], ' '); |
|
| 24 | 24 | |
| 25 | - $objectArray['image'] = str_replace('{XOOPS_URL}', XOOPS_URL, $objectArray['image']); |
|
| 25 | + $objectArray['image'] = str_replace('{XOOPS_URL}', XOOPS_URL, $objectArray['image']); |
|
| 26 | 26 | |
| 27 | - if ($object->getVar($key) !== '' && (0 === strpos($object->getVar($key), 'http') || 0 === strpos($object->getVar($key), '{XOOPS_URL}'))) { |
|
| 28 | - $this->addElement(new XoopsFormLabel('', "<img src='" . str_replace('{XOOPS_URL}', XOOPS_URL, $object->getVar($key)) . "' alt='' /><br><br>")); |
|
| 29 | - } elseif ($object->getVar($key) !== '') { |
|
| 30 | - $this->addElement(new XoopsFormLabel('', "<img src='" . $object_imageurl . $object->getVar($key) . "' alt='' /><br><br>")); |
|
| 31 | - } |
|
| 27 | + if ($object->getVar($key) !== '' && (0 === strpos($object->getVar($key), 'http') || 0 === strpos($object->getVar($key), '{XOOPS_URL}'))) { |
|
| 28 | + $this->addElement(new XoopsFormLabel('', "<img src='" . str_replace('{XOOPS_URL}', XOOPS_URL, $object->getVar($key)) . "' alt='' /><br><br>")); |
|
| 29 | + } elseif ($object->getVar($key) !== '') { |
|
| 30 | + $this->addElement(new XoopsFormLabel('', "<img src='" . $object_imageurl . $object->getVar($key) . "' alt='' /><br><br>")); |
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | - include_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformfileuploadelement.php'; |
|
| 34 | - $this->addElement(new SmartFormFileUploadElement($object, $key)); |
|
| 33 | + include_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformfileuploadelement.php'; |
|
| 34 | + $this->addElement(new SmartFormFileUploadElement($object, $key)); |
|
| 35 | 35 | |
| 36 | - $this->addElement(new XoopsFormLabel('<div style="height: 10px; padding-top: 8px; font-size: 80%;">' . _CO_SOBJECT_URL_FILE_DSC . '</div>', '')); |
|
| 37 | - include_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformtextelement.php'; |
|
| 38 | - include_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformcheckelement.php'; |
|
| 36 | + $this->addElement(new XoopsFormLabel('<div style="height: 10px; padding-top: 8px; font-size: 80%;">' . _CO_SOBJECT_URL_FILE_DSC . '</div>', '')); |
|
| 37 | + include_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformtextelement.php'; |
|
| 38 | + include_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformcheckelement.php'; |
|
| 39 | 39 | |
| 40 | - $this->addElement(new XoopsFormLabel('', '<br>' . _CO_SOBJECT_URL_FILE)); |
|
| 41 | - $this->addElement(new SmartFormTextElement($object, 'url_' . $key)); |
|
| 42 | - $this->addElement(new XoopsFormLabel('', '<br><br>')); |
|
| 43 | - $delete_check = new SmartFormCheckElement('', 'delete_' . $key); |
|
| 44 | - $delete_check->addOption(1, '<span style="color:red;">' . _CO_SOBJECT_DELETE . '</span>'); |
|
| 45 | - $this->addElement($delete_check); |
|
| 46 | - } |
|
| 40 | + $this->addElement(new XoopsFormLabel('', '<br>' . _CO_SOBJECT_URL_FILE)); |
|
| 41 | + $this->addElement(new SmartFormTextElement($object, 'url_' . $key)); |
|
| 42 | + $this->addElement(new XoopsFormLabel('', '<br><br>')); |
|
| 43 | + $delete_check = new SmartFormCheckElement('', 'delete_' . $key); |
|
| 44 | + $delete_check->addOption(1, '<span style="color:red;">' . _CO_SOBJECT_DELETE . '</span>'); |
|
| 45 | + $this->addElement($delete_check); |
|
| 46 | + } |
|
| 47 | 47 | } |
@@ -25,23 +25,23 @@ |
||
| 25 | 25 | $objectArray['image'] = str_replace('{XOOPS_URL}', XOOPS_URL, $objectArray['image']); |
| 26 | 26 | |
| 27 | 27 | if ($object->getVar($key) !== '' && (0 === strpos($object->getVar($key), 'http') || 0 === strpos($object->getVar($key), '{XOOPS_URL}'))) { |
| 28 | - $this->addElement(new XoopsFormLabel('', "<img src='" . str_replace('{XOOPS_URL}', XOOPS_URL, $object->getVar($key)) . "' alt='' /><br><br>")); |
|
| 28 | + $this->addElement(new XoopsFormLabel('', "<img src='".str_replace('{XOOPS_URL}', XOOPS_URL, $object->getVar($key))."' alt='' /><br><br>")); |
|
| 29 | 29 | } elseif ($object->getVar($key) !== '') { |
| 30 | - $this->addElement(new XoopsFormLabel('', "<img src='" . $object_imageurl . $object->getVar($key) . "' alt='' /><br><br>")); |
|
| 30 | + $this->addElement(new XoopsFormLabel('', "<img src='".$object_imageurl.$object->getVar($key)."' alt='' /><br><br>")); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - include_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformfileuploadelement.php'; |
|
| 33 | + include_once SMARTOBJECT_ROOT_PATH.'class/form/elements/smartformfileuploadelement.php'; |
|
| 34 | 34 | $this->addElement(new SmartFormFileUploadElement($object, $key)); |
| 35 | 35 | |
| 36 | - $this->addElement(new XoopsFormLabel('<div style="height: 10px; padding-top: 8px; font-size: 80%;">' . _CO_SOBJECT_URL_FILE_DSC . '</div>', '')); |
|
| 37 | - include_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformtextelement.php'; |
|
| 38 | - include_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformcheckelement.php'; |
|
| 36 | + $this->addElement(new XoopsFormLabel('<div style="height: 10px; padding-top: 8px; font-size: 80%;">'._CO_SOBJECT_URL_FILE_DSC.'</div>', '')); |
|
| 37 | + include_once SMARTOBJECT_ROOT_PATH.'class/form/elements/smartformtextelement.php'; |
|
| 38 | + include_once SMARTOBJECT_ROOT_PATH.'class/form/elements/smartformcheckelement.php'; |
|
| 39 | 39 | |
| 40 | - $this->addElement(new XoopsFormLabel('', '<br>' . _CO_SOBJECT_URL_FILE)); |
|
| 41 | - $this->addElement(new SmartFormTextElement($object, 'url_' . $key)); |
|
| 40 | + $this->addElement(new XoopsFormLabel('', '<br>'._CO_SOBJECT_URL_FILE)); |
|
| 41 | + $this->addElement(new SmartFormTextElement($object, 'url_'.$key)); |
|
| 42 | 42 | $this->addElement(new XoopsFormLabel('', '<br><br>')); |
| 43 | - $delete_check = new SmartFormCheckElement('', 'delete_' . $key); |
|
| 44 | - $delete_check->addOption(1, '<span style="color:red;">' . _CO_SOBJECT_DELETE . '</span>'); |
|
| 43 | + $delete_check = new SmartFormCheckElement('', 'delete_'.$key); |
|
| 44 | + $delete_check->addOption(1, '<span style="color:red;">'._CO_SOBJECT_DELETE.'</span>'); |
|
| 45 | 45 | $this->addElement($delete_check); |
| 46 | 46 | } |
| 47 | 47 | } |
@@ -12,50 +12,50 @@ |
||
| 12 | 12 | |
| 13 | 13 | class SmartFormSet_passwordElement extends XoopsFormElementTray |
| 14 | 14 | { |
| 15 | - /** |
|
| 16 | - * Size of the field. |
|
| 17 | - * @var int |
|
| 18 | - * @access private |
|
| 19 | - */ |
|
| 20 | - public $_size; |
|
| 15 | + /** |
|
| 16 | + * Size of the field. |
|
| 17 | + * @var int |
|
| 18 | + * @access private |
|
| 19 | + */ |
|
| 20 | + public $_size; |
|
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * Maximum length of the text |
|
| 24 | - * @var int |
|
| 25 | - * @access private |
|
| 26 | - */ |
|
| 27 | - public $_maxlength; |
|
| 22 | + /** |
|
| 23 | + * Maximum length of the text |
|
| 24 | + * @var int |
|
| 25 | + * @access private |
|
| 26 | + */ |
|
| 27 | + public $_maxlength; |
|
| 28 | 28 | |
| 29 | - /** |
|
| 30 | - * Initial content of the field. |
|
| 31 | - * @var string |
|
| 32 | - * @access private |
|
| 33 | - */ |
|
| 34 | - public $_value; |
|
| 29 | + /** |
|
| 30 | + * Initial content of the field. |
|
| 31 | + * @var string |
|
| 32 | + * @access private |
|
| 33 | + */ |
|
| 34 | + public $_value; |
|
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * Constructor |
|
| 38 | - * |
|
| 39 | - * @param string $object |
|
| 40 | - * @param string $key |
|
| 41 | - * @internal param string $caption Caption |
|
| 42 | - * @internal param string $name "name" attribute |
|
| 43 | - * @internal param int $size Size of the field |
|
| 44 | - * @internal param int $maxlength Maximum length of the text |
|
| 45 | - * @internal param int $value Initial value of the field. |
|
| 46 | - * <b>Warning:</b> this is readable in cleartext in the page's source! |
|
| 47 | - */ |
|
| 48 | - public function __construct($object, $key) |
|
| 49 | - { |
|
| 50 | - $var = $object->vars[$key]; |
|
| 51 | - $control = $object->controls[$key]; |
|
| 36 | + /** |
|
| 37 | + * Constructor |
|
| 38 | + * |
|
| 39 | + * @param string $object |
|
| 40 | + * @param string $key |
|
| 41 | + * @internal param string $caption Caption |
|
| 42 | + * @internal param string $name "name" attribute |
|
| 43 | + * @internal param int $size Size of the field |
|
| 44 | + * @internal param int $maxlength Maximum length of the text |
|
| 45 | + * @internal param int $value Initial value of the field. |
|
| 46 | + * <b>Warning:</b> this is readable in cleartext in the page's source! |
|
| 47 | + */ |
|
| 48 | + public function __construct($object, $key) |
|
| 49 | + { |
|
| 50 | + $var = $object->vars[$key]; |
|
| 51 | + $control = $object->controls[$key]; |
|
| 52 | 52 | |
| 53 | - parent::__construct($var['form_caption'] . '<br>' . _US_TYPEPASSTWICE, ' ', $key . '_password_tray'); |
|
| 53 | + parent::__construct($var['form_caption'] . '<br>' . _US_TYPEPASSTWICE, ' ', $key . '_password_tray'); |
|
| 54 | 54 | |
| 55 | - $password_box1 = new XoopsFormPassword('', $key . '1', 10, 32); |
|
| 56 | - $this->addElement($password_box1); |
|
| 55 | + $password_box1 = new XoopsFormPassword('', $key . '1', 10, 32); |
|
| 56 | + $this->addElement($password_box1); |
|
| 57 | 57 | |
| 58 | - $password_box2 = new XoopsFormPassword('', $key . '2', 10, 32); |
|
| 59 | - $this->addElement($password_box2); |
|
| 60 | - } |
|
| 58 | + $password_box2 = new XoopsFormPassword('', $key . '2', 10, 32); |
|
| 59 | + $this->addElement($password_box2); |
|
| 60 | + } |
|
| 61 | 61 | } |
@@ -50,12 +50,12 @@ |
||
| 50 | 50 | $var = $object->vars[$key]; |
| 51 | 51 | $control = $object->controls[$key]; |
| 52 | 52 | |
| 53 | - parent::__construct($var['form_caption'] . '<br>' . _US_TYPEPASSTWICE, ' ', $key . '_password_tray'); |
|
| 53 | + parent::__construct($var['form_caption'].'<br>'._US_TYPEPASSTWICE, ' ', $key.'_password_tray'); |
|
| 54 | 54 | |
| 55 | - $password_box1 = new XoopsFormPassword('', $key . '1', 10, 32); |
|
| 55 | + $password_box1 = new XoopsFormPassword('', $key.'1', 10, 32); |
|
| 56 | 56 | $this->addElement($password_box1); |
| 57 | 57 | |
| 58 | - $password_box2 = new XoopsFormPassword('', $key . '2', 10, 32); |
|
| 58 | + $password_box2 = new XoopsFormPassword('', $key.'2', 10, 32); |
|
| 59 | 59 | $this->addElement($password_box2); |
| 60 | 60 | } |
| 61 | 61 | } |
@@ -13,9 +13,9 @@ |
||
| 13 | 13 | * @filesource |
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | -include __DIR__ . '/classes/JavaScript.php'; |
|
| 17 | -__DIR__ . '/classes/Prototype.php'; |
|
| 18 | -__DIR__ . '/classes/Scriptaculous.php'; |
|
| 16 | +include __DIR__.'/classes/JavaScript.php'; |
|
| 17 | +__DIR__.'/classes/Prototype.php'; |
|
| 18 | +__DIR__.'/classes/Scriptaculous.php'; |
|
| 19 | 19 | |
| 20 | 20 | // For $projax = new Projax(); |
| 21 | 21 | /** |
@@ -35,26 +35,26 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | function xoops_module_update_smartobject($module) |
| 37 | 37 | { |
| 38 | - ob_start(); |
|
| 38 | + ob_start(); |
|
| 39 | 39 | |
| 40 | - $dbVersion = smart_GetMeta('version', 'smartobject'); |
|
| 41 | - if (!$dbVersion) { |
|
| 42 | - $dbVersion = 0; |
|
| 43 | - } |
|
| 40 | + $dbVersion = smart_GetMeta('version', 'smartobject'); |
|
| 41 | + if (!$dbVersion) { |
|
| 42 | + $dbVersion = 0; |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - $dbupdater = new SmartobjectDbupdater(); |
|
| 45 | + $dbupdater = new SmartobjectDbupdater(); |
|
| 46 | 46 | |
| 47 | - echo '<code>' . _SDU_UPDATE_UPDATING_DATABASE . '<br>'; |
|
| 47 | + echo '<code>' . _SDU_UPDATE_UPDATING_DATABASE . '<br>'; |
|
| 48 | 48 | |
| 49 | - // db migrate version = 1 |
|
| 50 | - $newDbVersion = 1; |
|
| 51 | - if ($dbVersion < $newDbVersion) { |
|
| 52 | - echo 'Database migrate to version ' . $newDbVersion . '<br>'; |
|
| 49 | + // db migrate version = 1 |
|
| 50 | + $newDbVersion = 1; |
|
| 51 | + if ($dbVersion < $newDbVersion) { |
|
| 52 | + echo 'Database migrate to version ' . $newDbVersion . '<br>'; |
|
| 53 | 53 | |
| 54 | - // Create table smartobject_link |
|
| 55 | - $table = new SmartDbTable('smartobject_link'); |
|
| 56 | - if (!$table->exists()) { |
|
| 57 | - $table->setStructure("CREATE TABLE %s ( |
|
| 54 | + // Create table smartobject_link |
|
| 55 | + $table = new SmartDbTable('smartobject_link'); |
|
| 56 | + if (!$table->exists()) { |
|
| 57 | + $table->setStructure("CREATE TABLE %s ( |
|
| 58 | 58 | `linkid` int(11) NOT NULL auto_increment, |
| 59 | 59 | `from_uid` int(11) NOT NULL default '0', |
| 60 | 60 | `from_email` varchar(255) NOT NULL default '', |
@@ -71,63 +71,63 @@ discard block |
||
| 71 | 71 | PRIMARY KEY (`linkid`) |
| 72 | 72 | ) ENGINE=MyISAM COMMENT='SmartObject by The SmartFactory <www.smartfactory.ca>' AUTO_INCREMENT=1 ;"); |
| 73 | 73 | |
| 74 | - if (!$dbupdater->updateTable($table)) { |
|
| 75 | - /** |
|
| 76 | - * @todo trap the errors |
|
| 77 | - */ |
|
| 78 | - } |
|
| 79 | - } |
|
| 80 | - unset($table); |
|
| 81 | - // Create table smartobject_link |
|
| 82 | - $table = new SmartDbTable('smartobject_link'); |
|
| 83 | - if (!$table->fieldExists('date')) { |
|
| 84 | - $table->addNewField('date', "int(11) NOT NULL default '0'"); |
|
| 85 | - if (!$dbupdater->updateTable($table)) { |
|
| 86 | - /** |
|
| 87 | - * @todo trap the errors |
|
| 88 | - */ |
|
| 89 | - } |
|
| 90 | - } |
|
| 91 | - unset($table); |
|
| 92 | - |
|
| 93 | - // Create table smartobject_tag |
|
| 94 | - $table = new SmartDbTable('smartobject_tag'); |
|
| 95 | - if (!$table->exists()) { |
|
| 96 | - $table->setStructure("CREATE TABLE %s ( |
|
| 74 | + if (!$dbupdater->updateTable($table)) { |
|
| 75 | + /** |
|
| 76 | + * @todo trap the errors |
|
| 77 | + */ |
|
| 78 | + } |
|
| 79 | + } |
|
| 80 | + unset($table); |
|
| 81 | + // Create table smartobject_link |
|
| 82 | + $table = new SmartDbTable('smartobject_link'); |
|
| 83 | + if (!$table->fieldExists('date')) { |
|
| 84 | + $table->addNewField('date', "int(11) NOT NULL default '0'"); |
|
| 85 | + if (!$dbupdater->updateTable($table)) { |
|
| 86 | + /** |
|
| 87 | + * @todo trap the errors |
|
| 88 | + */ |
|
| 89 | + } |
|
| 90 | + } |
|
| 91 | + unset($table); |
|
| 92 | + |
|
| 93 | + // Create table smartobject_tag |
|
| 94 | + $table = new SmartDbTable('smartobject_tag'); |
|
| 95 | + if (!$table->exists()) { |
|
| 96 | + $table->setStructure("CREATE TABLE %s ( |
|
| 97 | 97 | `tagid` int(11) NOT NULL auto_increment, |
| 98 | 98 | `name` varchar(255) NOT NULL default '', |
| 99 | 99 | `description` TEXT NOT NULL, |
| 100 | 100 | PRIMARY KEY (`id`) |
| 101 | 101 | ) ENGINE=MyISAM COMMENT='SmartObject by The SmartFactory <www.smartfactory.ca>' AUTO_INCREMENT=1 ;"); |
| 102 | 102 | |
| 103 | - if (!$dbupdater->updateTable($table)) { |
|
| 104 | - /** |
|
| 105 | - * @todo trap the errors |
|
| 106 | - */ |
|
| 107 | - } |
|
| 108 | - } |
|
| 109 | - |
|
| 110 | - // Create table smartobject_tag_text |
|
| 111 | - $table = new SmartDbTable('smartobject_tag_text'); |
|
| 112 | - if (!$table->exists()) { |
|
| 113 | - $table->setStructure("CREATE TABLE %s ( |
|
| 103 | + if (!$dbupdater->updateTable($table)) { |
|
| 104 | + /** |
|
| 105 | + * @todo trap the errors |
|
| 106 | + */ |
|
| 107 | + } |
|
| 108 | + } |
|
| 109 | + |
|
| 110 | + // Create table smartobject_tag_text |
|
| 111 | + $table = new SmartDbTable('smartobject_tag_text'); |
|
| 112 | + if (!$table->exists()) { |
|
| 113 | + $table->setStructure("CREATE TABLE %s ( |
|
| 114 | 114 | `tagid` int(11) NOT NULL default 0, |
| 115 | 115 | `language` varchar(255) NOT NULL default '', |
| 116 | 116 | `value` TEXT NOT NULL, |
| 117 | 117 | PRIMARY KEY (`id`, `language`) |
| 118 | 118 | ) ENGINE=MyISAM COMMENT='SmartObject by The SmartFactory <www.smartfactory.ca>' AUTO_INCREMENT=1 ;"); |
| 119 | 119 | |
| 120 | - if (!$dbupdater->updateTable($table)) { |
|
| 121 | - /** |
|
| 122 | - * @todo trap the errors |
|
| 123 | - */ |
|
| 124 | - } |
|
| 125 | - } |
|
| 126 | - |
|
| 127 | - // Create table smartobject_adsense |
|
| 128 | - $table = new SmartDbTable('smartobject_adsense'); |
|
| 129 | - if (!$table->exists()) { |
|
| 130 | - $table->setStructure(" |
|
| 120 | + if (!$dbupdater->updateTable($table)) { |
|
| 121 | + /** |
|
| 122 | + * @todo trap the errors |
|
| 123 | + */ |
|
| 124 | + } |
|
| 125 | + } |
|
| 126 | + |
|
| 127 | + // Create table smartobject_adsense |
|
| 128 | + $table = new SmartDbTable('smartobject_adsense'); |
|
| 129 | + if (!$table->exists()) { |
|
| 130 | + $table->setStructure(" |
|
| 131 | 131 | `adsenseid` int(11) NOT NULL auto_increment, |
| 132 | 132 | `format` VARCHAR(100) NOT NULL, |
| 133 | 133 | `description` TEXT NOT NULL, |
@@ -141,23 +141,23 @@ discard block |
||
| 141 | 141 | `tag` varchar(50) NOT NULL default '', |
| 142 | 142 | PRIMARY KEY (`adsenseid`) |
| 143 | 143 | "); |
| 144 | - } |
|
| 145 | - |
|
| 146 | - if (!$dbupdater->updateTable($table)) { |
|
| 147 | - /** |
|
| 148 | - * @todo trap the errors |
|
| 149 | - */ |
|
| 150 | - } |
|
| 151 | - } |
|
| 152 | - // db migrate version = 2 |
|
| 153 | - $newDbVersion = 2; |
|
| 154 | - if ($dbVersion < $newDbVersion) { |
|
| 155 | - echo 'Database migrate to version ' . $newDbVersion . '<br>'; |
|
| 156 | - |
|
| 157 | - // Create table smartobject_rating |
|
| 158 | - $table = new SmartDbTable('smartobject_rating'); |
|
| 159 | - if (!$table->exists()) { |
|
| 160 | - $table->setStructure(' |
|
| 144 | + } |
|
| 145 | + |
|
| 146 | + if (!$dbupdater->updateTable($table)) { |
|
| 147 | + /** |
|
| 148 | + * @todo trap the errors |
|
| 149 | + */ |
|
| 150 | + } |
|
| 151 | + } |
|
| 152 | + // db migrate version = 2 |
|
| 153 | + $newDbVersion = 2; |
|
| 154 | + if ($dbVersion < $newDbVersion) { |
|
| 155 | + echo 'Database migrate to version ' . $newDbVersion . '<br>'; |
|
| 156 | + |
|
| 157 | + // Create table smartobject_rating |
|
| 158 | + $table = new SmartDbTable('smartobject_rating'); |
|
| 159 | + if (!$table->exists()) { |
|
| 160 | + $table->setStructure(' |
|
| 161 | 161 | `ratingid` int(11) NOT NULL auto_increment, |
| 162 | 162 | `dirname` VARCHAR(255) NOT NULL, |
| 163 | 163 | `item` VARCHAR(255) NOT NULL, |
@@ -168,36 +168,36 @@ discard block |
||
| 168 | 168 | PRIMARY KEY (`ratingid`), |
| 169 | 169 | UNIQUE (`dirname`, `item`, `itemid`, `uid`) |
| 170 | 170 | '); |
| 171 | - } |
|
| 172 | - |
|
| 173 | - if (!$dbupdater->updateTable($table)) { |
|
| 174 | - /** |
|
| 175 | - * @todo trap the errors |
|
| 176 | - */ |
|
| 177 | - } |
|
| 178 | - |
|
| 179 | - // Create table smartobject_currency |
|
| 180 | - $table = new SmartDbTable('smartobject_currency'); |
|
| 181 | - $table->setData("2, 'EUR', 'Euro', '�', 0.65, 0"); |
|
| 182 | - $table->setData("3, 'USD', 'American dollar', '$', 0.9, 0"); |
|
| 183 | - $table->setData("1, 'CAD', 'Canadian dollar', '$', 1, 1"); |
|
| 184 | - |
|
| 185 | - if (!$dbupdater->updateTable($table)) { |
|
| 186 | - /** |
|
| 187 | - * @todo trap the errors |
|
| 188 | - */ |
|
| 189 | - } |
|
| 190 | - } |
|
| 191 | - |
|
| 192 | - // db migrate version = 3 |
|
| 193 | - $newDbVersion = 3; |
|
| 194 | - if ($dbVersion < $newDbVersion) { |
|
| 195 | - echo 'Database migrate to version ' . $newDbVersion . '<br>'; |
|
| 196 | - |
|
| 197 | - // Create table smartobject_customtag |
|
| 198 | - $table = new SmartDbTable('smartobject_customtag'); |
|
| 199 | - if (!$table->exists()) { |
|
| 200 | - $table->setStructure(' |
|
| 171 | + } |
|
| 172 | + |
|
| 173 | + if (!$dbupdater->updateTable($table)) { |
|
| 174 | + /** |
|
| 175 | + * @todo trap the errors |
|
| 176 | + */ |
|
| 177 | + } |
|
| 178 | + |
|
| 179 | + // Create table smartobject_currency |
|
| 180 | + $table = new SmartDbTable('smartobject_currency'); |
|
| 181 | + $table->setData("2, 'EUR', 'Euro', '�', 0.65, 0"); |
|
| 182 | + $table->setData("3, 'USD', 'American dollar', '$', 0.9, 0"); |
|
| 183 | + $table->setData("1, 'CAD', 'Canadian dollar', '$', 1, 1"); |
|
| 184 | + |
|
| 185 | + if (!$dbupdater->updateTable($table)) { |
|
| 186 | + /** |
|
| 187 | + * @todo trap the errors |
|
| 188 | + */ |
|
| 189 | + } |
|
| 190 | + } |
|
| 191 | + |
|
| 192 | + // db migrate version = 3 |
|
| 193 | + $newDbVersion = 3; |
|
| 194 | + if ($dbVersion < $newDbVersion) { |
|
| 195 | + echo 'Database migrate to version ' . $newDbVersion . '<br>'; |
|
| 196 | + |
|
| 197 | + // Create table smartobject_customtag |
|
| 198 | + $table = new SmartDbTable('smartobject_customtag'); |
|
| 199 | + if (!$table->exists()) { |
|
| 200 | + $table->setStructure(' |
|
| 201 | 201 | `customtagid` int(11) NOT NULL auto_increment, |
| 202 | 202 | `name` VARCHAR(255) NOT NULL, |
| 203 | 203 | `description` TEXT NOT NULL, |
@@ -205,24 +205,24 @@ discard block |
||
| 205 | 205 | `language` TEXT NOT NULL, |
| 206 | 206 | PRIMARY KEY (`customtagid`) |
| 207 | 207 | '); |
| 208 | - } |
|
| 209 | - |
|
| 210 | - if (!$dbupdater->updateTable($table)) { |
|
| 211 | - /** |
|
| 212 | - * @todo trap the errors |
|
| 213 | - */ |
|
| 214 | - } |
|
| 215 | - } |
|
| 216 | - |
|
| 217 | - // db migrate version = 4 |
|
| 218 | - $newDbVersion = 4; |
|
| 219 | - if ($dbVersion < $newDbVersion) { |
|
| 220 | - echo 'Database migrate to version ' . $newDbVersion . '<br>'; |
|
| 221 | - |
|
| 222 | - // Create table smartobject_currency |
|
| 223 | - $table = new SmartDbTable('smartobject_currency'); |
|
| 224 | - if (!$table->exists()) { |
|
| 225 | - $table->setStructure(' |
|
| 208 | + } |
|
| 209 | + |
|
| 210 | + if (!$dbupdater->updateTable($table)) { |
|
| 211 | + /** |
|
| 212 | + * @todo trap the errors |
|
| 213 | + */ |
|
| 214 | + } |
|
| 215 | + } |
|
| 216 | + |
|
| 217 | + // db migrate version = 4 |
|
| 218 | + $newDbVersion = 4; |
|
| 219 | + if ($dbVersion < $newDbVersion) { |
|
| 220 | + echo 'Database migrate to version ' . $newDbVersion . '<br>'; |
|
| 221 | + |
|
| 222 | + // Create table smartobject_currency |
|
| 223 | + $table = new SmartDbTable('smartobject_currency'); |
|
| 224 | + if (!$table->exists()) { |
|
| 225 | + $table->setStructure(' |
|
| 226 | 226 | `currencyid` int(11) NOT NULL auto_increment, |
| 227 | 227 | `iso4217` VARCHAR(5) NOT NULL, |
| 228 | 228 | `name` VARCHAR(255) NOT NULL, |
@@ -231,46 +231,46 @@ discard block |
||
| 231 | 231 | `default_currency` int(1) NOT NULL, |
| 232 | 232 | PRIMARY KEY (`currencyid`) |
| 233 | 233 | '); |
| 234 | - } |
|
| 235 | - |
|
| 236 | - if (!$dbupdater->updateTable($table)) { |
|
| 237 | - /** |
|
| 238 | - * @todo trap the errors |
|
| 239 | - */ |
|
| 240 | - } |
|
| 241 | - } |
|
| 242 | - |
|
| 243 | - // db migrate version = 6 |
|
| 244 | - $newDbVersion = 6; |
|
| 245 | - if ($dbVersion < $newDbVersion) { |
|
| 246 | - echo 'Database migrate to version ' . $newDbVersion . '<br>'; |
|
| 247 | - } |
|
| 248 | - |
|
| 249 | - $newDbVersion = 7; |
|
| 250 | - if ($dbVersion < $newDbVersion) { |
|
| 251 | - echo 'Database migrate to version ' . $newDbVersion . '<br>'; |
|
| 252 | - |
|
| 253 | - // Create table smartobject_file |
|
| 254 | - $table = new SmartDbTable('smartobject_file'); |
|
| 255 | - if (!$table->exists()) { |
|
| 256 | - $table->setStructure(' |
|
| 234 | + } |
|
| 235 | + |
|
| 236 | + if (!$dbupdater->updateTable($table)) { |
|
| 237 | + /** |
|
| 238 | + * @todo trap the errors |
|
| 239 | + */ |
|
| 240 | + } |
|
| 241 | + } |
|
| 242 | + |
|
| 243 | + // db migrate version = 6 |
|
| 244 | + $newDbVersion = 6; |
|
| 245 | + if ($dbVersion < $newDbVersion) { |
|
| 246 | + echo 'Database migrate to version ' . $newDbVersion . '<br>'; |
|
| 247 | + } |
|
| 248 | + |
|
| 249 | + $newDbVersion = 7; |
|
| 250 | + if ($dbVersion < $newDbVersion) { |
|
| 251 | + echo 'Database migrate to version ' . $newDbVersion . '<br>'; |
|
| 252 | + |
|
| 253 | + // Create table smartobject_file |
|
| 254 | + $table = new SmartDbTable('smartobject_file'); |
|
| 255 | + if (!$table->exists()) { |
|
| 256 | + $table->setStructure(' |
|
| 257 | 257 | `fileid` int(11) NOT NULL auto_increment, |
| 258 | 258 | `caption` varchar(255) collate latin1_general_ci NOT NULL, |
| 259 | 259 | `url` varchar(255) collate latin1_general_ci NOT NULL, |
| 260 | 260 | `description` text collate latin1_general_ci NOT NULL, |
| 261 | 261 | PRIMARY KEY (`fileid`) |
| 262 | 262 | '); |
| 263 | - if (!$dbupdater->updateTable($table)) { |
|
| 264 | - /** |
|
| 265 | - * @todo trap the errors |
|
| 266 | - */ |
|
| 267 | - } |
|
| 268 | - } |
|
| 269 | - unset($table); |
|
| 270 | - // Create table smartobject_urllink |
|
| 271 | - $table = new SmartDbTable('smartobject_urllink'); |
|
| 272 | - if (!$table->exists()) { |
|
| 273 | - $table->setStructure(' |
|
| 263 | + if (!$dbupdater->updateTable($table)) { |
|
| 264 | + /** |
|
| 265 | + * @todo trap the errors |
|
| 266 | + */ |
|
| 267 | + } |
|
| 268 | + } |
|
| 269 | + unset($table); |
|
| 270 | + // Create table smartobject_urllink |
|
| 271 | + $table = new SmartDbTable('smartobject_urllink'); |
|
| 272 | + if (!$table->exists()) { |
|
| 273 | + $table->setStructure(' |
|
| 274 | 274 | `urllinkid` int(11) NOT NULL auto_increment, |
| 275 | 275 | `caption` varchar(255) collate latin1_general_ci NOT NULL, |
| 276 | 276 | `url` varchar(255) collate latin1_general_ci NOT NULL, |
@@ -278,25 +278,25 @@ discard block |
||
| 278 | 278 | `target` varchar(10) collate latin1_general_ci NOT NULL, |
| 279 | 279 | PRIMARY KEY (`urllinkid`) |
| 280 | 280 | '); |
| 281 | - if (!$dbupdater->updateTable($table)) { |
|
| 282 | - /** |
|
| 283 | - * @todo trap the errors |
|
| 284 | - */ |
|
| 285 | - } |
|
| 286 | - } |
|
| 287 | - unset($table); |
|
| 288 | - } |
|
| 289 | - echo '</code>'; |
|
| 290 | - |
|
| 291 | - $feedback = ob_get_clean(); |
|
| 292 | - if (method_exists($module, 'setMessage')) { |
|
| 293 | - $module->setMessage($feedback); |
|
| 294 | - } else { |
|
| 295 | - echo $feedback; |
|
| 296 | - } |
|
| 297 | - smart_SetMeta('version', $newDbVersion, 'smartobject'); //Set meta version to current |
|
| 298 | - |
|
| 299 | - return true; |
|
| 281 | + if (!$dbupdater->updateTable($table)) { |
|
| 282 | + /** |
|
| 283 | + * @todo trap the errors |
|
| 284 | + */ |
|
| 285 | + } |
|
| 286 | + } |
|
| 287 | + unset($table); |
|
| 288 | + } |
|
| 289 | + echo '</code>'; |
|
| 290 | + |
|
| 291 | + $feedback = ob_get_clean(); |
|
| 292 | + if (method_exists($module, 'setMessage')) { |
|
| 293 | + $module->setMessage($feedback); |
|
| 294 | + } else { |
|
| 295 | + echo $feedback; |
|
| 296 | + } |
|
| 297 | + smart_SetMeta('version', $newDbVersion, 'smartobject'); //Set meta version to current |
|
| 298 | + |
|
| 299 | + return true; |
|
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | /** |
@@ -305,10 +305,10 @@ discard block |
||
| 305 | 305 | */ |
| 306 | 306 | function xoops_module_install_smartobject($module) |
| 307 | 307 | { |
| 308 | - ob_start(); |
|
| 308 | + ob_start(); |
|
| 309 | 309 | |
| 310 | - echo 'Using the ImpressCMS onInstall event'; |
|
| 311 | - $feedback = ob_get_clean(); |
|
| 310 | + echo 'Using the ImpressCMS onInstall event'; |
|
| 311 | + $feedback = ob_get_clean(); |
|
| 312 | 312 | |
| 313 | - return $feedback; |
|
| 313 | + return $feedback; |
|
| 314 | 314 | } |
@@ -26,8 +26,8 @@ discard block |
||
| 26 | 26 | // ------------------------------------------------------------------------ // |
| 27 | 27 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
| 28 | 28 | |
| 29 | -include_once(XOOPS_ROOT_PATH . '/modules/smartobject/include/common.php'); |
|
| 30 | -include_once(XOOPS_ROOT_PATH . '/modules/smartobject/class/smartdbupdater.php'); |
|
| 29 | +include_once(XOOPS_ROOT_PATH.'/modules/smartobject/include/common.php'); |
|
| 30 | +include_once(XOOPS_ROOT_PATH.'/modules/smartobject/class/smartdbupdater.php'); |
|
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * @param $module |
@@ -44,12 +44,12 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | $dbupdater = new SmartobjectDbupdater(); |
| 46 | 46 | |
| 47 | - echo '<code>' . _SDU_UPDATE_UPDATING_DATABASE . '<br>'; |
|
| 47 | + echo '<code>'._SDU_UPDATE_UPDATING_DATABASE.'<br>'; |
|
| 48 | 48 | |
| 49 | 49 | // db migrate version = 1 |
| 50 | 50 | $newDbVersion = 1; |
| 51 | 51 | if ($dbVersion < $newDbVersion) { |
| 52 | - echo 'Database migrate to version ' . $newDbVersion . '<br>'; |
|
| 52 | + echo 'Database migrate to version '.$newDbVersion.'<br>'; |
|
| 53 | 53 | |
| 54 | 54 | // Create table smartobject_link |
| 55 | 55 | $table = new SmartDbTable('smartobject_link'); |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | // db migrate version = 2 |
| 153 | 153 | $newDbVersion = 2; |
| 154 | 154 | if ($dbVersion < $newDbVersion) { |
| 155 | - echo 'Database migrate to version ' . $newDbVersion . '<br>'; |
|
| 155 | + echo 'Database migrate to version '.$newDbVersion.'<br>'; |
|
| 156 | 156 | |
| 157 | 157 | // Create table smartobject_rating |
| 158 | 158 | $table = new SmartDbTable('smartobject_rating'); |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | // db migrate version = 3 |
| 193 | 193 | $newDbVersion = 3; |
| 194 | 194 | if ($dbVersion < $newDbVersion) { |
| 195 | - echo 'Database migrate to version ' . $newDbVersion . '<br>'; |
|
| 195 | + echo 'Database migrate to version '.$newDbVersion.'<br>'; |
|
| 196 | 196 | |
| 197 | 197 | // Create table smartobject_customtag |
| 198 | 198 | $table = new SmartDbTable('smartobject_customtag'); |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | // db migrate version = 4 |
| 218 | 218 | $newDbVersion = 4; |
| 219 | 219 | if ($dbVersion < $newDbVersion) { |
| 220 | - echo 'Database migrate to version ' . $newDbVersion . '<br>'; |
|
| 220 | + echo 'Database migrate to version '.$newDbVersion.'<br>'; |
|
| 221 | 221 | |
| 222 | 222 | // Create table smartobject_currency |
| 223 | 223 | $table = new SmartDbTable('smartobject_currency'); |
@@ -243,12 +243,12 @@ discard block |
||
| 243 | 243 | // db migrate version = 6 |
| 244 | 244 | $newDbVersion = 6; |
| 245 | 245 | if ($dbVersion < $newDbVersion) { |
| 246 | - echo 'Database migrate to version ' . $newDbVersion . '<br>'; |
|
| 246 | + echo 'Database migrate to version '.$newDbVersion.'<br>'; |
|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | $newDbVersion = 7; |
| 250 | 250 | if ($dbVersion < $newDbVersion) { |
| 251 | - echo 'Database migrate to version ' . $newDbVersion . '<br>'; |
|
| 251 | + echo 'Database migrate to version '.$newDbVersion.'<br>'; |
|
| 252 | 252 | |
| 253 | 253 | // Create table smartobject_file |
| 254 | 254 | $table = new SmartDbTable('smartobject_file'); |
@@ -7,84 +7,84 @@ |
||
| 7 | 7 | */ |
| 8 | 8 | class XoopsCaptchaText |
| 9 | 9 | { |
| 10 | - public $config = array(); |
|
| 11 | - public $code; |
|
| 10 | + public $config = array(); |
|
| 11 | + public $code; |
|
| 12 | 12 | |
| 13 | - /** |
|
| 14 | - * XoopsCaptchaText constructor. |
|
| 15 | - */ |
|
| 16 | - public function __construct() |
|
| 17 | - { |
|
| 18 | - } |
|
| 13 | + /** |
|
| 14 | + * XoopsCaptchaText constructor. |
|
| 15 | + */ |
|
| 16 | + public function __construct() |
|
| 17 | + { |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | - /** |
|
| 21 | - * @return XoopsCaptchaText |
|
| 22 | - */ |
|
| 23 | - public static function getInstance() |
|
| 24 | - { |
|
| 25 | - static $instance; |
|
| 26 | - if (null === $instance) { |
|
| 27 | - $instance = new static(); |
|
| 28 | - } |
|
| 20 | + /** |
|
| 21 | + * @return XoopsCaptchaText |
|
| 22 | + */ |
|
| 23 | + public static function getInstance() |
|
| 24 | + { |
|
| 25 | + static $instance; |
|
| 26 | + if (null === $instance) { |
|
| 27 | + $instance = new static(); |
|
| 28 | + } |
|
| 29 | 29 | |
| 30 | - return $instance; |
|
| 31 | - } |
|
| 30 | + return $instance; |
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * Loading configs from CAPTCHA class |
|
| 35 | - * @param array $config |
|
| 36 | - */ |
|
| 37 | - public function loadConfig($config = array()) |
|
| 38 | - { |
|
| 39 | - // Loading default preferences |
|
| 40 | - $this->config = $config; |
|
| 41 | - } |
|
| 33 | + /** |
|
| 34 | + * Loading configs from CAPTCHA class |
|
| 35 | + * @param array $config |
|
| 36 | + */ |
|
| 37 | + public function loadConfig($config = array()) |
|
| 38 | + { |
|
| 39 | + // Loading default preferences |
|
| 40 | + $this->config = $config; |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - public function setCode() |
|
| 44 | - { |
|
| 45 | - $_SESSION['XoopsCaptcha_sessioncode'] = (string)$this->code; |
|
| 46 | - } |
|
| 43 | + public function setCode() |
|
| 44 | + { |
|
| 45 | + $_SESSION['XoopsCaptcha_sessioncode'] = (string)$this->code; |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - /** |
|
| 49 | - * @return string |
|
| 50 | - */ |
|
| 51 | - public function render() |
|
| 52 | - { |
|
| 53 | - $form = $this->loadText() . |
|
| 54 | - " <input type='text' name='" . |
|
| 55 | - $this->config['name'] . |
|
| 56 | - "' id='" . |
|
| 57 | - $this->config['name'] . |
|
| 58 | - "' size='" . |
|
| 59 | - $this->config['num_chars'] . |
|
| 60 | - "' maxlength='" . |
|
| 61 | - $this->config['num_chars'] . |
|
| 62 | - "' value='' />"; |
|
| 63 | - $rule = constant('XOOPS_CAPTCHA_RULE_TEXT'); |
|
| 64 | - if (!empty($rule)) { |
|
| 65 | - $form .= " <small>{$rule}</small>"; |
|
| 66 | - } |
|
| 48 | + /** |
|
| 49 | + * @return string |
|
| 50 | + */ |
|
| 51 | + public function render() |
|
| 52 | + { |
|
| 53 | + $form = $this->loadText() . |
|
| 54 | + " <input type='text' name='" . |
|
| 55 | + $this->config['name'] . |
|
| 56 | + "' id='" . |
|
| 57 | + $this->config['name'] . |
|
| 58 | + "' size='" . |
|
| 59 | + $this->config['num_chars'] . |
|
| 60 | + "' maxlength='" . |
|
| 61 | + $this->config['num_chars'] . |
|
| 62 | + "' value='' />"; |
|
| 63 | + $rule = constant('XOOPS_CAPTCHA_RULE_TEXT'); |
|
| 64 | + if (!empty($rule)) { |
|
| 65 | + $form .= " <small>{$rule}</small>"; |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - $this->setCode(); |
|
| 68 | + $this->setCode(); |
|
| 69 | 69 | |
| 70 | - return $form; |
|
| 71 | - } |
|
| 70 | + return $form; |
|
| 71 | + } |
|
| 72 | 72 | |
| 73 | - /** |
|
| 74 | - * @return string |
|
| 75 | - */ |
|
| 76 | - public function loadText() |
|
| 77 | - { |
|
| 78 | - $val_a = mt_rand(0, 9); |
|
| 79 | - $val_b = mt_rand(0, 9); |
|
| 80 | - if ($val_a > $val_b) { |
|
| 81 | - $expression = "{$val_a} - {$val_b} = ?"; |
|
| 82 | - $this->code = $val_a - $val_b; |
|
| 83 | - } else { |
|
| 84 | - $expression = "{$val_a} + {$val_b} = ?"; |
|
| 85 | - $this->code = $val_a + $val_b; |
|
| 86 | - } |
|
| 73 | + /** |
|
| 74 | + * @return string |
|
| 75 | + */ |
|
| 76 | + public function loadText() |
|
| 77 | + { |
|
| 78 | + $val_a = mt_rand(0, 9); |
|
| 79 | + $val_b = mt_rand(0, 9); |
|
| 80 | + if ($val_a > $val_b) { |
|
| 81 | + $expression = "{$val_a} - {$val_b} = ?"; |
|
| 82 | + $this->code = $val_a - $val_b; |
|
| 83 | + } else { |
|
| 84 | + $expression = "{$val_a} + {$val_b} = ?"; |
|
| 85 | + $this->code = $val_a + $val_b; |
|
| 86 | + } |
|
| 87 | 87 | |
| 88 | - return "<span style='font-style: normal; font-weight: bold; font-size: 100%; font-color: #333; border: 1px solid #333; padding: 1px 5px;'>{$expression}</span>"; |
|
| 89 | - } |
|
| 88 | + return "<span style='font-style: normal; font-weight: bold; font-size: 100%; font-color: #333; border: 1px solid #333; padding: 1px 5px;'>{$expression}</span>"; |
|
| 89 | + } |
|
| 90 | 90 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | public function setCode() |
| 44 | 44 | { |
| 45 | - $_SESSION['XoopsCaptcha_sessioncode'] = (string)$this->code; |
|
| 45 | + $_SESSION['XoopsCaptcha_sessioncode'] = (string) $this->code; |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** |
@@ -50,15 +50,15 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function render() |
| 52 | 52 | { |
| 53 | - $form = $this->loadText() . |
|
| 54 | - " <input type='text' name='" . |
|
| 55 | - $this->config['name'] . |
|
| 56 | - "' id='" . |
|
| 57 | - $this->config['name'] . |
|
| 58 | - "' size='" . |
|
| 59 | - $this->config['num_chars'] . |
|
| 60 | - "' maxlength='" . |
|
| 61 | - $this->config['num_chars'] . |
|
| 53 | + $form = $this->loadText(). |
|
| 54 | + " <input type='text' name='". |
|
| 55 | + $this->config['name']. |
|
| 56 | + "' id='". |
|
| 57 | + $this->config['name']. |
|
| 58 | + "' size='". |
|
| 59 | + $this->config['num_chars']. |
|
| 60 | + "' maxlength='". |
|
| 61 | + $this->config['num_chars']. |
|
| 62 | 62 | "' value='' />"; |
| 63 | 63 | $rule = constant('XOOPS_CAPTCHA_RULE_TEXT'); |
| 64 | 64 | if (!empty($rule)) { |