Completed
Push — master ( 248a3a...c5aa4f )
by Michael
05:44 queued 02:41
created
class/smarttip.php 1 patch
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -10,45 +10,45 @@
 block discarded – undo
10 10
 
11 11
 class SmartTip
12 12
 {
13
-    public $id;
14
-    public $caption;
15
-    public $message;
16
-    public $visible;
17
-    public $_tpl;
13
+	public $id;
14
+	public $caption;
15
+	public $message;
16
+	public $visible;
17
+	public $_tpl;
18 18
 
19
-    /**
20
-     * SmartTip constructor.
21
-     * @param      $id
22
-     * @param      $caption
23
-     * @param      $message
24
-     * @param bool $visible
25
-     */
26
-    public function __construct($id, $caption, $message, $visible = false)
27
-    {
28
-        $this->id      = $id;
29
-        $this->caption = $caption;
30
-        $this->message = $message;
31
-        $this->visible = $visible;
32
-        $this->_tpl    = new XoopsTpl();
33
-    }
19
+	/**
20
+	 * SmartTip constructor.
21
+	 * @param      $id
22
+	 * @param      $caption
23
+	 * @param      $message
24
+	 * @param bool $visible
25
+	 */
26
+	public function __construct($id, $caption, $message, $visible = false)
27
+	{
28
+		$this->id      = $id;
29
+		$this->caption = $caption;
30
+		$this->message = $message;
31
+		$this->visible = $visible;
32
+		$this->_tpl    = new XoopsTpl();
33
+	}
34 34
 
35
-    /**
36
-     * @param  bool $outputNow
37
-     * @return mixed|string|void
38
-     */
39
-    public function render($outputNow = true)
40
-    {
41
-        $aTip = array(
42
-            'id'      => $this->id,
43
-            'caption' => $this->caption,
44
-            'message' => $this->message,
45
-            'visible' => $this->visible ? 'block' : 'none'
46
-        );
47
-        $this->_tpl->assign('tip', $aTip);
48
-        if ($outputNow) {
49
-            $this->_tpl->display('db:smartobject_tip.tpl');
50
-        } else {
51
-            return $this->_tpl->fetch('db:smartobject_tip.tpl');
52
-        }
53
-    }
35
+	/**
36
+	 * @param  bool $outputNow
37
+	 * @return mixed|string|void
38
+	 */
39
+	public function render($outputNow = true)
40
+	{
41
+		$aTip = array(
42
+			'id'      => $this->id,
43
+			'caption' => $this->caption,
44
+			'message' => $this->message,
45
+			'visible' => $this->visible ? 'block' : 'none'
46
+		);
47
+		$this->_tpl->assign('tip', $aTip);
48
+		if ($outputNow) {
49
+			$this->_tpl->display('db:smartobject_tip.tpl');
50
+		} else {
51
+			return $this->_tpl->fetch('db:smartobject_tip.tpl');
52
+		}
53
+	}
54 54
 }
Please login to merge, or discard this patch.
class/smartobjecttree.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -9,17 +9,17 @@
 block discarded – undo
9 9
  */
10 10
 class SmartObjectTree extends XoopsObjectTree
11 11
 {
12
-    public function _initialize()
13
-    {
14
-        foreach (array_keys($this->_objects) as $i) {
15
-            $key1                          = $this->_objects[$i]->getVar($this->_myId);
16
-            $this->_tree[$key1]['obj']     = $this->_objects[$i];
17
-            $key2                          = $this->_objects[$i]->getVar($this->_parentId, 'e');
18
-            $this->_tree[$key1]['parent']  = $key2;
19
-            $this->_tree[$key2]['child'][] = $key1;
20
-            if (isset($this->_rootId)) {
21
-                $this->_tree[$key1]['root'] = $this->_objects[$i]->getVar($this->_rootId);
22
-            }
23
-        }
24
-    }
12
+	public function _initialize()
13
+	{
14
+		foreach (array_keys($this->_objects) as $i) {
15
+			$key1                          = $this->_objects[$i]->getVar($this->_myId);
16
+			$this->_tree[$key1]['obj']     = $this->_objects[$i];
17
+			$key2                          = $this->_objects[$i]->getVar($this->_parentId, 'e');
18
+			$this->_tree[$key1]['parent']  = $key2;
19
+			$this->_tree[$key2]['child'][] = $key1;
20
+			if (isset($this->_rootId)) {
21
+				$this->_tree[$key1]['root'] = $this->_objects[$i]->getVar($this->_rootId);
22
+			}
23
+		}
24
+	}
25 25
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
4 4
 
5
-include_once XOOPS_ROOT_PATH . '/class/tree.php';
5
+include_once XOOPS_ROOT_PATH.'/class/tree.php';
6 6
 
7 7
 /**
8 8
  * Class smartobjecttree
Please login to merge, or discard this patch.
class/smartseoobject.php 2 patches
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -24,44 +24,44 @@
 block discarded – undo
24 24
  */
25 25
 class SmartSeoObject extends SmartObject
26 26
 {
27
-    /**
28
-     * SmartSeoObject constructor.
29
-     */
30
-    public function __construct()
31
-    {
32
-        $this->initCommonVar('meta_keywords');
33
-        $this->initCommonVar('meta_description');
34
-        $this->initCommonVar('short_url');
35
-        $this->seoEnabled = true;
36
-    }
27
+	/**
28
+	 * SmartSeoObject constructor.
29
+	 */
30
+	public function __construct()
31
+	{
32
+		$this->initCommonVar('meta_keywords');
33
+		$this->initCommonVar('meta_description');
34
+		$this->initCommonVar('short_url');
35
+		$this->seoEnabled = true;
36
+	}
37 37
 
38
-    /**
39
-     * Return the value of the short_url field of this object
40
-     *
41
-     * @return string
42
-     */
43
-    public function short_url()
44
-    {
45
-        return $this->getVar('short_url');
46
-    }
38
+	/**
39
+	 * Return the value of the short_url field of this object
40
+	 *
41
+	 * @return string
42
+	 */
43
+	public function short_url()
44
+	{
45
+		return $this->getVar('short_url');
46
+	}
47 47
 
48
-    /**
49
-     * Return the value of the meta_keywords field of this object
50
-     *
51
-     * @return string
52
-     */
53
-    public function meta_keywords()
54
-    {
55
-        return $this->getVar('meta_keywords');
56
-    }
48
+	/**
49
+	 * Return the value of the meta_keywords field of this object
50
+	 *
51
+	 * @return string
52
+	 */
53
+	public function meta_keywords()
54
+	{
55
+		return $this->getVar('meta_keywords');
56
+	}
57 57
 
58
-    /**
59
-     * Return the value of the meta_description field of this object
60
-     *
61
-     * @return string
62
-     */
63
-    public function meta_description()
64
-    {
65
-        return $this->getVar('meta_description');
66
-    }
58
+	/**
59
+	 * Return the value of the meta_description field of this object
60
+	 *
61
+	 * @return string
62
+	 */
63
+	public function meta_description()
64
+	{
65
+		return $this->getVar('meta_description');
66
+	}
67 67
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
  */
12 12
 
13 13
 // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
14
-include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobject.php';
14
+include_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobject.php';
15 15
 
16 16
 /**
17 17
  * SmartObject base SEO-enabled class
Please login to merge, or discard this patch.
class/smartjax.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -36,10 +36,10 @@
 block discarded – undo
36 36
  */
37 37
 class SmartJax extends Projax
38 38
 {
39
-    public function initiateFromUserside()
40
-    {
41
-        global $xoTheme;
42
-        $xoTheme->addScript(SMARTOBJECT_URL . 'include/projax/js/prototype.js');
43
-        $xoTheme->addScript(SMARTOBJECT_URL . 'include/projax/js/scriptaculous.js');
44
-    }
39
+	public function initiateFromUserside()
40
+	{
41
+		global $xoTheme;
42
+		$xoTheme->addScript(SMARTOBJECT_URL . 'include/projax/js/prototype.js');
43
+		$xoTheme->addScript(SMARTOBJECT_URL . 'include/projax/js/scriptaculous.js');
44
+	}
45 45
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
 // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
31 31
 
32
-include_once XOOPS_ROOT_PATH . '/modules/smartobject/include/projax/projax.php';
32
+include_once XOOPS_ROOT_PATH.'/modules/smartobject/include/projax/projax.php';
33 33
 
34 34
 /**
35 35
  * Class SmartJax
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     public function initiateFromUserside()
40 40
     {
41 41
         global $xoTheme;
42
-        $xoTheme->addScript(SMARTOBJECT_URL . 'include/projax/js/prototype.js');
43
-        $xoTheme->addScript(SMARTOBJECT_URL . 'include/projax/js/scriptaculous.js');
42
+        $xoTheme->addScript(SMARTOBJECT_URL.'include/projax/js/prototype.js');
43
+        $xoTheme->addScript(SMARTOBJECT_URL.'include/projax/js/scriptaculous.js');
44 44
     }
45 45
 }
Please login to merge, or discard this patch.
class/form/elements/smartformtextelement.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -11,24 +11,24 @@
 block discarded – undo
11 11
  */
12 12
 class SmartFormTextElement extends XoopsFormText
13 13
 {
14
-    /**
15
-     * SmartFormTextElement constructor.
16
-     * @param string $object
17
-     * @param string $key
18
-     */
19
-    public function __construct($object, $key)
20
-    {
21
-        $var = $object->vars[$key];
14
+	/**
15
+	 * SmartFormTextElement constructor.
16
+	 * @param string $object
17
+	 * @param string $key
18
+	 */
19
+	public function __construct($object, $key)
20
+	{
21
+		$var = $object->vars[$key];
22 22
 
23
-        if (isset($object->controls[$key])) {
24
-            $control        = $object->controls[$key];
25
-            $form_maxlength = isset($control['maxlength']) ? $control['maxlength'] : (isset($var['maxlength']) ? $var['maxlength'] : 255);
26
-            $form_size      = isset($control['size']) ? $control['size'] : 50;
27
-        } else {
28
-            $form_maxlength = 255;
29
-            $form_size      = 50;
30
-        }
23
+		if (isset($object->controls[$key])) {
24
+			$control        = $object->controls[$key];
25
+			$form_maxlength = isset($control['maxlength']) ? $control['maxlength'] : (isset($var['maxlength']) ? $var['maxlength'] : 255);
26
+			$form_size      = isset($control['size']) ? $control['size'] : 50;
27
+		} else {
28
+			$form_maxlength = 255;
29
+			$form_size      = 50;
30
+		}
31 31
 
32
-        parent::__construct($var['form_caption'], $key, $form_size, $form_maxlength, $object->getVar($key, 'e'));
33
-    }
32
+		parent::__construct($var['form_caption'], $key, $form_size, $form_maxlength, $object->getVar($key, 'e'));
33
+	}
34 34
 }
Please login to merge, or discard this patch.
class/form/elements/smartformdateelement.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -11,13 +11,13 @@
 block discarded – undo
11 11
  */
12 12
 class SmartFormDateElement extends XoopsFormTextDateSelect
13 13
 {
14
-    /**
15
-     * SmartFormDateElement constructor.
16
-     * @param $object
17
-     * @param $key
18
-     */
19
-    public function __construct($object, $key)
20
-    {
21
-        parent::__construct($object->vars[$key]['form_caption'], $key, 15, $object->getVar($key, 'e'));
22
-    }
14
+	/**
15
+	 * SmartFormDateElement constructor.
16
+	 * @param $object
17
+	 * @param $key
18
+	 */
19
+	public function __construct($object, $key)
20
+	{
21
+		parent::__construct($object->vars[$key]['form_caption'], $key, 15, $object->getVar($key, 'e'));
22
+	}
23 23
 }
Please login to merge, or discard this patch.
class/form/elements/smartformfileuploadelement.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -16,27 +16,27 @@
 block discarded – undo
16 16
  */
17 17
 class SmartFormFileUploadElement extends SmartFormUploadElement
18 18
 {
19
-    /**
20
-     * SmartFormFileUploadElement constructor.
21
-     * @param string $object
22
-     * @param string $key
23
-     */
24
-    public function __construct($object, $key)
25
-    {
26
-        $this->SmartFormFileElement($object, $key);
27
-        // Override name for upload purposes
28
-        $this->setName('upload_' . $key);
29
-    }
19
+	/**
20
+	 * SmartFormFileUploadElement constructor.
21
+	 * @param string $object
22
+	 * @param string $key
23
+	 */
24
+	public function __construct($object, $key)
25
+	{
26
+		$this->SmartFormFileElement($object, $key);
27
+		// Override name for upload purposes
28
+		$this->setName('upload_' . $key);
29
+	}
30 30
 
31
-    /**
32
-     * prepare HTML for output
33
-     *
34
-     * @return string HTML
35
-     */
36
-    public function render()
37
-    {
38
-        return "<input type='hidden' name='MAX_FILE_SIZE' value='" . $this->getMaxFileSize() . "' />
31
+	/**
32
+	 * prepare HTML for output
33
+	 *
34
+	 * @return string HTML
35
+	 */
36
+	public function render()
37
+	{
38
+		return "<input type='hidden' name='MAX_FILE_SIZE' value='" . $this->getMaxFileSize() . "' />
39 39
         <input type='file' name='upload_" . $this->getName() . "' id='upload_" . $this->getName() . "'" . $this->getExtra() . " />
40 40
         <input type='hidden' name='smart_upload_file[]' id='smart_upload_file[]' value='" . $this->getName() . "' />";
41
-    }
41
+	}
42 42
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @package    SmartObject
10 10
  * @subpackage SmartObjectForm
11 11
  */
12
-include_once SMARTOBJECT_ROOT_PATH . 'class/form/elements/smartformuploadelement.php';
12
+include_once SMARTOBJECT_ROOT_PATH.'class/form/elements/smartformuploadelement.php';
13 13
 
14 14
 /**
15 15
  * Class SmartFormFileUploadElement
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     {
26 26
         $this->SmartFormFileElement($object, $key);
27 27
         // Override name for upload purposes
28
-        $this->setName('upload_' . $key);
28
+        $this->setName('upload_'.$key);
29 29
     }
30 30
 
31 31
     /**
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public function render()
37 37
     {
38
-        return "<input type='hidden' name='MAX_FILE_SIZE' value='" . $this->getMaxFileSize() . "' />
39
-        <input type='file' name='upload_" . $this->getName() . "' id='upload_" . $this->getName() . "'" . $this->getExtra() . " />
40
-        <input type='hidden' name='smart_upload_file[]' id='smart_upload_file[]' value='" . $this->getName() . "' />";
38
+        return "<input type='hidden' name='MAX_FILE_SIZE' value='".$this->getMaxFileSize()."' />
39
+        <input type='file' name='upload_" . $this->getName()."' id='upload_".$this->getName()."'".$this->getExtra()." />
40
+        <input type='hidden' name='smart_upload_file[]' id='smart_upload_file[]' value='" . $this->getName()."' />";
41 41
     }
42 42
 }
Please login to merge, or discard this patch.
class/form/elements/smartformlanguageelement.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -11,20 +11,20 @@
 block discarded – undo
11 11
  */
12 12
 class SmartFormLanguageElement extends XoopsFormSelectLang
13 13
 {
14
-    /**
15
-     * SmartFormLanguageElement constructor.
16
-     * @param string $object
17
-     * @param string $key
18
-     */
19
-    public function __construct($object, $key)
20
-    {
21
-        $var     = $object->vars[$key];
22
-        $control = $object->controls[$key];
23
-        $all     = isset($control['all']) ? true : false;
14
+	/**
15
+	 * SmartFormLanguageElement constructor.
16
+	 * @param string $object
17
+	 * @param string $key
18
+	 */
19
+	public function __construct($object, $key)
20
+	{
21
+		$var     = $object->vars[$key];
22
+		$control = $object->controls[$key];
23
+		$all     = isset($control['all']) ? true : false;
24 24
 
25
-        parent::__construct($var['form_caption'], $key, $object->getVar($key, 'e'));
26
-        if ($all) {
27
-            $this->addOption('all', _ALL);
28
-        }
29
-    }
25
+		parent::__construct($var['form_caption'], $key, $object->getVar($key, 'e'));
26
+		if ($all) {
27
+			$this->addOption('all', _ALL);
28
+		}
29
+	}
30 30
 }
Please login to merge, or discard this patch.
class/form/elements/smartformselectelement.php 2 patches
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -11,59 +11,59 @@
 block discarded – undo
11 11
  */
12 12
 class SmartFormSelectElement extends XoopsFormSelect
13 13
 {
14
-    public $multiple = false;
14
+	public $multiple = false;
15 15
 
16
-    /**
17
-     * SmartFormSelectElement constructor.
18
-     * @param string $object
19
-     * @param string $key
20
-     */
21
-    public function __construct($object, $key)
22
-    {
23
-        $var  = $object->vars[$key];
24
-        $size = isset($var['size']) ? $var['size'] : ($this->multiple ? 5 : 1);
16
+	/**
17
+	 * SmartFormSelectElement constructor.
18
+	 * @param string $object
19
+	 * @param string $key
20
+	 */
21
+	public function __construct($object, $key)
22
+	{
23
+		$var  = $object->vars[$key];
24
+		$size = isset($var['size']) ? $var['size'] : ($this->multiple ? 5 : 1);
25 25
 
26
-        // Adding the options inside this SelectBox
27
-        // If the custom method is not from a module, than it's from the core
28
-        $control = $object->getControl($key);
26
+		// Adding the options inside this SelectBox
27
+		// If the custom method is not from a module, than it's from the core
28
+		$control = $object->getControl($key);
29 29
 
30
-        $value = isset($control['value']) ? $control['value'] : $object->getVar($key, 'e');
30
+		$value = isset($control['value']) ? $control['value'] : $object->getVar($key, 'e');
31 31
 
32
-        parent::__construct($var['form_caption'], $key, $value, $size, $this->multiple);
32
+		parent::__construct($var['form_caption'], $key, $value, $size, $this->multiple);
33 33
 
34
-        if (isset($control['options'])) {
35
-            $this->addOptionArray($control['options']);
36
-        } else {
37
-            // let's find if the method we need to call comes from an already defined object
38
-            if (isset($control['object'])) {
39
-                if (method_exists($control['object'], $control['method'])) {
40
-                    if ($option_array = $control['object']->{$control['method']}()) {
41
-                        // Adding the options array to the XoopsFormSelect
42
-                        $this->addOptionArray($option_array);
43
-                    }
44
-                }
45
-            } else {
46
-                // finding the itemHandler; if none, let's take the itemHandler of the $object
47
-                if (isset($control['itemHandler'])) {
48
-                    if (!$control['module']) {
49
-                        // Creating the specified core object handler
50
-                        $controlHandler = xoops_getHandler($control['itemHandler']);
51
-                    } else {
52
-                        $controlHandler = xoops_getModuleHandler($control['itemHandler'], $control['module']);
53
-                    }
54
-                } else {
55
-                    $controlHandler =& $object->handler;
56
-                }
34
+		if (isset($control['options'])) {
35
+			$this->addOptionArray($control['options']);
36
+		} else {
37
+			// let's find if the method we need to call comes from an already defined object
38
+			if (isset($control['object'])) {
39
+				if (method_exists($control['object'], $control['method'])) {
40
+					if ($option_array = $control['object']->{$control['method']}()) {
41
+						// Adding the options array to the XoopsFormSelect
42
+						$this->addOptionArray($option_array);
43
+					}
44
+				}
45
+			} else {
46
+				// finding the itemHandler; if none, let's take the itemHandler of the $object
47
+				if (isset($control['itemHandler'])) {
48
+					if (!$control['module']) {
49
+						// Creating the specified core object handler
50
+						$controlHandler = xoops_getHandler($control['itemHandler']);
51
+					} else {
52
+						$controlHandler = xoops_getModuleHandler($control['itemHandler'], $control['module']);
53
+					}
54
+				} else {
55
+					$controlHandler =& $object->handler;
56
+				}
57 57
 
58
-                // Checking if the specified method exists
59
-                if (method_exists($controlHandler, $control['method'])) {
60
-                    // TODO: How could I pass the parameters in the following call ...
61
-                    if ($option_array = $controlHandler->{$control['method']}()) {
62
-                        // Adding the options array to the XoopsFormSelect
63
-                        $this->addOptionArray($option_array);
64
-                    }
65
-                }
66
-            }
67
-        }
68
-    }
58
+				// Checking if the specified method exists
59
+				if (method_exists($controlHandler, $control['method'])) {
60
+					// TODO: How could I pass the parameters in the following call ...
61
+					if ($option_array = $controlHandler->{$control['method']}()) {
62
+						// Adding the options array to the XoopsFormSelect
63
+						$this->addOptionArray($option_array);
64
+					}
65
+				}
66
+			}
67
+		}
68
+	}
69 69
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
                         $controlHandler = xoops_getModuleHandler($control['itemHandler'], $control['module']);
53 53
                     }
54 54
                 } else {
55
-                    $controlHandler =& $object->handler;
55
+                    $controlHandler = & $object->handler;
56 56
                 }
57 57
 
58 58
                 // Checking if the specified method exists
Please login to merge, or discard this patch.