Completed
Push — master ( bf34f3...88111b )
by Michael
03:08
created
admin/adsense.php 3 patches
Indentation   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -12,32 +12,32 @@  discard block
 block discarded – undo
12 12
 
13 13
 function editclass($showmenu = false, $adsenseid = 0, $clone = false)
14 14
 {
15
-    global $smartobjectAdsenseHandler;
16
-
17
-    $adsenseObj = $smartobjectAdsenseHandler->get($adsenseid);
18
-
19
-    if (!$clone && !$adsenseObj->isNew()) {
20
-        if ($showmenu) {
21
-            //smart_adminMenu(3, _AM_SOBJECT_ADSENSES . " > " . _AM_SOBJECT_EDITING);
22
-        }
23
-        smart_collapsableBar('adsenseedit', _AM_SOBJECT_ADSENSES_EDIT, _AM_SOBJECT_ADSENSES_EDIT_INFO);
24
-
25
-        $sform = $adsenseObj->getForm(_AM_SOBJECT_ADSENSES_EDIT, 'addadsense');
26
-        $sform->display();
27
-        smart_close_collapsable('adsenseedit');
28
-    } else {
29
-        $adsenseObj->setVar('adsenseid', 0);
30
-        $adsenseObj->setVar('tag', '');
31
-
32
-        if ($showmenu) {
33
-            //smart_adminMenu(3, _AM_SOBJECT_ADSENSES . " > " . _CO_SOBJECT_CREATINGNEW);
34
-        }
35
-
36
-        smart_collapsableBar('adsensecreate', _AM_SOBJECT_ADSENSES_CREATE, _AM_SOBJECT_ADSENSES_CREATE_INFO);
37
-        $sform = $adsenseObj->getForm(_AM_SOBJECT_ADSENSES_CREATE, 'addadsense', false, false, false, true);
38
-        $sform->display();
39
-        smart_close_collapsable('adsensecreate');
40
-    }
15
+	global $smartobjectAdsenseHandler;
16
+
17
+	$adsenseObj = $smartobjectAdsenseHandler->get($adsenseid);
18
+
19
+	if (!$clone && !$adsenseObj->isNew()) {
20
+		if ($showmenu) {
21
+			//smart_adminMenu(3, _AM_SOBJECT_ADSENSES . " > " . _AM_SOBJECT_EDITING);
22
+		}
23
+		smart_collapsableBar('adsenseedit', _AM_SOBJECT_ADSENSES_EDIT, _AM_SOBJECT_ADSENSES_EDIT_INFO);
24
+
25
+		$sform = $adsenseObj->getForm(_AM_SOBJECT_ADSENSES_EDIT, 'addadsense');
26
+		$sform->display();
27
+		smart_close_collapsable('adsenseedit');
28
+	} else {
29
+		$adsenseObj->setVar('adsenseid', 0);
30
+		$adsenseObj->setVar('tag', '');
31
+
32
+		if ($showmenu) {
33
+			//smart_adminMenu(3, _AM_SOBJECT_ADSENSES . " > " . _CO_SOBJECT_CREATINGNEW);
34
+		}
35
+
36
+		smart_collapsableBar('adsensecreate', _AM_SOBJECT_ADSENSES_CREATE, _AM_SOBJECT_ADSENSES_CREATE_INFO);
37
+		$sform = $adsenseObj->getForm(_AM_SOBJECT_ADSENSES_CREATE, 'addadsense', false, false, false, true);
38
+		$sform->display();
39
+		smart_close_collapsable('adsensecreate');
40
+	}
41 41
 }
42 42
 
43 43
 require_once __DIR__ . '/admin_header.php';
@@ -50,72 +50,72 @@  discard block
 block discarded – undo
50 50
 $op = '';
51 51
 
52 52
 if (isset($_GET['op'])) {
53
-    $op = $_GET['op'];
53
+	$op = $_GET['op'];
54 54
 }
55 55
 if (isset($_POST['op'])) {
56
-    $op = $_POST['op'];
56
+	$op = $_POST['op'];
57 57
 }
58 58
 
59 59
 switch ($op) {
60
-    case 'mod':
60
+	case 'mod':
61 61
 
62
-        $adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0;
62
+		$adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0;
63 63
 
64
-        smart_xoops_cp_header();
65
-        $adminObject->displayNavigation(basename(__FILE__));
64
+		smart_xoops_cp_header();
65
+		$adminObject->displayNavigation(basename(__FILE__));
66 66
 
67
-        editclass(true, $adsenseid);
68
-        break;
67
+		editclass(true, $adsenseid);
68
+		break;
69 69
 
70
-    case 'clone':
70
+	case 'clone':
71 71
 
72
-        $adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0;
72
+		$adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0;
73 73
 
74
-        smart_xoops_cp_header();
75
-        $adminObject->displayNavigation(basename(__FILE__));
74
+		smart_xoops_cp_header();
75
+		$adminObject->displayNavigation(basename(__FILE__));
76 76
 
77
-        editclass(true, $adsenseid, true);
78
-        break;
77
+		editclass(true, $adsenseid, true);
78
+		break;
79 79
 
80
-    case 'addadsense':
81
-        if (@require_once SMARTOBJECT_ROOT_PATH . 'include/captcha/captcha.php') {
82
-            $xoopsCaptcha = XoopsCaptcha::getInstance();
83
-            if (!$xoopsCaptcha->verify()) {
84
-                redirect_header('javascript:history.go(-1);', 3, $xoopsCaptcha->getMessage());
85
-            }
86
-        }
87
-        require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
88
-        $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectAdsenseHandler);
89
-        $controller->storeFromDefaultForm(_AM_SOBJECT_ADSENSES_CREATED, _AM_SOBJECT_ADSENSES_MODIFIED);
90
-        break;
80
+	case 'addadsense':
81
+		if (@require_once SMARTOBJECT_ROOT_PATH . 'include/captcha/captcha.php') {
82
+			$xoopsCaptcha = XoopsCaptcha::getInstance();
83
+			if (!$xoopsCaptcha->verify()) {
84
+				redirect_header('javascript:history.go(-1);', 3, $xoopsCaptcha->getMessage());
85
+			}
86
+		}
87
+		require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
88
+		$controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectAdsenseHandler);
89
+		$controller->storeFromDefaultForm(_AM_SOBJECT_ADSENSES_CREATED, _AM_SOBJECT_ADSENSES_MODIFIED);
90
+		break;
91 91
 
92
-    case 'del':
92
+	case 'del':
93 93
 
94
-        require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
95
-        $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectAdsenseHandler);
96
-        $controller->handleObjectDeletion();
94
+		require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
95
+		$controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectAdsenseHandler);
96
+		$controller->handleObjectDeletion();
97 97
 
98
-        break;
98
+		break;
99 99
 
100
-    default:
100
+	default:
101 101
 
102
-        smart_xoops_cp_header();
103
-        $adminObject->displayNavigation(basename(__FILE__));
102
+		smart_xoops_cp_header();
103
+		$adminObject->displayNavigation(basename(__FILE__));
104 104
 
105
-        //smart_adminMenu(3, _AM_SOBJECT_ADSENSES);
105
+		//smart_adminMenu(3, _AM_SOBJECT_ADSENSES);
106 106
 
107
-        smart_collapsableBar('createdadsenses', _AM_SOBJECT_ADSENSES, _AM_SOBJECT_ADSENSES_DSC);
107
+		smart_collapsableBar('createdadsenses', _AM_SOBJECT_ADSENSES, _AM_SOBJECT_ADSENSES_DSC);
108 108
 
109
-        require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php';
110
-        $objectTable = new XoopsModules\Smartobject\SmartObjectTable($smartobjectAdsenseHandler);
111
-        $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('description', 'left'));
112
-        $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn(_AM_SOBJECT_ADSENSE_TAG, 'center', 200, 'getXoopsCode'));
109
+		require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php';
110
+		$objectTable = new XoopsModules\Smartobject\SmartObjectTable($smartobjectAdsenseHandler);
111
+		$objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('description', 'left'));
112
+		$objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn(_AM_SOBJECT_ADSENSE_TAG, 'center', 200, 'getXoopsCode'));
113 113
 
114
-        //      $objectTable->addCustomAction('getCreateItemLink');
115
-        //      $objectTable->addCustomAction('getCreateAttributLink');
114
+		//      $objectTable->addCustomAction('getCreateItemLink');
115
+		//      $objectTable->addCustomAction('getCreateAttributLink');
116 116
 
117
-        $objectTable->addIntroButton('addadsense', 'adsense.php?op=mod', _AM_SOBJECT_ADSENSES_CREATE);
118
-        /*
117
+		$objectTable->addIntroButton('addadsense', 'adsense.php?op=mod', _AM_SOBJECT_ADSENSES_CREATE);
118
+		/*
119 119
                 $criteria_upcoming = new \CriteriaCompo();
120 120
                 $criteria_upcoming->add(new \Criteria('start_date', time(), '>'));
121 121
                 $objectTable->addFilter(_AM_SOBJECT_FILTER_UPCOMING, array(
@@ -139,16 +139,16 @@  discard block
 block discarded – undo
139 139
                                             'criteria' => $criteria_last30days
140 140
                 ));
141 141
         */
142
-        $objectTable->addQuickSearch(['title', 'summary', 'description']);
143
-        $objectTable->addCustomAction('getCloneLink');
142
+		$objectTable->addQuickSearch(['title', 'summary', 'description']);
143
+		$objectTable->addCustomAction('getCloneLink');
144 144
 
145
-        $objectTable->render();
145
+		$objectTable->render();
146 146
 
147
-        echo '<br>';
148
-        smart_close_collapsable('createdadsenses');
149
-        echo '<br>';
147
+		echo '<br>';
148
+		smart_close_collapsable('createdadsenses');
149
+		echo '<br>';
150 150
 
151
-        break;
151
+		break;
152 152
 }
153 153
 
154 154
 //smart_modFooter();
Please login to merge, or discard this patch.
Switch Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -57,65 +57,65 @@  discard block
 block discarded – undo
57 57
 }
58 58
 
59 59
 switch ($op) {
60
-    case 'mod':
60
+    	case 'mod':
61 61
 
62
-        $adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0;
62
+        	$adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0;
63 63
 
64
-        smart_xoops_cp_header();
65
-        $adminObject->displayNavigation(basename(__FILE__));
64
+        	smart_xoops_cp_header();
65
+        	$adminObject->displayNavigation(basename(__FILE__));
66 66
 
67
-        editclass(true, $adsenseid);
68
-        break;
67
+        	editclass(true, $adsenseid);
68
+        	break;
69 69
 
70
-    case 'clone':
70
+    	case 'clone':
71 71
 
72
-        $adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0;
72
+        	$adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0;
73 73
 
74
-        smart_xoops_cp_header();
75
-        $adminObject->displayNavigation(basename(__FILE__));
74
+        	smart_xoops_cp_header();
75
+        	$adminObject->displayNavigation(basename(__FILE__));
76 76
 
77
-        editclass(true, $adsenseid, true);
78
-        break;
77
+        	editclass(true, $adsenseid, true);
78
+        	break;
79 79
 
80
-    case 'addadsense':
81
-        if (@require_once SMARTOBJECT_ROOT_PATH . 'include/captcha/captcha.php') {
82
-            $xoopsCaptcha = XoopsCaptcha::getInstance();
83
-            if (!$xoopsCaptcha->verify()) {
84
-                redirect_header('javascript:history.go(-1);', 3, $xoopsCaptcha->getMessage());
85
-            }
86
-        }
87
-        require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
88
-        $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectAdsenseHandler);
89
-        $controller->storeFromDefaultForm(_AM_SOBJECT_ADSENSES_CREATED, _AM_SOBJECT_ADSENSES_MODIFIED);
90
-        break;
80
+    	case 'addadsense':
81
+        	if (@require_once SMARTOBJECT_ROOT_PATH . 'include/captcha/captcha.php') {
82
+            	$xoopsCaptcha = XoopsCaptcha::getInstance();
83
+            	if (!$xoopsCaptcha->verify()) {
84
+                	redirect_header('javascript:history.go(-1);', 3, $xoopsCaptcha->getMessage());
85
+            	}
86
+        	}
87
+        	require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
88
+        	$controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectAdsenseHandler);
89
+        	$controller->storeFromDefaultForm(_AM_SOBJECT_ADSENSES_CREATED, _AM_SOBJECT_ADSENSES_MODIFIED);
90
+        	break;
91 91
 
92
-    case 'del':
92
+    	case 'del':
93 93
 
94
-        require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
95
-        $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectAdsenseHandler);
96
-        $controller->handleObjectDeletion();
94
+        	require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
95
+        	$controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectAdsenseHandler);
96
+        	$controller->handleObjectDeletion();
97 97
 
98
-        break;
98
+        	break;
99 99
 
100
-    default:
100
+    	default:
101 101
 
102
-        smart_xoops_cp_header();
103
-        $adminObject->displayNavigation(basename(__FILE__));
102
+        	smart_xoops_cp_header();
103
+        	$adminObject->displayNavigation(basename(__FILE__));
104 104
 
105
-        //smart_adminMenu(3, _AM_SOBJECT_ADSENSES);
105
+        	//smart_adminMenu(3, _AM_SOBJECT_ADSENSES);
106 106
 
107
-        smart_collapsableBar('createdadsenses', _AM_SOBJECT_ADSENSES, _AM_SOBJECT_ADSENSES_DSC);
107
+        	smart_collapsableBar('createdadsenses', _AM_SOBJECT_ADSENSES, _AM_SOBJECT_ADSENSES_DSC);
108 108
 
109
-        require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php';
110
-        $objectTable = new XoopsModules\Smartobject\SmartObjectTable($smartobjectAdsenseHandler);
111
-        $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('description', 'left'));
112
-        $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn(_AM_SOBJECT_ADSENSE_TAG, 'center', 200, 'getXoopsCode'));
109
+        	require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php';
110
+        	$objectTable = new XoopsModules\Smartobject\SmartObjectTable($smartobjectAdsenseHandler);
111
+        	$objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('description', 'left'));
112
+        	$objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn(_AM_SOBJECT_ADSENSE_TAG, 'center', 200, 'getXoopsCode'));
113 113
 
114
-        //      $objectTable->addCustomAction('getCreateItemLink');
115
-        //      $objectTable->addCustomAction('getCreateAttributLink');
114
+        	//      $objectTable->addCustomAction('getCreateItemLink');
115
+        	//      $objectTable->addCustomAction('getCreateAttributLink');
116 116
 
117
-        $objectTable->addIntroButton('addadsense', 'adsense.php?op=mod', _AM_SOBJECT_ADSENSES_CREATE);
118
-        /*
117
+        	$objectTable->addIntroButton('addadsense', 'adsense.php?op=mod', _AM_SOBJECT_ADSENSES_CREATE);
118
+        	/*
119 119
                 $criteria_upcoming = new \CriteriaCompo();
120 120
                 $criteria_upcoming->add(new \Criteria('start_date', time(), '>'));
121 121
                 $objectTable->addFilter(_AM_SOBJECT_FILTER_UPCOMING, array(
@@ -139,16 +139,16 @@  discard block
 block discarded – undo
139 139
                                             'criteria' => $criteria_last30days
140 140
                 ));
141 141
         */
142
-        $objectTable->addQuickSearch(['title', 'summary', 'description']);
143
-        $objectTable->addCustomAction('getCloneLink');
142
+        	$objectTable->addQuickSearch(['title', 'summary', 'description']);
143
+        	$objectTable->addCustomAction('getCloneLink');
144 144
 
145
-        $objectTable->render();
145
+        	$objectTable->render();
146 146
 
147
-        echo '<br>';
148
-        smart_close_collapsable('createdadsenses');
149
-        echo '<br>';
147
+        	echo '<br>';
148
+        	smart_close_collapsable('createdadsenses');
149
+        	echo '<br>';
150 150
 
151
-        break;
151
+        	break;
152 152
 }
153 153
 
154 154
 //smart_modFooter();
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
     }
41 41
 }
42 42
 
43
-require_once __DIR__ . '/admin_header.php';
44
-require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php';
45
-require_once SMARTOBJECT_ROOT_PATH . 'class/adsense.php';
43
+require_once __DIR__.'/admin_header.php';
44
+require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecttable.php';
45
+require_once SMARTOBJECT_ROOT_PATH.'class/adsense.php';
46 46
 $smartobjectAdsenseHandler = xoops_getModuleHandler('adsense');
47 47
 smart_loadLanguageFile('smartobject', 'adsense');
48 48
 $adminObject = \Xmf\Module\Admin::getInstance();
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 switch ($op) {
60 60
     case 'mod':
61 61
 
62
-        $adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0;
62
+        $adsenseid = isset($_GET['adsenseid']) ? (int) $_GET['adsenseid'] : 0;
63 63
 
64 64
         smart_xoops_cp_header();
65 65
         $adminObject->displayNavigation(basename(__FILE__));
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
     case 'clone':
71 71
 
72
-        $adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0;
72
+        $adsenseid = isset($_GET['adsenseid']) ? (int) $_GET['adsenseid'] : 0;
73 73
 
74 74
         smart_xoops_cp_header();
75 75
         $adminObject->displayNavigation(basename(__FILE__));
@@ -78,20 +78,20 @@  discard block
 block discarded – undo
78 78
         break;
79 79
 
80 80
     case 'addadsense':
81
-        if (@require_once SMARTOBJECT_ROOT_PATH . 'include/captcha/captcha.php') {
81
+        if (@require_once SMARTOBJECT_ROOT_PATH.'include/captcha/captcha.php') {
82 82
             $xoopsCaptcha = XoopsCaptcha::getInstance();
83 83
             if (!$xoopsCaptcha->verify()) {
84 84
                 redirect_header('javascript:history.go(-1);', 3, $xoopsCaptcha->getMessage());
85 85
             }
86 86
         }
87
-        require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
87
+        require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobjectcontroller.php';
88 88
         $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectAdsenseHandler);
89 89
         $controller->storeFromDefaultForm(_AM_SOBJECT_ADSENSES_CREATED, _AM_SOBJECT_ADSENSES_MODIFIED);
90 90
         break;
91 91
 
92 92
     case 'del':
93 93
 
94
-        require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
94
+        require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobjectcontroller.php';
95 95
         $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectAdsenseHandler);
96 96
         $controller->handleObjectDeletion();
97 97
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 
107 107
         smart_collapsableBar('createdadsenses', _AM_SOBJECT_ADSENSES, _AM_SOBJECT_ADSENSES_DSC);
108 108
 
109
-        require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php';
109
+        require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecttable.php';
110 110
         $objectTable = new XoopsModules\Smartobject\SmartObjectTable($smartobjectAdsenseHandler);
111 111
         $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('description', 'left'));
112 112
         $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn(_AM_SOBJECT_ADSENSE_TAG, 'center', 200, 'getXoopsCode'));
@@ -153,4 +153,4 @@  discard block
 block discarded – undo
153 153
 
154 154
 //smart_modFooter();
155 155
 //xoops_cp_footer();
156
-require_once __DIR__ . '/admin_footer.php';
156
+require_once __DIR__.'/admin_footer.php';
Please login to merge, or discard this patch.
admin/about.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,11 +17,11 @@
 block discarded – undo
17 17
  * @author       XOOPS Development Team
18 18
  */
19 19
 
20
-require_once __DIR__ . '/admin_header.php';
20
+require_once __DIR__.'/admin_header.php';
21 21
 xoops_cp_header();
22 22
 
23 23
 $adminObject->displayNavigation(basename(__FILE__));
24 24
 $adminObject::setPaypal('[email protected]');
25 25
 $adminObject->displayAbout(false);
26 26
 
27
-require_once __DIR__ . '/admin_footer.php';
27
+require_once __DIR__.'/admin_footer.php';
Please login to merge, or discard this patch.
admin/menu.php 2 patches
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
 $adminmenu = [];
19 19
 
20 20
 $adminmenu[] = [
21
-    'title' => _MI_SOBJECT_HOME,
22
-    'link'  => 'admin/index.php',
23
-    'icon'  => $pathIcon32 . '/home.png',
21
+	'title' => _MI_SOBJECT_HOME,
22
+	'link'  => 'admin/index.php',
23
+	'icon'  => $pathIcon32 . '/home.png',
24 24
 ];
25 25
 
26 26
 //$adminmenu[] = [
@@ -30,76 +30,76 @@  discard block
 block discarded – undo
30 30
 //];
31 31
 
32 32
 $adminmenu[] = [
33
-    'title' => _MI_SOBJECT_SENT_LINKS,
34
-    'link'  => 'admin/link.php',
35
-    'icon'  => $pathIcon32 . '/addlink.png',
33
+	'title' => _MI_SOBJECT_SENT_LINKS,
34
+	'link'  => 'admin/link.php',
35
+	'icon'  => $pathIcon32 . '/addlink.png',
36 36
 ];
37 37
 
38 38
 $adminmenu[] = [
39
-    'title' => _MI_SOBJECT_TAGS,
40
-    'link'  => 'admin/customtag.php',
41
-    'icon'  => $pathIcon32 . '/identity.png',
39
+	'title' => _MI_SOBJECT_TAGS,
40
+	'link'  => 'admin/customtag.php',
41
+	'icon'  => $pathIcon32 . '/identity.png',
42 42
 ];
43 43
 
44 44
 $adminmenu[] = [
45
-    'title' => _MI_SOBJECT_ADSENSES,
46
-    'link'  => 'admin/adsense.php',
47
-    'icon'  => $pathIcon32 . '/alert.png',
45
+	'title' => _MI_SOBJECT_ADSENSES,
46
+	'link'  => 'admin/adsense.php',
47
+	'icon'  => $pathIcon32 . '/alert.png',
48 48
 ];
49 49
 
50 50
 $adminmenu[] = [
51
-    'title' => _MI_SOBJECT_RATINGS,
52
-    'link'  => 'admin/rating.php',
53
-    'icon'  => $pathIcon32 . '/stats.png',
51
+	'title' => _MI_SOBJECT_RATINGS,
52
+	'link'  => 'admin/rating.php',
53
+	'icon'  => $pathIcon32 . '/stats.png',
54 54
 ];
55 55
 
56 56
 $adminmenu[] = [
57
-    'title' => _MI_SOBJECT_ABOUT,
58
-    'link'  => 'admin/about.php',
59
-    'icon'  => $pathIcon32 . '/about.png',
57
+	'title' => _MI_SOBJECT_ABOUT,
58
+	'link'  => 'admin/about.php',
59
+	'icon'  => $pathIcon32 . '/about.png',
60 60
 ];
61 61
 
62 62
 //---------------------------------
63 63
 
64 64
 if (!defined('SMARTOBJECT_ROOT_PATH')) {
65
-    require_once XOOPS_ROOT_PATH . '/modules/smartobject/include/functions.php';
65
+	require_once XOOPS_ROOT_PATH . '/modules/smartobject/include/functions.php';
66 66
 }
67 67
 
68 68
 $smartobjectConfig = smart_getModuleConfig('smartobject');
69 69
 
70 70
 if (isset($smartobjectConfig['enable_currencyman']) && true === $smartobjectConfig['enable_currencyman']) {
71
-    $adminmenu[] = [
72
-        'title' => _MI_SOBJECT_CURRENCIES,
73
-        'link'  => 'admin/currency.php',
74
-        'icon'  => $pathIcon32 . '/cash_stack.png',
75
-    ];
71
+	$adminmenu[] = [
72
+		'title' => _MI_SOBJECT_CURRENCIES,
73
+		'link'  => 'admin/currency.php',
74
+		'icon'  => $pathIcon32 . '/cash_stack.png',
75
+	];
76 76
 }
77 77
 
78 78
 global $xoopsModule;
79 79
 if (isset($xoopsModule)) {
80
-    $i = -1;
81
-
82
-    // --- for XCL ---
83
-    //  $headermenu[$i]['link'] = '../../system/admin.php?fct=preferences&amp;op=showmod&amp;mod=' . $xoopsModule->getVar('mid');
84
-    $mid = $xoopsModule->getVar('mid');
85
-    if (defined('XOOPS_CUBE_LEGACY')) {
86
-        $link_pref = XOOPS_URL . '/modules/legacy/admin/index.php?action=PreferenceEdit&confmod_id=' . $mid;
87
-    } else {
88
-        $link_pref = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mid;
89
-    }
90
-    $headermenu[$i]['link'] = $link_pref;
91
-    // -----
92
-
93
-    // --- for XCL ---
94
-    //  $headermenu[$i]['link'] = XOOPS_URL . "/modules/system/admin.php?fct=modulesadmin&op=update&module=" . $xoopsModule->getVar('dirname');
95
-    $dirname = $xoopsModule->getVar('dirname');
96
-    if (defined('XOOPS_CUBE_LEGACY')) {
97
-        $link_module = XOOPS_URL . '/modules/legacy/admin/index.php?action=ModuleUpdate&dirname=' . $dirname;
98
-    } else {
99
-        $link_module = XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin&op=update&module=' . $dirname;
100
-    }
101
-    $headermenu[$i]['link'] = $link_module;
102
-    // -----
103
-
104
-    ++$i;
80
+	$i = -1;
81
+
82
+	// --- for XCL ---
83
+	//  $headermenu[$i]['link'] = '../../system/admin.php?fct=preferences&amp;op=showmod&amp;mod=' . $xoopsModule->getVar('mid');
84
+	$mid = $xoopsModule->getVar('mid');
85
+	if (defined('XOOPS_CUBE_LEGACY')) {
86
+		$link_pref = XOOPS_URL . '/modules/legacy/admin/index.php?action=PreferenceEdit&confmod_id=' . $mid;
87
+	} else {
88
+		$link_pref = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mid;
89
+	}
90
+	$headermenu[$i]['link'] = $link_pref;
91
+	// -----
92
+
93
+	// --- for XCL ---
94
+	//  $headermenu[$i]['link'] = XOOPS_URL . "/modules/system/admin.php?fct=modulesadmin&op=update&module=" . $xoopsModule->getVar('dirname');
95
+	$dirname = $xoopsModule->getVar('dirname');
96
+	if (defined('XOOPS_CUBE_LEGACY')) {
97
+		$link_module = XOOPS_URL . '/modules/legacy/admin/index.php?action=ModuleUpdate&dirname=' . $dirname;
98
+	} else {
99
+		$link_module = XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin&op=update&module=' . $dirname;
100
+	}
101
+	$headermenu[$i]['link'] = $link_module;
102
+	// -----
103
+
104
+	++$i;
105 105
 }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 $adminmenu[] = [
21 21
     'title' => _MI_SOBJECT_HOME,
22 22
     'link'  => 'admin/index.php',
23
-    'icon'  => $pathIcon32 . '/home.png',
23
+    'icon'  => $pathIcon32.'/home.png',
24 24
 ];
25 25
 
26 26
 //$adminmenu[] = [
@@ -32,37 +32,37 @@  discard block
 block discarded – undo
32 32
 $adminmenu[] = [
33 33
     'title' => _MI_SOBJECT_SENT_LINKS,
34 34
     'link'  => 'admin/link.php',
35
-    'icon'  => $pathIcon32 . '/addlink.png',
35
+    'icon'  => $pathIcon32.'/addlink.png',
36 36
 ];
37 37
 
38 38
 $adminmenu[] = [
39 39
     'title' => _MI_SOBJECT_TAGS,
40 40
     'link'  => 'admin/customtag.php',
41
-    'icon'  => $pathIcon32 . '/identity.png',
41
+    'icon'  => $pathIcon32.'/identity.png',
42 42
 ];
43 43
 
44 44
 $adminmenu[] = [
45 45
     'title' => _MI_SOBJECT_ADSENSES,
46 46
     'link'  => 'admin/adsense.php',
47
-    'icon'  => $pathIcon32 . '/alert.png',
47
+    'icon'  => $pathIcon32.'/alert.png',
48 48
 ];
49 49
 
50 50
 $adminmenu[] = [
51 51
     'title' => _MI_SOBJECT_RATINGS,
52 52
     'link'  => 'admin/rating.php',
53
-    'icon'  => $pathIcon32 . '/stats.png',
53
+    'icon'  => $pathIcon32.'/stats.png',
54 54
 ];
55 55
 
56 56
 $adminmenu[] = [
57 57
     'title' => _MI_SOBJECT_ABOUT,
58 58
     'link'  => 'admin/about.php',
59
-    'icon'  => $pathIcon32 . '/about.png',
59
+    'icon'  => $pathIcon32.'/about.png',
60 60
 ];
61 61
 
62 62
 //---------------------------------
63 63
 
64 64
 if (!defined('SMARTOBJECT_ROOT_PATH')) {
65
-    require_once XOOPS_ROOT_PATH . '/modules/smartobject/include/functions.php';
65
+    require_once XOOPS_ROOT_PATH.'/modules/smartobject/include/functions.php';
66 66
 }
67 67
 
68 68
 $smartobjectConfig = smart_getModuleConfig('smartobject');
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     $adminmenu[] = [
72 72
         'title' => _MI_SOBJECT_CURRENCIES,
73 73
         'link'  => 'admin/currency.php',
74
-        'icon'  => $pathIcon32 . '/cash_stack.png',
74
+        'icon'  => $pathIcon32.'/cash_stack.png',
75 75
     ];
76 76
 }
77 77
 
@@ -83,9 +83,9 @@  discard block
 block discarded – undo
83 83
     //  $headermenu[$i]['link'] = '../../system/admin.php?fct=preferences&amp;op=showmod&amp;mod=' . $xoopsModule->getVar('mid');
84 84
     $mid = $xoopsModule->getVar('mid');
85 85
     if (defined('XOOPS_CUBE_LEGACY')) {
86
-        $link_pref = XOOPS_URL . '/modules/legacy/admin/index.php?action=PreferenceEdit&confmod_id=' . $mid;
86
+        $link_pref = XOOPS_URL.'/modules/legacy/admin/index.php?action=PreferenceEdit&confmod_id='.$mid;
87 87
     } else {
88
-        $link_pref = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mid;
88
+        $link_pref = XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=showmod&mod='.$mid;
89 89
     }
90 90
     $headermenu[$i]['link'] = $link_pref;
91 91
     // -----
@@ -94,9 +94,9 @@  discard block
 block discarded – undo
94 94
     //  $headermenu[$i]['link'] = XOOPS_URL . "/modules/system/admin.php?fct=modulesadmin&op=update&module=" . $xoopsModule->getVar('dirname');
95 95
     $dirname = $xoopsModule->getVar('dirname');
96 96
     if (defined('XOOPS_CUBE_LEGACY')) {
97
-        $link_module = XOOPS_URL . '/modules/legacy/admin/index.php?action=ModuleUpdate&dirname=' . $dirname;
97
+        $link_module = XOOPS_URL.'/modules/legacy/admin/index.php?action=ModuleUpdate&dirname='.$dirname;
98 98
     } else {
99
-        $link_module = XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin&op=update&module=' . $dirname;
99
+        $link_module = XOOPS_URL.'/modules/system/admin.php?fct=modulesadmin&op=update&module='.$dirname;
100 100
     }
101 101
     $headermenu[$i]['link'] = $link_module;
102 102
     // -----
Please login to merge, or discard this patch.
sendlink.php 2 patches
Indentation   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -28,82 +28,82 @@
 block discarded – undo
28 28
 $op = isset($_POST['op']) ? $_POST['op'] : '';
29 29
 
30 30
 switch ($op) {
31
-    case 'sendlink':
32
-
33
-        require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
34
-        $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectLinkHandler);
35
-
36
-        $linkObj = $controller->storeSmartObject();
37
-        if ($linkObj->hasError()) {
38
-            /**
39
-             * @todo inform user and propose to close the window if a problem occured when saving the link
40
-             */
41
-        }
42
-
43
-        $xoopsMailer = xoops_getMailer();
44
-        $xoopsMailer->useMail();
45
-        $xoopsMailer->setTemplateDir('language/' . $xoopsConfig['language'] . '/mail_template');
46
-
47
-        $xoopsMailer->setTemplate('sendlink.tpl');
48
-        $xoopsMailer->assign('X_SITENAME', $xoopsConfig['sitename']);
49
-        $xoopsMailer->assign('TO_NAME', $linkObj->getVar('to_name'));
50
-        $xoopsMailer->assign('FROM_NAME', $linkObj->getVar('from_name'));
51
-        $xoopsMailer->assign('SITEURL', XOOPS_URL . '/');
52
-        $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']);
53
-        $xoopsMailer->assign('MESSAGE', $_POST['body']);
54
-        $xoopsMailer->setToEmails($linkObj->getVar('to_email'));
55
-        $xoopsMailer->setFromEmail($linkObj->getVar('from_email'));
56
-        $xoopsMailer->setFromName($xoopsConfig['sitename']);
57
-        $xoopsMailer->setSubject(sprintf(_CO_SOBJECT_SUBJECT_DEFAULT, $myts->oopsStripSlashesGPC($xoopsConfig['sitename'])));
58
-
59
-        if (!$xoopsMailer->send(true)) {
60
-            $xoopsTpl->assign('send_error', sprintf(_CO_SOBJECT_SEND_ERROR, $xoopsConfig['adminmail']) . '<br>' . $xoopsMailer->getErrors(true));
61
-        } else {
62
-            $xoopsTpl->assign('send_success', _CO_SOBJECT_SEND_SUCCESS);
63
-        }
64
-
65
-        break;
66
-
67
-    default:
68
-        if (isset($_GET['mid'])) {
69
-            $mid = $_GET['mid'];
70
-        } else {
71
-            /**
72
-             * @todo close the window if no mid is passed as GET
73
-             */
74
-        }
75
-
76
-        $hModule = xoops_getHandler('module');
77
-        $module  = $hModule->get($mid);
78
-        $linkObj->setVar('mid', $module->getVar('mid'));
79
-        $linkObj->setVar('mid_name', $module->getVar('name'));
80
-
81
-        if (isset($_GET['link'])) {
82
-            $link = $_GET['link'];
83
-        } else {
84
-            /**
85
-             * @todo close the window if no link is passed as GET
86
-             */
87
-        }
88
-        $linkObj->setVar('link', $link);
89
-
90
-        if (is_object($xoopsUser)) {
91
-            $linkObj->setVar('from_uid', $xoopsUser->getVar('uid'));
92
-            $linkObj->setVar('from_name', '' !== $xoopsUser->getVar('name') ? $xoopsUser->getVar('name') : $xoopsUser->getVar('uname'));
93
-            $linkObj->setVar('from_email', $xoopsUser->getVar('email'));
94
-        }
95
-
96
-        $linkObj->setVar('subject', sprintf(_CO_SOBJECT_SUBJECT_DEFAULT, $xoopsConfig['sitename']));
97
-        $linkObj->setVar('body', sprintf(_CO_SOBJECT_BODY_DEFAULT, $xoopsConfig['sitename'], $link));
98
-        $linkObj->setVar('date', time());
99
-        $linkObj->hideFieldFromForm(['from_uid', 'to_uid', 'link', 'mid', 'mid_name']);
100
-
101
-        $form = $linkObj->getForm(_CO_SOBJECT_SEND_LINK_FORM, 'sendlink', false, _SEND, 'javascript:window.close();');
102
-
103
-        $form->assign($xoopsTpl);
104
-
105
-        $xoopsTpl->assign('showform', true);
106
-        break;
31
+	case 'sendlink':
32
+
33
+		require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
34
+		$controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectLinkHandler);
35
+
36
+		$linkObj = $controller->storeSmartObject();
37
+		if ($linkObj->hasError()) {
38
+			/**
39
+			 * @todo inform user and propose to close the window if a problem occured when saving the link
40
+			 */
41
+		}
42
+
43
+		$xoopsMailer = xoops_getMailer();
44
+		$xoopsMailer->useMail();
45
+		$xoopsMailer->setTemplateDir('language/' . $xoopsConfig['language'] . '/mail_template');
46
+
47
+		$xoopsMailer->setTemplate('sendlink.tpl');
48
+		$xoopsMailer->assign('X_SITENAME', $xoopsConfig['sitename']);
49
+		$xoopsMailer->assign('TO_NAME', $linkObj->getVar('to_name'));
50
+		$xoopsMailer->assign('FROM_NAME', $linkObj->getVar('from_name'));
51
+		$xoopsMailer->assign('SITEURL', XOOPS_URL . '/');
52
+		$xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']);
53
+		$xoopsMailer->assign('MESSAGE', $_POST['body']);
54
+		$xoopsMailer->setToEmails($linkObj->getVar('to_email'));
55
+		$xoopsMailer->setFromEmail($linkObj->getVar('from_email'));
56
+		$xoopsMailer->setFromName($xoopsConfig['sitename']);
57
+		$xoopsMailer->setSubject(sprintf(_CO_SOBJECT_SUBJECT_DEFAULT, $myts->oopsStripSlashesGPC($xoopsConfig['sitename'])));
58
+
59
+		if (!$xoopsMailer->send(true)) {
60
+			$xoopsTpl->assign('send_error', sprintf(_CO_SOBJECT_SEND_ERROR, $xoopsConfig['adminmail']) . '<br>' . $xoopsMailer->getErrors(true));
61
+		} else {
62
+			$xoopsTpl->assign('send_success', _CO_SOBJECT_SEND_SUCCESS);
63
+		}
64
+
65
+		break;
66
+
67
+	default:
68
+		if (isset($_GET['mid'])) {
69
+			$mid = $_GET['mid'];
70
+		} else {
71
+			/**
72
+			 * @todo close the window if no mid is passed as GET
73
+			 */
74
+		}
75
+
76
+		$hModule = xoops_getHandler('module');
77
+		$module  = $hModule->get($mid);
78
+		$linkObj->setVar('mid', $module->getVar('mid'));
79
+		$linkObj->setVar('mid_name', $module->getVar('name'));
80
+
81
+		if (isset($_GET['link'])) {
82
+			$link = $_GET['link'];
83
+		} else {
84
+			/**
85
+			 * @todo close the window if no link is passed as GET
86
+			 */
87
+		}
88
+		$linkObj->setVar('link', $link);
89
+
90
+		if (is_object($xoopsUser)) {
91
+			$linkObj->setVar('from_uid', $xoopsUser->getVar('uid'));
92
+			$linkObj->setVar('from_name', '' !== $xoopsUser->getVar('name') ? $xoopsUser->getVar('name') : $xoopsUser->getVar('uname'));
93
+			$linkObj->setVar('from_email', $xoopsUser->getVar('email'));
94
+		}
95
+
96
+		$linkObj->setVar('subject', sprintf(_CO_SOBJECT_SUBJECT_DEFAULT, $xoopsConfig['sitename']));
97
+		$linkObj->setVar('body', sprintf(_CO_SOBJECT_BODY_DEFAULT, $xoopsConfig['sitename'], $link));
98
+		$linkObj->setVar('date', time());
99
+		$linkObj->hideFieldFromForm(['from_uid', 'to_uid', 'link', 'mid', 'mid_name']);
100
+
101
+		$form = $linkObj->getForm(_CO_SOBJECT_SEND_LINK_FORM, 'sendlink', false, _SEND, 'javascript:window.close();');
102
+
103
+		$form->assign($xoopsTpl);
104
+
105
+		$xoopsTpl->assign('showform', true);
106
+		break;
107 107
 }
108 108
 
109 109
 $xoopsTpl->display('db:smartobject_sendlink.tpl');
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -9,17 +9,17 @@  discard block
 block discarded – undo
9 9
 
10 10
 use XoopsModules\Smartobject\SmartObjectController;
11 11
 
12
-require_once __DIR__ . '/header.php';
13
-require_once SMARTOBJECT_ROOT_PATH . 'class/smartloader.php';
14
-require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectlink.php';
15
-require_once XOOPS_ROOT_PATH . '/class/template.php';
12
+require_once __DIR__.'/header.php';
13
+require_once SMARTOBJECT_ROOT_PATH.'class/smartloader.php';
14
+require_once SMARTOBJECT_ROOT_PATH.'class/smartobjectlink.php';
15
+require_once XOOPS_ROOT_PATH.'/class/template.php';
16 16
 
17 17
 $xoopsTpl                = new \XoopsTpl();
18 18
 $myts                    = \MyTextSanitizer::getInstance();
19 19
 $xoopsConfig['sitename'] = $myts->displayTarea($xoopsConfig['sitename']);
20 20
 
21 21
 xoops_header(false);
22
-echo smart_get_css_link(SMARTOBJECT_URL . 'assets/css/module.css');
22
+echo smart_get_css_link(SMARTOBJECT_URL.'assets/css/module.css');
23 23
 echo '</head><body>';
24 24
 
25 25
 $smartobjectLinkHandler = xoops_getModuleHandler('link', 'smartobject');
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 switch ($op) {
31 31
     case 'sendlink':
32 32
 
33
-        require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
33
+        require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobjectcontroller.php';
34 34
         $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectLinkHandler);
35 35
 
36 36
         $linkObj = $controller->storeSmartObject();
@@ -42,13 +42,13 @@  discard block
 block discarded – undo
42 42
 
43 43
         $xoopsMailer = xoops_getMailer();
44 44
         $xoopsMailer->useMail();
45
-        $xoopsMailer->setTemplateDir('language/' . $xoopsConfig['language'] . '/mail_template');
45
+        $xoopsMailer->setTemplateDir('language/'.$xoopsConfig['language'].'/mail_template');
46 46
 
47 47
         $xoopsMailer->setTemplate('sendlink.tpl');
48 48
         $xoopsMailer->assign('X_SITENAME', $xoopsConfig['sitename']);
49 49
         $xoopsMailer->assign('TO_NAME', $linkObj->getVar('to_name'));
50 50
         $xoopsMailer->assign('FROM_NAME', $linkObj->getVar('from_name'));
51
-        $xoopsMailer->assign('SITEURL', XOOPS_URL . '/');
51
+        $xoopsMailer->assign('SITEURL', XOOPS_URL.'/');
52 52
         $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']);
53 53
         $xoopsMailer->assign('MESSAGE', $_POST['body']);
54 54
         $xoopsMailer->setToEmails($linkObj->getVar('to_email'));
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         $xoopsMailer->setSubject(sprintf(_CO_SOBJECT_SUBJECT_DEFAULT, $myts->oopsStripSlashesGPC($xoopsConfig['sitename'])));
58 58
 
59 59
         if (!$xoopsMailer->send(true)) {
60
-            $xoopsTpl->assign('send_error', sprintf(_CO_SOBJECT_SEND_ERROR, $xoopsConfig['adminmail']) . '<br>' . $xoopsMailer->getErrors(true));
60
+            $xoopsTpl->assign('send_error', sprintf(_CO_SOBJECT_SEND_ERROR, $xoopsConfig['adminmail']).'<br>'.$xoopsMailer->getErrors(true));
61 61
         } else {
62 62
             $xoopsTpl->assign('send_success', _CO_SOBJECT_SEND_SUCCESS);
63 63
         }
Please login to merge, or discard this patch.
preloads/autoloader.php 2 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -4,29 +4,29 @@
 block discarded – undo
4 4
  * @see http://www.php-fig.org/psr/psr-4/examples/
5 5
  */
6 6
 spl_autoload_register(function ($class) {
7
-    // project-specific namespace prefix
8
-    $prefix = 'XoopsModules\\' . ucfirst(basename(dirname(__DIR__)));
7
+	// project-specific namespace prefix
8
+	$prefix = 'XoopsModules\\' . ucfirst(basename(dirname(__DIR__)));
9 9
 
10
-    // base directory for the namespace prefix
11
-    $base_dir = __DIR__ . '/../class/';
10
+	// base directory for the namespace prefix
11
+	$base_dir = __DIR__ . '/../class/';
12 12
 
13
-    // does the class use the namespace prefix?
14
-    $len      = strlen($prefix);
13
+	// does the class use the namespace prefix?
14
+	$len      = strlen($prefix);
15 15
 
16
-    if (0 !== strncmp($prefix, $class, $len)) {
17
-        return;
18
-    }
16
+	if (0 !== strncmp($prefix, $class, $len)) {
17
+		return;
18
+	}
19 19
 
20
-    // get the relative class name
21
-    $relative_class = substr($class, $len);
20
+	// get the relative class name
21
+	$relative_class = substr($class, $len);
22 22
 
23
-    // replace the namespace prefix with the base directory, replace namespace
24
-    // separators with directory separators in the relative class name, append
25
-    // with .php
26
-    $file           = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
23
+	// replace the namespace prefix with the base directory, replace namespace
24
+	// separators with directory separators in the relative class name, append
25
+	// with .php
26
+	$file           = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
27 27
 
28
-    // if the file exists, require it
29
-    if (file_exists($file)) {
30
-        require $file;
31
-    }
28
+	// if the file exists, require it
29
+	if (file_exists($file)) {
30
+		require $file;
31
+	}
32 32
 });
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@  discard block
 block discarded – undo
3 3
 /**
4 4
  * @see http://www.php-fig.org/psr/psr-4/examples/
5 5
  */
6
-spl_autoload_register(function ($class) {
6
+spl_autoload_register(function($class) {
7 7
     // project-specific namespace prefix
8
-    $prefix = 'XoopsModules\\' . ucfirst(basename(dirname(__DIR__)));
8
+    $prefix = 'XoopsModules\\'.ucfirst(basename(dirname(__DIR__)));
9 9
 
10 10
     // base directory for the namespace prefix
11
-    $base_dir = __DIR__ . '/../class/';
11
+    $base_dir = __DIR__.'/../class/';
12 12
 
13 13
     // does the class use the namespace prefix?
14 14
     $len      = strlen($prefix);
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     // replace the namespace prefix with the base directory, replace namespace
24 24
     // separators with directory separators in the relative class name, append
25 25
     // with .php
26
-    $file           = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
26
+    $file = $base_dir.str_replace('\\', '/', $relative_class).'.php';
27 27
 
28 28
     // if the file exists, require it
29 29
     if (file_exists($file)) {
Please login to merge, or discard this patch.
preloads/core.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -22,12 +22,12 @@
 block discarded – undo
22 22
  */
23 23
 class SmartobjectCorePreload extends \XoopsPreloadItem
24 24
 {
25
-    // to add PSR-4 autoloader
26
-    /**
27
-     * @param $args
28
-     */
29
-    public static function eventCoreIncludeCommonEnd($args)
30
-    {
31
-        include __DIR__ . '/autoloader.php';
32
-    }
25
+	// to add PSR-4 autoloader
26
+	/**
27
+	 * @param $args
28
+	 */
29
+	public static function eventCoreIncludeCommonEnd($args)
30
+	{
31
+		include __DIR__ . '/autoloader.php';
32
+	}
33 33
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,6 +28,6 @@
 block discarded – undo
28 28
      */
29 29
     public static function eventCoreIncludeCommonEnd($args)
30 30
     {
31
-        include __DIR__ . '/autoloader.php';
31
+        include __DIR__.'/autoloader.php';
32 32
     }
33 33
 }
Please login to merge, or discard this patch.
class/SmartobjectRating.php 2 patches
Indentation   +119 added lines, -119 removed lines patch added patch discarded remove patch
@@ -30,123 +30,123 @@
 block discarded – undo
30 30
  */
31 31
 class SmartobjectRating extends Smartobject\BaseSmartObject
32 32
 {
33
-    public $_modulePlugin = false;
34
-
35
-    /**
36
-     * SmartobjectRating constructor.
37
-     */
38
-    public function __construct()
39
-    {
40
-        $this->quickInitVar('ratingid', XOBJ_DTYPE_INT, true);
41
-        $this->quickInitVar('dirname', XOBJ_DTYPE_TXTBOX, true, _CO_SOBJECT_RATING_DIRNAME);
42
-        $this->quickInitVar('item', XOBJ_DTYPE_TXTBOX, true, _CO_SOBJECT_RATING_ITEM);
43
-        $this->quickInitVar('itemid', XOBJ_DTYPE_INT, true, _CO_SOBJECT_RATING_ITEMID);
44
-        $this->quickInitVar('uid', XOBJ_DTYPE_INT, true, _CO_SOBJECT_RATING_UID);
45
-        $this->quickInitVar('date', XOBJ_DTYPE_LTIME, true, _CO_SOBJECT_RATING_DATE);
46
-        $this->quickInitVar('rate', XOBJ_DTYPE_INT, true, _CO_SOBJECT_RATING_RATE);
47
-
48
-        $this->initNonPersistableVar('name', XOBJ_DTYPE_TXTBOX, 'user', _CO_SOBJECT_RATING_NAME);
49
-
50
-        $this->setControl('dirname', [
51
-            'handler'  => 'rating',
52
-            'method'   => 'getModuleList',
53
-            'onSelect' => 'submit'
54
-        ]);
55
-
56
-        $this->setControl('item', [
57
-            'object' => &$this,
58
-            'method' => 'getItemList'
59
-        ]);
60
-
61
-        $this->setControl('uid', 'user');
62
-
63
-        $this->setControl('rate', [
64
-            'handler' => 'rating',
65
-            'method'  => 'getRateList'
66
-        ]);
67
-    }
68
-
69
-    /**
70
-     * @param  string $key
71
-     * @param  string $format
72
-     * @return mixed
73
-     */
74
-    public function getVar($key, $format = 's')
75
-    {
76
-        if ('s' === $format && in_array($key, ['name', 'dirname'])) {
77
-            //            return call_user_func(array($this, $key));
78
-            return $this->{$key}();
79
-        }
80
-
81
-        return parent::getVar($key, $format);
82
-    }
83
-
84
-    /**
85
-     * @return string
86
-     */
87
-    public function name()
88
-    {
89
-        $ret = smart_getLinkedUnameFromId($this->getVar('uid', 'e'), true, []);
90
-
91
-        return $ret;
92
-    }
93
-
94
-    /**
95
-     * @return mixed
96
-     */
97
-    public function dirname()
98
-    {
99
-        global $smartobjectRatingHandler;
100
-        $moduleArray = $smartobjectRatingHandler->getModuleList();
101
-
102
-        return $moduleArray[$this->getVar('dirname', 'n')];
103
-    }
104
-
105
-    /**
106
-     * @return mixed
107
-     */
108
-    public function getItemList()
109
-    {
110
-        $plugin = $this->getModulePlugin();
111
-
112
-        return $plugin->getItemList();
113
-    }
114
-
115
-    /**
116
-     * @return string
117
-     */
118
-    public function getItemValue()
119
-    {
120
-        $moduleUrl      = XOOPS_URL . '/modules/' . $this->getVar('dirname', 'n') . '/';
121
-        $plugin         = $this->getModulePlugin();
122
-        $pluginItemInfo = $plugin->getItemInfo($this->getVar('item'));
123
-        if (!$pluginItemInfo) {
124
-            return '';
125
-        }
126
-        $itemPath = sprintf($pluginItemInfo['url'], $this->getVar('itemid'));
127
-        $ret      = '<a href="' . $moduleUrl . $itemPath . '">' . $pluginItemInfo['caption'] . '</a>';
128
-
129
-        return $ret;
130
-    }
131
-
132
-    /**
133
-     * @return mixed
134
-     */
135
-    public function getRateValue()
136
-    {
137
-        return $this->getVar('rate');
138
-    }
139
-
140
-    /**
141
-     * @return bool
142
-     */
143
-    public function getModulePlugin()
144
-    {
145
-        if (!$this->_modulePlugin) {
146
-            global $smartobjectRatingHandler;
147
-            $this->_modulePlugin = $smartobjectRatingHandler->pluginsObject->getPlugin($this->getVar('dirname', 'n'));
148
-        }
149
-
150
-        return $this->_modulePlugin;
151
-    }
33
+	public $_modulePlugin = false;
34
+
35
+	/**
36
+	 * SmartobjectRating constructor.
37
+	 */
38
+	public function __construct()
39
+	{
40
+		$this->quickInitVar('ratingid', XOBJ_DTYPE_INT, true);
41
+		$this->quickInitVar('dirname', XOBJ_DTYPE_TXTBOX, true, _CO_SOBJECT_RATING_DIRNAME);
42
+		$this->quickInitVar('item', XOBJ_DTYPE_TXTBOX, true, _CO_SOBJECT_RATING_ITEM);
43
+		$this->quickInitVar('itemid', XOBJ_DTYPE_INT, true, _CO_SOBJECT_RATING_ITEMID);
44
+		$this->quickInitVar('uid', XOBJ_DTYPE_INT, true, _CO_SOBJECT_RATING_UID);
45
+		$this->quickInitVar('date', XOBJ_DTYPE_LTIME, true, _CO_SOBJECT_RATING_DATE);
46
+		$this->quickInitVar('rate', XOBJ_DTYPE_INT, true, _CO_SOBJECT_RATING_RATE);
47
+
48
+		$this->initNonPersistableVar('name', XOBJ_DTYPE_TXTBOX, 'user', _CO_SOBJECT_RATING_NAME);
49
+
50
+		$this->setControl('dirname', [
51
+			'handler'  => 'rating',
52
+			'method'   => 'getModuleList',
53
+			'onSelect' => 'submit'
54
+		]);
55
+
56
+		$this->setControl('item', [
57
+			'object' => &$this,
58
+			'method' => 'getItemList'
59
+		]);
60
+
61
+		$this->setControl('uid', 'user');
62
+
63
+		$this->setControl('rate', [
64
+			'handler' => 'rating',
65
+			'method'  => 'getRateList'
66
+		]);
67
+	}
68
+
69
+	/**
70
+	 * @param  string $key
71
+	 * @param  string $format
72
+	 * @return mixed
73
+	 */
74
+	public function getVar($key, $format = 's')
75
+	{
76
+		if ('s' === $format && in_array($key, ['name', 'dirname'])) {
77
+			//            return call_user_func(array($this, $key));
78
+			return $this->{$key}();
79
+		}
80
+
81
+		return parent::getVar($key, $format);
82
+	}
83
+
84
+	/**
85
+	 * @return string
86
+	 */
87
+	public function name()
88
+	{
89
+		$ret = smart_getLinkedUnameFromId($this->getVar('uid', 'e'), true, []);
90
+
91
+		return $ret;
92
+	}
93
+
94
+	/**
95
+	 * @return mixed
96
+	 */
97
+	public function dirname()
98
+	{
99
+		global $smartobjectRatingHandler;
100
+		$moduleArray = $smartobjectRatingHandler->getModuleList();
101
+
102
+		return $moduleArray[$this->getVar('dirname', 'n')];
103
+	}
104
+
105
+	/**
106
+	 * @return mixed
107
+	 */
108
+	public function getItemList()
109
+	{
110
+		$plugin = $this->getModulePlugin();
111
+
112
+		return $plugin->getItemList();
113
+	}
114
+
115
+	/**
116
+	 * @return string
117
+	 */
118
+	public function getItemValue()
119
+	{
120
+		$moduleUrl      = XOOPS_URL . '/modules/' . $this->getVar('dirname', 'n') . '/';
121
+		$plugin         = $this->getModulePlugin();
122
+		$pluginItemInfo = $plugin->getItemInfo($this->getVar('item'));
123
+		if (!$pluginItemInfo) {
124
+			return '';
125
+		}
126
+		$itemPath = sprintf($pluginItemInfo['url'], $this->getVar('itemid'));
127
+		$ret      = '<a href="' . $moduleUrl . $itemPath . '">' . $pluginItemInfo['caption'] . '</a>';
128
+
129
+		return $ret;
130
+	}
131
+
132
+	/**
133
+	 * @return mixed
134
+	 */
135
+	public function getRateValue()
136
+	{
137
+		return $this->getVar('rate');
138
+	}
139
+
140
+	/**
141
+	 * @return bool
142
+	 */
143
+	public function getModulePlugin()
144
+	{
145
+		if (!$this->_modulePlugin) {
146
+			global $smartobjectRatingHandler;
147
+			$this->_modulePlugin = $smartobjectRatingHandler->pluginsObject->getPlugin($this->getVar('dirname', 'n'));
148
+		}
149
+
150
+		return $this->_modulePlugin;
151
+	}
152 152
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -117,14 +117,14 @@
 block discarded – undo
117 117
      */
118 118
     public function getItemValue()
119 119
     {
120
-        $moduleUrl      = XOOPS_URL . '/modules/' . $this->getVar('dirname', 'n') . '/';
120
+        $moduleUrl      = XOOPS_URL.'/modules/'.$this->getVar('dirname', 'n').'/';
121 121
         $plugin         = $this->getModulePlugin();
122 122
         $pluginItemInfo = $plugin->getItemInfo($this->getVar('item'));
123 123
         if (!$pluginItemInfo) {
124 124
             return '';
125 125
         }
126 126
         $itemPath = sprintf($pluginItemInfo['url'], $this->getVar('itemid'));
127
-        $ret      = '<a href="' . $moduleUrl . $itemPath . '">' . $pluginItemInfo['caption'] . '</a>';
127
+        $ret      = '<a href="'.$moduleUrl.$itemPath.'">'.$pluginItemInfo['caption'].'</a>';
128 128
 
129 129
         return $ret;
130 130
     }
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
@@ -30,17 +30,17 @@
 block discarded – undo
30 30
  */
31 31
 class SmartObjectTree extends \XoopsObjectTree
32 32
 {
33
-    public function _initialize()
34
-    {
35
-        foreach (array_keys($this->_objects) as $i) {
36
-            $key1                         = $this->_objects[$i]->getVar($this->_myId);
37
-            $this->tree[$key1]['obj']     = $this->_objects[$i];
38
-            $key2                         = $this->_objects[$i]->getVar($this->_parentId, 'e');
39
-            $this->tree[$key1]['parent']  = $key2;
40
-            $this->tree[$key2]['child'][] = $key1;
41
-            if (isset($this->_rootId)) {
42
-                $this->tree[$key1]['root'] = $this->_objects[$i]->getVar($this->_rootId);
43
-            }
44
-        }
45
-    }
33
+	public function _initialize()
34
+	{
35
+		foreach (array_keys($this->_objects) as $i) {
36
+			$key1                         = $this->_objects[$i]->getVar($this->_myId);
37
+			$this->tree[$key1]['obj']     = $this->_objects[$i];
38
+			$key2                         = $this->_objects[$i]->getVar($this->_parentId, 'e');
39
+			$this->tree[$key1]['parent']  = $key2;
40
+			$this->tree[$key2]['child'][] = $key1;
41
+			if (isset($this->_rootId)) {
42
+				$this->tree[$key1]['root'] = $this->_objects[$i]->getVar($this->_rootId);
43
+			}
44
+		}
45
+	}
46 46
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 
24 24
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
25 25
 
26
-require_once XOOPS_ROOT_PATH . '/class/tree.php';
26
+require_once XOOPS_ROOT_PATH.'/class/tree.php';
27 27
 
28 28
 /**
29 29
  * Class smartobjecttree
Please login to merge, or discard this patch.
class/SmartPersistableMlObjectHandler.php 2 patches
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -21,60 +21,60 @@
 block discarded – undo
21 21
  */
22 22
 class SmartPersistableMlObjectHandler extends Smartobject\SmartPersistableObjectHandler
23 23
 {
24
-    /**
25
-     * @param  null|\CriteriaElement  $criteria
26
-     * @param  bool $id_as_key
27
-     * @param  bool $as_object
28
-     * @param  bool $debug
29
-     * @param  bool $language
30
-     * @return array
31
-     */
32
-    public function getObjects(
33
-        \CriteriaElement $criteria = null,
34
-        $id_as_key = false,
35
-        $as_object = true,
36
-        $debug = false,
37
-        $language = false
38
-    ) {
39
-        // Create the first part of the SQL query to join the "_text" table
40
-        $sql = 'SELECT * FROM ' . $this->table . ' AS ' . $this->_itemname . ' INNER JOIN ' . $this->table . '_text AS ' . $this->_itemname . '_text ON ' . $this->_itemname . '.' . $this->keyName . '=' . $this->_itemname . '_text.' . $this->keyName;
24
+	/**
25
+	 * @param  null|\CriteriaElement  $criteria
26
+	 * @param  bool $id_as_key
27
+	 * @param  bool $as_object
28
+	 * @param  bool $debug
29
+	 * @param  bool $language
30
+	 * @return array
31
+	 */
32
+	public function getObjects(
33
+		\CriteriaElement $criteria = null,
34
+		$id_as_key = false,
35
+		$as_object = true,
36
+		$debug = false,
37
+		$language = false
38
+	) {
39
+		// Create the first part of the SQL query to join the "_text" table
40
+		$sql = 'SELECT * FROM ' . $this->table . ' AS ' . $this->_itemname . ' INNER JOIN ' . $this->table . '_text AS ' . $this->_itemname . '_text ON ' . $this->_itemname . '.' . $this->keyName . '=' . $this->_itemname . '_text.' . $this->keyName;
41 41
 
42
-        if ($language) {
43
-            // If a language was specified, then let's create a WHERE clause to only return the objects associated with this language
42
+		if ($language) {
43
+			// If a language was specified, then let's create a WHERE clause to only return the objects associated with this language
44 44
 
45
-            // if no criteria was previously created, let's create it
46
-            if (!$criteria) {
47
-                $criteria = new \CriteriaCompo();
48
-            }
49
-            $criteria->add(new \Criteria('language', $language));
45
+			// if no criteria was previously created, let's create it
46
+			if (!$criteria) {
47
+				$criteria = new \CriteriaCompo();
48
+			}
49
+			$criteria->add(new \Criteria('language', $language));
50 50
 
51
-            return parent::getObjects($criteria, $id_as_key, $as_object, $debug, $sql);
52
-        }
51
+			return parent::getObjects($criteria, $id_as_key, $as_object, $debug, $sql);
52
+		}
53 53
 
54
-        return parent::getObjects($criteria, $id_as_key, $as_object, $debug, $sql);
55
-    }
54
+		return parent::getObjects($criteria, $id_as_key, $as_object, $debug, $sql);
55
+	}
56 56
 
57
-    /**
58
-     * @param  mixed $id
59
-     * @param  bool  $language
60
-     * @param  bool  $as_object
61
-     * @param  bool  $debug
62
-     * @return mixed
63
-     */
64
-    public function &get($id, $language = false, $as_object = true, $debug = false)
65
-    {
66
-        if (!$language) {
67
-            return parent::get($id, $as_object, $debug);
68
-        } else {
69
-            $criteria = new \CriteriaCompo();
70
-            $criteria->add(new \Criteria('language', $language));
57
+	/**
58
+	 * @param  mixed $id
59
+	 * @param  bool  $language
60
+	 * @param  bool  $as_object
61
+	 * @param  bool  $debug
62
+	 * @return mixed
63
+	 */
64
+	public function &get($id, $language = false, $as_object = true, $debug = false)
65
+	{
66
+		if (!$language) {
67
+			return parent::get($id, $as_object, $debug);
68
+		} else {
69
+			$criteria = new \CriteriaCompo();
70
+			$criteria->add(new \Criteria('language', $language));
71 71
 
72
-            return parent::get($id, $as_object, $debug, $criteria);
73
-        }
74
-    }
72
+			return parent::get($id, $as_object, $debug, $criteria);
73
+		}
74
+	}
75 75
 
76
-    public function changeTableNameForML()
77
-    {
78
-        $this->table = $this->db->prefix($this->_moduleName . '_' . $this->_itemname . '_text');
79
-    }
76
+	public function changeTableNameForML()
77
+	{
78
+		$this->table = $this->db->prefix($this->_moduleName . '_' . $this->_itemname . '_text');
79
+	}
80 80
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         $language = false
38 38
     ) {
39 39
         // Create the first part of the SQL query to join the "_text" table
40
-        $sql = 'SELECT * FROM ' . $this->table . ' AS ' . $this->_itemname . ' INNER JOIN ' . $this->table . '_text AS ' . $this->_itemname . '_text ON ' . $this->_itemname . '.' . $this->keyName . '=' . $this->_itemname . '_text.' . $this->keyName;
40
+        $sql = 'SELECT * FROM '.$this->table.' AS '.$this->_itemname.' INNER JOIN '.$this->table.'_text AS '.$this->_itemname.'_text ON '.$this->_itemname.'.'.$this->keyName.'='.$this->_itemname.'_text.'.$this->keyName;
41 41
 
42 42
         if ($language) {
43 43
             // If a language was specified, then let's create a WHERE clause to only return the objects associated with this language
@@ -75,6 +75,6 @@  discard block
 block discarded – undo
75 75
 
76 76
     public function changeTableNameForML()
77 77
     {
78
-        $this->table = $this->db->prefix($this->_moduleName . '_' . $this->_itemname . '_text');
78
+        $this->table = $this->db->prefix($this->_moduleName.'_'.$this->_itemname.'_text');
79 79
     }
80 80
 }
Please login to merge, or discard this patch.