Test Failed
Push — CI ( 0f01dd...c95a04 )
by Adam
55:13
created
modules/ModuleBuilder/views/view.wizard.php 1 patch
Spacing   +147 added lines, -147 removed lines patch added patch discarded remove patch
@@ -37,27 +37,27 @@  discard block
 block discarded – undo
37 37
  * display the words  "Powered by SugarCRM" and "Supercharged by SuiteCRM".
38 38
  ********************************************************************************/
39 39
 
40
-require_once ('modules/ModuleBuilder/MB/AjaxCompose.php') ;
41
-require_once ('modules/ModuleBuilder/Module/StudioModuleFactory.php') ;
42
-require_once ('include/MVC/View/SugarView.php') ;
40
+require_once ('modules/ModuleBuilder/MB/AjaxCompose.php');
41
+require_once ('modules/ModuleBuilder/Module/StudioModuleFactory.php');
42
+require_once ('include/MVC/View/SugarView.php');
43 43
 
44 44
 class ModuleBuilderViewWizard extends SugarView
45 45
 {
46
-	private $view = null ; // the wizard view to display
47
-	private $actions ;
48
-	private $buttons ;
49
-	private $question ;
50
-	private $title ;
51
-	private $help ;
46
+	private $view = null; // the wizard view to display
47
+	private $actions;
48
+	private $buttons;
49
+	private $question;
50
+	private $title;
51
+	private $help;
52 52
 
53
-	private $editModule ;
53
+	private $editModule;
54 54
 
55 55
 	function __construct()
56 56
 	{
57
-		if ( isset ( $_REQUEST [ 'view' ] ) )
58
-			$this->view = $_REQUEST [ 'view' ] ;
57
+		if (isset ($_REQUEST ['view']))
58
+			$this->view = $_REQUEST ['view'];
59 59
 
60
-		$this->editModule = (! empty ( $_REQUEST [ 'view_module' ] ) ) ? $_REQUEST [ 'view_module' ] : null ;
60
+		$this->editModule = (!empty ($_REQUEST ['view_module'])) ? $_REQUEST ['view_module'] : null;
61 61
 		$this->buttons = array(); // initialize so that modules without subpanels for example don't result in this being unset and causing problems in the smarty->assign
62 62
 	}
63 63
 	
@@ -69,35 +69,35 @@  discard block
 block discarded – undo
69 69
 	    global $mod_strings;
70 70
 	    
71 71
     	return array(
72
-    	   translate('LBL_MODULE_NAME','Administration'),
72
+    	   translate('LBL_MODULE_NAME', 'Administration'),
73 73
     	   ModuleBuilderController::getModuleTitle(),
74 74
     	   );
75 75
     }
76 76
 
77 77
 	function display()
78 78
 	{
79
-		$this->ajax = new AjaxCompose ( ) ;
80
-		$smarty = new Sugar_Smarty ( ) ;
79
+		$this->ajax = new AjaxCompose( );
80
+		$smarty = new Sugar_Smarty( );
81 81
 
82
-		if (isset ( $_REQUEST [ 'MB' ] ))
82
+		if (isset ($_REQUEST ['MB']))
83 83
 		{
84
-			$this->processMB ( $this->ajax ) ;
84
+			$this->processMB($this->ajax);
85 85
 		} else
86 86
 		{
87 87
 
88
-				$this->processStudio ( $this->ajax ) ;
88
+				$this->processStudio($this->ajax);
89 89
 
90 90
 		}
91 91
 
92
-		$smarty->assign ( 'buttons', $this->buttons ) ;
93
-		$smarty->assign ( 'image_path', $GLOBALS [ 'image_path' ] ) ;
94
-		$smarty->assign ( "title", $this->title ) ;
95
-		$smarty->assign ( "question", $this->question ) ;
96
-		$smarty->assign ( "defaultHelp", $this->help ) ;
97
-		$smarty->assign ( "actions", $this->actions ) ;
92
+		$smarty->assign('buttons', $this->buttons);
93
+		$smarty->assign('image_path', $GLOBALS ['image_path']);
94
+		$smarty->assign("title", $this->title);
95
+		$smarty->assign("question", $this->question);
96
+		$smarty->assign("defaultHelp", $this->help);
97
+		$smarty->assign("actions", $this->actions);
98 98
 
99
-		$this->ajax->addSection ( 'center', $this->title, $smarty->fetch ( 'modules/ModuleBuilder/tpls/wizard.tpl' ) ) ;
100
-		echo $this->ajax->getJavascript () ;
99
+		$this->ajax->addSection('center', $this->title, $smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl'));
100
+		echo $this->ajax->getJavascript();
101 101
 	}
102 102
 
103 103
 	function processStudio( 
@@ -105,161 +105,161 @@  discard block
 block discarded – undo
105 105
 	    )
106 106
 	{
107 107
 
108
-		$this->ajax->addCrumb ( translate( 'LBL_STUDIO' ), 'ModuleBuilder.main("studio")' ) ;
108
+		$this->ajax->addCrumb(translate('LBL_STUDIO'), 'ModuleBuilder.main("studio")');
109 109
 
110
-		if (! isset ( $this->editModule ))
110
+		if (!isset ($this->editModule))
111 111
 		{
112 112
 			//Studio Select Module Page
113
-			$this->generateStudioModuleButtons () ;
114
-			$this->question = translate('LBL_QUESTION_EDIT') ;
115
-			$this->title = translate( 'LBL_STUDIO' );
113
+			$this->generateStudioModuleButtons();
114
+			$this->question = translate('LBL_QUESTION_EDIT');
115
+			$this->title = translate('LBL_STUDIO');
116 116
 			global $current_user;
117 117
 			if (is_admin($current_user))
118
-				$this->actions = "<input class=\"button\" type=\"button\" id=\"exportBtn\" name=\"exportBtn\" onclick=\"ModuleBuilder.getContent('module=ModuleBuilder&action=exportcustomizations');\" value=\"" . translate ( 'LBL_BTN_EXPORT' ) . '">' ;
118
+				$this->actions = "<input class=\"button\" type=\"button\" id=\"exportBtn\" name=\"exportBtn\" onclick=\"ModuleBuilder.getContent('module=ModuleBuilder&action=exportcustomizations');\" value=\"".translate('LBL_BTN_EXPORT').'">';
119 119
 
120
-			$this->help = 'studioHelp' ;
120
+			$this->help = 'studioHelp';
121 121
 		} else
122 122
 		{
123
-			$module = StudioModuleFactory::getStudioModule( $this->editModule ) ;
124
-			$this->ajax->addCrumb ( $module->name, !empty($this->view) ? 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $this->editModule . '")' : '' ) ;
125
-			switch ( $this->view )
123
+			$module = StudioModuleFactory::getStudioModule($this->editModule);
124
+			$this->ajax->addCrumb($module->name, !empty($this->view) ? 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module='.$this->editModule.'")' : '');
125
+			switch ($this->view)
126 126
 			{
127 127
 				case 'layouts':
128 128
 					//Studio Select Layout page
129
-					$this->buttons = $module->getLayouts() ;
130
-					$this->title = $module->name . " " . translate('LBL_LAYOUTS') ;
131
-					$this->question = translate( 'LBL_QUESTION_LAYOUT' ) ;
132
-					$this->help = 'layoutsHelp' ;
133
-					$this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), '' ) ;
129
+					$this->buttons = $module->getLayouts();
130
+					$this->title = $module->name." ".translate('LBL_LAYOUTS');
131
+					$this->question = translate('LBL_QUESTION_LAYOUT');
132
+					$this->help = 'layoutsHelp';
133
+					$this->ajax->addCrumb(translate('LBL_LAYOUTS'), '');
134 134
 					break;
135 135
 
136 136
 
137 137
 				case 'subpanels':
138 138
 					//Studio Select Subpanel page.
139
-					$this->buttons = $module->getSubpanels() ;
140
-					$this->title = $module->name . " " . translate( 'LBL_SUBPANELS' ) ;
141
-					$this->question = translate( 'LBL_QUESTION_SUBPANEL' ) ;
142
-					$this->ajax->addCrumb ( translate( 'LBL_SUBPANELS' ), '' ) ;
143
-					$this->help = 'subpanelHelp' ;
139
+					$this->buttons = $module->getSubpanels();
140
+					$this->title = $module->name." ".translate('LBL_SUBPANELS');
141
+					$this->question = translate('LBL_QUESTION_SUBPANEL');
142
+					$this->ajax->addCrumb(translate('LBL_SUBPANELS'), '');
143
+					$this->help = 'subpanelHelp';
144 144
 					break;
145 145
 
146 146
 				case 'search':
147 147
 					//Studio Select Search Layout page.
148
-					$this->buttons = $module->getSearch() ;
149
-					$this->title = $module->name . " " . translate('LBL_SEARCH');
150
-					$this->question = translate( 'LBL_QUESTION_SEARCH' ) ;
151
-					$this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&view_module=' . $this->editModule . '")' ) ;
152
-					$this->ajax->addCrumb ( translate( 'LBL_SEARCH' ), '' ) ;
153
-					$this->help = 'searchHelp' ;
148
+					$this->buttons = $module->getSearch();
149
+					$this->title = $module->name." ".translate('LBL_SEARCH');
150
+					$this->question = translate('LBL_QUESTION_SEARCH');
151
+					$this->ajax->addCrumb(translate('LBL_LAYOUTS'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&view_module='.$this->editModule.'")');
152
+					$this->ajax->addCrumb(translate('LBL_SEARCH'), '');
153
+					$this->help = 'searchHelp';
154 154
 					break;
155 155
 
156 156
 				case 'dashlet':
157 157
 					$this->generateStudioDashletButtons();
158
-					$this->title = $this->editModule ." " .translate('LBL_DASHLET');
159
-					$this->question = translate( 'LBL_QUESTION_DASHLET' ) ;
160
-					$this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&view_module=' . $this->editModule . '")' ) ;
161
-					$this->ajax->addCrumb ( translate( 'LBL_DASHLET' ), '' ) ;
162
-					$this->help = 'dashletHelp' ;
158
+					$this->title = $this->editModule." ".translate('LBL_DASHLET');
159
+					$this->question = translate('LBL_QUESTION_DASHLET');
160
+					$this->ajax->addCrumb(translate('LBL_LAYOUTS'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&view_module='.$this->editModule.'")');
161
+					$this->ajax->addCrumb(translate('LBL_DASHLET'), '');
162
+					$this->help = 'dashletHelp';
163 163
 					break;
164 164
 				
165 165
 				case 'popup':
166 166
 					$this->generateStudioPopupButtons();
167
-					$this->title = $this->editModule ." " .translate('LBL_POPUP');
168
-					$this->question = translate( 'LBL_QUESTION_POPUP' ) ;
169
-					$this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&view_module=' . $this->editModule . '")' ) ;
170
-					$this->ajax->addCrumb ( translate( 'LBL_POPUP' ), '' ) ;
171
-					$this->help = 'popupHelp' ;
167
+					$this->title = $this->editModule." ".translate('LBL_POPUP');
168
+					$this->question = translate('LBL_QUESTION_POPUP');
169
+					$this->ajax->addCrumb(translate('LBL_LAYOUTS'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&view_module='.$this->editModule.'")');
170
+					$this->ajax->addCrumb(translate('LBL_POPUP'), '');
171
+					$this->help = 'popupHelp';
172 172
 					break;
173 173
 				default:
174 174
 					//Studio Edit Module Page
175
-					$this->buttons = $module->getModule () ;
176
-					$this->question = translate( 'LBL_QUESTION_MODULE' ) ;
177
-					$this->title = translate( 'LBL_EDIT' ) . " " . $module->name ;
178
-					$this->help = 'moduleHelp' ;
175
+					$this->buttons = $module->getModule();
176
+					$this->question = translate('LBL_QUESTION_MODULE');
177
+					$this->title = translate('LBL_EDIT')." ".$module->name;
178
+					$this->help = 'moduleHelp';
179 179
 					global $current_user;
180 180
 					if (is_admin($current_user))
181 181
                         $this->actions = "<input class=\"button\" type=\"button\" id=\"exportBtn\" name=\"exportBtn\" " 
182 182
                         . "onclick=\"ModuleBuilder.getContent('module=ModuleBuilder&action=resetmodule&view_module=$this->editModule');\" value=\"" 
183
-                        . translate( 'LBL_RESET_MODULE' ) . '">' ;
183
+                        . translate('LBL_RESET_MODULE').'">';
184 184
 			}
185 185
 		}
186 186
 	}
187 187
 
188
-	function processMB ( 
188
+	function processMB( 
189 189
 	    $ajax 
190 190
 	    )
191 191
 	{
192
-		if (! isset ( $_REQUEST [ 'view_package' ] ))
192
+		if (!isset ($_REQUEST ['view_package']))
193 193
 		{
194
-			sugar_die ( "no ModuleBuilder package set" ) ;
194
+			sugar_die("no ModuleBuilder package set");
195 195
 		}
196 196
 
197
-		$this->editModule = $_REQUEST [ 'view_module' ] ;
198
-		$this->package = $_REQUEST [ 'view_package' ] ;
197
+		$this->editModule = $_REQUEST ['view_module'];
198
+		$this->package = $_REQUEST ['view_package'];
199 199
 
200
-		$ajax->addCrumb ( translate ( 'LBL_MODULEBUILDER', 'ModuleBuilder' ), 'ModuleBuilder.main("mb")' ) ;
201
-		$ajax->addCrumb ( $this->package, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&view_package=' . $this->package . '")' ) ;
202
-		$ajax->addCrumb ( $this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module=' . $this->editModule . '&view_package=' . $this->package . '")') ;
200
+		$ajax->addCrumb(translate('LBL_MODULEBUILDER', 'ModuleBuilder'), 'ModuleBuilder.main("mb")');
201
+		$ajax->addCrumb($this->package, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&view_package='.$this->package.'")');
202
+		$ajax->addCrumb($this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module='.$this->editModule.'&view_package='.$this->package.'")');
203 203
 
204
-		switch ( $this->view )
204
+		switch ($this->view)
205 205
 		{
206 206
 			case 'search':
207 207
 				//MB Select Search Layout page.
208
-				$this->generateMBSearchButtons () ;
209
-				$this->title = $this->editModule . " " . translate( 'LBL_SEARCH' ) ;
210
-				$this->question = translate( 'LBL_QUESTION_SEARCH' ) ;
211
-				$ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view_module=' . $this->editModule . '&view_package=' . $this->package . '")' ) ;
212
-				$ajax->addCrumb ( translate( 'LBL_SEARCH_FORMS' ), '' ) ;
213
-				$this->help = "searchHelp" ;
208
+				$this->generateMBSearchButtons();
209
+				$this->title = $this->editModule." ".translate('LBL_SEARCH');
210
+				$this->question = translate('LBL_QUESTION_SEARCH');
211
+				$ajax->addCrumb(translate('LBL_LAYOUTS'), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view_module='.$this->editModule.'&view_package='.$this->package.'")');
212
+				$ajax->addCrumb(translate('LBL_SEARCH_FORMS'), '');
213
+				$this->help = "searchHelp";
214 214
 				break;
215 215
 
216 216
 			case 'subpanel':
217 217
 				//ModuleBuilder Select Subpanel
218
-				$ajax->addCrumb ( $this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module=' . $this->editModule . '&view_package=' . $this->package . '")' ) ;
219
-				$ajax->addCrumb ( translate( 'LBL_SUBPANELS' ), '' ) ;
220
-				$this->question = translate( 'LBL_QUESTION_SUBPANEL' ) ;
221
-				$this->help = 'subpanelHelp' ;
218
+				$ajax->addCrumb($this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module='.$this->editModule.'&view_package='.$this->package.'")');
219
+				$ajax->addCrumb(translate('LBL_SUBPANELS'), '');
220
+				$this->question = translate('LBL_QUESTION_SUBPANEL');
221
+				$this->help = 'subpanelHelp';
222 222
 				break;
223 223
 
224 224
 			case 'dashlet':
225
-				$this->generateMBDashletButtons ();
226
-				$this->title = $this->editModule ." " .translate('LBL_DASHLET');
227
-				$this->question = translate( 'LBL_QUESTION_DASHLET' ) ;
228
-				$this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&MB=1&view_package='.$this->package.'&view_module=' . $this->editModule . '")' ) ;
229
-				$this->ajax->addCrumb ( translate( 'LBL_DASHLET' ), '' ) ;
230
-				$this->help = 'dashletHelp' ;
225
+				$this->generateMBDashletButtons();
226
+				$this->title = $this->editModule." ".translate('LBL_DASHLET');
227
+				$this->question = translate('LBL_QUESTION_DASHLET');
228
+				$this->ajax->addCrumb(translate('LBL_LAYOUTS'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&MB=1&view_package='.$this->package.'&view_module='.$this->editModule.'")');
229
+				$this->ajax->addCrumb(translate('LBL_DASHLET'), '');
230
+				$this->help = 'dashletHelp';
231 231
 				break;
232 232
 
233 233
 
234 234
 			case 'popup':
235 235
 				$this->generateMBPopupButtons();
236
-				$this->title = $this->editModule ." " .translate('LBL_POPUP');
237
-				$this->question = translate( 'LBL_QUESTION_POPUP' ) ;
238
-				$this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view=layouts&MB=1&view_package='.$this->package.'&view_module=' . $this->editModule . '")' ) ;
239
-				$this->ajax->addCrumb ( translate( 'LBL_POPUP' ), '' ) ;
240
-				$this->help = 'popupHelp' ;
236
+				$this->title = $this->editModule." ".translate('LBL_POPUP');
237
+				$this->question = translate('LBL_QUESTION_POPUP');
238
+				$this->ajax->addCrumb(translate('LBL_LAYOUTS'), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view=layouts&MB=1&view_package='.$this->package.'&view_module='.$this->editModule.'")');
239
+				$this->ajax->addCrumb(translate('LBL_POPUP'), '');
240
+				$this->help = 'popupHelp';
241 241
 				break;
242 242
 			default:
243
-				$ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), '' ) ;
244
-				$this->generateMBViewButtons () ;
245
-				$this->title = $this->editModule . " " . translate( 'LBL_LAYOUTS' ) ;
246
-				$this->question = translate( 'LBL_QUESTION_LAYOUT' ) ;
247
-				$this->help = "layoutsHelp" ;
243
+				$ajax->addCrumb(translate('LBL_LAYOUTS'), '');
244
+				$this->generateMBViewButtons();
245
+				$this->title = $this->editModule." ".translate('LBL_LAYOUTS');
246
+				$this->question = translate('LBL_QUESTION_LAYOUT');
247
+				$this->help = "layoutsHelp";
248 248
 		}
249 249
 	}
250 250
 
251 251
 
252 252
 	function generateStudioModuleButtons()
253 253
 	{
254
-		require_once ('modules/ModuleBuilder/Module/StudioBrowser.php') ;
255
-		$sb = new StudioBrowser ( ) ;
256
-		$sb->loadModules () ;
257
-		$nodes = $sb->getNodes () ;
258
-		$this->buttons = array ( ) ;
254
+		require_once ('modules/ModuleBuilder/Module/StudioBrowser.php');
255
+		$sb = new StudioBrowser( );
256
+		$sb->loadModules();
257
+		$nodes = $sb->getNodes();
258
+		$this->buttons = array( );
259 259
 		//$GLOBALS['log']->debug(print_r($nodes,true));
260
-		foreach ( $nodes as $module )
260
+		foreach ($nodes as $module)
261 261
 		{
262
-			$this->buttons [ $module [ 'name' ] ] = array ( 'action' => $module [ 'action' ] , 'imageTitle' => ucfirst ( $module [ 'module' ] . "_32" ) , 'size' => '32', 'linkId' => 'studiolink_'.$module [ 'module' ] ) ;
262
+			$this->buttons [$module ['name']] = array('action' => $module ['action'], 'imageTitle' => ucfirst($module ['module']."_32"), 'size' => '32', 'linkId' => 'studiolink_'.$module ['module']);
263 263
 		}
264 264
 	}
265 265
 
@@ -267,44 +267,44 @@  discard block
 block discarded – undo
267 267
 
268 268
 	function generateMBViewButtons()
269 269
 	{
270
-		$this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_EDITVIEW' ] ] = 
271
-		  array ( 
272
-		      'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_EDITVIEW."&view_module={$this->editModule}&view_package={$this->package}" , 
270
+		$this->buttons [$GLOBALS ['mod_strings'] ['LBL_EDITVIEW']] = 
271
+		  array( 
272
+		      'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_EDITVIEW."&view_module={$this->editModule}&view_package={$this->package}", 
273 273
 		      'imageTitle' => 'EditView', 
274 274
 		      'help'=>'viewBtnEditView'
275
-		  ) ;
276
-		$this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_DETAILVIEW' ] ] = 
277
-		  array ( 
278
-		      'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_DETAILVIEW."&view_module={$this->editModule}&view_package={$this->package}" , 
275
+		  );
276
+		$this->buttons [$GLOBALS ['mod_strings'] ['LBL_DETAILVIEW']] = 
277
+		  array( 
278
+		      'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_DETAILVIEW."&view_module={$this->editModule}&view_package={$this->package}", 
279 279
 		      'imageTitle' => 'DetailView', 
280 280
 		      'help'=>'viewBtnListView'  
281
-		  ) ;
282
-		$this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_LISTVIEW' ] ] = 
283
-		  array ( 
284
-		      'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_LISTVIEW."&view_module={$this->editModule}&view_package={$this->package}" , 
281
+		  );
282
+		$this->buttons [$GLOBALS ['mod_strings'] ['LBL_LISTVIEW']] = 
283
+		  array( 
284
+		      'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_LISTVIEW."&view_module={$this->editModule}&view_package={$this->package}", 
285 285
 		      'imageTitle' => 'ListView', 
286 286
 		      'help'=>'viewBtnListView' 
287
-		  ) ;
288
-		  $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_QUICKCREATE' ] ] = 
289
-		  array ( 
290
-		      'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_QUICKCREATE."&view_module={$this->editModule}&view_package={$this->package}" , 
287
+		  );
288
+		  $this->buttons [$GLOBALS ['mod_strings'] ['LBL_QUICKCREATE']] = 
289
+		  array( 
290
+		      'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_QUICKCREATE."&view_module={$this->editModule}&view_package={$this->package}", 
291 291
 		      'imageTitle' => 'QuickCreate', 
292 292
 		      'help'=>'viewBtnQuickCreate' 
293
-		  ) ;
294
-		$this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_SEARCH' ] ] = 
295
-		  array (
296
-		      'action' => "module=ModuleBuilder&MB=true&action=wizard&view=search&view_module={$this->editModule}&view_package={$this->package}" , 
297
-		      'imageTitle' => 'SearchForm' , 
293
+		  );
294
+		$this->buttons [$GLOBALS ['mod_strings'] ['LBL_SEARCH']] = 
295
+		  array(
296
+		      'action' => "module=ModuleBuilder&MB=true&action=wizard&view=search&view_module={$this->editModule}&view_package={$this->package}", 
297
+		      'imageTitle' => 'SearchForm', 
298 298
 		      'help'=> 'searchBtn' 
299
-		  ) ;
300
-		$this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_DASHLET' ] ] = 
301
-		  array ( 
302
-		      'action' => "module=ModuleBuilder&MB=true&action=wizard&view=dashlet&view_module={$this->editModule}&view_package={$this->package}" , 
299
+		  );
300
+		$this->buttons [$GLOBALS ['mod_strings'] ['LBL_DASHLET']] = 
301
+		  array( 
302
+		      'action' => "module=ModuleBuilder&MB=true&action=wizard&view=dashlet&view_module={$this->editModule}&view_package={$this->package}", 
303 303
 		      'imageTitle' => 'Dashlet', 
304 304
 		      'help'=>'viewBtnDashlet' 
305
-		  ) ;
306
-		$this->buttons [ $GLOBALS [ 'mod_strings' ] ['LBL_POPUP'] ] = 
307
-		array ( 
305
+		  );
306
+		$this->buttons [$GLOBALS ['mod_strings'] ['LBL_POPUP']] = 
307
+		array( 
308 308
 			'imageTitle' => 'Popup',  
309 309
 			'action' => "module=ModuleBuilder&MB=true&action=wizard&view=popup&view_module={$this->editModule}&view_package={$this->package}", 
310 310
 			'help'=>'PopupListViewBtn'
@@ -313,31 +313,31 @@  discard block
 block discarded – undo
313 313
 
314 314
 	function generateMBDashletButtons() 
315 315
 	{
316
-		$this->buttons [ $GLOBALS [ 'mod_strings' ][ 'LBL_DASHLETLISTVIEW' ] ] = array('action'=> "module=ModuleBuilder&MB=true&action=editLayout&view=dashlet&view_module={$this->editModule}&view_package={$this->package}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_DASHLETLISTVIEW'], 'imageName'=>'ListView', 'help'=>'DashletListViewBtn');
317
-		$this->buttons [ $GLOBALS [ 'mod_strings' ][ 'LBL_DASHLETSEARCHVIEW' ] ] = array('action'=> "module=ModuleBuilder&MB=true&action=editLayout&view=dashletsearch&view_module={$this->editModule}&view_package={$this->package}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_DASHLETSEARCHVIEW'], 'imageName'=>'BasicSearch','help'=> 'DashletSearchViewBtn');
316
+		$this->buttons [$GLOBALS ['mod_strings']['LBL_DASHLETLISTVIEW']] = array('action'=> "module=ModuleBuilder&MB=true&action=editLayout&view=dashlet&view_module={$this->editModule}&view_package={$this->package}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_DASHLETLISTVIEW'], 'imageName'=>'ListView', 'help'=>'DashletListViewBtn');
317
+		$this->buttons [$GLOBALS ['mod_strings']['LBL_DASHLETSEARCHVIEW']] = array('action'=> "module=ModuleBuilder&MB=true&action=editLayout&view=dashletsearch&view_module={$this->editModule}&view_package={$this->package}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_DASHLETSEARCHVIEW'], 'imageName'=>'BasicSearch', 'help'=> 'DashletSearchViewBtn');
318 318
 	}
319 319
 	
320 320
 	function generateMBPopupButtons() 
321 321
 	{
322
-		$this->buttons [ $GLOBALS [ 'mod_strings' ][ 'LBL_POPUPLISTVIEW' ] ] = array('action'=> "module=ModuleBuilder&action=editLayout&view=popuplist&view_module={$this->editModule}&view_package={$this->package}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_POPUPLISTVIEW'], 'imageName'=>'ListView', 'help'=>'PopupListViewBtn');
323
-		$this->buttons [ $GLOBALS [ 'mod_strings' ][ 'LBL_POPUPSEARCH' ] ] = array('action'=> "module=ModuleBuilder&action=editLayout&view=popupsearch&view_module={$this->editModule}&view_package={$this->package}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_POPUPSEARCH'], 'imageName'=>'BasicSearch','help'=> 'PopupSearchViewBtn');
322
+		$this->buttons [$GLOBALS ['mod_strings']['LBL_POPUPLISTVIEW']] = array('action'=> "module=ModuleBuilder&action=editLayout&view=popuplist&view_module={$this->editModule}&view_package={$this->package}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_POPUPLISTVIEW'], 'imageName'=>'ListView', 'help'=>'PopupListViewBtn');
323
+		$this->buttons [$GLOBALS ['mod_strings']['LBL_POPUPSEARCH']] = array('action'=> "module=ModuleBuilder&action=editLayout&view=popupsearch&view_module={$this->editModule}&view_package={$this->package}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_POPUPSEARCH'], 'imageName'=>'BasicSearch', 'help'=> 'PopupSearchViewBtn');
324 324
 	}
325 325
 	
326 326
 	function generateStudioDashletButtons() 
327 327
 	{
328
-		$this->buttons [ $GLOBALS [ 'mod_strings' ][ 'LBL_DASHLETLISTVIEW' ] ] = array('action'=> "module=ModuleBuilder&action=editLayout&view=dashlet&view_module={$this->editModule}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_DASHLETLISTVIEW'], 'imageName'=>'ListView', 'help'=>'DashletListViewBtn');
329
-		$this->buttons [ $GLOBALS [ 'mod_strings' ][ 'LBL_DASHLETSEARCHVIEW' ] ] = array('action'=> "module=ModuleBuilder&action=editLayout&view=dashletsearch&view_module={$this->editModule}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_DASHLETSEARCHVIEW'], 'imageName'=>'BasicSearch','help'=> 'DashletSearchViewBtn');
328
+		$this->buttons [$GLOBALS ['mod_strings']['LBL_DASHLETLISTVIEW']] = array('action'=> "module=ModuleBuilder&action=editLayout&view=dashlet&view_module={$this->editModule}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_DASHLETLISTVIEW'], 'imageName'=>'ListView', 'help'=>'DashletListViewBtn');
329
+		$this->buttons [$GLOBALS ['mod_strings']['LBL_DASHLETSEARCHVIEW']] = array('action'=> "module=ModuleBuilder&action=editLayout&view=dashletsearch&view_module={$this->editModule}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_DASHLETSEARCHVIEW'], 'imageName'=>'BasicSearch', 'help'=> 'DashletSearchViewBtn');
330 330
 	}
331 331
 	
332 332
 	function generateStudioPopupButtons()
333 333
 	{
334
-		$this->buttons [ $GLOBALS [ 'mod_strings' ][ 'LBL_POPUPLISTVIEW' ] ] = array('action'=> "module=ModuleBuilder&action=editLayout&view=popuplist&view_module={$this->editModule}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_POPUPLISTVIEW'], 'imageName'=>'ListView', 'help'=>'PopupListViewBtn');
335
-		$this->buttons [ $GLOBALS [ 'mod_strings' ][ 'LBL_POPUPSEARCH' ] ] = array('action'=> "module=ModuleBuilder&action=editLayout&view=popupsearch&view_module={$this->editModule}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_POPUPSEARCH'], 'imageName'=>'BasicSearch','help'=> 'PopupSearchViewBtn');
334
+		$this->buttons [$GLOBALS ['mod_strings']['LBL_POPUPLISTVIEW']] = array('action'=> "module=ModuleBuilder&action=editLayout&view=popuplist&view_module={$this->editModule}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_POPUPLISTVIEW'], 'imageName'=>'ListView', 'help'=>'PopupListViewBtn');
335
+		$this->buttons [$GLOBALS ['mod_strings']['LBL_POPUPSEARCH']] = array('action'=> "module=ModuleBuilder&action=editLayout&view=popupsearch&view_module={$this->editModule}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_POPUPSEARCH'], 'imageName'=>'BasicSearch', 'help'=> 'PopupSearchViewBtn');
336 336
 	}
337 337
 	
338 338
 	function generateMBSearchButtons()
339 339
 	{
340
-		$this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_BASIC' ] ] = array ( 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view_module={$this->editModule}&view_package={$this->package}&view=SearchView&searchlayout=basic_search" , 'imageTitle' => $GLOBALS [ 'mod_strings' ] [ 'LBL_BASIC_SEARCH' ] , 'imageName' => 'BasicSearch','help' => "BasicSearchBtn" ) ;
341
-		$this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_ADVANCED' ] ] = array ( 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view_module={$this->editModule}&view_package={$this->package}&view=SearchView&searchlayout=advanced_search" , 'imageTitle' => $GLOBALS [ 'mod_strings' ] [ 'LBL_ADVANCED_SEARCH' ] , 'imageName' => 'AdvancedSearch','help' => "AdvancedSearchBtn" ) ;
340
+		$this->buttons [$GLOBALS ['mod_strings'] ['LBL_BASIC']] = array('action' => "module=ModuleBuilder&MB=true&action=editLayout&view_module={$this->editModule}&view_package={$this->package}&view=SearchView&searchlayout=basic_search", 'imageTitle' => $GLOBALS ['mod_strings'] ['LBL_BASIC_SEARCH'], 'imageName' => 'BasicSearch', 'help' => "BasicSearchBtn");
341
+		$this->buttons [$GLOBALS ['mod_strings'] ['LBL_ADVANCED']] = array('action' => "module=ModuleBuilder&MB=true&action=editLayout&view_module={$this->editModule}&view_package={$this->package}&view=SearchView&searchlayout=advanced_search", 'imageTitle' => $GLOBALS ['mod_strings'] ['LBL_ADVANCED_SEARCH'], 'imageName' => 'AdvancedSearch', 'help' => "AdvancedSearchBtn");
342 342
 	}
343 343
 }
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.main.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
 class ViewMain extends SugarView
42 42
 { 	
43
- 	function ViewMain(){
43
+ 	function ViewMain() {
44 44
 		$this->options['show_footer'] = true;
45 45
  		parent::SugarView();
46 46
  	}
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	    global $mod_strings;
54 54
 	    
55 55
     	return array(
56
-    	   translate('LBL_MODULE_NAME','Administration'),
56
+    	   translate('LBL_MODULE_NAME', 'Administration'),
57 57
     	   ModuleBuilderController::getModuleTitle(),
58 58
     	   );
59 59
     }
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 		global $app_strings, $current_user, $mod_strings, $theme;
64 64
 
65 65
  		$smarty = new Sugar_Smarty();
66
- 		$type = (!empty($_REQUEST['type']))?$_REQUEST['type']:'main';
66
+ 		$type = (!empty($_REQUEST['type'])) ? $_REQUEST['type'] : 'main';
67 67
  		$mbt = false;
68 68
  		$admin = false;
69 69
  		$mb = strtolower($type);
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
  		$smarty->assign('app_strings', $app_strings);
72 72
  		$smarty->assign('mod', $mod_strings);
73 73
  		//Replaced by javascript function "setMode"
74
- 		switch($type){
74
+ 		switch ($type) {
75 75
  			case 'studio':
76 76
  				//$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")');
77 77
  				require_once('modules/ModuleBuilder/Module/StudioTree.php');
@@ -95,20 +95,20 @@  discard block
 block discarded – undo
95 95
  		$smarty->assign('TEST_STUDIO', displayStudioForCurrentUser());
96 96
  		$smarty->assign('ADMIN', is_admin($current_user));
97 97
  		$smarty->display('modules/ModuleBuilder/tpls/includes.tpl');
98
-		if($mbt)
98
+		if ($mbt)
99 99
 		{
100
-			$smarty->assign('TREE',$mbt->fetch());
100
+			$smarty->assign('TREE', $mbt->fetch());
101 101
 			$smarty->assign('TREElabel', $mbt->getName());
102 102
 		}
103 103
 		$userPref = $current_user->getPreference('mb_assist', 'Assistant');
104
-		if(!$userPref) $userPref="na"; 
105
-		$smarty->assign('userPref',$userPref);
104
+		if (!$userPref) $userPref = "na"; 
105
+		$smarty->assign('userPref', $userPref);
106 106
 		
107 107
 		///////////////////////////////////
108 108
 	    require_once('include/SugarTinyMCE.php');
109 109
 	    $tiny = new SugarTinyMCE();
110
-	    $tiny->defaultConfig['width']=300;
111
-	    $tiny->defaultConfig['height']=300;
110
+	    $tiny->defaultConfig['width'] = 300;
111
+	    $tiny->defaultConfig['height'] = 300;
112 112
 	    $tiny->buttonConfig = "code,separator,bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,
113 113
 	                         justifyfull,separator,forecolor,backcolor,
114 114
 	                         ";
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.relationships.php 1 patch
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -37,11 +37,11 @@  discard block
 block discarded – undo
37 37
  * display the words  "Powered by SugarCRM" and "Supercharged by SuiteCRM".
38 38
  ********************************************************************************/
39 39
 
40
-require_once ('modules/ModuleBuilder/MB/AjaxCompose.php') ;
41
-require_once ('modules/ModuleBuilder/MB/ModuleBuilder.php') ;
42
-require_once ('modules/ModuleBuilder/views/view.relationship.php') ;
43
-require_once ('modules/ModuleBuilder/Module/StudioModule.php') ;
44
-require_once ('modules/ModuleBuilder/Module/StudioBrowser.php') ;
40
+require_once ('modules/ModuleBuilder/MB/AjaxCompose.php');
41
+require_once ('modules/ModuleBuilder/MB/ModuleBuilder.php');
42
+require_once ('modules/ModuleBuilder/views/view.relationship.php');
43
+require_once ('modules/ModuleBuilder/Module/StudioModule.php');
44
+require_once ('modules/ModuleBuilder/Module/StudioBrowser.php');
45 45
 
46 46
 class ViewRelationships extends SugarView
47 47
 {
@@ -53,103 +53,103 @@  discard block
 block discarded – undo
53 53
 	    global $mod_strings;
54 54
 	    
55 55
     	return array(
56
-    	   translate('LBL_MODULE_NAME','Administration'),
56
+    	   translate('LBL_MODULE_NAME', 'Administration'),
57 57
     	   ModuleBuilderController::getModuleTitle(),
58 58
     	   );
59 59
     }
60 60
 
61 61
     function display()
62 62
     {
63
-        $moduleName = ! empty ( $_REQUEST [ 'view_module' ] ) ? $_REQUEST [ 'view_module' ] : $_REQUEST [ 'edit_module' ] ;
64
-        $smarty = new Sugar_Smarty ( ) ;
63
+        $moduleName = !empty ($_REQUEST ['view_module']) ? $_REQUEST ['view_module'] : $_REQUEST ['edit_module'];
64
+        $smarty = new Sugar_Smarty( );
65 65
         // set the mod_strings as we can be called after doing a Repair and the mod_strings are set to Administration
66 66
         $GLOBALS['mod_strings'] = return_module_language($GLOBALS['current_language'], 'ModuleBuilder');
67
-        $smarty->assign ( 'mod_strings', $GLOBALS [ 'mod_strings' ] ) ;
68
-        $smarty->assign ( 'view_module', $moduleName ) ;
67
+        $smarty->assign('mod_strings', $GLOBALS ['mod_strings']);
68
+        $smarty->assign('view_module', $moduleName);
69 69
 
70
-        $ajax = new AjaxCompose ( ) ;
71
-        $json = getJSONobj () ;
72
-		$this->fromModuleBuilder = !empty ( $_REQUEST [ 'MB' ] ) || (!empty($_REQUEST['view_package']) && $_REQUEST['view_package'] != 'studio') ;
70
+        $ajax = new AjaxCompose( );
71
+        $json = getJSONobj();
72
+		$this->fromModuleBuilder = !empty ($_REQUEST ['MB']) || (!empty($_REQUEST['view_package']) && $_REQUEST['view_package'] != 'studio');
73 73
         $smarty->assign('fromModuleBuilder', $this->fromModuleBuilder);
74 74
         if (!$this->fromModuleBuilder)
75 75
         {
76
-            $smarty->assign ( 'view_package', '' ) ;
76
+            $smarty->assign('view_package', '');
77 77
 
78
-            $relationships = new DeployedRelationships ( $moduleName ) ;
79
-            $ajaxRelationships = $this->getAjaxRelationships( $relationships ) ;
80
-            $smarty->assign ( 'relationships', $json->encode ( $ajaxRelationships ) ) ;
81
-            $smarty->assign ( 'empty', (sizeof ( $ajaxRelationships ) == 0) ) ;
82
-            $smarty->assign ( 'studio', true ) ;
78
+            $relationships = new DeployedRelationships($moduleName);
79
+            $ajaxRelationships = $this->getAjaxRelationships($relationships);
80
+            $smarty->assign('relationships', $json->encode($ajaxRelationships));
81
+            $smarty->assign('empty', (sizeof($ajaxRelationships) == 0));
82
+            $smarty->assign('studio', true);
83 83
 
84 84
             //crumb
85
-            global $app_list_strings ;
86
-            $moduleNames = array_change_key_case ( $app_list_strings [ 'moduleList' ] ) ;
87
-            $translatedModule = $moduleNames [ strtolower ( $moduleName ) ] ;
88
-            $ajax->addCrumb ( translate('LBL_STUDIO'), 'ModuleBuilder.main("studio")' ) ;
89
-            $ajax->addCrumb ( $translatedModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $moduleName . '")' ) ;
90
-            $ajax->addCrumb ( translate('LBL_RELATIONSHIPS'), '' ) ;
91
-            $ajax->addSection ( 'center', $moduleName . ' ' . translate('LBL_RELATIONSHIPS'), $this->fetchTemplate($smarty, 'modules/ModuleBuilder/tpls/studioRelationships.tpl'));
85
+            global $app_list_strings;
86
+            $moduleNames = array_change_key_case($app_list_strings ['moduleList']);
87
+            $translatedModule = $moduleNames [strtolower($moduleName)];
88
+            $ajax->addCrumb(translate('LBL_STUDIO'), 'ModuleBuilder.main("studio")');
89
+            $ajax->addCrumb($translatedModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module='.$moduleName.'")');
90
+            $ajax->addCrumb(translate('LBL_RELATIONSHIPS'), '');
91
+            $ajax->addSection('center', $moduleName.' '.translate('LBL_RELATIONSHIPS'), $this->fetchTemplate($smarty, 'modules/ModuleBuilder/tpls/studioRelationships.tpl'));
92 92
 
93 93
         } else
94 94
         {
95
-            $smarty->assign ( 'view_package', $_REQUEST [ 'view_package' ] ) ;
95
+            $smarty->assign('view_package', $_REQUEST ['view_package']);
96 96
 
97
-            $mb = new ModuleBuilder ( ) ;
98
-            $module = & $mb->getPackageModule ( $_REQUEST [ 'view_package' ], $_REQUEST [ 'view_module' ] ) ;
99
-            $package = $mb->packages [ $_REQUEST [ 'view_package' ] ] ;
97
+            $mb = new ModuleBuilder( );
98
+            $module = & $mb->getPackageModule($_REQUEST ['view_package'], $_REQUEST ['view_module']);
99
+            $package = $mb->packages [$_REQUEST ['view_package']];
100 100
 			$package->loadModuleTitles();
101
-            $relationships = new UndeployedRelationships ( $module->getModuleDir () ) ;
102
-            $ajaxRelationships = $this->getAjaxRelationships( $relationships ) ;
103
-            $smarty->assign ( 'relationships', $json->encode ( $ajaxRelationships ) ) ;
104
-            $smarty->assign ( 'empty', (sizeof ( $ajaxRelationships ) == 0) ) ;
101
+            $relationships = new UndeployedRelationships($module->getModuleDir());
102
+            $ajaxRelationships = $this->getAjaxRelationships($relationships);
103
+            $smarty->assign('relationships', $json->encode($ajaxRelationships));
104
+            $smarty->assign('empty', (sizeof($ajaxRelationships) == 0));
105 105
 
106
-            $module->help [ 'default' ] = (empty ( $_REQUEST [ 'view_module' ] )) ? 'create' : 'modify' ;
107
-            $module->help [ 'group' ] = 'module' ;
106
+            $module->help ['default'] = (empty ($_REQUEST ['view_module'])) ? 'create' : 'modify';
107
+            $module->help ['group'] = 'module';
108 108
 
109
-            $ajax->addCrumb ( translate('LBL_MODULEBUILDER'), 'ModuleBuilder.main("mb")' ) ;
110
-            $ajax->addCrumb ( $package->name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=' . $package->name . '")' ) ;
111
-            $ajax->addCrumb ( $moduleName, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package=' . $package->name . '&view_module=' . $moduleName . '")' ) ;
112
-            $ajax->addCrumb ( translate('LBL_RELATIONSHIPS'), '' ) ;
113
-            $ajax->addSection ( 'center', $moduleName . ' ' . translate('LBL_RELATIONSHIPS'), $this->fetchTemplate($smarty, 'modules/ModuleBuilder/tpls/studioRelationships.tpl'));
109
+            $ajax->addCrumb(translate('LBL_MODULEBUILDER'), 'ModuleBuilder.main("mb")');
110
+            $ajax->addCrumb($package->name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$package->name.'")');
111
+            $ajax->addCrumb($moduleName, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package='.$package->name.'&view_module='.$moduleName.'")');
112
+            $ajax->addCrumb(translate('LBL_RELATIONSHIPS'), '');
113
+            $ajax->addSection('center', $moduleName.' '.translate('LBL_RELATIONSHIPS'), $this->fetchTemplate($smarty, 'modules/ModuleBuilder/tpls/studioRelationships.tpl'));
114 114
         }
115
-        echo $ajax->getJavascript () ;
115
+        echo $ajax->getJavascript();
116 116
     }
117 117
 
118 118
     /*
119 119
      * Encode the relationships for this module for display in the Ext grid layout
120 120
      */
121
-    function getAjaxRelationships ( $relationships )
121
+    function getAjaxRelationships($relationships)
122 122
     {
123
-        $ajaxrels = array ( ) ;
124
-        foreach ( $relationships->getRelationshipList () as $relationshipName )
123
+        $ajaxrels = array( );
124
+        foreach ($relationships->getRelationshipList() as $relationshipName)
125 125
         {
126
-            $rel = $relationships->get ( $relationshipName )->getDefinition () ;
127
-            $rel [ 'lhs_module' ] = translate( $rel [ 'lhs_module' ] ) ;
128
-            $rel [ 'rhs_module' ] = translate( $rel [ 'rhs_module' ] ) ;
126
+            $rel = $relationships->get($relationshipName)->getDefinition();
127
+            $rel ['lhs_module'] = translate($rel ['lhs_module']);
128
+            $rel ['rhs_module'] = translate($rel ['rhs_module']);
129 129
             
130 130
             //#28668  , translate the relationship type before render it .
131
-            switch($rel['relationship_type']){
131
+            switch ($rel['relationship_type']) {
132 132
             	case 'one-to-one':
133
-            	$rel['relationship_type']  = translate ( 'LBL_ONETOONE' );
133
+            	$rel['relationship_type']  = translate('LBL_ONETOONE');
134 134
             	break;
135 135
             	case 'one-to-many':
136
-            	$rel['relationship_type']  = translate ( 'LBL_ONETOMANY' );
136
+            	$rel['relationship_type']  = translate('LBL_ONETOMANY');
137 137
             	break;
138 138
             	case 'many-to-one':
139
-            	$rel['relationship_type']  = translate ( 'LBL_MANYTOONE' );
139
+            	$rel['relationship_type']  = translate('LBL_MANYTOONE');
140 140
             	break;
141 141
             	case 'many-to-many':
142
-            	$rel['relationship_type']  = translate ( 'LBL_MANYTOMANY' );
142
+            	$rel['relationship_type']  = translate('LBL_MANYTOMANY');
143 143
             	break;
144
-            	default: $rel['relationship_type']  = '';
144
+            	default: $rel['relationship_type'] = '';
145 145
             }
146
-            $rel [ 'name' ] = $relationshipName ;
147
-            if ($rel [ 'is_custom' ] && isset($rel [ 'from_studio' ]) && $rel [ 'from_studio' ]) {
148
-            	$rel [ 'name' ] = $relationshipName . "*";
146
+            $rel ['name'] = $relationshipName;
147
+            if ($rel ['is_custom'] && isset($rel ['from_studio']) && $rel ['from_studio']) {
148
+            	$rel ['name'] = $relationshipName."*";
149 149
             }
150
-            $ajaxrels [] = $rel ;
150
+            $ajaxrels [] = $rel;
151 151
         }
152
-        return $ajaxrels ;
152
+        return $ajaxrels;
153 153
     }
154 154
 
155 155
     /**
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.deletemodule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	    global $mod_strings;
51 51
 	    
52 52
     	return array(
53
-    	   translate('LBL_MODULE_NAME','Administration'),
53
+    	   translate('LBL_MODULE_NAME', 'Administration'),
54 54
     	   ModuleBuilderController::getModuleTitle(),
55 55
     	   );
56 56
     }
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	function display()
59 59
 	{
60 60
  		$ajax = new AjaxCompose();
61
-		$ajax->addSection('center', 'Module Deleted', $_REQUEST['module'] . ' was deleted from ' . $_REQUEST['package']);
61
+		$ajax->addSection('center', 'Module Deleted', $_REQUEST['module'].' was deleted from '.$_REQUEST['package']);
62 62
 		echo $ajax->getJavascript(); 
63 63
  	}
64 64
 }
65 65
\ No newline at end of file
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.dropdown.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	    global $mod_strings;
50 50
 	    
51 51
     	return array(
52
-    	   translate('LBL_MODULE_NAME','Administration'),
52
+    	   translate('LBL_MODULE_NAME', 'Administration'),
53 53
     	   ModuleBuilderController::getModuleTitle(),
54 54
     	   );
55 55
     }
@@ -64,57 +64,57 @@  discard block
 block discarded – undo
64 64
 			require_once ('modules/ModuleBuilder/Module/DropDownTree.php');
65 65
 			$mbt = new DropDownTree();
66 66
 			$ajax->addSection('west', $mbt->getName(), $mbt->fetchNodes());
67
-			$smarty->assign('refreshTree',true);
67
+			$smarty->assign('refreshTree', true);
68 68
 		}
69 69
 
70 70
         global $mod_strings;
71 71
 
72
- 		$smarty->assign('deleteImage', SugarThemeRegistry::current()->getImage( 'delete_inline', '',null,null,'.gif',$mod_strings['LBL_MB_DELETE']));
73
-		$smarty->assign('editImage', SugarThemeRegistry::current()->getImage( 'edit_inline', ''
74
-,null,null,'.gif',$mod_strings['LBL_EDIT']));
72
+ 		$smarty->assign('deleteImage', SugarThemeRegistry::current()->getImage('delete_inline', '', null, null, '.gif', $mod_strings['LBL_MB_DELETE']));
73
+		$smarty->assign('editImage', SugarThemeRegistry::current()->getImage('edit_inline', ''
74
+,null, null, '.gif', $mod_strings['LBL_EDIT']));
75 75
 		$smarty->assign('action', 'savedropdown');
76 76
 		$body = $smarty->fetch('modules/ModuleBuilder/tpls/MBModule/dropdown.tpl');
77
-		$ajax->addSection('east2', $mod_strings['LBL_SECTION_DROPDOWNED'], $body );
77
+		$ajax->addSection('east2', $mod_strings['LBL_SECTION_DROPDOWNED'], $body);
78 78
  		echo $ajax->getJavascript();
79 79
  	}
80 80
  	
81 81
  	function generateSmarty()
82 82
  	{
83 83
 		//get the selected language
84
-		$selected_lang = (!empty($_REQUEST['dropdown_lang'])?$_REQUEST['dropdown_lang']:$_SESSION['authenticated_user_language']);
84
+		$selected_lang = (!empty($_REQUEST['dropdown_lang']) ? $_REQUEST['dropdown_lang'] : $_SESSION['authenticated_user_language']);
85 85
 		$vardef = array();
86 86
 		$package_name = 'studio';
87 87
 		$package_strings = array();
88
-		$new =false;
89
-		$my_list_strings = return_app_list_strings_language( $selected_lang ) ;
88
+		$new = false;
89
+		$my_list_strings = return_app_list_strings_language($selected_lang);
90 90
 //		$my_list_strings = $GLOBALS['app_list_strings'];
91 91
 
92 92
         $smarty = new Sugar_Smarty();
93 93
 		      
94 94
 		//if we are using ModuleBuilder then process the following
95
-		if(!empty($_REQUEST['view_package']) && $_REQUEST['view_package'] != 'studio'){
95
+		if (!empty($_REQUEST['view_package']) && $_REQUEST['view_package'] != 'studio') {
96 96
 			require_once('modules/ModuleBuilder/MB/ModuleBuilder.php');
97 97
 			$mb = new ModuleBuilder();
98 98
 			$module = $mb->getPackageModule($_REQUEST['view_package'], $_REQUEST['view_module']);
99 99
 			$package = $mb->packages[$_REQUEST['view_package']];
100 100
 			$package_name = $package->name;
101 101
 			$module->getVardefs();
102
-			if(empty($_REQUEST['dropdown_name']) && !empty($_REQUEST['field'])){
102
+			if (empty($_REQUEST['dropdown_name']) && !empty($_REQUEST['field'])) {
103 103
 				$new = true;
104
-				$_REQUEST['dropdown_name'] = $_REQUEST['field']. '_list';
104
+				$_REQUEST['dropdown_name'] = $_REQUEST['field'].'_list';
105 105
 			}
106 106
 			
107
-			$vardef = (!empty($module->mbvardefs->fields[$_REQUEST['dropdown_name']]))? $module->mbvardefs->fields[$_REQUEST['dropdown_name']]: array();
108
-			$module->mblanguage->generateAppStrings(false) ;
109
-            $my_list_strings = array_merge( $my_list_strings, $module->mblanguage->appListStrings[$selected_lang.'.lang.php'] );
107
+			$vardef = (!empty($module->mbvardefs->fields[$_REQUEST['dropdown_name']])) ? $module->mbvardefs->fields[$_REQUEST['dropdown_name']] : array();
108
+			$module->mblanguage->generateAppStrings(false);
109
+            $my_list_strings = array_merge($my_list_strings, $module->mblanguage->appListStrings[$selected_lang.'.lang.php']);
110 110
             $smarty->assign('module_name', $module->name);
111 111
 		}
112 112
 
113
-        $module_name = !empty($module->name) ?  $module->name : '';
114
-        $module_name = (empty($module_name) && !empty($_REQUEST['view_module'])) ?  $_REQUEST['view_module'] : $module_name;
113
+        $module_name = !empty($module->name) ? $module->name : '';
114
+        $module_name = (empty($module_name) && !empty($_REQUEST['view_module'])) ? $_REQUEST['view_module'] : $module_name;
115 115
 
116
-		foreach($my_list_strings as $key=>$value){
117
-			if(!is_array($value)){
116
+		foreach ($my_list_strings as $key=>$value) {
117
+			if (!is_array($value)) {
118 118
 				unset($my_list_strings[$key]);
119 119
 			}
120 120
 		}
@@ -129,29 +129,29 @@  discard block
 block discarded – undo
129 129
 
130 130
 		$json = getJSONobj();
131 131
 
132
-		if(!empty($_REQUEST['dropdown_name']) && !$new){
132
+		if (!empty($_REQUEST['dropdown_name']) && !$new) {
133 133
 			$name = $_REQUEST['dropdown_name'];
134 134
 			
135 135
 			// handle the case where we've saved a dropdown in one language, and now attempt to edit it for another language. The $name exists, but $my_list_strings[$name] doesn't
136 136
             // for now, we just treat it as if it was new. A better approach might be to use the first language version as a template for future languages
137 137
             if (!isset($my_list_strings[$name]))
138
-                $my_list_strings[$name] = array () ;
138
+                $my_list_strings[$name] = array();
139 139
  
140 140
 			$selected_dropdown = (!empty($vardef['options']) && !empty($my_list_strings[$vardef['options']])) ? $my_list_strings[$vardef['options']] : $my_list_strings[$name];
141 141
 			$smarty->assign('ul_list', 'list = '.$json->encode(array_keys($selected_dropdown)));
142 142
 			$smarty->assign('dropdown_name', (!empty($vardef['options']) ? $vardef['options'] : $_REQUEST['dropdown_name']));
143 143
 			$smarty->assign('name', $_REQUEST['dropdown_name']);
144 144
 			$smarty->assign('options', $selected_dropdown);
145
-		}else{
145
+		} else {
146 146
 			$smarty->assign('ul_list', 'list = {}');
147 147
 			//we should try to find a name for this dropdown based on the field name.
148 148
 			$pre_pop_name = '';
149
-			if(!empty($_REQUEST['field']))
149
+			if (!empty($_REQUEST['field']))
150 150
 				$pre_pop_name = $_REQUEST['field'];
151 151
 			//ensure this dropdown name does not already exist
152 152
 			$use_name = $pre_pop_name.'_list';
153
-			for($i = 0; $i < 100; $i++){
154
-				if(empty($my_list_strings[$use_name]))
153
+			for ($i = 0; $i < 100; $i++) {
154
+				if (empty($my_list_strings[$use_name]))
155 155
 					break;
156 156
 				else
157 157
 					$use_name = $pre_pop_name.'_'.$i;
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 		$smarty->assign('APP', $GLOBALS['app_strings']);
164 164
 		$smarty->assign('MOD', $GLOBALS['mod_strings']);
165 165
 		$smarty->assign('selected_lang', $selected_lang);
166
-		$smarty->assign('available_languages',get_languages());
166
+		$smarty->assign('available_languages', get_languages());
167 167
 		$smarty->assign('package_name', $package_name);
168 168
  		return $smarty;
169 169
  	}
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.listview.php 1 patch
Spacing   +125 added lines, -125 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (! defined ( 'sugarEntry' ) || ! sugarEntry)
3
-    die ( 'Not A Valid Entry Point' ) ;
2
+if (!defined('sugarEntry') || !sugarEntry)
3
+    die ('Not A Valid Entry Point');
4 4
 /*********************************************************************************
5 5
  * SugarCRM Community Edition is a customer relationship management program developed by
6 6
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
  ********************************************************************************/
41 41
 
42 42
 
43
-require_once 'modules/ModuleBuilder/parsers/constants.php' ;
44
-require_once ('include/SubPanel/SubPanel.php') ;
43
+require_once 'modules/ModuleBuilder/parsers/constants.php';
44
+require_once ('include/SubPanel/SubPanel.php');
45 45
 
46 46
 class ViewListView extends SugarView
47 47
 {
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	    global $mod_strings;
54 54
 	    
55 55
     	return array(
56
-    	   translate('LBL_MODULE_NAME','Administration'),
56
+    	   translate('LBL_MODULE_NAME', 'Administration'),
57 57
     	   ModuleBuilderController::getModuleTitle(),
58 58
     	   );
59 59
     }
@@ -63,224 +63,224 @@  discard block
 block discarded – undo
63 63
      */
64 64
     function __construct()
65 65
     {
66
-        $this->editModule = $_REQUEST [ 'view_module' ] ;
67
-        $this->editLayout = $_REQUEST [ 'view' ] ;
68
-        $this->subpanel = (! empty ( $_REQUEST [ 'subpanel' ] )) ? $_REQUEST [ 'subpanel' ] : false ;
69
-        $this->subpanelLabel = (! empty ( $_REQUEST [ 'subpanelLabel' ] )) ? $_REQUEST [ 'subpanelLabel' ] : false ;
66
+        $this->editModule = $_REQUEST ['view_module'];
67
+        $this->editLayout = $_REQUEST ['view'];
68
+        $this->subpanel = (!empty ($_REQUEST ['subpanel'])) ? $_REQUEST ['subpanel'] : false;
69
+        $this->subpanelLabel = (!empty ($_REQUEST ['subpanelLabel'])) ? $_REQUEST ['subpanelLabel'] : false;
70 70
 
71
-        $this->fromModuleBuilder = ! empty ( $_REQUEST [ 'view_package' ] ) ;
72
-        if (! $this->fromModuleBuilder)
71
+        $this->fromModuleBuilder = !empty ($_REQUEST ['view_package']);
72
+        if (!$this->fromModuleBuilder)
73 73
         {
74
-            $moduleNames = array_change_key_case ( $GLOBALS['app_list_strings'] [ 'moduleList' ] ) ;
75
-            $this->translatedEditModule = $moduleNames [ strtolower ( $this->editModule ) ] ;
74
+            $moduleNames = array_change_key_case($GLOBALS['app_list_strings'] ['moduleList']);
75
+            $this->translatedEditModule = $moduleNames [strtolower($this->editModule)];
76 76
         }
77 77
     }
78 78
 
79 79
     // DO NOT REMOVE - overrides parent ViewEdit preDisplay() which attempts to load a bean for a non-existent module
80
-    function preDisplay ()
80
+    function preDisplay()
81 81
     {
82 82
     }
83 83
 
84
-    function display ($preview = false)
84
+    function display($preview = false)
85 85
     {
86 86
 
87
-        $packageName = (! empty ( $_REQUEST [ 'view_package' ] )) ? $_REQUEST [ 'view_package' ] : null ;
88
-        $subpanelName = (! empty ( $_REQUEST [ 'subpanel' ] )) ? $_REQUEST [ 'subpanel' ] : null ;
89
-        require_once 'modules/ModuleBuilder/parsers/ParserFactory.php' ;
90
-        $parser = ParserFactory::getParser (  $this->editLayout , $this->editModule , $packageName, $subpanelName ) ;
91
-        $smarty = $this->constructSmarty ( $parser ) ;
87
+        $packageName = (!empty ($_REQUEST ['view_package'])) ? $_REQUEST ['view_package'] : null;
88
+        $subpanelName = (!empty ($_REQUEST ['subpanel'])) ? $_REQUEST ['subpanel'] : null;
89
+        require_once 'modules/ModuleBuilder/parsers/ParserFactory.php';
90
+        $parser = ParserFactory::getParser($this->editLayout, $this->editModule, $packageName, $subpanelName);
91
+        $smarty = $this->constructSmarty($parser);
92 92
 
93 93
         if ($preview)
94 94
         {
95
-            echo $smarty->fetch ( "modules/ModuleBuilder/tpls/Preview/listView.tpl" ) ;
95
+            echo $smarty->fetch("modules/ModuleBuilder/tpls/Preview/listView.tpl");
96 96
         } else
97 97
         {
98
-            $ajax = $this->constructAjax () ;
99
-            $ajax->addSection ( 'center', $this->translatedViewType, $smarty->fetch ( "modules/ModuleBuilder/tpls/listView.tpl" ) ) ;
98
+            $ajax = $this->constructAjax();
99
+            $ajax->addSection('center', $this->translatedViewType, $smarty->fetch("modules/ModuleBuilder/tpls/listView.tpl"));
100 100
 
101
-            echo $ajax->getJavascript () ;
101
+            echo $ajax->getJavascript();
102 102
         }
103 103
     }
104 104
 
105
-    function constructAjax ()
105
+    function constructAjax()
106 106
     {
107
-        require_once ('modules/ModuleBuilder/MB/AjaxCompose.php') ;
108
-        $ajax = new AjaxCompose ( ) ;
107
+        require_once ('modules/ModuleBuilder/MB/AjaxCompose.php');
108
+        $ajax = new AjaxCompose( );
109 109
 
110
-        $layoutLabel = 'LBL_LAYOUTS' ;
111
-        $layoutView = 'layouts' ;
110
+        $layoutLabel = 'LBL_LAYOUTS';
111
+        $layoutView = 'layouts';
112 112
 
113 113
 
114
-        $labels = array (
115
-        			MB_LISTVIEW => 'LBL_LISTVIEW' ,
116
-        			) ;
117
-        $translatedViewType = '' ;
118
-		if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) )
119
-			$translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ;
114
+        $labels = array(
115
+        			MB_LISTVIEW => 'LBL_LISTVIEW',
116
+        			);
117
+        $translatedViewType = '';
118
+		if (isset ($labels [strtolower($this->editLayout)]))
119
+			$translatedViewType = translate($labels [strtolower($this->editLayout)], 'ModuleBuilder');
120 120
 		$this->translatedViewType = $translatedViewType;
121 121
 
122 122
         if ($this->fromModuleBuilder)
123 123
         {
124
-            $ajax->addCrumb ( translate ( 'LBL_MODULEBUILDER', 'ModuleBuilder' ), 'ModuleBuilder.main("mb")' ) ;
125
-            $ajax->addCrumb ( $_REQUEST [ 'view_package' ], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=' . $_REQUEST [ 'view_package' ] . '")' ) ;
126
-            $ajax->addCrumb ( $this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package=' . $_REQUEST [ 'view_package' ] . '&view_module=' . $_REQUEST [ 'view_module' ] . '")' ) ;
124
+            $ajax->addCrumb(translate('LBL_MODULEBUILDER', 'ModuleBuilder'), 'ModuleBuilder.main("mb")');
125
+            $ajax->addCrumb($_REQUEST ['view_package'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$_REQUEST ['view_package'].'")');
126
+            $ajax->addCrumb($this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package='.$_REQUEST ['view_package'].'&view_module='.$_REQUEST ['view_module'].'")');
127 127
             if ($this->subpanel != "")
128 128
             {
129
-                $ajax->addCrumb ( translate ( 'LBL_AVAILABLE_SUBPANELS', 'ModuleBuilder' ), '' ) ;
129
+                $ajax->addCrumb(translate('LBL_AVAILABLE_SUBPANELS', 'ModuleBuilder'), '');
130 130
                 if ($this->subpanelLabel)
131 131
                 {
132 132
                     $subpanelLabel = $this->subpanelLabel;
133 133
                     // If the subpanel title has changed, use that for the label instead
134
-                    if( !empty($_REQUEST['subpanel_title'] ) && $_REQUEST['subpanelLabel'] != $_REQUEST['subpanel_title'] )
134
+                    if (!empty($_REQUEST['subpanel_title']) && $_REQUEST['subpanelLabel'] != $_REQUEST['subpanel_title'])
135 135
                         $subpanelLabel = $_REQUEST['subpanel_title'];
136 136
 
137
-                    $ajax->addCrumb( $subpanelLabel, '' );
138
-                    $this->translatedViewType = $subpanelLabel . "&nbsp;" . translate("LBL_SUBPANEL", "ModuleBuilder");
137
+                    $ajax->addCrumb($subpanelLabel, '');
138
+                    $this->translatedViewType = $subpanelLabel."&nbsp;".translate("LBL_SUBPANEL", "ModuleBuilder");
139 139
                 } else
140 140
                 {
141
-                    $ajax->addCrumb ( $this->subpanel, '' ) ;
141
+                    $ajax->addCrumb($this->subpanel, '');
142 142
                     $this->translatedViewType = translate("LBL_SUBPANEL", "ModuleBuilder");
143 143
                 }
144 144
             } else
145 145
             {
146
-                $ajax->addCrumb ( translate ( $layoutLabel, 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view_module=' . $_REQUEST [ 'view_module' ] . '&view_package=' . $_REQUEST [ 'view_package' ] . '")' ) ;
147
-                $ajax->addCrumb ( $translatedViewType, '' ) ;
146
+                $ajax->addCrumb(translate($layoutLabel, 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view_module='.$_REQUEST ['view_module'].'&view_package='.$_REQUEST ['view_package'].'")');
147
+                $ajax->addCrumb($translatedViewType, '');
148 148
             }
149 149
         } else
150 150
         {
151
-            $ajax->addCrumb ( translate ( 'LBL_STUDIO', 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")' ) ;
152
-            $ajax->addCrumb ( $this->translatedEditModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $this->editModule . '")' ) ;
151
+            $ajax->addCrumb(translate('LBL_STUDIO', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")');
152
+            $ajax->addCrumb($this->translatedEditModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module='.$this->editModule.'")');
153 153
 
154 154
             if ($this->subpanel)
155 155
             {
156
-                $ajax->addCrumb ( translate ( 'LBL_SUBPANELS', 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=subpanels&view_module=' . $this->editModule . '")' ) ;
156
+                $ajax->addCrumb(translate('LBL_SUBPANELS', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=subpanels&view_module='.$this->editModule.'")');
157 157
                 if ($this->subpanelLabel)
158 158
                 {
159 159
                     $subpanelLabel = $this->subpanelLabel;
160 160
                     // If the subpanel title has changed, use that for the label instead
161
-                    if( !empty($_REQUEST['subpanel_title'] ) && $_REQUEST['subpanelLabel'] != $_REQUEST['subpanel_title'] )
161
+                    if (!empty($_REQUEST['subpanel_title']) && $_REQUEST['subpanelLabel'] != $_REQUEST['subpanel_title'])
162 162
                         $subpanelLabel = $_REQUEST['subpanel_title'];
163 163
 
164
-                    $ajax->addCrumb( $subpanelLabel, '' );
165
-                    $this->translatedViewType = $subpanelLabel . "&nbsp;" . translate("LBL_SUBPANEL", "ModuleBuilder");
164
+                    $ajax->addCrumb($subpanelLabel, '');
165
+                    $this->translatedViewType = $subpanelLabel."&nbsp;".translate("LBL_SUBPANEL", "ModuleBuilder");
166 166
                 } else
167 167
                 {
168
-                    $ajax->addCrumb ( $this->subpanel, '' ) ;
168
+                    $ajax->addCrumb($this->subpanel, '');
169 169
                     $this->translatedViewType = translate("LBL_SUBPANEL", "ModuleBuilder");
170 170
                 }
171 171
             } else
172 172
             {
173
-                $ajax->addCrumb ( translate ( $layoutLabel, 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view='.$layoutView.'&view_module=' . $this->editModule . '")' ) ;
174
-                $ajax->addCrumb ( $translatedViewType, '' ) ;
173
+                $ajax->addCrumb(translate($layoutLabel, 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view='.$layoutView.'&view_module='.$this->editModule.'")');
174
+                $ajax->addCrumb($translatedViewType, '');
175 175
             }
176 176
         }
177
-        return $ajax ;
177
+        return $ajax;
178 178
     }
179 179
 
180
-    function constructSmarty ($parser)
180
+    function constructSmarty($parser)
181 181
     {
182 182
         global $mod_strings;
183
-        $smarty = new Sugar_Smarty ( ) ;
184
-        $smarty->assign ( 'translate', true ) ;
185
-        $smarty->assign ( 'language', $parser->getLanguage () ) ;
186
-
187
-        $smarty->assign ( 'view', $this->editLayout ) ;
188
-        $smarty->assign ( 'module', "ModuleBuilder" ) ;
189
-        $smarty->assign ( 'field_defs', $parser->getFieldDefs () ) ;
190
-        $smarty->assign ( 'action', 'listViewSave' ) ;
191
-        $smarty->assign ( 'view_module', $this->editModule ) ;
192
-        if (!empty ( $this->subpanel ) )
183
+        $smarty = new Sugar_Smarty( );
184
+        $smarty->assign('translate', true);
185
+        $smarty->assign('language', $parser->getLanguage());
186
+
187
+        $smarty->assign('view', $this->editLayout);
188
+        $smarty->assign('module', "ModuleBuilder");
189
+        $smarty->assign('field_defs', $parser->getFieldDefs());
190
+        $smarty->assign('action', 'listViewSave');
191
+        $smarty->assign('view_module', $this->editModule);
192
+        if (!empty ($this->subpanel))
193 193
         {
194
-            $smarty->assign ( 'subpanel', $this->subpanel ) ;
195
-            $smarty->assign ( 'subpanelLabel', $this->subpanelLabel ) ;
194
+            $smarty->assign('subpanel', $this->subpanel);
195
+            $smarty->assign('subpanelLabel', $this->subpanelLabel);
196 196
             if (!$this->fromModuleBuilder) {
197
-                $subList =  SubPanel::getModuleSubpanels ( $this->editModule);
197
+                $subList = SubPanel::getModuleSubpanels($this->editModule);
198 198
                 $subRef = $subList[strtolower($this->subpanel)];
199
-                $subTitleKey = !empty($subRef) ? $subRef : "LBL_" . strtoupper($this->subpanel) . "_SUBPANEL_TITLE";
199
+                $subTitleKey = !empty($subRef) ? $subRef : "LBL_".strtoupper($this->subpanel)."_SUBPANEL_TITLE";
200 200
                 $subTitle    = !empty($subRef) ? translate($subTitleKey, $this->editModule) : UCfirst($this->subpanel);
201
-            	$smarty->assign ( 'subpanel_label', $subTitleKey ) ;
202
-            	$smarty->assign ( 'subpanel_title', $subTitle ) ;
201
+            	$smarty->assign('subpanel_label', $subTitleKey);
202
+            	$smarty->assign('subpanel_title', $subTitle);
203 203
             }
204 204
         }
205 205
         $helpName = $this->subpanel ? 'subPanelEditor' : 'listViewEditor';
206
-        $smarty->assign ( 'helpName', $helpName ) ;
207
-        $smarty->assign ( 'helpDefault', 'modify' ) ;
206
+        $smarty->assign('helpName', $helpName);
207
+        $smarty->assign('helpDefault', 'modify');
208 208
 
209
-        $smarty->assign ( 'title', $this->_constructTitle () ) ;
210
-        $groups = array ( ) ;
211
-        foreach ( $parser->columns as $column => $function )
209
+        $smarty->assign('title', $this->_constructTitle());
210
+        $groups = array( );
211
+        foreach ($parser->columns as $column => $function)
212 212
         {
213 213
             // update this so that each field has a properties set
214 214
             // properties are name, value, title (optional)
215
-            $groups [ $GLOBALS [ 'mod_strings' ] [ $column ] ] = $parser->$function () ; // call the parser functions to populate the list view columns, by default 'default', 'available' and 'hidden'
215
+            $groups [$GLOBALS ['mod_strings'] [$column]] = $parser->$function(); // call the parser functions to populate the list view columns, by default 'default', 'available' and 'hidden'
216 216
         }
217
-        foreach ( $groups as $groupKey => $group )
217
+        foreach ($groups as $groupKey => $group)
218 218
         {
219
-            foreach ( $group as $fieldKey => $field )
219
+            foreach ($group as $fieldKey => $field)
220 220
             {
221
-                if (isset ( $field [ 'width' ] ))
221
+                if (isset ($field ['width']))
222 222
                 {
223
-                    if (substr ( $field [ 'width' ], - 1, 1 ) == '%')
223
+                    if (substr($field ['width'], - 1, 1) == '%')
224 224
                     {
225 225
 
226
-                        $groups [ $groupKey ] [ $fieldKey ] [ 'width' ] = substr ( $field [ 'width' ], 0, strlen ( $field [ 'width' ] ) - 1 ) ;
226
+                        $groups [$groupKey] [$fieldKey] ['width'] = substr($field ['width'], 0, strlen($field ['width']) - 1);
227 227
                     }
228 228
                 }
229 229
             }
230 230
         }
231 231
 
232
-        $smarty->assign ( 'groups', $groups ) ;
232
+        $smarty->assign('groups', $groups);
233 233
         $smarty->assign('from_mb', $this->fromModuleBuilder);
234 234
 
235 235
         global $image_path;
236
-        $imageSave = SugarThemeRegistry::current()->getImage('studio_save','',null,null,'.gif',$mod_strings['LBL_BTN_SAVE']) ;
236
+        $imageSave = SugarThemeRegistry::current()->getImage('studio_save', '', null, null, '.gif', $mod_strings['LBL_BTN_SAVE']);
237 237
 
238 238
 //        $imageHelp = SugarThemeRegistry::current()->getImage('help') ;
239 239
 
240 240
 
241
-        $history = $parser->getHistory () ;
241
+        $history = $parser->getHistory();
242 242
 
243
-        $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")" ;
243
+        $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")";
244 244
         if ($this->subpanel)
245
-            $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$this->subpanel}\")" ;
245
+            $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$this->subpanel}\")";
246 246
 
247 247
         $restoreAction = "onclick='ModuleBuilder.history.revert(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$history->getLast()}\", \"\")'";
248 248
         if ($this->subpanel)
249 249
             $restoreAction = "onclick='ModuleBuilder.history.revert(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$history->getLast()}\", \"{$this->subpanel}\")'";
250 250
 
251
-        $buttons = array ( ) ;
252
-        $buttons [] = array ( 'id' =>'savebtn', 'name' => 'savebtn' , 'image' => $imageSave , 'text' => (! $this->fromModuleBuilder)?$GLOBALS [ 'mod_strings' ] [ 'LBL_BTN_SAVEPUBLISH' ]: $GLOBALS [ 'mod_strings' ] [ 'LBL_BTN_SAVE' ], 'actionScript' => "onclick='studiotabs.generateGroupForm(\"edittabs\");if (countListFields()==0) ModuleBuilder.layoutValidation.popup() ; else ModuleBuilder.handleSave(\"edittabs\" )'" ) ;
253
-        $buttons [] = array ( 'id' => 'spacer' , 'width' => '50px' ) ;
254
-        $buttons [] = array ( 'id' =>'historyBtn',       'name' => 'historyBtn' , 'text' => translate ( 'LBL_HISTORY' ) , 'actionScript' => "onclick='$histaction'" ) ;
255
-        $buttons [] = array ( 'id' => 'historyDefault' , 'name' => 'historyDefault',  'text' => translate ( 'LBL_RESTORE_DEFAULT' ) , 'actionScript' => $restoreAction ) ;
251
+        $buttons = array( );
252
+        $buttons [] = array('id' =>'savebtn', 'name' => 'savebtn', 'image' => $imageSave, 'text' => (!$this->fromModuleBuilder) ? $GLOBALS ['mod_strings'] ['LBL_BTN_SAVEPUBLISH'] : $GLOBALS ['mod_strings'] ['LBL_BTN_SAVE'], 'actionScript' => "onclick='studiotabs.generateGroupForm(\"edittabs\");if (countListFields()==0) ModuleBuilder.layoutValidation.popup() ; else ModuleBuilder.handleSave(\"edittabs\" )'");
253
+        $buttons [] = array('id' => 'spacer', 'width' => '50px');
254
+        $buttons [] = array('id' =>'historyBtn', 'name' => 'historyBtn', 'text' => translate('LBL_HISTORY'), 'actionScript' => "onclick='$histaction'");
255
+        $buttons [] = array('id' => 'historyDefault', 'name' => 'historyDefault', 'text' => translate('LBL_RESTORE_DEFAULT'), 'actionScript' => $restoreAction);
256 256
 
257
-        $smarty->assign ( 'buttons', $this->_buildImageButtons ( $buttons ) ) ;
257
+        $smarty->assign('buttons', $this->_buildImageButtons($buttons));
258 258
 
259
-        $editImage = SugarThemeRegistry::current()->getImage('edit_inline','',null,null,'.gif',$mod_strings['LBL_EDIT']) ;
259
+        $editImage = SugarThemeRegistry::current()->getImage('edit_inline', '', null, null, '.gif', $mod_strings['LBL_EDIT']);
260 260
 
261
-        $smarty->assign ( 'editImage', $editImage ) ;
262
-        $deleteImage = SugarThemeRegistry::current()->getImage('delete_inline','',null,null,'.gif',$mod_strings['LBL_MB_DELETE']) ;
261
+        $smarty->assign('editImage', $editImage);
262
+        $deleteImage = SugarThemeRegistry::current()->getImage('delete_inline', '', null, null, '.gif', $mod_strings['LBL_MB_DELETE']);
263 263
 
264
-        $smarty->assign ( 'deleteImage', $deleteImage ) ;
265
-        $smarty->assign ( 'MOD', $GLOBALS [ 'mod_strings' ] ) ;
264
+        $smarty->assign('deleteImage', $deleteImage);
265
+        $smarty->assign('MOD', $GLOBALS ['mod_strings']);
266 266
 
267 267
         if ($this->fromModuleBuilder)
268 268
         {
269
-            $smarty->assign ( 'MB', true ) ;
270
-            $smarty->assign ( 'view_package', $_REQUEST [ 'view_package' ] ) ;
271
-            $mb = new ModuleBuilder ( ) ;
272
-            $module = & $mb->getPackageModule ( $_REQUEST [ 'view_package' ], $this->editModule ) ;
269
+            $smarty->assign('MB', true);
270
+            $smarty->assign('view_package', $_REQUEST ['view_package']);
271
+            $mb = new ModuleBuilder( );
272
+            $module = & $mb->getPackageModule($_REQUEST ['view_package'], $this->editModule);
273 273
             $smarty->assign('current_mod_strings', $module->getModStrings());
274 274
             if ($this->subpanel)
275 275
             {
276
-                if (isset ( $_REQUEST [ 'local' ] ))
276
+                if (isset ($_REQUEST ['local']))
277 277
                 {
278
-                    $smarty->assign ( 'local', '1' ) ;
278
+                    $smarty->assign('local', '1');
279 279
                 }
280
-                $smarty->assign ( "subpanel", $this->subpanel ) ;
280
+                $smarty->assign("subpanel", $this->subpanel);
281 281
             } else
282 282
             {
283
-                $smarty->assign ( 'description', $GLOBALS [ 'mod_strings' ] [ 'LBL_LISTVIEW_DESCRIPTION' ] ) ;
283
+                $smarty->assign('description', $GLOBALS ['mod_strings'] ['LBL_LISTVIEW_DESCRIPTION']);
284 284
 
285 285
             }
286 286
 
@@ -288,55 +288,55 @@  discard block
 block discarded – undo
288 288
         {
289 289
             if ($this->subpanel)
290 290
             {
291
-                $smarty->assign ( "subpanel", "$this->subpanel" ) ;
291
+                $smarty->assign("subpanel", "$this->subpanel");
292 292
             } else
293 293
             {
294
-                $smarty->assign ( 'description', $GLOBALS [ 'mod_strings' ] [ 'LBL_LISTVIEW_DESCRIPTION' ] ) ;
294
+                $smarty->assign('description', $GLOBALS ['mod_strings'] ['LBL_LISTVIEW_DESCRIPTION']);
295 295
             }
296 296
         }
297 297
 
298
-        return $smarty ;
298
+        return $smarty;
299 299
     }
300 300
 
301
-    function _constructTitle ()
301
+    function _constructTitle()
302 302
 
303 303
     {
304 304
 
305
-        global $app_list_strings ;
305
+        global $app_list_strings;
306 306
 
307 307
         if ($this->fromModuleBuilder)
308 308
         {
309
-            $title = $this->editModule ;
309
+            $title = $this->editModule;
310 310
             if ($this->subpanel != "")
311 311
             {
312
-                $title .= ":$this->subpanel" ;
312
+                $title .= ":$this->subpanel";
313 313
             }
314 314
         } else
315 315
         {
316
-            $title = ($this->subpanel) ? ':' . $this->subpanel : $app_list_strings [ 'moduleList' ] [ $this->editModule ] ;
316
+            $title = ($this->subpanel) ? ':'.$this->subpanel : $app_list_strings ['moduleList'] [$this->editModule];
317 317
         }
318
-        return $GLOBALS [ 'mod_strings' ] [ 'LBL_LISTVIEW_EDIT' ] . ':&nbsp;' . $title ;
318
+        return $GLOBALS ['mod_strings'] ['LBL_LISTVIEW_EDIT'].':&nbsp;'.$title;
319 319
 
320 320
     }
321 321
 
322
-    function _buildImageButtons ($buttons , $horizontal = true)
322
+    function _buildImageButtons($buttons, $horizontal = true)
323 323
     {
324
-    	$text = '<table cellspacing=2><tr>' ;
325
-        foreach ( $buttons as $button )
324
+    	$text = '<table cellspacing=2><tr>';
325
+        foreach ($buttons as $button)
326 326
         {
327 327
             if (empty($button['id'])) {
328 328
             	$button['id'] = $button['name'];
329 329
             }
330
-            if (! $horizontal)
330
+            if (!$horizontal)
331 331
             {
332
-                $text .= '</tr><tr>' ;
332
+                $text .= '</tr><tr>';
333 333
             }
334 334
             if ($button['id'] == "spacer") {
335 335
                 $text .= "<td style='width:{$button['width']}'> </td>";
336 336
                 continue;
337 337
             }
338 338
 
339
-            if (! empty ( $button [ 'plain' ] ))
339
+            if (!empty ($button ['plain']))
340 340
             {
341 341
                 $text .= <<<EOQ
342 342
 	             <td><input name={$button['name']} id={$button['id']} class="button" type="button" valign='center' {$button['actionScript']}
@@ -348,9 +348,9 @@  discard block
 block discarded – undo
348 348
 	          <td><input name={$button['name']} id={$button['id']} class="button" type="button" valign='center' style='cursor:default'  {$button['actionScript']}
349 349
 EOQ;
350 350
             }
351
-            $text .= "value=\"{$button['text']}\"/></td>" ;
351
+            $text .= "value=\"{$button['text']}\"/></td>";
352 352
         }
353
-        $text .= '</tr></table>' ;
354
-        return $text ;
353
+        $text .= '</tr></table>';
354
+        return $text;
355 355
     }
356 356
 }
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.dashlet.php 1 patch
Spacing   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (! defined ( 'sugarEntry' ) || ! sugarEntry)
3
-    die ( 'Not A Valid Entry Point' ) ;
2
+if (!defined('sugarEntry') || !sugarEntry)
3
+    die ('Not A Valid Entry Point');
4 4
 /*********************************************************************************
5 5
  * SugarCRM Community Edition is a customer relationship management program developed by
6 6
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -43,27 +43,27 @@  discard block
 block discarded – undo
43 43
 
44 44
 
45 45
 
46
-require_once ('modules/ModuleBuilder/views/view.listview.php') ;
47
-require_once 'modules/ModuleBuilder/parsers/constants.php' ;
46
+require_once ('modules/ModuleBuilder/views/view.listview.php');
47
+require_once 'modules/ModuleBuilder/parsers/constants.php';
48 48
 
49 49
 class ViewDashlet extends ViewListView
50 50
 {
51 51
     function __construct()
52 52
     {
53
-        $this->editModule = $_REQUEST [ 'view_module' ] ;
54
-        $this->editLayout = $_REQUEST [ 'view' ] ;
55
-        if(isset ( $_REQUEST [ 'view_package' ] ) && ! empty ( $_REQUEST [ 'view_package' ] ))
56
-            $this->editPackage = $_REQUEST [ 'view_package' ];
53
+        $this->editModule = $_REQUEST ['view_module'];
54
+        $this->editLayout = $_REQUEST ['view'];
55
+        if (isset ($_REQUEST ['view_package']) && !empty ($_REQUEST ['view_package']))
56
+            $this->editPackage = $_REQUEST ['view_package'];
57 57
         else
58 58
             $this->editPackage = null;
59 59
 
60
-        $this->fromModuleBuilder = isset ( $_REQUEST [ 'MB' ] ) || (isset($_REQUEST['view_package']) && $_REQUEST['view_package'] && $_REQUEST['view_package'] != 'studio') ;
60
+        $this->fromModuleBuilder = isset ($_REQUEST ['MB']) || (isset($_REQUEST['view_package']) && $_REQUEST['view_package'] && $_REQUEST['view_package'] != 'studio');
61 61
 
62 62
         if (!$this->fromModuleBuilder)
63 63
         {
64
-            global $app_list_strings ;
65
-            $moduleNames = array_change_key_case ( $app_list_strings [ 'moduleList' ] ) ;
66
-            $this->translatedEditModule = $moduleNames [ strtolower ( $this->editModule ) ] ;
64
+            global $app_list_strings;
65
+            $moduleNames = array_change_key_case($app_list_strings ['moduleList']);
66
+            $this->translatedEditModule = $moduleNames [strtolower($this->editModule)];
67 67
         }
68 68
     }
69 69
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	    global $mod_strings;
76 76
 	    
77 77
     	return array(
78
-    	   translate('LBL_MODULE_NAME','Administration'),
78
+    	   translate('LBL_MODULE_NAME', 'Administration'),
79 79
     	   ModuleBuilderController::getModuleTitle(),
80 80
     	   );
81 81
     }
@@ -91,141 +91,141 @@  discard block
 block discarded – undo
91 91
     {
92 92
 
93 93
 
94
-        require_once 'modules/ModuleBuilder/parsers/ParserFactory.php' ;
95
-        $parser = ParserFactory::getParser ( $this->editLayout, $this->editModule, $this->editPackage) ;
94
+        require_once 'modules/ModuleBuilder/parsers/ParserFactory.php';
95
+        $parser = ParserFactory::getParser($this->editLayout, $this->editModule, $this->editPackage);
96 96
 
97
-        $smarty = $this->constructSmarty ( $parser ) ;
97
+        $smarty = $this->constructSmarty($parser);
98 98
         if ($preview)
99 99
         {
100
-        	echo $smarty->fetch ( "modules/ModuleBuilder/tpls/Preview/listView.tpl" ) ;
100
+        	echo $smarty->fetch("modules/ModuleBuilder/tpls/Preview/listView.tpl");
101 101
         } else
102 102
         {
103
-        	$ajax = $this->constructAjax () ;
104
-        	$ajax->addSection ( 'center', translate('LBL_DASHLET'), $smarty->fetch ( "modules/ModuleBuilder/tpls/listView.tpl" ) ) ;
105
-        	echo $ajax->getJavascript () ;
103
+        	$ajax = $this->constructAjax();
104
+        	$ajax->addSection('center', translate('LBL_DASHLET'), $smarty->fetch("modules/ModuleBuilder/tpls/listView.tpl"));
105
+        	echo $ajax->getJavascript();
106 106
         }
107 107
     }
108 108
 
109 109
     function constructAjax()
110 110
     {
111
-        require_once ('modules/ModuleBuilder/MB/AjaxCompose.php') ;
112
-        $ajax = new AjaxCompose ( ) ;
111
+        require_once ('modules/ModuleBuilder/MB/AjaxCompose.php');
112
+        $ajax = new AjaxCompose( );
113 113
 
114 114
         if ($this->fromModuleBuilder)
115 115
         {
116
-            $ajax->addCrumb ( translate ( 'LBL_MODULEBUILDER', 'ModuleBuilder' ), 'ModuleBuilder.main("mb")' ) ;
117
-            $ajax->addCrumb ( $_REQUEST [ 'view_package' ], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=' . $this->editPackage . '")' ) ;
118
-            $ajax->addCrumb ( $this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package=' . $this->editPackage . '&view_module=' . $this->editModule . '")' ) ;
119
-            $ajax->addCrumb ( translate('LBL_LAYOUTS', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&layouts=1&MB=1&view_package='.$this->editPackage.'&view_module=' . $this->editModule . '")');
120
-            $ajax->addCrumb ( translate('LBL_DASHLET', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=dashlet&MB=1&view_package='.$this->editPackage.'&view_module=' . $this->editModule . '")' );
116
+            $ajax->addCrumb(translate('LBL_MODULEBUILDER', 'ModuleBuilder'), 'ModuleBuilder.main("mb")');
117
+            $ajax->addCrumb($_REQUEST ['view_package'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$this->editPackage.'")');
118
+            $ajax->addCrumb($this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package='.$this->editPackage.'&view_module='.$this->editModule.'")');
119
+            $ajax->addCrumb(translate('LBL_LAYOUTS', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&layouts=1&MB=1&view_package='.$this->editPackage.'&view_module='.$this->editModule.'")');
120
+            $ajax->addCrumb(translate('LBL_DASHLET', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=dashlet&MB=1&view_package='.$this->editPackage.'&view_module='.$this->editModule.'")');
121 121
 
122 122
             $ViewLabel = ($this->editLayout == MB_DASHLET) ? 'LBL_DASHLETLISTVIEW' : 'LBL_DASHLETSEARCHVIEW';
123
-            $ajax->addCrumb ( translate ($ViewLabel, 'ModuleBuilder' ), '' ) ;
124
-        }else{
125
-            $ajax->addCrumb ( translate($this->editModule), 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module=' . $this->editModule . '")' ) ;
126
-            $ajax->addCrumb ( translate('LBL_LAYOUTS', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&layouts=1&view_module=' . $this->editModule . '")');
127
-            $ajax->addCrumb ( translate('LBL_DASHLET', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=dashlet&view_module=' . $this->editModule . '")' );
123
+            $ajax->addCrumb(translate($ViewLabel, 'ModuleBuilder'), '');
124
+        } else {
125
+            $ajax->addCrumb(translate($this->editModule), 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module='.$this->editModule.'")');
126
+            $ajax->addCrumb(translate('LBL_LAYOUTS', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&layouts=1&view_module='.$this->editModule.'")');
127
+            $ajax->addCrumb(translate('LBL_DASHLET', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=dashlet&view_module='.$this->editModule.'")');
128 128
             $ViewLabel = ($this->editLayout == MB_DASHLET) ? 'LBL_DASHLETLISTVIEW' : 'LBL_DASHLETSEARCHVIEW';
129
-            $ajax->addCrumb ( translate ($ViewLabel, 'ModuleBuilder' ), '' ) ;
129
+            $ajax->addCrumb(translate($ViewLabel, 'ModuleBuilder'), '');
130 130
         }
131
-        return $ajax ;
131
+        return $ajax;
132 132
     }
133 133
 
134 134
     function constructSmarty($parser)
135 135
     {
136
-        $smarty = new Sugar_Smarty ( ) ;
137
-        $smarty->assign ( 'translate', true ) ;
138
-        $smarty->assign ( 'language', $parser->getLanguage () ) ;
136
+        $smarty = new Sugar_Smarty( );
137
+        $smarty->assign('translate', true);
138
+        $smarty->assign('language', $parser->getLanguage());
139 139
 		
140
-        $smarty->assign ( 'view', $this->editLayout ) ;
141
-        $smarty->assign ( 'action', 'dashletSave' ) ;
142
-        $smarty->assign( 'module', 'ModuleBuilder');
143
-        $smarty->assign ( 'view_module', $this->editModule ) ;
144
-        $smarty->assign ( 'field_defs', $parser->getFieldDefs () ) ;
145
-        $helpName = (isset( $_REQUEST['view']) && $_REQUEST['view']=='dashletsearch') ? 'searchViewEditor' : 'listViewEditor';
146
-        $smarty->assign ( 'helpName', $helpName ) ;
147
-        $smarty->assign ( 'helpDefault', 'modify' ) ;
140
+        $smarty->assign('view', $this->editLayout);
141
+        $smarty->assign('action', 'dashletSave');
142
+        $smarty->assign('module', 'ModuleBuilder');
143
+        $smarty->assign('view_module', $this->editModule);
144
+        $smarty->assign('field_defs', $parser->getFieldDefs());
145
+        $helpName = (isset($_REQUEST['view']) && $_REQUEST['view'] == 'dashletsearch') ? 'searchViewEditor' : 'listViewEditor';
146
+        $smarty->assign('helpName', $helpName);
147
+        $smarty->assign('helpDefault', 'modify');
148 148
     	if ($this->fromModuleBuilder) {
149
-			$mb = new ModuleBuilder ( ) ;
150
-            $module = & $mb->getPackageModule ( $this->editPackage, $this->editModule ) ;
149
+			$mb = new ModuleBuilder( );
150
+            $module = & $mb->getPackageModule($this->editPackage, $this->editModule);
151 151
 		    $smarty->assign('current_mod_strings', $module->getModStrings());
152 152
 		}
153
-        $smarty->assign ( 'title', $this->_constructTitle () ) ;
154
-        $groups = array ( ) ;
155
-        foreach ( $parser->columns as $column => $function )
153
+        $smarty->assign('title', $this->_constructTitle());
154
+        $groups = array( );
155
+        foreach ($parser->columns as $column => $function)
156 156
         {
157 157
             // update this so that each field has a properties set
158 158
             // properties are name, value, title (optional)
159
-            $groups [ $GLOBALS [ 'mod_strings' ] [ $column ] ] = $parser->$function () ; // call the parser functions to populate the list view columns, by default 'default', 'available' and 'hidden'
159
+            $groups [$GLOBALS ['mod_strings'] [$column]] = $parser->$function(); // call the parser functions to populate the list view columns, by default 'default', 'available' and 'hidden'
160 160
         }
161
-        foreach ( $groups as $groupKey => $group )
161
+        foreach ($groups as $groupKey => $group)
162 162
         {
163
-            foreach ( $group as $fieldKey => $field )
163
+            foreach ($group as $fieldKey => $field)
164 164
             {
165
-                if (isset ( $field [ 'width' ] ))
165
+                if (isset ($field ['width']))
166 166
                 {
167
-                    if (substr ( $field [ 'width' ], - 1, 1 ) == '%')
167
+                    if (substr($field ['width'], - 1, 1) == '%')
168 168
                     {
169 169
 
170
-                        $groups [ $groupKey ] [ $fieldKey ] [ 'width' ] = substr ( $field [ 'width' ], 0, strlen ( $field [ 'width' ] ) - 1 ) ;
170
+                        $groups [$groupKey] [$fieldKey] ['width'] = substr($field ['width'], 0, strlen($field ['width']) - 1);
171 171
                     }
172 172
                 }
173 173
             }
174 174
         }
175 175
 
176
-        $smarty->assign ( 'groups', $groups ) ;
176
+        $smarty->assign('groups', $groups);
177 177
 
178 178
         global $image_path, $mod_strings;
179
-        $imageSave = SugarThemeRegistry::current()->getImage('studio_save','',null,null,'.gif',$mod_strings['LBL_BTN_SAVE']) ;
179
+        $imageSave = SugarThemeRegistry::current()->getImage('studio_save', '', null, null, '.gif', $mod_strings['LBL_BTN_SAVE']);
180 180
 
181 181
 //        $imageHelp = SugarThemeRegistry::current()->getImage('help','',null,null,'.gif',$mod_strings['LBL_SECTION_HELP']) ;
182 182
 
183 183
 
184
-        $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")" ;
184
+        $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")";
185 185
         if (isset($this->searchlayout))
186
-            $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$this->searchlayout}\")" ;
186
+            $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$this->searchlayout}\")";
187 187
 
188
-        $buttons = array ( ) ;
189
-        if (! $this->fromModuleBuilder)
188
+        $buttons = array( );
189
+        if (!$this->fromModuleBuilder)
190 190
         {
191
-            $buttons [] = array ( 'name' => 'savebtn' , 'image' => $imageSave , 'text' => $GLOBALS [ 'mod_strings' ] [ 'LBL_BTN_SAVEPUBLISH' ] , 'actionScript' => "onclick='studiotabs.generateGroupForm(\"edittabs\");ModuleBuilder.state.isDirty=false;ModuleBuilder.submitForm(\"edittabs\" )'" ) ;
191
+            $buttons [] = array('name' => 'savebtn', 'image' => $imageSave, 'text' => $GLOBALS ['mod_strings'] ['LBL_BTN_SAVEPUBLISH'], 'actionScript' => "onclick='studiotabs.generateGroupForm(\"edittabs\");ModuleBuilder.state.isDirty=false;ModuleBuilder.submitForm(\"edittabs\" )'");
192 192
         } else
193 193
         {
194
-            $buttons [] = array ( 'name' => 'mbsavebtn' , 'image' => $imageSave , 'text' => $GLOBALS [ 'mod_strings' ] [ 'LBL_BTN_SAVE' ] , 'actionScript' => "onclick='studiotabs.generateGroupForm(\"edittabs\");ModuleBuilder.state.isDirty=false;ModuleBuilder.submitForm(\"edittabs\" )'" ) ;
194
+            $buttons [] = array('name' => 'mbsavebtn', 'image' => $imageSave, 'text' => $GLOBALS ['mod_strings'] ['LBL_BTN_SAVE'], 'actionScript' => "onclick='studiotabs.generateGroupForm(\"edittabs\");ModuleBuilder.state.isDirty=false;ModuleBuilder.submitForm(\"edittabs\" )'");
195 195
         }
196
-        $buttons [] = array ( 'name' => 'historyBtn' , 'text' => translate ( 'LBL_HISTORY' ) , 'actionScript' => "onclick='$histaction'" ) ;
197
-        $smarty->assign ( 'buttons', $this->_buildImageButtons ( $buttons ) ) ;
198
-        $editImage = SugarThemeRegistry::current()->getImage('edit_inline','',null,null,'.gif',$mod_strings['LBL_EDIT']) ;
196
+        $buttons [] = array('name' => 'historyBtn', 'text' => translate('LBL_HISTORY'), 'actionScript' => "onclick='$histaction'");
197
+        $smarty->assign('buttons', $this->_buildImageButtons($buttons));
198
+        $editImage = SugarThemeRegistry::current()->getImage('edit_inline', '', null, null, '.gif', $mod_strings['LBL_EDIT']);
199 199
 
200
-        $smarty->assign ( 'editImage', $editImage ) ;
201
-        $deleteImage = SugarThemeRegistry::current()->getImage('delete_inline','',null,null,'.gif',$mod_strings['LBL_MB_DELETE']) ;
200
+        $smarty->assign('editImage', $editImage);
201
+        $deleteImage = SugarThemeRegistry::current()->getImage('delete_inline', '', null, null, '.gif', $mod_strings['LBL_MB_DELETE']);
202 202
 
203
-        $smarty->assign ( 'deleteImage', $deleteImage ) ;
204
-        $smarty->assign ( 'MOD', $GLOBALS [ 'mod_strings' ] ) ;
203
+        $smarty->assign('deleteImage', $deleteImage);
204
+        $smarty->assign('MOD', $GLOBALS ['mod_strings']);
205 205
 
206 206
         if ($this->fromModuleBuilder)
207 207
         {
208
-            $smarty->assign ( 'MB', true ) ;
209
-            $smarty->assign ( 'view_package', $this->editPackage ) ;
210
-            $smarty->assign ( 'description', $GLOBALS [ 'mod_strings' ] [ 'LBL_LISTVIEW_DESCRIPTION' ] ) ;
208
+            $smarty->assign('MB', true);
209
+            $smarty->assign('view_package', $this->editPackage);
210
+            $smarty->assign('description', $GLOBALS ['mod_strings'] ['LBL_LISTVIEW_DESCRIPTION']);
211 211
 
212 212
         } else
213 213
         {
214
-            $smarty->assign ( 'description', $GLOBALS [ 'mod_strings' ] [ 'LBL_LISTVIEW_DESCRIPTION' ] ) ;
214
+            $smarty->assign('description', $GLOBALS ['mod_strings'] ['LBL_LISTVIEW_DESCRIPTION']);
215 215
         }
216 216
 
217
-        return $smarty ;
217
+        return $smarty;
218 218
     }
219 219
 
220 220
     function _constructTitle()
221 221
     {
222
-        global $app_list_strings ;
222
+        global $app_list_strings;
223 223
 
224 224
         if ($this->fromModuleBuilder)
225
-            $title = $this->editModule ;
225
+            $title = $this->editModule;
226 226
         else
227
-            $title =  $app_list_strings [ 'moduleList' ] [ $this->editModule ] ;
227
+            $title = $app_list_strings ['moduleList'] [$this->editModule];
228 228
         
229
-        return $GLOBALS [ 'mod_strings' ] [ 'LBL_LISTVIEW_EDIT' ] . ':&nbsp;' . $title ;
229
+        return $GLOBALS ['mod_strings'] ['LBL_LISTVIEW_EDIT'].':&nbsp;'.$title;
230 230
     }
231 231
 }
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.modulelabels.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	    global $mod_strings;
57 57
 	    
58 58
     	return array(
59
-    	   translate('LBL_MODULE_NAME','Administration'),
59
+    	   translate('LBL_MODULE_NAME', 'Administration'),
60 60
     	   ModuleBuilderController::getModuleTitle(),
61 61
     	   );
62 62
     }
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	function display()
65 65
 	{
66 66
  		global $mod_strings;
67
-        $bak_mod_strings=$mod_strings;
67
+        $bak_mod_strings = $mod_strings;
68 68
  		$smarty = new Sugar_Smarty();
69 69
         $smarty->assign('mod_strings', $mod_strings);
70 70
  		$package_name = $_REQUEST['view_package'];
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
 		$package = $mb->packages[$_REQUEST['view_package']];
77 77
 		$package->getModule($module_name);
78 78
 		$mbModule = $package->modules[$module_name];
79
-		$selected_lang = (!empty($_REQUEST['selected_lang'])?$_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']);
80
-		if(empty($selected_lang)){
79
+		$selected_lang = (!empty($_REQUEST['selected_lang']) ? $_REQUEST['selected_lang'] : $_SESSION['authenticated_user_language']);
80
+		if (empty($selected_lang)) {
81 81
 	    	$selected_lang = $GLOBALS['sugar_config']['default_language'];
82 82
 		}
83 83
 	        //need to change the following to interface with MBlanguage.
@@ -87,20 +87,20 @@  discard block
 block discarded – undo
87 87
 		$smarty->assign('selected_lang', $selected_lang);
88 88
 		$smarty->assign('view_package', $package_name);
89 89
 		$smarty->assign('view_module', $module_name);
90
-		$smarty->assign('mb','1');
90
+		$smarty->assign('mb', '1');
91 91
 		$smarty->assign('available_languages', get_languages());
92 92
 		///////////////////////////////////////////////////////////////////
93 93
  		////ASSISTANT
94
- 		$smarty->assign('assistant',array('group'=>'module', 'key'=>'labels'));
94
+ 		$smarty->assign('assistant', array('group'=>'module', 'key'=>'labels'));
95 95
 		/////////////////////////////////////////////////////////////////
96 96
 	 	////ASSISTANT
97 97
 
98 98
 		$ajax = new AjaxCompose();
99 99
 		$ajax->addCrumb($bak_mod_strings['LBL_MODULEBUILDER'], 'ModuleBuilder.main("mb")');
100
-		$ajax->addCrumb($package_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$package->name. '")');
101
-        $ajax->addCrumb($module_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package='.$package->name.'&view_module='. $module_name . '")');
100
+		$ajax->addCrumb($package_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$package->name.'")');
101
+        $ajax->addCrumb($module_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package='.$package->name.'&view_module='.$module_name.'")');
102 102
         $ajax->addCrumb($bak_mod_strings['LBL_LABELS'], '');
103
-		$ajax->addSection('center', $bak_mod_strings['LBL_LABELS'],$smarty->fetch('modules/ModuleBuilder/tpls/labels.tpl'));
103
+		$ajax->addSection('center', $bak_mod_strings['LBL_LABELS'], $smarty->fetch('modules/ModuleBuilder/tpls/labels.tpl'));
104 104
 		echo $ajax->getJavascript();
105 105
 	}
106 106
 }
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.layoutview.php 1 patch
Spacing   +123 added lines, -123 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (! defined ( 'sugarEntry' ) || ! sugarEntry)
3
-    die ( 'Not A Valid Entry Point' ) ;
2
+if (!defined('sugarEntry') || !sugarEntry)
3
+    die ('Not A Valid Entry Point');
4 4
 
5 5
 /*********************************************************************************
6 6
  * SugarCRM Community Edition is a customer relationship management program developed by
@@ -41,28 +41,28 @@  discard block
 block discarded – undo
41 41
  ********************************************************************************/
42 42
 
43 43
 
44
-require_once ('modules/ModuleBuilder/parsers/ParserFactory.php') ;
45
-require_once ('modules/ModuleBuilder/MB/AjaxCompose.php') ;
46
-require_once 'modules/ModuleBuilder/parsers/constants.php' ;
44
+require_once ('modules/ModuleBuilder/parsers/ParserFactory.php');
45
+require_once ('modules/ModuleBuilder/MB/AjaxCompose.php');
46
+require_once 'modules/ModuleBuilder/parsers/constants.php';
47 47
 
48 48
 class ViewLayoutView extends SugarView
49 49
 {
50
-    function ViewLayoutView ()
50
+    function ViewLayoutView()
51 51
     {
52
-        $GLOBALS [ 'log' ]->debug ( 'in ViewLayoutView' ) ;
53
-        $this->editModule = $_REQUEST [ 'view_module' ] ;
54
-        $this->editLayout = $_REQUEST [ 'view' ] ;
52
+        $GLOBALS ['log']->debug('in ViewLayoutView');
53
+        $this->editModule = $_REQUEST ['view_module'];
54
+        $this->editLayout = $_REQUEST ['view'];
55 55
         $this->package = null;
56
-        $this->fromModuleBuilder = isset ( $_REQUEST [ 'MB' ] ) || !empty($_REQUEST [ 'view_package' ]);
56
+        $this->fromModuleBuilder = isset ($_REQUEST ['MB']) || !empty($_REQUEST ['view_package']);
57 57
         if ($this->fromModuleBuilder)
58 58
         {
59
-            $this->package = $_REQUEST [ 'view_package' ] ;
59
+            $this->package = $_REQUEST ['view_package'];
60 60
             $this->type = $this->editLayout;
61 61
         } else
62 62
         {
63
-            global $app_list_strings ;
64
-            $moduleNames = array_change_key_case ( $app_list_strings [ 'moduleList' ] ) ;
65
-            $this->translatedEditModule = $moduleNames [ strtolower ( $this->editModule ) ] ;
63
+            global $app_list_strings;
64
+            $moduleNames = array_change_key_case($app_list_strings ['moduleList']);
65
+            $this->translatedEditModule = $moduleNames [strtolower($this->editModule)];
66 66
             $this->sm = StudioModuleFactory::getStudioModule($this->editModule);
67 67
             $this->type = $this->sm->getViewType($this->editLayout);
68 68
         }
@@ -76,30 +76,30 @@  discard block
 block discarded – undo
76 76
 	    global $mod_strings;
77 77
 	    
78 78
     	return array(
79
-    	   translate('LBL_MODULE_NAME','Administration'),
79
+    	   translate('LBL_MODULE_NAME', 'Administration'),
80 80
     	   ModuleBuilderController::getModuleTitle(),
81 81
     	   );
82 82
     }
83 83
 
84 84
     // DO NOT REMOVE - overrides parent ViewEdit preDisplay() which attempts to load a bean for a non-existent module
85
-    function preDisplay ()
85
+    function preDisplay()
86 86
     {
87 87
     }
88 88
 
89
-    function display ($preview = false)
89
+    function display($preview = false)
90 90
     {
91 91
 
92
-        global $mod_strings ;
93
-        $parser = ParserFactory::getParser($this->editLayout,$this->editModule,$this->package);
92
+        global $mod_strings;
93
+        $parser = ParserFactory::getParser($this->editLayout, $this->editModule, $this->package);
94 94
 
95
-        if(isset($this->view_object_map['new_parser'])) {
95
+        if (isset($this->view_object_map['new_parser'])) {
96 96
             $parser = $this->view_object_map['new_parser'];
97 97
         }
98 98
 
99
-        $history = $parser->getHistory () ;
100
-        $smarty = new Sugar_Smarty ( ) ;
99
+        $history = $parser->getHistory();
100
+        $smarty = new Sugar_Smarty( );
101 101
         //Add in the module we are viewing to our current mod strings
102
-		if (! $this->fromModuleBuilder) {
102
+		if (!$this->fromModuleBuilder) {
103 103
 			global $current_language;
104 104
 			$editModStrings = return_module_language($current_language, $this->editModule);
105 105
 			$mod_strings = sugarArrayMerge($editModStrings, $mod_strings);
@@ -107,171 +107,171 @@  discard block
 block discarded – undo
107 107
         $smarty->assign('mod', $mod_strings);
108 108
 		$smarty->assign('MOD', $mod_strings);
109 109
         // assign buttons
110
-        $images = array ( 'icon_save' => 'studio_save' , 'icon_publish' => 'studio_publish' , 'icon_address' => 'icon_Address' , 'icon_emailaddress' => 'icon_EmailAddress' , 'icon_phone' => 'icon_Phone' ) ;
111
-        foreach ( $images as $image => $file )
110
+        $images = array('icon_save' => 'studio_save', 'icon_publish' => 'studio_publish', 'icon_address' => 'icon_Address', 'icon_emailaddress' => 'icon_EmailAddress', 'icon_phone' => 'icon_Phone');
111
+        foreach ($images as $image => $file)
112 112
         {
113
-            $smarty->assign ( $image, SugarThemeRegistry::current()->getImage($file,'',null,null,'.gif',$file) ) ;
113
+            $smarty->assign($image, SugarThemeRegistry::current()->getImage($file, '', null, null, '.gif', $file));
114 114
         }
115 115
 
116
-        $requiredFields = implode($parser->getRequiredFields () , ',');
116
+        $requiredFields = implode($parser->getRequiredFields(), ',');
117 117
         $slashedRequiredFields = addslashes($requiredFields);
118
-        $buttons = array ( ) ;
118
+        $buttons = array( );
119 119
         $disableLayout = false;
120 120
 
121 121
         if ($preview)
122 122
         {
123
-            $smarty->assign ( 'layouttitle', translate ( 'LBL_LAYOUT_PREVIEW', 'ModuleBuilder' ) ) ;
123
+            $smarty->assign('layouttitle', translate('LBL_LAYOUT_PREVIEW', 'ModuleBuilder'));
124 124
         } else
125 125
         {
126
-            $smarty->assign ( 'layouttitle', translate ( 'LBL_CURRENT_LAYOUT', 'ModuleBuilder' ) ) ;
126
+            $smarty->assign('layouttitle', translate('LBL_CURRENT_LAYOUT', 'ModuleBuilder'));
127 127
 
128 128
             //Check if we need to synch edit view to other layouts
129
-            if($this->editLayout == MB_DETAILVIEW || $this->editLayout == MB_QUICKCREATE){
130
-		        $parser2 = ParserFactory::getParser(MB_EDITVIEW,$this->editModule,$this->package);
131
-                if($this->editLayout == MB_DETAILVIEW){
129
+            if ($this->editLayout == MB_DETAILVIEW || $this->editLayout == MB_QUICKCREATE) {
130
+		        $parser2 = ParserFactory::getParser(MB_EDITVIEW, $this->editModule, $this->package);
131
+                if ($this->editLayout == MB_DETAILVIEW) {
132 132
 		            $disableLayout = $parser2->getSyncDetailEditViews();
133 133
                 }
134
-                if(!empty($_REQUEST['copyFromEditView'])){
135
-                    $editViewPanels = $parser2->convertFromCanonicalForm ( $parser2->_viewdefs [ 'panels' ] , $parser2->_fielddefs ) ;
136
-                    $parser->_viewdefs [ 'panels' ] = $editViewPanels;
134
+                if (!empty($_REQUEST['copyFromEditView'])) {
135
+                    $editViewPanels = $parser2->convertFromCanonicalForm($parser2->_viewdefs ['panels'], $parser2->_fielddefs);
136
+                    $parser->_viewdefs ['panels'] = $editViewPanels;
137 137
                     $parser->_fielddefs = $parser2->_fielddefs;
138 138
                     $parser->setUseTabs($parser2->getUseTabs());
139 139
                     $parser->setTabDefs($parser2->getTabDefs());
140 140
                 }
141 141
 		    }
142 142
 
143
-            if (! $this->fromModuleBuilder)
143
+            if (!$this->fromModuleBuilder)
144 144
             {
145
-	            $buttons [] = array (
146
-                    'id' => 'saveBtn' , 
147
-                    'text' => translate ( 'LBL_BTN_SAVE' ) , 
145
+	            $buttons [] = array(
146
+                    'id' => 'saveBtn', 
147
+                    'text' => translate('LBL_BTN_SAVE'), 
148 148
                     'actionScript' => "onclick='if(Studio2.checkGridLayout(\"{$this->editLayout}\")) Studio2.handleSave();'",
149 149
                 	'disabled' => $disableLayout, 
150
-                ) ;
151
-                $buttons [] = array ( 
152
-                    'id' => 'publishBtn' , 
153
-                    'text' => translate ( 'LBL_BTN_SAVEPUBLISH' ) , 
150
+                );
151
+                $buttons [] = array( 
152
+                    'id' => 'publishBtn', 
153
+                    'text' => translate('LBL_BTN_SAVEPUBLISH'), 
154 154
                     'actionScript' => "onclick='if(Studio2.checkGridLayout(\"{$this->editLayout}\")) Studio2.handlePublish();'",
155 155
                 	'disabled' => $disableLayout, 
156
-                ) ;
157
-                $buttons [] = array ( 'id' => 'spacer' , 'width' => '33px' ) ;
158
-                $buttons [] = array ( 
159
-	                'id' => 'historyBtn' , 
160
-	                'text' => translate ( 'LBL_HISTORY' ) , 
156
+                );
157
+                $buttons [] = array('id' => 'spacer', 'width' => '33px');
158
+                $buttons [] = array( 
159
+	                'id' => 'historyBtn', 
160
+	                'text' => translate('LBL_HISTORY'), 
161 161
 	                'actionScript' => "onclick='ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")'",
162 162
                     'disabled' => $disableLayout,
163
-                ) ;
164
-                $buttons [] = array ( 
165
-	                'id' => 'historyDefault' , 
166
-	                'text' => translate ( 'LBL_RESTORE_DEFAULT' ) , 
163
+                );
164
+                $buttons [] = array( 
165
+	                'id' => 'historyDefault', 
166
+	                'text' => translate('LBL_RESTORE_DEFAULT'), 
167 167
 	                'actionScript' => "onclick='ModuleBuilder.history.revert(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$history->getLast()}\", \"\")'",
168 168
                 	'disabled' => $disableLayout, 
169
-                ) ;
169
+                );
170 170
             } else
171 171
             {
172
-                $buttons [] = array ( 
173
-                    'id' => 'saveBtn' , 
174
-                    'text' => $GLOBALS [ 'mod_strings' ] [ 'LBL_BTN_SAVE' ] , 
172
+                $buttons [] = array( 
173
+                    'id' => 'saveBtn', 
174
+                    'text' => $GLOBALS ['mod_strings'] ['LBL_BTN_SAVE'], 
175 175
                     'actionScript' => "onclick='if(Studio2.checkGridLayout(\"{$this->editLayout}\")) Studio2.handlePublish();'",
176 176
                     'disabled' => $disableLayout,
177
-                ) ;
178
-                $buttons [] = array ( 'id' => 'spacer' , 'width' => '33px' ) ;
179
-                $buttons [] = array (
180
-                    'id' => 'historyBtn' , 
181
-                    'text' => translate ( 'LBL_HISTORY' ) , 
177
+                );
178
+                $buttons [] = array('id' => 'spacer', 'width' => '33px');
179
+                $buttons [] = array(
180
+                    'id' => 'historyBtn', 
181
+                    'text' => translate('LBL_HISTORY'), 
182 182
                     'actionScript' => "onclick='ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")'",
183 183
                     'disabled' => $disableLayout, 
184
-                ) ;
185
-                $buttons [] = array ( 
186
-                    'id' => 'historyDefault' , 
187
-                    'text' => translate ( 'LBL_RESTORE_DEFAULT' ) , 
184
+                );
185
+                $buttons [] = array( 
186
+                    'id' => 'historyDefault', 
187
+                    'text' => translate('LBL_RESTORE_DEFAULT'), 
188 188
                     'actionScript' => "onclick='ModuleBuilder.history.revert(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$history->getLast()}\", \"\")'",
189 189
                     'disabled' => $disableLayout, 
190
-                ) ;
190
+                );
191 191
             }
192 192
 
193 193
 
194
-            if($this->editLayout == MB_DETAILVIEW || $this->editLayout == MB_QUICKCREATE){
195
-                $buttons [] = array (
196
-                'id' => 'copyFromEditView' ,
197
-                'text' => translate ( 'LBL_COPY_FROM_EDITVIEW' ) ,
194
+            if ($this->editLayout == MB_DETAILVIEW || $this->editLayout == MB_QUICKCREATE) {
195
+                $buttons [] = array(
196
+                'id' => 'copyFromEditView',
197
+                'text' => translate('LBL_COPY_FROM_EDITVIEW'),
198 198
                 'actionScript' => "onclick='ModuleBuilder.copyFromView(\"{$this->editModule}\", \"{$this->editLayout}\")'",
199 199
                 'disabled' => $disableLayout,
200
-                ) ;
200
+                );
201 201
             }
202 202
         }
203 203
 
204
-        $html = "" ;
205
-        foreach ( $buttons as $button )
204
+        $html = "";
205
+        foreach ($buttons as $button)
206 206
         {
207 207
             if ($button['id'] == "spacer") {
208 208
             	$html .= "<td style='width:{$button['width']}'> </td>";
209 209
             } else {
210 210
         	    $html .= "<td><input id='{$button['id']}' type='button' valign='center' class='button' style='cursor:pointer' "
211 211
         	       . "onmousedown='this.className=\"buttonOn\";return false;' onmouseup='this.className=\"button\"' "
212
-        	       . "onmouseout='this.className=\"button\"' {$button['actionScript']} value = '{$button['text']}'" ;
213
-        	    if(!empty($button['disabled'])){
212
+        	       . "onmouseout='this.className=\"button\"' {$button['actionScript']} value = '{$button['text']}'";
213
+        	    if (!empty($button['disabled'])) {
214 214
         	    	 $html .= " disabled";
215 215
         	    }
216 216
         	    $html .= "></td>";
217 217
             }
218 218
         }
219 219
 
220
-        $smarty->assign ( 'buttons', $html ) ;
220
+        $smarty->assign('buttons', $html);
221 221
 
222 222
         // assign fields and layout
223
-        $smarty->assign ( 'available_fields', $parser->getAvailableFields () ) ;
223
+        $smarty->assign('available_fields', $parser->getAvailableFields());
224 224
         
225
-        $smarty->assign ( 'disable_layout', $disableLayout) ;
226
-        $smarty->assign ( 'required_fields', $requiredFields) ;
227
-        $smarty->assign ( 'layout', $parser->getLayout () ) ;
228
-        $smarty->assign ( 'field_defs', $parser->getFieldDefs () ) ;
229
-        $smarty->assign ( 'view_module', $this->editModule ) ;
230
-        $smarty->assign ( 'view', $this->editLayout ) ;
231
-        $smarty->assign ( 'maxColumns', $parser->getMaxColumns() ) ;
232
-        $smarty->assign ( 'nextPanelId', $parser->getFirstNewPanelId() ) ;
233
-        $smarty->assign ( 'displayAsTabs', $parser->getUseTabs() ) ;
234
-        $smarty->assign ( 'tabDefs', $parser->getTabDefs() ) ;
235
-        $smarty->assign ( 'syncDetailEditViews', $parser->getSyncDetailEditViews() ) ;
236
-        $smarty->assign ( 'fieldwidth', 150 ) ;
237
-        $smarty->assign ( 'translate', $this->fromModuleBuilder ? false : true ) ;
225
+        $smarty->assign('disable_layout', $disableLayout);
226
+        $smarty->assign('required_fields', $requiredFields);
227
+        $smarty->assign('layout', $parser->getLayout());
228
+        $smarty->assign('field_defs', $parser->getFieldDefs());
229
+        $smarty->assign('view_module', $this->editModule);
230
+        $smarty->assign('view', $this->editLayout);
231
+        $smarty->assign('maxColumns', $parser->getMaxColumns());
232
+        $smarty->assign('nextPanelId', $parser->getFirstNewPanelId());
233
+        $smarty->assign('displayAsTabs', $parser->getUseTabs());
234
+        $smarty->assign('tabDefs', $parser->getTabDefs());
235
+        $smarty->assign('syncDetailEditViews', $parser->getSyncDetailEditViews());
236
+        $smarty->assign('fieldwidth', 150);
237
+        $smarty->assign('translate', $this->fromModuleBuilder ? false : true);
238 238
 
239 239
         if ($this->fromModuleBuilder)
240 240
         {
241
-            $smarty->assign ( 'fromModuleBuilder', $this->fromModuleBuilder ) ;
242
-            $smarty->assign ( 'view_package', $this->package ) ;
241
+            $smarty->assign('fromModuleBuilder', $this->fromModuleBuilder);
242
+            $smarty->assign('view_package', $this->package);
243 243
         }
244 244
 
245
-        $labels = array (
246
-        			MB_EDITVIEW => 'LBL_EDITVIEW' ,
247
-        			MB_DETAILVIEW => 'LBL_DETAILVIEW' ,
245
+        $labels = array(
246
+        			MB_EDITVIEW => 'LBL_EDITVIEW',
247
+        			MB_DETAILVIEW => 'LBL_DETAILVIEW',
248 248
         			MB_QUICKCREATE => 'LBL_QUICKCREATE',
249
-        			) ;
249
+        			);
250 250
 
251
-        $layoutLabel = 'LBL_LAYOUTS' ;
252
-        $layoutView = 'layouts' ;
251
+        $layoutLabel = 'LBL_LAYOUTS';
252
+        $layoutView = 'layouts';
253 253
 
254 254
 
255
-        $ajax = new AjaxCompose ( ) ;
255
+        $ajax = new AjaxCompose( );
256 256
 
257
-        $translatedViewType = '' ;
258
-		if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) )
259
-			$translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ;
257
+        $translatedViewType = '';
258
+		if (isset ($labels [strtolower($this->editLayout)]))
259
+			$translatedViewType = translate($labels [strtolower($this->editLayout)], 'ModuleBuilder');
260 260
         else if (isset($this->sm))
261 261
         {
262
-            foreach($this->sm->sources as $file => $def)
262
+            foreach ($this->sm->sources as $file => $def)
263 263
             {
264 264
                 if (!empty($def['view']) && $def['view'] == $this->editLayout && !empty($def['name']))
265 265
                 {
266 266
                     $translatedViewType = $def['name'];
267 267
                 }
268 268
             }
269
-            if(empty($translatedViewType))
269
+            if (empty($translatedViewType))
270 270
             {
271
-                $label = "LBL_" . strtoupper($this->editLayout);
271
+                $label = "LBL_".strtoupper($this->editLayout);
272 272
                 $translated = translate($label, $this->editModule);
273 273
                 if ($translated != $label)
274
-                    $translatedViewType =  $translated;
274
+                    $translatedViewType = $translated;
275 275
             }
276 276
         }
277 277
 
@@ -280,34 +280,34 @@  discard block
 block discarded – undo
280 280
 
281 281
         if ($this->fromModuleBuilder)
282 282
         {
283
-            $ajax->addCrumb ( translate ( 'LBL_MODULEBUILDER', 'ModuleBuilder' ), 'ModuleBuilder.main("mb")' ) ;
284
-            $ajax->addCrumb ( $this->package, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=' . $this->package . '")' ) ;
285
-            $ajax->addCrumb ( $this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package=' . $this->package . '&view_module=' . $this->editModule . '")' ) ;
286
-            $ajax->addCrumb ( translate ( $layoutLabel, 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view='.$layoutView.'&view_module=' . $this->editModule . '&view_package=' . $this->package . '")' ) ;
287
-            $ajax->addCrumb ( $translatedViewType, '' ) ;
283
+            $ajax->addCrumb(translate('LBL_MODULEBUILDER', 'ModuleBuilder'), 'ModuleBuilder.main("mb")');
284
+            $ajax->addCrumb($this->package, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$this->package.'")');
285
+            $ajax->addCrumb($this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package='.$this->package.'&view_module='.$this->editModule.'")');
286
+            $ajax->addCrumb(translate($layoutLabel, 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view='.$layoutView.'&view_module='.$this->editModule.'&view_package='.$this->package.'")');
287
+            $ajax->addCrumb($translatedViewType, '');
288 288
         } else
289 289
         {
290
-            $ajax->addCrumb ( translate ( 'LBL_STUDIO', 'ModuleBuilder' ), 'ModuleBuilder.main("studio")' ) ;
291
-            $ajax->addCrumb ( $this->translatedEditModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $this->editModule . '")' ) ;
292
-            $ajax->addCrumb ( translate ( $layoutLabel, 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view='.$layoutView.'&view_module=' . $this->editModule . '")' ) ;
293
-            $ajax->addCrumb ( $translatedViewType, '' ) ;
290
+            $ajax->addCrumb(translate('LBL_STUDIO', 'ModuleBuilder'), 'ModuleBuilder.main("studio")');
291
+            $ajax->addCrumb($this->translatedEditModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module='.$this->editModule.'")');
292
+            $ajax->addCrumb(translate($layoutLabel, 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view='.$layoutView.'&view_module='.$this->editModule.'")');
293
+            $ajax->addCrumb($translatedViewType, '');
294 294
         }
295 295
 
296 296
         // set up language files
297
-		$smarty->assign ( 'language', $parser->getLanguage() ) ; // for sugar_translate in the smarty template
298
-        $smarty->assign('from_mb',$this->fromModuleBuilder);
297
+		$smarty->assign('language', $parser->getLanguage()); // for sugar_translate in the smarty template
298
+        $smarty->assign('from_mb', $this->fromModuleBuilder);
299 299
         $smarty->assign('calc_field_list', json_encode($parser->getCalculatedFields()));
300 300
 		if ($this->fromModuleBuilder) {
301
-			$mb = new ModuleBuilder ( ) ;
302
-            $module = & $mb->getPackageModule ( $this->package, $this->editModule ) ;
301
+			$mb = new ModuleBuilder( );
302
+            $module = & $mb->getPackageModule($this->package, $this->editModule);
303 303
 		    $smarty->assign('current_mod_strings', $module->getModStrings());
304 304
 		}
305 305
 
306
-        $ajax->addSection ( 'center', $translatedViewType, $smarty->fetch ( 'modules/ModuleBuilder/tpls/layoutView.tpl' ) ) ;
306
+        $ajax->addSection('center', $translatedViewType, $smarty->fetch('modules/ModuleBuilder/tpls/layoutView.tpl'));
307 307
         if ($preview) {
308
-        	echo $smarty->fetch ( 'modules/ModuleBuilder/tpls/Preview/layoutView.tpl' );
308
+        	echo $smarty->fetch('modules/ModuleBuilder/tpls/Preview/layoutView.tpl');
309 309
 		} else {
310
-			echo $ajax->getJavascript () ;
310
+			echo $ajax->getJavascript();
311 311
     	}
312 312
     }
313 313
 }
Please login to merge, or discard this patch.