Completed
Push — master ( 2d4977...3189d6 )
by Michael
10:50
created
class/smarthookhandler.php 1 patch
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -6,44 +6,44 @@
 block discarded – undo
6 6
  */
7 7
 class SmartHookHandler
8 8
 {
9
-    /**
10
-     * SmartHookHandler constructor.
11
-     */
12
-    public function __construct()
13
-    {
14
-    }
9
+	/**
10
+	 * SmartHookHandler constructor.
11
+	 */
12
+	public function __construct()
13
+	{
14
+	}
15 15
 
16
-    /**
17
-     * Access the only instance of this class
18
-     *
19
-     * @return object
20
-     *
21
-     * @static
22
-     * @staticvar   object
23
-     */
24
-    public static function getInstance()
25
-    {
26
-        static $instance;
27
-        if (!isset($instance)) {
28
-            $instance = new SmartHookHandler();
29
-        }
16
+	/**
17
+	 * Access the only instance of this class
18
+	 *
19
+	 * @return object
20
+	 *
21
+	 * @static
22
+	 * @staticvar   object
23
+	 */
24
+	public static function getInstance()
25
+	{
26
+		static $instance;
27
+		if (!isset($instance)) {
28
+			$instance = new SmartHookHandler();
29
+		}
30 30
 
31
-        return $instance;
32
-    }
31
+		return $instance;
32
+	}
33 33
 
34
-    /**
35
-     * @param $hook_name
36
-     */
37
-    public function executeHook($hook_name)
38
-    {
39
-        $lower_hook_name = strtolower($hook_name);
40
-        $filename        = SMARTOBJECT_ROOT_PATH . 'include/custom_code/' . $lower_hook_name . '.php';
41
-        if (file_exists($filename)) {
42
-            include_once($filename);
43
-            $function = 'smarthook_' . $lower_hook_name;
44
-            if (function_exists($function)) {
45
-                $function();
46
-            }
47
-        }
48
-    }
34
+	/**
35
+	 * @param $hook_name
36
+	 */
37
+	public function executeHook($hook_name)
38
+	{
39
+		$lower_hook_name = strtolower($hook_name);
40
+		$filename        = SMARTOBJECT_ROOT_PATH . 'include/custom_code/' . $lower_hook_name . '.php';
41
+		if (file_exists($filename)) {
42
+			include_once($filename);
43
+			$function = 'smarthook_' . $lower_hook_name;
44
+			if (function_exists($function)) {
45
+				$function();
46
+			}
47
+		}
48
+	}
49 49
 }
Please login to merge, or discard this patch.
class/smartloader.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  discard block
 block discarded – undo
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
- * @link       http://smartfactory.ca The SmartFactory
10
- * @package    SmartObject
11
- * @subpackage SmartObjectCore
12
- */
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
+	 * @link       http://smartfactory.ca The SmartFactory
10
+	 * @package    SmartObject
11
+	 * @subpackage SmartObjectCore
12
+	 */
13 13
 
14 14
 // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
15 15
 
@@ -30,6 +30,6 @@  discard block
 block discarded – undo
30 30
 $smarthookHandler = SmartHookHandler::getInstance();
31 31
 
32 32
 if (!class_exists('smartmetagen')) {
33
-    include_once(SMARTOBJECT_ROOT_PATH . 'class/smartmetagen.php');
33
+	include_once(SMARTOBJECT_ROOT_PATH . 'class/smartmetagen.php');
34 34
 }
35 35
 //$smartobjectConfig = smart_getModuleConfig('smartobject');
Please login to merge, or discard this patch.
class/smartplugins.php 1 patch
Indentation   +115 added lines, -115 removed lines patch added patch discarded remove patch
@@ -5,68 +5,68 @@  discard block
 block discarded – undo
5 5
  */
6 6
 class SmartPlugin
7 7
 {
8
-    public $_infoArray;
9
-
10
-    /**
11
-     * SmartPlugin constructor.
12
-     * @param $array
13
-     */
14
-    public function __construct($array)
15
-    {
16
-        $this->_infoArray = $array;
17
-    }
18
-
19
-    /**
20
-     * @param $item
21
-     * @return bool
22
-     */
23
-    public function getItemInfo($item)
24
-    {
25
-        if (isset($this->_infoArray['items'][$item])) {
26
-            return $this->_infoArray['items'][$item];
27
-        } else {
28
-            return false;
29
-        }
30
-    }
31
-
32
-    /**
33
-     * @return mixed
34
-     */
35
-    public function getItemList()
36
-    {
37
-        $itemsArray = $this->_infoArray['items'];
38
-        foreach ($itemsArray as $k => $v) {
39
-            $ret[$k] = $v['caption'];
40
-        }
41
-
42
-        return $ret;
43
-    }
44
-
45
-    /**
46
-     * @return bool|int|string
47
-     */
48
-    public function getItem()
49
-    {
50
-        $ret = false;
51
-        foreach ($this->_infoArray['items'] as $k => $v) {
52
-            $search_str = str_replace('%u', '', $v['url']);
53
-            if (strpos($_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'], $search_str) > 0) {
54
-                $ret = $k;
55
-                break;
56
-            }
57
-        }
58
-
59
-        return $ret;
60
-    }
61
-
62
-    /**
63
-     * @param $item
64
-     * @return mixed
65
-     */
66
-    public function getItemIdForItem($item)
67
-    {
68
-        return $_REQUEST[$this->_infoArray['items'][$item]['request']];
69
-    }
8
+	public $_infoArray;
9
+
10
+	/**
11
+	 * SmartPlugin constructor.
12
+	 * @param $array
13
+	 */
14
+	public function __construct($array)
15
+	{
16
+		$this->_infoArray = $array;
17
+	}
18
+
19
+	/**
20
+	 * @param $item
21
+	 * @return bool
22
+	 */
23
+	public function getItemInfo($item)
24
+	{
25
+		if (isset($this->_infoArray['items'][$item])) {
26
+			return $this->_infoArray['items'][$item];
27
+		} else {
28
+			return false;
29
+		}
30
+	}
31
+
32
+	/**
33
+	 * @return mixed
34
+	 */
35
+	public function getItemList()
36
+	{
37
+		$itemsArray = $this->_infoArray['items'];
38
+		foreach ($itemsArray as $k => $v) {
39
+			$ret[$k] = $v['caption'];
40
+		}
41
+
42
+		return $ret;
43
+	}
44
+
45
+	/**
46
+	 * @return bool|int|string
47
+	 */
48
+	public function getItem()
49
+	{
50
+		$ret = false;
51
+		foreach ($this->_infoArray['items'] as $k => $v) {
52
+			$search_str = str_replace('%u', '', $v['url']);
53
+			if (strpos($_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'], $search_str) > 0) {
54
+				$ret = $k;
55
+				break;
56
+			}
57
+		}
58
+
59
+		return $ret;
60
+	}
61
+
62
+	/**
63
+	 * @param $item
64
+	 * @return mixed
65
+	 */
66
+	public function getItemIdForItem($item)
67
+	{
68
+		return $_REQUEST[$this->_infoArray['items'][$item]['request']];
69
+	}
70 70
 }
71 71
 
72 72
 /**
@@ -74,57 +74,57 @@  discard block
 block discarded – undo
74 74
  */
75 75
 class SmartPluginHandler
76 76
 {
77
-    public $pluginPatterns = false;
78
-
79
-    /**
80
-     * @param $dirname
81
-     * @return bool|SmartPlugin
82
-     */
83
-    public function getPlugin($dirname)
84
-    {
85
-        $pluginName = SMARTOBJECT_ROOT_PATH . 'plugins/' . $dirname . '.php';
86
-        if (file_exists($pluginName)) {
87
-            include_once($pluginName);
88
-            $function = 'smartobject_plugin_' . $dirname;
89
-            if (function_exists($function)) {
90
-                $array = $function();
91
-                $ret   = new SmartPlugin($array);
92
-
93
-                return $ret;
94
-            }
95
-        }
96
-
97
-        return false;
98
-    }
99
-
100
-    /**
101
-     * @return array
102
-     */
103
-    public function getPluginsArray()
104
-    {
105
-        include_once(XOOPS_ROOT_PATH . '/class/xoopslists.php');
106
-
107
-        $moduleHandler = xoops_getHandler('module');
108
-        $criteria       = new CriteriaCompo();
109
-        $criteria->add(new Criteria('isactive', 1));
110
-        $tempModulesObj = $moduleHandler->getObjects($criteria);
111
-        $modulesObj     = array();
112
-        foreach ($tempModulesObj as $moduleObj) {
113
-            $modulesObj[$moduleObj->getVar('dirname')] = $moduleObj;
114
-        }
115
-
116
-        $aFiles = XoopsLists::getFileListAsArray(SMARTOBJECT_ROOT_PATH . 'plugins/');
117
-        $ret    = array();
118
-        foreach ($aFiles as $file) {
119
-            if (substr($file, strlen($file) - 4, 4) === '.php') {
120
-                $pluginName                = str_replace('.php', '', $file);
121
-                $module_xoops_version_file = XOOPS_ROOT_PATH . "/modules/$pluginName/xoops_version.php";
122
-                if (file_exists($module_xoops_version_file) && isset($modulesObj[$pluginName])) {
123
-                    $ret[$pluginName] = $modulesObj[$pluginName]->getVar('name');
124
-                }
125
-            }
126
-        }
127
-
128
-        return $ret;
129
-    }
77
+	public $pluginPatterns = false;
78
+
79
+	/**
80
+	 * @param $dirname
81
+	 * @return bool|SmartPlugin
82
+	 */
83
+	public function getPlugin($dirname)
84
+	{
85
+		$pluginName = SMARTOBJECT_ROOT_PATH . 'plugins/' . $dirname . '.php';
86
+		if (file_exists($pluginName)) {
87
+			include_once($pluginName);
88
+			$function = 'smartobject_plugin_' . $dirname;
89
+			if (function_exists($function)) {
90
+				$array = $function();
91
+				$ret   = new SmartPlugin($array);
92
+
93
+				return $ret;
94
+			}
95
+		}
96
+
97
+		return false;
98
+	}
99
+
100
+	/**
101
+	 * @return array
102
+	 */
103
+	public function getPluginsArray()
104
+	{
105
+		include_once(XOOPS_ROOT_PATH . '/class/xoopslists.php');
106
+
107
+		$moduleHandler = xoops_getHandler('module');
108
+		$criteria       = new CriteriaCompo();
109
+		$criteria->add(new Criteria('isactive', 1));
110
+		$tempModulesObj = $moduleHandler->getObjects($criteria);
111
+		$modulesObj     = array();
112
+		foreach ($tempModulesObj as $moduleObj) {
113
+			$modulesObj[$moduleObj->getVar('dirname')] = $moduleObj;
114
+		}
115
+
116
+		$aFiles = XoopsLists::getFileListAsArray(SMARTOBJECT_ROOT_PATH . 'plugins/');
117
+		$ret    = array();
118
+		foreach ($aFiles as $file) {
119
+			if (substr($file, strlen($file) - 4, 4) === '.php') {
120
+				$pluginName                = str_replace('.php', '', $file);
121
+				$module_xoops_version_file = XOOPS_ROOT_PATH . "/modules/$pluginName/xoops_version.php";
122
+				if (file_exists($module_xoops_version_file) && isset($modulesObj[$pluginName])) {
123
+					$ret[$pluginName] = $modulesObj[$pluginName]->getVar('name');
124
+				}
125
+			}
126
+		}
127
+
128
+		return $ret;
129
+	}
130 130
 }
Please login to merge, or discard this patch.
class/smartuploader.php 2 patches
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -29,27 +29,27 @@  discard block
 block discarded – undo
29 29
 // Project: XOOPS Project                                                    //
30 30
 // ------------------------------------------------------------------------- //
31 31
 /**
32
- * !
33
- * Example
34
- *
35
- * include_once 'uploader.php';
36
- * $allowed_mimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png');
37
- * $maxfilesize = 50000;
38
- * $maxfilewidth = 120;
39
- * $maxfileheight = 120;
40
- * $uploader = new SmartUploader('/home/xoops/uploads', $allowed_mimetypes, $maxfilesize, $maxfilewidth, $maxfileheight);
41
- * if ($uploader->fetchMedia($HTTP_POST_VARS['uploade_file_name'])) {
42
- * if (!$uploader->upload()) {
43
- * echo $uploader->getErrors();
44
- * } else {
45
- * echo '<h4>File uploaded successfully!</h4>'
46
- * echo 'Saved as: ' . $uploader->getSavedFileName() . '<br />';
47
- * echo 'Full path: ' . $uploader->getSavedDestination();
48
- * }
49
- * } else {
50
- * echo $uploader->getErrors();
51
- * }
52
- */
32
+	 * !
33
+	 * Example
34
+	 *
35
+	 * include_once 'uploader.php';
36
+	 * $allowed_mimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png');
37
+	 * $maxfilesize = 50000;
38
+	 * $maxfilewidth = 120;
39
+	 * $maxfileheight = 120;
40
+	 * $uploader = new SmartUploader('/home/xoops/uploads', $allowed_mimetypes, $maxfilesize, $maxfilewidth, $maxfileheight);
41
+	 * if ($uploader->fetchMedia($HTTP_POST_VARS['uploade_file_name'])) {
42
+	 * if (!$uploader->upload()) {
43
+	 * echo $uploader->getErrors();
44
+	 * } else {
45
+	 * echo '<h4>File uploaded successfully!</h4>'
46
+	 * echo 'Saved as: ' . $uploader->getSavedFileName() . '<br />';
47
+	 * echo 'Full path: ' . $uploader->getSavedDestination();
48
+	 * }
49
+	 * } else {
50
+	 * echo $uploader->getErrors();
51
+	 * }
52
+	 */
53 53
 
54 54
 /**
55 55
  * Upload Media files
@@ -89,51 +89,51 @@  discard block
 block discarded – undo
89 89
  */
90 90
 class SmartUploader extends XoopsMediaUploader
91 91
 {
92
-    public $ext;
93
-    public $dimension;
92
+	public $ext;
93
+	public $dimension;
94 94
 
95
-    /**
96
-     * No admin check for uploads
97
-     */
98
-    public $noAdminSizeCheck;
95
+	/**
96
+	 * No admin check for uploads
97
+	 */
98
+	public $noAdminSizeCheck;
99 99
 
100
-    /**
101
-     * Constructor
102
-     *
103
-     * @param string    $uploadDir
104
-     * @param array|int $allowedMimeTypes
105
-     * @param int       $maxFileSize
106
-     * @param int       $maxWidth
107
-     * @param int       $maxHeight
108
-     * @internal param int $cmodvalue
109
-     */
110
-    public function __construct($uploadDir, $allowedMimeTypes = 0, $maxFileSize, $maxWidth = 0, $maxHeight = 0)
111
-    {
112
-        parent::__construct($uploadDir, $allowedMimeTypes, $maxFileSize, $maxWidth, $maxHeight);
113
-    }
100
+	/**
101
+	 * Constructor
102
+	 *
103
+	 * @param string    $uploadDir
104
+	 * @param array|int $allowedMimeTypes
105
+	 * @param int       $maxFileSize
106
+	 * @param int       $maxWidth
107
+	 * @param int       $maxHeight
108
+	 * @internal param int $cmodvalue
109
+	 */
110
+	public function __construct($uploadDir, $allowedMimeTypes = 0, $maxFileSize, $maxWidth = 0, $maxHeight = 0)
111
+	{
112
+		parent::__construct($uploadDir, $allowedMimeTypes, $maxFileSize, $maxWidth, $maxHeight);
113
+	}
114 114
 
115
-    /**
116
-     * @param $value
117
-     */
118
-    public function noAdminSizeCheck($value)
119
-    {
120
-        $this->noAdminSizeCheck = $value;
121
-    }
115
+	/**
116
+	 * @param $value
117
+	 */
118
+	public function noAdminSizeCheck($value)
119
+	{
120
+		$this->noAdminSizeCheck = $value;
121
+	}
122 122
 
123
-    /**
124
-     * Is the file the right size?
125
-     *
126
-     * @return bool
127
-     */
128
-    public function checkMaxFileSize()
129
-    {
130
-        if ($this->noAdminSizeCheck) {
131
-            return true;
132
-        }
133
-        if ($this->mediaSize > $this->maxFileSize) {
134
-            return false;
135
-        }
123
+	/**
124
+	 * Is the file the right size?
125
+	 *
126
+	 * @return bool
127
+	 */
128
+	public function checkMaxFileSize()
129
+	{
130
+		if ($this->noAdminSizeCheck) {
131
+			return true;
132
+		}
133
+		if ($this->mediaSize > $this->maxFileSize) {
134
+			return false;
135
+		}
136 136
 
137
-        return true;
138
-    }
137
+		return true;
138
+	}
139 139
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
  * @link    http://smartfactory.ca The SmartFactory
81 81
  * @package SmartObject
82 82
  */
83
-mt_srand((double)microtime() * 1000000);
83
+mt_srand((double) microtime() * 1000000);
84 84
 
85 85
 include_once XOOPS_ROOT_PATH . '/class/uploader.php';
86 86
 
Please login to merge, or discard this patch.
xoops_version.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
 $modversion['min_xoops']           = '2.5.8';
44 44
 $modversion['min_admin']           = '1.1';
45 45
 $modversion['min_db']              = array(
46
-    'mysql'  => '5.0.7',
47
-    'mysqli' => '5.0.7'
46
+	'mysql'  => '5.0.7',
47
+	'mysqli' => '5.0.7'
48 48
 );
49 49
 
50 50
 // ---
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
 global $xoopsConfig;
75 75
 $common_file = XOOPS_ROOT_PATH . '/modules/smartobject/language/' . $xoopsConfig['language'] . '/common.php';
76 76
 if (file_exists($common_file)) {
77
-    $flag_common = true;
78
-    include_once $common_file;
77
+	$flag_common = true;
78
+	include_once $common_file;
79 79
 } else {
80
-    include_once(XOOPS_ROOT_PATH . '/modules/smartobject/language/english/common.php');
80
+	include_once(XOOPS_ROOT_PATH . '/modules/smartobject/language/english/common.php');
81 81
 }
82 82
 // -----
83 83
 
Please login to merge, or discard this patch.