Completed
Branch master (2d4977)
by Michael
03:20
created
language/english/common.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
  */
9 9
 
10 10
 if (!defined("XOOPS_ROOT_PATH")) {
11
-    die("XOOPS root path not defined");
11
+	die("XOOPS root path not defined");
12 12
 }
13 13
 
14 14
 define('_CO_OBJ_ALL', "All"); // deprecated
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -176,7 +176,7 @@
 block discarded – undo
176 176
 define('_CO_SOBJECT_BLOCKS_ADDTO_LAYOUT_OPTION2', "Vertical with icons");
177 177
 define('_CO_SOBJECT_BLOCKS_ADDTO_LAYOUT_OPTION3', "Vertical no icon");
178 178
 define('_CO_SOBJECT_CURRENT_FILE', "Current file: ");
179
-define('_CO_SOBJECT_URL_FILE_DSC', "Alternatively, you can use an URL. If you select a file via 'Browse' button, URL will be ignored. You can use the tag {XOOPS_URL} to print ".XOOPS_URL);
179
+define('_CO_SOBJECT_URL_FILE_DSC', "Alternatively, you can use an URL. If you select a file via 'Browse' button, URL will be ignored. You can use the tag {XOOPS_URL} to print " . XOOPS_URL);
180 180
 define('_CO_SOBJECT_URL_FILE', "URL: ");
181 181
 define('_CO_SOBJECT_UPLOAD', "Select a file to upload: ");
182 182
 
Please login to merge, or discard this patch.
language/english/admin.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
  * Licence: GNU
8 8
  */
9 9
 if (!defined("XOOPS_ROOT_PATH")) {
10
-    die("XOOPS root path not defined");
10
+	die("XOOPS root path not defined");
11 11
 }
12 12
 
13 13
 define('_AM_SOBJECT_ABOUT', 'About');
Please login to merge, or discard this patch.
language/english/customtag.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
  * Licence: GNU
8 8
  */
9 9
 if (!defined("XOOPS_ROOT_PATH")) {
10
-    die("XOOPS root path not defined");
10
+	die("XOOPS root path not defined");
11 11
 }
12 12
 
13 13
 define('_AM_SOBJECT_CUSTOMTAGS', 'Custom tags');
Please login to merge, or discard this patch.
header.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
  */
9 9
 
10 10
 include_once "../../mainfile.php";
11
-include_once XOOPS_ROOT_PATH.'/modules/smartobject/include/common.php';
11
+include_once XOOPS_ROOT_PATH . '/modules/smartobject/include/common.php';
12 12
 
13 13
 smart_loadCommonLanguageFile();
14 14
 
Please login to merge, or discard this patch.
class/smartobjecttreetable.php 2 patches
Indentation   +133 added lines, -133 removed lines patch added patch discarded remove patch
@@ -23,139 +23,139 @@
 block discarded – undo
23 23
  */
24 24
 class SmartObjectTreeTable extends SmartObjectTable {
25 25
 
26
-    function SmartObjectTreeTable(&$objectHandler, $criteria=false, $actions=array('edit', 'delete'), $userSide=false)
27
-    {
28
-        $this->SmartObjectTable($objectHandler, $criteria, $actions, $userSide);
29
-        $this->_isTree = true;
30
-    }
31
-    /**
32
-     * Get children objects given a specific parentid
33
-     *
34
-     * @var int $parentid id of the parent which children we want to retreive
35
-     * @return array of SmartObject
36
-     */
37
-    function getChildrenOf($parentid=0) {
38
-        return isset($this->_objects[$parentid]) ? $this->_objects[$parentid] : false;
39
-    }
40
-
41
-    function createTableRow($object, $level=0) {
42
-
43
-        $aObject = array();
44
-
45
-        $i=0;
46
-
47
-        $aColumns = array();
48
-        $doWeHaveActions = false;
49
-
50
-        foreach ($this->_columns as $column) {
51
-
52
-            $aColumn = array();
53
-
54
-            if ($i==0) {
55
-                $class = "head";
56
-            } elseif ($i % 2 == 0) {
57
-                $class = "even";
58
-            } else {
59
-                $class = "odd";
60
-            }
61
-
62
-            if ($column->_customMethodForValue && method_exists($object, $column->_customMethodForValue)) {
63
-                $method = $column->_customMethodForValue;
64
-                $value = $object->$method();
65
-            } else {
66
-                /**
67
-                 * If the column is the identifier, then put a link on it
68
-                 */
69
-                if ($column->getKeyName() == $this->_objectHandler->identifierName) {
70
-                    $value = $object->getItemLink();
71
-                } else {
72
-                    $value = $object->getVar($column->getKeyName());
73
-                }
74
-            }
75
-
76
-            $space = '';
77
-            if($column->getKeyName() == $this->_objectHandler->identifierName){
78
-                for ($i = 0; $i < $level; $i++) {
79
-                    $space = $space . '--';
80
-                }
81
-            }
82
-
83
-            if ($space != '') {
84
-                $space .= '&nbsp;';
85
-            }
86
-
87
-            $aColumn['value'] = $space . $value;
88
-            $aColumn['class'] = $class;
89
-            $aColumn['width'] = $column->getWidth();
90
-            $aColumn['align'] = $column->getAlign();
91
-            $aColumn['key'] = $column->getKeyName();
92
-
93
-            $aColumns[] = $aColumn;
94
-            $i++;
95
-        }
96
-
97
-        $aObject['columns'] = $aColumns;
98
-
99
-        $class = $class == 'even' ? 'odd' : 'even';
100
-        $aObject['class'] = $class;
101
-
102
-        $actions = array();
103
-
104
-        // Adding the custom actions if any
105
-        foreach ($this->_custom_actions as $action) {
106
-            if (method_exists($object, $action)) {
107
-                $actions[] = $object->$action();
108
-            }
109
-        }
110
-
111
-        include_once SMARTOBJECT_ROOT_PATH . "class/smartobjectcontroller.php";
112
-        $controller = new SmartObjectController($this->_objectHandler);
113
-
114
-        if (in_array('edit', $this->_actions)) {
115
-            $actions[] = $controller->getEditItemLink($object, false, true);
116
-        }
117
-        if (in_array('delete', $this->_actions)) {
118
-            $actions[] = $controller->getDeleteItemLink($object, false, true);
119
-        }
120
-        $aObject['actions'] = $actions;
121
-
122
-        $this->_tpl->assign('smartobject_actions_column_width', count($actions) * 30);
123
-        $aObject['id'] = $object->id();
124
-        $this->_aObjects[] = $aObject;
125
-
126
-        $childrenObjects = $this->getChildrenOf($object->id());
127
-
128
-        $this->_hasActions =$this->_hasActions  ? true : count($actions) > 0;
129
-
130
-        if ($childrenObjects) {
131
-            $level++;
132
-            foreach ($childrenObjects as $subObject) {
133
-                $this->createTableRow($subObject, $level);
134
-            }
135
-        }
136
-    }
137
-
138
-    function createTableRows() {
139
-        $this->_aObjects = array();
140
-
141
-        if (count($this->_objects) > 0) {
142
-
143
-            foreach ($this->getChildrenOf() as $object) {
144
-                $this->createTableRow($object);
145
-            }
146
-
147
-            $this->_tpl->assign('smartobject_objects', $this->_aObjects);
148
-        } else {
149
-            $colspan = count($this->_columns) + 1;
150
-            $this->_tpl->assign('smartobject_colspan', $colspan);
151
-        }
152
-    }
153
-
154
-    function fetchObjects() {
155
-        $ret = $this->_objectHandler->getObjects($this->_criteria, 'parentid');
156
-        return $ret;
157
-
158
-    }
26
+	function SmartObjectTreeTable(&$objectHandler, $criteria=false, $actions=array('edit', 'delete'), $userSide=false)
27
+	{
28
+		$this->SmartObjectTable($objectHandler, $criteria, $actions, $userSide);
29
+		$this->_isTree = true;
30
+	}
31
+	/**
32
+	 * Get children objects given a specific parentid
33
+	 *
34
+	 * @var int $parentid id of the parent which children we want to retreive
35
+	 * @return array of SmartObject
36
+	 */
37
+	function getChildrenOf($parentid=0) {
38
+		return isset($this->_objects[$parentid]) ? $this->_objects[$parentid] : false;
39
+	}
40
+
41
+	function createTableRow($object, $level=0) {
42
+
43
+		$aObject = array();
44
+
45
+		$i=0;
46
+
47
+		$aColumns = array();
48
+		$doWeHaveActions = false;
49
+
50
+		foreach ($this->_columns as $column) {
51
+
52
+			$aColumn = array();
53
+
54
+			if ($i==0) {
55
+				$class = "head";
56
+			} elseif ($i % 2 == 0) {
57
+				$class = "even";
58
+			} else {
59
+				$class = "odd";
60
+			}
61
+
62
+			if ($column->_customMethodForValue && method_exists($object, $column->_customMethodForValue)) {
63
+				$method = $column->_customMethodForValue;
64
+				$value = $object->$method();
65
+			} else {
66
+				/**
67
+				 * If the column is the identifier, then put a link on it
68
+				 */
69
+				if ($column->getKeyName() == $this->_objectHandler->identifierName) {
70
+					$value = $object->getItemLink();
71
+				} else {
72
+					$value = $object->getVar($column->getKeyName());
73
+				}
74
+			}
75
+
76
+			$space = '';
77
+			if($column->getKeyName() == $this->_objectHandler->identifierName){
78
+				for ($i = 0; $i < $level; $i++) {
79
+					$space = $space . '--';
80
+				}
81
+			}
82
+
83
+			if ($space != '') {
84
+				$space .= '&nbsp;';
85
+			}
86
+
87
+			$aColumn['value'] = $space . $value;
88
+			$aColumn['class'] = $class;
89
+			$aColumn['width'] = $column->getWidth();
90
+			$aColumn['align'] = $column->getAlign();
91
+			$aColumn['key'] = $column->getKeyName();
92
+
93
+			$aColumns[] = $aColumn;
94
+			$i++;
95
+		}
96
+
97
+		$aObject['columns'] = $aColumns;
98
+
99
+		$class = $class == 'even' ? 'odd' : 'even';
100
+		$aObject['class'] = $class;
101
+
102
+		$actions = array();
103
+
104
+		// Adding the custom actions if any
105
+		foreach ($this->_custom_actions as $action) {
106
+			if (method_exists($object, $action)) {
107
+				$actions[] = $object->$action();
108
+			}
109
+		}
110
+
111
+		include_once SMARTOBJECT_ROOT_PATH . "class/smartobjectcontroller.php";
112
+		$controller = new SmartObjectController($this->_objectHandler);
113
+
114
+		if (in_array('edit', $this->_actions)) {
115
+			$actions[] = $controller->getEditItemLink($object, false, true);
116
+		}
117
+		if (in_array('delete', $this->_actions)) {
118
+			$actions[] = $controller->getDeleteItemLink($object, false, true);
119
+		}
120
+		$aObject['actions'] = $actions;
121
+
122
+		$this->_tpl->assign('smartobject_actions_column_width', count($actions) * 30);
123
+		$aObject['id'] = $object->id();
124
+		$this->_aObjects[] = $aObject;
125
+
126
+		$childrenObjects = $this->getChildrenOf($object->id());
127
+
128
+		$this->_hasActions =$this->_hasActions  ? true : count($actions) > 0;
129
+
130
+		if ($childrenObjects) {
131
+			$level++;
132
+			foreach ($childrenObjects as $subObject) {
133
+				$this->createTableRow($subObject, $level);
134
+			}
135
+		}
136
+	}
137
+
138
+	function createTableRows() {
139
+		$this->_aObjects = array();
140
+
141
+		if (count($this->_objects) > 0) {
142
+
143
+			foreach ($this->getChildrenOf() as $object) {
144
+				$this->createTableRow($object);
145
+			}
146
+
147
+			$this->_tpl->assign('smartobject_objects', $this->_aObjects);
148
+		} else {
149
+			$colspan = count($this->_columns) + 1;
150
+			$this->_tpl->assign('smartobject_colspan', $colspan);
151
+		}
152
+	}
153
+
154
+	function fetchObjects() {
155
+		$ret = $this->_objectHandler->getObjects($this->_criteria, 'parentid');
156
+		return $ret;
157
+
158
+	}
159 159
 }
160 160
 
161 161
 ?>
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
  */
24 24
 class SmartObjectTreeTable extends SmartObjectTable {
25 25
 
26
-    function SmartObjectTreeTable(&$objectHandler, $criteria=false, $actions=array('edit', 'delete'), $userSide=false)
26
+    function SmartObjectTreeTable(&$objectHandler, $criteria = false, $actions = array('edit', 'delete'), $userSide = false)
27 27
     {
28 28
         $this->SmartObjectTable($objectHandler, $criteria, $actions, $userSide);
29 29
         $this->_isTree = true;
@@ -34,15 +34,15 @@  discard block
 block discarded – undo
34 34
      * @var int $parentid id of the parent which children we want to retreive
35 35
      * @return array of SmartObject
36 36
      */
37
-    function getChildrenOf($parentid=0) {
37
+    function getChildrenOf($parentid = 0) {
38 38
         return isset($this->_objects[$parentid]) ? $this->_objects[$parentid] : false;
39 39
     }
40 40
 
41
-    function createTableRow($object, $level=0) {
41
+    function createTableRow($object, $level = 0) {
42 42
 
43 43
         $aObject = array();
44 44
 
45
-        $i=0;
45
+        $i = 0;
46 46
 
47 47
         $aColumns = array();
48 48
         $doWeHaveActions = false;
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
             $aColumn = array();
53 53
 
54
-            if ($i==0) {
54
+            if ($i == 0) {
55 55
                 $class = "head";
56 56
             } elseif ($i % 2 == 0) {
57 57
                 $class = "even";
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
             }
75 75
 
76 76
             $space = '';
77
-            if($column->getKeyName() == $this->_objectHandler->identifierName){
77
+            if ($column->getKeyName() == $this->_objectHandler->identifierName) {
78 78
                 for ($i = 0; $i < $level; $i++) {
79 79
                     $space = $space . '--';
80 80
                 }
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 
126 126
         $childrenObjects = $this->getChildrenOf($object->id());
127 127
 
128
-        $this->_hasActions =$this->_hasActions  ? true : count($actions) > 0;
128
+        $this->_hasActions = $this->_hasActions ? true : count($actions) > 0;
129 129
 
130 130
         if ($childrenObjects) {
131 131
             $level++;
Please login to merge, or discard this patch.
class/smartobjectabout.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -158,16 +158,16 @@
 block discarded – undo
158 158
 		// Author's note
159 159
 		$this->_tpl->assign('module_author_word', $versioninfo->getInfo('author_word'));
160 160
 
161
-	    // For changelog thanks to 3Dev
162
-	    global $xoopsModule;
163
-	    $filename = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/changelog.txt';
164
-	    if(is_file($filename)){
165
-
166
-	        $filesize = filesize($filename);
167
-	        $handle = fopen($filename, 'r');
168
-	        $this->_tpl->assign('module_version_history', $myts->displayTarea(fread($handle, $filesize), true));
169
-	        fclose($handle);
170
-	    }
161
+		// For changelog thanks to 3Dev
162
+		global $xoopsModule;
163
+		$filename = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/changelog.txt';
164
+		if(is_file($filename)){
165
+
166
+			$filesize = filesize($filename);
167
+			$handle = fopen($filename, 'r');
168
+			$this->_tpl->assign('module_version_history', $myts->displayTarea(fread($handle, $filesize), true));
169
+			fclose($handle);
170
+		}
171 171
 
172 172
 		$this->_tpl->display( 'db:smartobject_about.html' );
173 173
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	var $_lang_by;
45 45
 	var $_tpl;
46 46
 
47
-	function SmartobjectAbout($aboutTitle='About')
47
+	function SmartobjectAbout($aboutTitle = 'About')
48 48
 	{
49 49
 		global $xoopsModule, $xoopsConfig;
50 50
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 		$this->_lang_developer_credits = _CO_SOBJECT_DEVELOPER_CREDITS;
63 63
 		$this->_lang_module_info = _CO_SOBJECT_MODULE_INFO;
64 64
 		$this->_lang_module_status = _CO_SOBJECT_MODULE_STATUS;
65
-		$this->_lang_module_release_date =_CO_SOBJECT_MODULE_RELEASE_DATE ;
65
+		$this->_lang_module_release_date = _CO_SOBJECT_MODULE_RELEASE_DATE;
66 66
 		$this->_lang_module_demo = _CO_SOBJECT_MODULE_DEMO;
67 67
 		$this->_lang_module_support = _CO_SOBJECT_MODULE_SUPPORT;
68 68
 		$this->_lang_module_bug = _CO_SOBJECT_MODULE_BUG;
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 // ---
104 104
 // 2012-01-01 PHP 5.3 : Assigning the return value of new by reference is now deprecated.
105 105
 //		$this->_tpl =& new XoopsTpl();
106
-		$this->_tpl =  new XoopsTpl();
106
+		$this->_tpl = new XoopsTpl();
107 107
 // ---
108 108
 
109 109
 		$this->_tpl->assign('module_url', XOOPS_URL . "/modules/" . $xoopsModule->getVar('dirname') . "/");
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 	    // For changelog thanks to 3Dev
162 162
 	    global $xoopsModule;
163 163
 	    $filename = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/changelog.txt';
164
-	    if(is_file($filename)){
164
+	    if (is_file($filename)) {
165 165
 
166 166
 	        $filesize = filesize($filename);
167 167
 	        $handle = fopen($filename, 'r');
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 	        fclose($handle);
170 170
 	    }
171 171
 
172
-		$this->_tpl->display( 'db:smartobject_about.html' );
172
+		$this->_tpl->display('db:smartobject_about.html');
173 173
 
174 174
 		smart_modFooter();
175 175
 
Please login to merge, or discard this patch.
class/smartobjectcategory.php 2 patches
Indentation   +76 added lines, -77 removed lines patch added patch discarded remove patch
@@ -6,7 +6,6 @@  discard block
 block discarded – undo
6 6
  * @license GNU
7 7
  * @author marcan <[email protected]>
8 8
  * @version $Id: smartobjectcategory.php 799 2008-02-04 22:14:27Z malanciault $
9
-
10 9
  * @link http://smartfactory.ca The SmartFactory
11 10
  * @package SmartObject
12 11
  * @subpackage SmartObjectItems
@@ -21,74 +20,74 @@  discard block
 block discarded – undo
21 20
 	var $_categoryPath;
22 21
 
23 22
 	function SmartobjectCategory() {
24
-	    $this->initVar('categoryid', XOBJ_DTYPE_INT, '', true);
25
-    	$this->initVar('parentid', XOBJ_DTYPE_INT, '', false, null, '', false, _CO_SOBJECT_CATEGORY_PARENTID, _CO_SOBJECT_CATEGORY_PARENTID_DSC);
26
-    	$this->initVar('name', XOBJ_DTYPE_TXTBOX, '', false, null, '', false, _CO_SOBJECT_CATEGORY_NAME, _CO_SOBJECT_CATEGORY_NAME_DSC);
27
-        $this->initVar('description', XOBJ_DTYPE_TXTAREA, '', false, null, '', false, _CO_SOBJECT_CATEGORY_DESCRIPTION, _CO_SOBJECT_CATEGORY_DESCRIPTION_DSC);
28
-        $this->initVar('image', XOBJ_DTYPE_TXTBOX, '', false, null, '',  false, _CO_SOBJECT_CATEGORY_IMAGE, _CO_SOBJECT_CATEGORY_IMAGE_DSC);
29
-
30
-        $this->initCommonVar('doxcode');
31
-
32
-        $this->setControl('image', array('name' => 'image'));
33
-        $this->setControl('parentid', array('name' => 'parentcategory'));
34
-        $this->setControl('description', array('name' => 'textarea',
35
-                                            'itemHandler' => false,
36
-                                            'method' => false,
37
-                                            'module' => false,
38
-                                            'form_editor' => 'default'));
39
-
40
-        // call parent constructor to get SEO fields initiated
41
-        $this->SmartSeoObject();
23
+		$this->initVar('categoryid', XOBJ_DTYPE_INT, '', true);
24
+		$this->initVar('parentid', XOBJ_DTYPE_INT, '', false, null, '', false, _CO_SOBJECT_CATEGORY_PARENTID, _CO_SOBJECT_CATEGORY_PARENTID_DSC);
25
+		$this->initVar('name', XOBJ_DTYPE_TXTBOX, '', false, null, '', false, _CO_SOBJECT_CATEGORY_NAME, _CO_SOBJECT_CATEGORY_NAME_DSC);
26
+		$this->initVar('description', XOBJ_DTYPE_TXTAREA, '', false, null, '', false, _CO_SOBJECT_CATEGORY_DESCRIPTION, _CO_SOBJECT_CATEGORY_DESCRIPTION_DSC);
27
+		$this->initVar('image', XOBJ_DTYPE_TXTBOX, '', false, null, '',  false, _CO_SOBJECT_CATEGORY_IMAGE, _CO_SOBJECT_CATEGORY_IMAGE_DSC);
28
+
29
+		$this->initCommonVar('doxcode');
30
+
31
+		$this->setControl('image', array('name' => 'image'));
32
+		$this->setControl('parentid', array('name' => 'parentcategory'));
33
+		$this->setControl('description', array('name' => 'textarea',
34
+											'itemHandler' => false,
35
+											'method' => false,
36
+											'module' => false,
37
+											'form_editor' => 'default'));
38
+
39
+		// call parent constructor to get SEO fields initiated
40
+		$this->SmartSeoObject();
41
+	}
42
+
43
+	/**
44
+	 * returns a specific variable for the object in a proper format
45
+	 *
46
+	 * @access public
47
+	 * @param string $key key of the object's variable to be returned
48
+	 * @param string $format format to use for the output
49
+	 * @return mixed formatted value of the variable
50
+	 */
51
+	function getVar($key, $format = 's') {
52
+		if ($format == 's' && in_array($key, array('description', 'image'))) {
53
+			return call_user_func(array($this,$key));
54
+		}
55
+		return parent::getVar($key, $format);
56
+	}
57
+
58
+	function description() {
59
+		return $this->getValueFor('description', false);
60
+	}
61
+
62
+	function image() {
63
+		$ret = $this->getVar('image', 'e');
64
+		if ($ret == '-1') {
65
+			return false;
66
+		} else {
67
+			return $ret;
68
+		}
42 69
 	}
43 70
 
44
-    /**
45
-    * returns a specific variable for the object in a proper format
46
-    *
47
-    * @access public
48
-    * @param string $key key of the object's variable to be returned
49
-    * @param string $format format to use for the output
50
-    * @return mixed formatted value of the variable
51
-    */
52
-    function getVar($key, $format = 's') {
53
-        if ($format == 's' && in_array($key, array('description', 'image'))) {
54
-            return call_user_func(array($this,$key));
55
-        }
56
-        return parent::getVar($key, $format);
57
-    }
58
-
59
-    function description() {
60
-    	return $this->getValueFor('description', false);
61
-    }
62
-
63
-    function image() {
64
-    	$ret = $this->getVar('image', 'e');
65
-    	if ($ret == '-1') {
66
-    		return false;
67
-    	} else {
68
-    		return $ret;
69
-    	}
70
-    }
71
-
72
-    function toArray() {
73
-    	$this->setVar('doxcode', true);
74
-    	global $myts;
75
-    	$objectArray = parent::toArray();
76
-    	if ($objectArray['image']) {
77
-    		$objectArray['image'] = $this->getImageDir() . $objectArray['image'];
78
-    	}
79
-    	return $objectArray;
80
-    }
81
-    /**
82
-     * Create the complete path of a category
83
-     *
84
-     * @todo this could be improved as it uses multiple queries
85
-     * @param bool $withAllLink make all name clickable
86
-     * @return string complete path (breadcrumb)
87
-     */
71
+	function toArray() {
72
+		$this->setVar('doxcode', true);
73
+		global $myts;
74
+		$objectArray = parent::toArray();
75
+		if ($objectArray['image']) {
76
+			$objectArray['image'] = $this->getImageDir() . $objectArray['image'];
77
+		}
78
+		return $objectArray;
79
+	}
80
+	/**
81
+	 * Create the complete path of a category
82
+	 *
83
+	 * @todo this could be improved as it uses multiple queries
84
+	 * @param bool $withAllLink make all name clickable
85
+	 * @return string complete path (breadcrumb)
86
+	 */
88 87
 	function getCategoryPath($withAllLink=true, $currentCategory=false)	{
89 88
 
90 89
 		include_once SMARTOBJECT_ROOT_PATH . "class/smartobjectcontroller.php";
91
-        $controller = new SmartObjectController($this->handler);
90
+		$controller = new SmartObjectController($this->handler);
92 91
 
93 92
 		if (!$this->_categoryPath) {
94 93
 			if ($withAllLink && !$currentCategory) {
@@ -107,7 +106,7 @@  discard block
 block discarded – undo
107 106
 				$ret = $parentObj->getCategoryPath($withAllLink, $currentCategory) . " > " .$ret;
108 107
 			}
109 108
 			$this->_categoryPath = $ret;
110
-        }
109
+		}
111 110
 
112 111
 		return $this->_categoryPath;
113 112
 	}
@@ -119,9 +118,9 @@  discard block
 block discarded – undo
119 118
 	var $allCategoriesObj = false;
120 119
 	var $_allCategoriesId = false;
121 120
 
122
-    function SmartobjectCategoryHandler($db, $modulename) {
123
-        $this->SmartPersistableObjectHandler($db, 'category', 'categoryid', 'name', 'description', $modulename);
124
-    }
121
+	function SmartobjectCategoryHandler($db, $modulename) {
122
+		$this->SmartPersistableObjectHandler($db, 'category', 'categoryid', 'name', 'description', $modulename);
123
+	}
125 124
 
126 125
 	function getAllCategoriesArray($parentid=0, $perm_name=false, $sort = 'parentid', $order='ASC') {
127 126
 
@@ -158,18 +157,18 @@  discard block
 block discarded – undo
158 157
 
159 158
 		if (!$this->allCategoriesId) {
160 159
 
161
-	    	$ret = array();
162
-	        $sql = 'SELECT categoryid, parentid FROM '.$this->table . " AS " . $this->_itemname . ' ORDER BY parentid';
160
+			$ret = array();
161
+			$sql = 'SELECT categoryid, parentid FROM '.$this->table . " AS " . $this->_itemname . ' ORDER BY parentid';
163 162
 
164
-	        $result = $this->db->query($sql);
163
+			$result = $this->db->query($sql);
165 164
 
166
-	        if (!$result) {
167
-	            return $ret;
168
-	        }
165
+			if (!$result) {
166
+				return $ret;
167
+			}
169 168
 
170
-	        while ($myrow = $this->db->fetchArray($result)) {
171
-	        	$this->allCategoriesId[$myrow['categoryid']] =  $myrow['parentid'];
172
-	        }
169
+			while ($myrow = $this->db->fetchArray($result)) {
170
+				$this->allCategoriesId[$myrow['categoryid']] =  $myrow['parentid'];
171
+			}
173 172
 		}
174 173
 
175 174
 		$retArray = array($parentid);
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 if (!defined("XOOPS_ROOT_PATH")) {
16 16
 	die("XOOPS root path not defined");
17 17
 }
18
-include_once XOOPS_ROOT_PATH."/modules/smartobject/class/smartseoobject.php";
18
+include_once XOOPS_ROOT_PATH . "/modules/smartobject/class/smartseoobject.php";
19 19
 class SmartobjectCategory extends SmartSeoObject {
20 20
 
21 21
 	var $_categoryPath;
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     	$this->initVar('parentid', XOBJ_DTYPE_INT, '', false, null, '', false, _CO_SOBJECT_CATEGORY_PARENTID, _CO_SOBJECT_CATEGORY_PARENTID_DSC);
26 26
     	$this->initVar('name', XOBJ_DTYPE_TXTBOX, '', false, null, '', false, _CO_SOBJECT_CATEGORY_NAME, _CO_SOBJECT_CATEGORY_NAME_DSC);
27 27
         $this->initVar('description', XOBJ_DTYPE_TXTAREA, '', false, null, '', false, _CO_SOBJECT_CATEGORY_DESCRIPTION, _CO_SOBJECT_CATEGORY_DESCRIPTION_DSC);
28
-        $this->initVar('image', XOBJ_DTYPE_TXTBOX, '', false, null, '',  false, _CO_SOBJECT_CATEGORY_IMAGE, _CO_SOBJECT_CATEGORY_IMAGE_DSC);
28
+        $this->initVar('image', XOBJ_DTYPE_TXTBOX, '', false, null, '', false, _CO_SOBJECT_CATEGORY_IMAGE, _CO_SOBJECT_CATEGORY_IMAGE_DSC);
29 29
 
30 30
         $this->initCommonVar('doxcode');
31 31
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     */
52 52
     function getVar($key, $format = 's') {
53 53
         if ($format == 's' && in_array($key, array('description', 'image'))) {
54
-            return call_user_func(array($this,$key));
54
+            return call_user_func(array($this, $key));
55 55
         }
56 56
         return parent::getVar($key, $format);
57 57
     }
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
      * @param bool $withAllLink make all name clickable
86 86
      * @return string complete path (breadcrumb)
87 87
      */
88
-	function getCategoryPath($withAllLink=true, $currentCategory=false)	{
88
+	function getCategoryPath($withAllLink = true, $currentCategory = false) {
89 89
 
90 90
 		include_once SMARTOBJECT_ROOT_PATH . "class/smartobjectcontroller.php";
91 91
         $controller = new SmartObjectController($this->handler);
@@ -99,12 +99,12 @@  discard block
 block discarded – undo
99 99
 			}
100 100
 			$parentid = $this->getVar('parentid');
101 101
 			if ($parentid != 0) {
102
-				$parentObj =& $this->handler->get($parentid);
102
+				$parentObj = & $this->handler->get($parentid);
103 103
 				if ($parentObj->isNew()) {
104 104
 					exit;
105 105
 				}
106 106
 				$parentid = $parentObj->getVar('parentid');
107
-				$ret = $parentObj->getCategoryPath($withAllLink, $currentCategory) . " > " .$ret;
107
+				$ret = $parentObj->getCategoryPath($withAllLink, $currentCategory) . " > " . $ret;
108 108
 			}
109 109
 			$this->_categoryPath = $ret;
110 110
         }
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         $this->SmartPersistableObjectHandler($db, 'category', 'categoryid', 'name', 'description', $modulename);
124 124
     }
125 125
 
126
-	function getAllCategoriesArray($parentid=0, $perm_name=false, $sort = 'parentid', $order='ASC') {
126
+	function getAllCategoriesArray($parentid = 0, $perm_name = false, $sort = 'parentid', $order = 'ASC') {
127 127
 
128 128
 		if (!$this->allCategoriesObj) {
129 129
 			$criteria = new CriteriaCompo();
@@ -138,15 +138,15 @@  discard block
 block discarded – undo
138 138
 				}
139 139
 			}
140 140
 
141
-			$this->allCategoriesObj =& $this->getObjects($criteria, 'parentid');
141
+			$this->allCategoriesObj = & $this->getObjects($criteria, 'parentid');
142 142
 		}
143 143
 
144 144
 		$ret = array();
145 145
 		if (isset($this->allCategoriesObj[$parentid])) {
146
-			foreach($this->allCategoriesObj[$parentid] as $categoryid=>$categoryObj) {
147
-				$ret[$categoryid]['self'] =& $categoryObj->toArray();
146
+			foreach ($this->allCategoriesObj[$parentid] as $categoryid=>$categoryObj) {
147
+				$ret[$categoryid]['self'] = & $categoryObj->toArray();
148 148
 				if (isset($this->allCategoriesObj[$categoryid])) {
149
-					$ret[$categoryid]['sub'] =& $this->getAllCategoriesArray($categoryid);
149
+					$ret[$categoryid]['sub'] = & $this->getAllCategoriesArray($categoryid);
150 150
 					$ret[$categoryid]['subcatscount'] = count($ret[$categoryid]['sub']);
151 151
 				}
152 152
 			}
@@ -154,12 +154,12 @@  discard block
 block discarded – undo
154 154
 		return $ret;
155 155
 	}
156 156
 
157
-	function getParentIds($parentid, $asString=true) {
157
+	function getParentIds($parentid, $asString = true) {
158 158
 
159 159
 		if (!$this->allCategoriesId) {
160 160
 
161 161
 	    	$ret = array();
162
-	        $sql = 'SELECT categoryid, parentid FROM '.$this->table . " AS " . $this->_itemname . ' ORDER BY parentid';
162
+	        $sql = 'SELECT categoryid, parentid FROM ' . $this->table . " AS " . $this->_itemname . ' ORDER BY parentid';
163 163
 
164 164
 	        $result = $this->db->query($sql);
165 165
 
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 	        }
169 169
 
170 170
 	        while ($myrow = $this->db->fetchArray($result)) {
171
-	        	$this->allCategoriesId[$myrow['categoryid']] =  $myrow['parentid'];
171
+	        	$this->allCategoriesId[$myrow['categoryid']] = $myrow['parentid'];
172 172
 	        }
173 173
 		}
174 174
 
Please login to merge, or discard this patch.
class/smartplugins.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@
 block discarded – undo
17 17
 
18 18
 	function getItemList() {
19 19
 		$itemsArray = $this->_infoArray['items'];
20
-    	foreach ($itemsArray as $k=>$v) {
20
+		foreach ($itemsArray as $k=>$v) {
21 21
 			$ret[$k] = $v['caption'];
22
-    	}
23
-    	return $ret;
22
+		}
23
+		return $ret;
24 24
 	}
25 25
 
26 26
 	function getItem() {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 	function getItem() {
27 27
 		$ret = false;
28
-		foreach($this->_infoArray['items'] as $k => $v) {
28
+		foreach ($this->_infoArray['items'] as $k => $v) {
29 29
 			$search_str = str_replace('%u', '', $v['url']);
30 30
 			if (strpos($_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'], $search_str) > 0) {
31 31
 				$ret = $k;
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
 		$aFiles = XoopsLists::getFileListAsArray(SMARTOBJECT_ROOT_PATH . 'plugins/');
74 74
 		$ret = array();
75
-		foreach($aFiles as $file) {
75
+		foreach ($aFiles as $file) {
76 76
 			if (substr($file, strlen($file) - 4, 4) == '.php') {
77 77
 				$pluginName = str_replace('.php', '', $file);
78 78
 				$module_xoops_version_file = XOOPS_ROOT_PATH . "/modules/$pluginName/xoops_version.php";
Please login to merge, or discard this patch.
class/smartobjecttag.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -28,25 +28,25 @@
 block discarded – undo
28 28
 // -------------------------------------------------------------------------//
29 29
 
30 30
 if (!defined("XOOPS_ROOT_PATH")) {
31
-    die("XOOPS root path not defined");
31
+	die("XOOPS root path not defined");
32 32
 }
33 33
 include_once XOOPS_ROOT_PATH."/modules/smartobject/class/smartmlobject.php";
34 34
 class SmartobjectTag extends SmartMlObject {
35 35
 
36
-    function SmartobjectTag() {
36
+	function SmartobjectTag() {
37 37
 		$this->initVar('tagid', XOBJ_DTYPE_INT, '', true);
38
-        $this->initVar('name', XOBJ_DTYPE_TXTBOX, '', true, 255, '', false, _CO_SOBJECT_TAG_TAGID_CAPTION, _CO_SOBJECT_TAG_TAGID_DSC, true);
39
-        $this->initVar('description', XOBJ_DTYPE_TXTAREA, '', true, null, '', false, _CO_SOBJECT_TAG_DESCRIPTION_CAPTION, _CO_SOBJECT_TAG_DESCRIPTION_DSC);
40
-        $this->initVar('value', XOBJ_DTYPE_TXTAREA, '', true, null, '', true, _CO_SOBJECT_TAG_VALUE_CAPTION, _CO_SOBJECT_TAG_VALUE_DSC);
38
+		$this->initVar('name', XOBJ_DTYPE_TXTBOX, '', true, 255, '', false, _CO_SOBJECT_TAG_TAGID_CAPTION, _CO_SOBJECT_TAG_TAGID_DSC, true);
39
+		$this->initVar('description', XOBJ_DTYPE_TXTAREA, '', true, null, '', false, _CO_SOBJECT_TAG_DESCRIPTION_CAPTION, _CO_SOBJECT_TAG_DESCRIPTION_DSC);
40
+		$this->initVar('value', XOBJ_DTYPE_TXTAREA, '', true, null, '', true, _CO_SOBJECT_TAG_VALUE_CAPTION, _CO_SOBJECT_TAG_VALUE_DSC);
41 41
 
42 42
 		// call parent constructor to get Multilanguage field initiated
43
-        $this->SmartMlObject();
44
-    }
43
+		$this->SmartMlObject();
44
+	}
45 45
 }
46 46
 class SmartobjectTagHandler extends SmartPersistableMlObjectHandler {
47
-    function SmartobjectTagHandler($db) {
48
-        $this->SmartPersistableObjectHandler($db, 'tag', 'tagid', 'name', 'description', 'smartobject');
49
-    }
47
+	function SmartobjectTagHandler($db) {
48
+		$this->SmartPersistableObjectHandler($db, 'tag', 'tagid', 'name', 'description', 'smartobject');
49
+	}
50 50
 
51 51
 	function getLanguages() {
52 52
 		include_once XOOPS_ROOT_PATH."/class/xoopslists.php";
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 if (!defined("XOOPS_ROOT_PATH")) {
31 31
     die("XOOPS root path not defined");
32 32
 }
33
-include_once XOOPS_ROOT_PATH."/modules/smartobject/class/smartmlobject.php";
33
+include_once XOOPS_ROOT_PATH . "/modules/smartobject/class/smartmlobject.php";
34 34
 class SmartobjectTag extends SmartMlObject {
35 35
 
36 36
     function SmartobjectTag() {
@@ -49,10 +49,10 @@  discard block
 block discarded – undo
49 49
     }
50 50
 
51 51
 	function getLanguages() {
52
-		include_once XOOPS_ROOT_PATH."/class/xoopslists.php";
52
+		include_once XOOPS_ROOT_PATH . "/class/xoopslists.php";
53 53
 		$aLanguages = XoopsLists::getLangList();
54 54
 		$ret['default'] = _CO_SOBJECT_ALL;
55
-		foreach($aLanguages as $lang) {
55
+		foreach ($aLanguages as $lang) {
56 56
 			$ret[$lang] = $lang;
57 57
 		}
58 58
 		return $ret;
Please login to merge, or discard this patch.