@@ -11,54 +11,54 @@ |
||
11 | 11 | * @subpackage SmartObjectForm |
12 | 12 | */ |
13 | 13 | class SmartFormParentcategoryElement extends XoopsFormSelect { |
14 | - function SmartFormParentcategoryElement($object, $key) { |
|
14 | + function SmartFormParentcategoryElement($object, $key) { |
|
15 | 15 | |
16 | - $addNoParent = isset($object->controls[$key]['addNoParent']) ? $object->controls[$key]['addNoParent'] : true; |
|
17 | - $criteria = new CriteriaCompo(); |
|
18 | - $criteria->setSort("weight, name"); |
|
19 | - $category_handler = xoops_getmodulehandler('category', $object->handler->_moduleName); |
|
20 | - $categories = $category_handler->getObjects($criteria); |
|
16 | + $addNoParent = isset($object->controls[$key]['addNoParent']) ? $object->controls[$key]['addNoParent'] : true; |
|
17 | + $criteria = new CriteriaCompo(); |
|
18 | + $criteria->setSort("weight, name"); |
|
19 | + $category_handler = xoops_getmodulehandler('category', $object->handler->_moduleName); |
|
20 | + $categories = $category_handler->getObjects($criteria); |
|
21 | 21 | |
22 | - include_once(XOOPS_ROOT_PATH . "/class/tree.php"); |
|
23 | - $mytree = new XoopsObjectTree($categories, "categoryid", "parentid"); |
|
24 | - $this->XoopsFormSelect( $object->vars[$key]['form_caption'], $key, $object->getVar($key, 'e') ); |
|
22 | + include_once(XOOPS_ROOT_PATH . "/class/tree.php"); |
|
23 | + $mytree = new XoopsObjectTree($categories, "categoryid", "parentid"); |
|
24 | + $this->XoopsFormSelect( $object->vars[$key]['form_caption'], $key, $object->getVar($key, 'e') ); |
|
25 | 25 | |
26 | - $ret = array(); |
|
27 | - $options = $this->getOptionArray($mytree, "name", 0, "", $ret); |
|
28 | - if ($addNoParent) { |
|
29 | - $newOptions = array('0'=>'----'); |
|
30 | - foreach ($options as $k=>$v) { |
|
31 | - $newOptions[$k] = $v; |
|
32 | - } |
|
33 | - $options = $newOptions; |
|
34 | - } |
|
35 | - $this->addOptionArray($options); |
|
36 | - } |
|
26 | + $ret = array(); |
|
27 | + $options = $this->getOptionArray($mytree, "name", 0, "", $ret); |
|
28 | + if ($addNoParent) { |
|
29 | + $newOptions = array('0'=>'----'); |
|
30 | + foreach ($options as $k=>$v) { |
|
31 | + $newOptions[$k] = $v; |
|
32 | + } |
|
33 | + $options = $newOptions; |
|
34 | + } |
|
35 | + $this->addOptionArray($options); |
|
36 | + } |
|
37 | 37 | |
38 | - /** |
|
39 | - * Get options for a category select with hierarchy (recursive) |
|
40 | - * |
|
41 | - * @param XoopsObjectTree $tree |
|
42 | - * @param string $fieldName |
|
43 | - * @param int $key |
|
44 | - * @param string $prefix_curr |
|
45 | - * @param array $ret |
|
46 | - * |
|
47 | - * @return array |
|
48 | - */ |
|
49 | - function getOptionArray($tree, $fieldName, $key, $prefix_curr = "", &$ret) { |
|
38 | + /** |
|
39 | + * Get options for a category select with hierarchy (recursive) |
|
40 | + * |
|
41 | + * @param XoopsObjectTree $tree |
|
42 | + * @param string $fieldName |
|
43 | + * @param int $key |
|
44 | + * @param string $prefix_curr |
|
45 | + * @param array $ret |
|
46 | + * |
|
47 | + * @return array |
|
48 | + */ |
|
49 | + function getOptionArray($tree, $fieldName, $key, $prefix_curr = "", &$ret) { |
|
50 | 50 | |
51 | - if ($key > 0) { |
|
52 | - $value = $tree->_tree[$key]['obj']->getVar($tree->_myId); |
|
51 | + if ($key > 0) { |
|
52 | + $value = $tree->_tree[$key]['obj']->getVar($tree->_myId); |
|
53 | 53 | $ret[$key] = $prefix_curr.$tree->_tree[$key]['obj']->getVar($fieldName); |
54 | - $prefix_curr .= "-"; |
|
55 | - } |
|
56 | - if (isset($tree->_tree[$key]['child']) && !empty($tree->_tree[$key]['child'])) { |
|
57 | - foreach ($tree->_tree[$key]['child'] as $childkey) { |
|
58 | - $this->getOptionArray($tree, $fieldName, $childkey, $prefix_curr, $ret); |
|
59 | - } |
|
60 | - } |
|
61 | - return $ret; |
|
62 | - } |
|
54 | + $prefix_curr .= "-"; |
|
55 | + } |
|
56 | + if (isset($tree->_tree[$key]['child']) && !empty($tree->_tree[$key]['child'])) { |
|
57 | + foreach ($tree->_tree[$key]['child'] as $childkey) { |
|
58 | + $this->getOptionArray($tree, $fieldName, $childkey, $prefix_curr, $ret); |
|
59 | + } |
|
60 | + } |
|
61 | + return $ret; |
|
62 | + } |
|
63 | 63 | } |
64 | 64 | ?> |
65 | 65 | \ No newline at end of file |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | include_once(XOOPS_ROOT_PATH . "/class/tree.php"); |
23 | 23 | $mytree = new XoopsObjectTree($categories, "categoryid", "parentid"); |
24 | - $this->XoopsFormSelect( $object->vars[$key]['form_caption'], $key, $object->getVar($key, 'e') ); |
|
24 | + $this->XoopsFormSelect($object->vars[$key]['form_caption'], $key, $object->getVar($key, 'e')); |
|
25 | 25 | |
26 | 26 | $ret = array(); |
27 | 27 | $options = $this->getOptionArray($mytree, "name", 0, "", $ret); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | if ($key > 0) { |
52 | 52 | $value = $tree->_tree[$key]['obj']->getVar($tree->_myId); |
53 | - $ret[$key] = $prefix_curr.$tree->_tree[$key]['obj']->getVar($fieldName); |
|
53 | + $ret[$key] = $prefix_curr . $tree->_tree[$key]['obj']->getVar($fieldName); |
|
54 | 54 | $prefix_curr .= "-"; |
55 | 55 | } |
56 | 56 | if (isset($tree->_tree[$key]['child']) && !empty($tree->_tree[$key]['child'])) { |
@@ -14,15 +14,15 @@ |
||
14 | 14 | |
15 | 15 | var $_include_file; |
16 | 16 | |
17 | - function SmartAutocompleteElement($caption, $name, $include_file, $size, $maxlength, $value="") { |
|
17 | + function SmartAutocompleteElement($caption, $name, $include_file, $size, $maxlength, $value="") { |
|
18 | 18 | $this->_include_file = $include_file; |
19 | 19 | $this->XoopsFormText($caption, $name, $size, $maxlength, $value); |
20 | - } |
|
20 | + } |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * Prepare HTML for output |
24 | 24 | * |
25 | - * @return string HTML |
|
25 | + * @return string HTML |
|
26 | 26 | */ |
27 | 27 | function render(){ |
28 | 28 | $ret = "<input type='text' name='".$this->getName()."' id='".$this->getName()."' size='".$this->getSize()."' maxlength='".$this->getMaxlength()."' value='".$this->getValue()."'".$this->getExtra()." />"; |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | var $_include_file; |
16 | 16 | |
17 | - function SmartAutocompleteElement($caption, $name, $include_file, $size, $maxlength, $value="") { |
|
17 | + function SmartAutocompleteElement($caption, $name, $include_file, $size, $maxlength, $value = "") { |
|
18 | 18 | $this->_include_file = $include_file; |
19 | 19 | $this->XoopsFormText($caption, $name, $size, $maxlength, $value); |
20 | 20 | } |
@@ -24,13 +24,13 @@ discard block |
||
24 | 24 | * |
25 | 25 | * @return string HTML |
26 | 26 | */ |
27 | - function render(){ |
|
28 | - $ret = "<input type='text' name='".$this->getName()."' id='".$this->getName()."' size='".$this->getSize()."' maxlength='".$this->getMaxlength()."' value='".$this->getValue()."'".$this->getExtra()." />"; |
|
27 | + function render() { |
|
28 | + $ret = "<input type='text' name='" . $this->getName() . "' id='" . $this->getName() . "' size='" . $this->getSize() . "' maxlength='" . $this->getMaxlength() . "' value='" . $this->getValue() . "'" . $this->getExtra() . " />"; |
|
29 | 29 | |
30 | 30 | $ret .= ' <div class="smartobject_autocomplete_hint" id="smartobject_autocomplete_hint' . $this->getName() . '"></div> |
31 | 31 | |
32 | 32 | <script type="text/javascript"> |
33 | - new Ajax.Autocompleter("' .$this->getName(). '","smartobject_autocomplete_hint' .$this->getName(). '","' . $this->_include_file . '?key=' . $this->getName() . '"); |
|
33 | + new Ajax.Autocompleter("' .$this->getName() . '","smartobject_autocomplete_hint' . $this->getName() . '","' . $this->_include_file . '?key=' . $this->getName() . '"); |
|
34 | 34 | </script>'; |
35 | 35 | |
36 | 36 | return $ret; |
@@ -12,16 +12,16 @@ |
||
12 | 12 | */ |
13 | 13 | class SmartFormLanguageElement extends XoopsFormSelectLang { |
14 | 14 | |
15 | - function SmartFormLanguageElement($object, $key) { |
|
15 | + function SmartFormLanguageElement($object, $key) { |
|
16 | 16 | |
17 | - $var = $object->vars[$key]; |
|
18 | - $control = $object->controls[$key]; |
|
19 | - $all = isset($control['all']) ? true : false; |
|
17 | + $var = $object->vars[$key]; |
|
18 | + $control = $object->controls[$key]; |
|
19 | + $all = isset($control['all']) ? true : false; |
|
20 | 20 | |
21 | 21 | $this->XoopsFormSelectLang($var['form_caption'], $key, $object->getVar($key, 'e')); |
22 | 22 | if ($all) { |
23 | 23 | $this->addOption('all', _ALL); |
24 | 24 | } |
25 | - } |
|
25 | + } |
|
26 | 26 | } |
27 | 27 | ?> |
28 | 28 | \ No newline at end of file |
@@ -11,8 +11,8 @@ |
||
11 | 11 | * @subpackage SmartObjectForm |
12 | 12 | */ |
13 | 13 | class SmartFormDate_timeElement extends XoopsFormDateTime { |
14 | - function SmartFormDate_timeElement($object, $key) { |
|
15 | - $this->XoopsFormDateTime($object->vars[$key]['form_caption'], $key, 15, $object->getVar($key, 'e')); |
|
16 | - } |
|
14 | + function SmartFormDate_timeElement($object, $key) { |
|
15 | + $this->XoopsFormDateTime($object->vars[$key]['form_caption'], $key, 15, $object->getVar($key, 'e')); |
|
16 | + } |
|
17 | 17 | } |
18 | 18 | ?> |
19 | 19 | \ No newline at end of file |
@@ -11,8 +11,8 @@ |
||
11 | 11 | * @subpackage SmartObjectForm |
12 | 12 | */ |
13 | 13 | class SmartFormYesnoElement extends XoopsFormRadioYN { |
14 | - function SmartFormYesnoElement($object, $key) { |
|
15 | - $this->XoopsFormRadioYN($object->vars[$key]['form_caption'], $key, $object->getVar($key,'e')); |
|
16 | - } |
|
14 | + function SmartFormYesnoElement($object, $key) { |
|
15 | + $this->XoopsFormRadioYN($object->vars[$key]['form_caption'], $key, $object->getVar($key,'e')); |
|
16 | + } |
|
17 | 17 | } |
18 | 18 | ?> |
19 | 19 | \ No newline at end of file |
@@ -12,7 +12,7 @@ |
||
12 | 12 | */ |
13 | 13 | class SmartFormYesnoElement extends XoopsFormRadioYN { |
14 | 14 | function SmartFormYesnoElement($object, $key) { |
15 | - $this->XoopsFormRadioYN($object->vars[$key]['form_caption'], $key, $object->getVar($key,'e')); |
|
15 | + $this->XoopsFormRadioYN($object->vars[$key]['form_caption'], $key, $object->getVar($key, 'e')); |
|
16 | 16 | } |
17 | 17 | } |
18 | 18 | ?> |
19 | 19 | \ No newline at end of file |
@@ -11,8 +11,8 @@ |
||
11 | 11 | * @subpackage SmartObjectForm |
12 | 12 | */ |
13 | 13 | class SmartFormDateElement extends XoopsFormTextDateSelect { |
14 | - function SmartFormDateElement($object, $key) { |
|
15 | - $this->XoopsFormTextDateSelect($object->vars[$key]['form_caption'], $key, 15, $object->getVar($key, 'e')); |
|
16 | - } |
|
14 | + function SmartFormDateElement($object, $key) { |
|
15 | + $this->XoopsFormTextDateSelect($object->vars[$key]['form_caption'], $key, 15, $object->getVar($key, 'e')); |
|
16 | + } |
|
17 | 17 | } |
18 | 18 | ?> |
19 | 19 | \ No newline at end of file |
@@ -11,14 +11,14 @@ |
||
11 | 11 | * @subpackage SmartObjectForm |
12 | 12 | */ |
13 | 13 | class SmartFormAutocompleteElement extends SmartAutocompleteElement { |
14 | - function SmartFormAutocompleteElement($object, $key) { |
|
14 | + function SmartFormAutocompleteElement($object, $key) { |
|
15 | 15 | |
16 | - $var = $object->vars[$key]; |
|
17 | - $control = $object->controls[$key]; |
|
18 | - $form_maxlength = isset($control['maxlength']) ? $control['maxlength'] : (isset($var['maxlength']) ? $var['maxlength'] : 255); |
|
16 | + $var = $object->vars[$key]; |
|
17 | + $control = $object->controls[$key]; |
|
18 | + $form_maxlength = isset($control['maxlength']) ? $control['maxlength'] : (isset($var['maxlength']) ? $var['maxlength'] : 255); |
|
19 | 19 | |
20 | 20 | $form_size = isset($control['size']) ? $control['size'] : 50; |
21 | 21 | $this->SmartAutocompleteElement($var['form_caption'], $key, $form_size, $form_maxlength, $object->getVar($key, 'e')); |
22 | - } |
|
22 | + } |
|
23 | 23 | } |
24 | 24 | ?> |
25 | 25 | \ No newline at end of file |
@@ -12,20 +12,20 @@ |
||
12 | 12 | */ |
13 | 13 | include_once SMARTOBJECT_ROOT_PATH."class/form/elements/smartformuploadelement.php"; |
14 | 14 | class SmartFormImageUploadElement extends SmartFormUploadElement { |
15 | - function SmartFormImageUploadElement($object, $key) { |
|
16 | - $this->SmartFormFileElement($object, $key); |
|
17 | - // Override name for upload purposes |
|
18 | - $this->setName('upload_'.$key); |
|
19 | - } |
|
20 | - /** |
|
21 | - * prepare HTML for output |
|
22 | - * |
|
23 | - * @return string HTML |
|
24 | - */ |
|
25 | - function render(){ |
|
26 | - return "<input type='hidden' name='MAX_FILE_SIZE' value='".$this->getMaxFileSize()."' /> |
|
15 | + function SmartFormImageUploadElement($object, $key) { |
|
16 | + $this->SmartFormFileElement($object, $key); |
|
17 | + // Override name for upload purposes |
|
18 | + $this->setName('upload_'.$key); |
|
19 | + } |
|
20 | + /** |
|
21 | + * prepare HTML for output |
|
22 | + * |
|
23 | + * @return string HTML |
|
24 | + */ |
|
25 | + function render(){ |
|
26 | + return "<input type='hidden' name='MAX_FILE_SIZE' value='".$this->getMaxFileSize()."' /> |
|
27 | 27 | <input type='file' name='".$this->getName()."' id='".$this->getName()."'".$this->getExtra()." /> |
28 | 28 | <input type='hidden' name='smart_upload_image[]' id='smart_upload_image[]' value='".$this->getName()."' />"; |
29 | - } |
|
29 | + } |
|
30 | 30 | } |
31 | 31 | ?> |
32 | 32 | \ No newline at end of file |
@@ -10,22 +10,22 @@ |
||
10 | 10 | * @package SmartObject |
11 | 11 | * @subpackage SmartObjectForm |
12 | 12 | */ |
13 | -include_once SMARTOBJECT_ROOT_PATH."class/form/elements/smartformuploadelement.php"; |
|
13 | +include_once SMARTOBJECT_ROOT_PATH . "class/form/elements/smartformuploadelement.php"; |
|
14 | 14 | class SmartFormImageUploadElement extends SmartFormUploadElement { |
15 | 15 | function SmartFormImageUploadElement($object, $key) { |
16 | 16 | $this->SmartFormFileElement($object, $key); |
17 | 17 | // Override name for upload purposes |
18 | - $this->setName('upload_'.$key); |
|
18 | + $this->setName('upload_' . $key); |
|
19 | 19 | } |
20 | 20 | /** |
21 | 21 | * prepare HTML for output |
22 | 22 | * |
23 | 23 | * @return string HTML |
24 | 24 | */ |
25 | - function render(){ |
|
26 | - return "<input type='hidden' name='MAX_FILE_SIZE' value='".$this->getMaxFileSize()."' /> |
|
27 | - <input type='file' name='".$this->getName()."' id='".$this->getName()."'".$this->getExtra()." /> |
|
28 | - <input type='hidden' name='smart_upload_image[]' id='smart_upload_image[]' value='".$this->getName()."' />"; |
|
25 | + function render() { |
|
26 | + return "<input type='hidden' name='MAX_FILE_SIZE' value='" . $this->getMaxFileSize() . "' /> |
|
27 | + <input type='file' name='".$this->getName() . "' id='" . $this->getName() . "'" . $this->getExtra() . " /> |
|
28 | + <input type='hidden' name='smart_upload_image[]' id='smart_upload_image[]' value='".$this->getName() . "' />"; |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 | ?> |
32 | 32 | \ No newline at end of file |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Loader for the SmartObject framework |
|
4 | - * |
|
5 | - * This file is responible for including some main files used by the smartobject framework. |
|
6 | - * |
|
7 | - * @license GNU |
|
8 | - * @author marcan <[email protected]> |
|
9 | - * @version $Id: smartloader.php 159 2007-12-17 16:44:05Z malanciault $ |
|
10 | - * @link http://smartfactory.ca The SmartFactory |
|
11 | - * @package SmartObject |
|
12 | - * @subpackage SmartObjectCore |
|
13 | - */ |
|
3 | + * Loader for the SmartObject framework |
|
4 | + * |
|
5 | + * This file is responible for including some main files used by the smartobject framework. |
|
6 | + * |
|
7 | + * @license GNU |
|
8 | + * @author marcan <[email protected]> |
|
9 | + * @version $Id: smartloader.php 159 2007-12-17 16:44:05Z malanciault $ |
|
10 | + * @link http://smartfactory.ca The SmartFactory |
|
11 | + * @package SmartObject |
|
12 | + * @subpackage SmartObjectCore |
|
13 | + */ |
|
14 | 14 | |
15 | 15 | if (!defined("XOOPS_ROOT_PATH")) { |
16 | 16 | die("XOOPS root path not defined"); |