Completed
Push — console-installer ( e2b50d...6ce748 )
by Adam
22:30
created
modules/ModuleBuilder/views/view.wizard.php 3 patches
Indentation   +285 added lines, -285 removed lines patch added patch discarded remove patch
@@ -43,301 +43,301 @@
 block discarded – undo
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 ;
52
-
53
-	private $editModule ;
54
-
55
-	function __construct()
56
-	{
57
-		if ( isset ( $_REQUEST [ 'view' ] ) )
58
-			$this->view = $_REQUEST [ 'view' ] ;
59
-
60
-		$this->editModule = (! empty ( $_REQUEST [ 'view_module' ] ) ) ? $_REQUEST [ 'view_module' ] : null ;
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
-	}
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
+
53
+    private $editModule ;
54
+
55
+    function __construct()
56
+    {
57
+        if ( isset ( $_REQUEST [ 'view' ] ) )
58
+            $this->view = $_REQUEST [ 'view' ] ;
59
+
60
+        $this->editModule = (! empty ( $_REQUEST [ 'view_module' ] ) ) ? $_REQUEST [ 'view_module' ] : null ;
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
+    }
63 63
 	
64
-	/**
65
-	 * @see SugarView::_getModuleTitleParams()
66
-	 */
67
-	protected function _getModuleTitleParams($browserTitle = false)
68
-	{
69
-	    global $mod_strings;
64
+    /**
65
+     * @see SugarView::_getModuleTitleParams()
66
+     */
67
+    protected function _getModuleTitleParams($browserTitle = false)
68
+    {
69
+        global $mod_strings;
70 70
 	    
71
-    	return array(
72
-    	   translate('LBL_MODULE_NAME','Administration'),
73
-    	   ModuleBuilderController::getModuleTitle(),
74
-    	   );
71
+        return array(
72
+            translate('LBL_MODULE_NAME','Administration'),
73
+            ModuleBuilderController::getModuleTitle(),
74
+            );
75
+    }
76
+
77
+    function display()
78
+    {
79
+        $this->ajax = new AjaxCompose ( ) ;
80
+        $smarty = new Sugar_Smarty ( ) ;
81
+
82
+        if (isset ( $_REQUEST [ 'MB' ] ))
83
+        {
84
+            $this->processMB ( $this->ajax ) ;
85
+        } else
86
+        {
87
+
88
+                $this->processStudio ( $this->ajax ) ;
89
+
90
+        }
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 ) ;
98
+
99
+        $this->ajax->addSection ( 'center', $this->title, $smarty->fetch ( 'modules/ModuleBuilder/tpls/wizard.tpl' ) ) ;
100
+        echo $this->ajax->getJavascript () ;
75 101
     }
76 102
 
77
-	function display()
78
-	{
79
-		$this->ajax = new AjaxCompose ( ) ;
80
-		$smarty = new Sugar_Smarty ( ) ;
81
-
82
-		if (isset ( $_REQUEST [ 'MB' ] ))
83
-		{
84
-			$this->processMB ( $this->ajax ) ;
85
-		} else
86
-		{
87
-
88
-				$this->processStudio ( $this->ajax ) ;
89
-
90
-		}
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 ) ;
98
-
99
-		$this->ajax->addSection ( 'center', $this->title, $smarty->fetch ( 'modules/ModuleBuilder/tpls/wizard.tpl' ) ) ;
100
-		echo $this->ajax->getJavascript () ;
101
-	}
102
-
103
-	function processStudio( 
104
-	    $ajax
105
-	    )
106
-	{
107
-
108
-		$this->ajax->addCrumb ( translate( 'LBL_STUDIO' ), 'ModuleBuilder.main("studio")' ) ;
109
-
110
-		if (! isset ( $this->editModule ))
111
-		{
112
-			//Studio Select Module Page
113
-			$this->generateStudioModuleButtons () ;
114
-			$this->question = translate('LBL_QUESTION_EDIT') ;
115
-			$this->title = translate( 'LBL_STUDIO' );
116
-			global $current_user;
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' ) . '">' ;
119
-
120
-			$this->help = 'studioHelp' ;
121
-		} else
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 )
126
-			{
127
-				case 'layouts':
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' ), '' ) ;
134
-					break;
135
-
136
-
137
-				case 'subpanels':
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' ;
144
-					break;
145
-
146
-				case 'search':
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' ;
154
-					break;
155
-
156
-				case 'dashlet':
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' ;
163
-					break;
103
+    function processStudio( 
104
+        $ajax
105
+        )
106
+    {
107
+
108
+        $this->ajax->addCrumb ( translate( 'LBL_STUDIO' ), 'ModuleBuilder.main("studio")' ) ;
109
+
110
+        if (! isset ( $this->editModule ))
111
+        {
112
+            //Studio Select Module Page
113
+            $this->generateStudioModuleButtons () ;
114
+            $this->question = translate('LBL_QUESTION_EDIT') ;
115
+            $this->title = translate( 'LBL_STUDIO' );
116
+            global $current_user;
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' ) . '">' ;
119
+
120
+            $this->help = 'studioHelp' ;
121
+        } else
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 )
126
+            {
127
+                case 'layouts':
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' ), '' ) ;
134
+                    break;
135
+
136
+
137
+                case 'subpanels':
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' ;
144
+                    break;
145
+
146
+                case 'search':
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' ;
154
+                    break;
155
+
156
+                case 'dashlet':
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' ;
163
+                    break;
164 164
 				
165
-				case 'popup':
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' ;
172
-					break;
173
-				default:
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' ;
179
-					global $current_user;
180
-					if (is_admin($current_user))
165
+                case 'popup':
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' ;
172
+                    break;
173
+                default:
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' ;
179
+                    global $current_user;
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 183
                         . translate( 'LBL_RESET_MODULE' ) . '">' ;
184
-			}
185
-		}
186
-	}
187
-
188
-	function processMB ( 
189
-	    $ajax 
190
-	    )
191
-	{
192
-		if (! isset ( $_REQUEST [ 'view_package' ] ))
193
-		{
194
-			sugar_die ( "no ModuleBuilder package set" ) ;
195
-		}
196
-
197
-		$this->editModule = $_REQUEST [ 'view_module' ] ;
198
-		$this->package = $_REQUEST [ 'view_package' ] ;
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 . '")') ;
203
-
204
-		switch ( $this->view )
205
-		{
206
-			case 'search':
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" ;
214
-				break;
215
-
216
-			case 'subpanel':
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' ;
222
-				break;
223
-
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' ;
231
-				break;
232
-
233
-
234
-			case 'popup':
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' ;
241
-				break;
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" ;
248
-		}
249
-	}
250
-
251
-
252
-	function generateStudioModuleButtons()
253
-	{
254
-		require_once ('modules/ModuleBuilder/Module/StudioBrowser.php') ;
255
-		$sb = new StudioBrowser ( ) ;
256
-		$sb->loadModules () ;
257
-		$nodes = $sb->getNodes () ;
258
-		$this->buttons = array ( ) ;
259
-		//$GLOBALS['log']->debug(print_r($nodes,true));
260
-		foreach ( $nodes as $module )
261
-		{
262
-			$this->buttons [ $module [ 'name' ] ] = array ( 'action' => $module [ 'action' ] , 'imageTitle' => ucfirst ( $module [ 'module' ] . "_32" ) , 'size' => '32', 'linkId' => 'studiolink_'.$module [ 'module' ] ) ;
263
-		}
264
-	}
265
-
266
-
267
-
268
-	function generateMBViewButtons()
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}" , 
273
-		      'imageTitle' => 'EditView', 
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}" , 
279
-		      'imageTitle' => 'DetailView', 
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}" , 
285
-		      'imageTitle' => 'ListView', 
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}" , 
291
-		      'imageTitle' => 'QuickCreate', 
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' , 
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}" , 
303
-		      'imageTitle' => 'Dashlet', 
304
-		      'help'=>'viewBtnDashlet' 
305
-		  ) ;
306
-		$this->buttons [ $GLOBALS [ 'mod_strings' ] ['LBL_POPUP'] ] = 
307
-		array ( 
308
-			'imageTitle' => 'Popup',  
309
-			'action' => "module=ModuleBuilder&MB=true&action=wizard&view=popup&view_module={$this->editModule}&view_package={$this->package}", 
310
-			'help'=>'PopupListViewBtn'
311
-		);  
312
-	}
313
-
314
-	function generateMBDashletButtons() 
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');
318
-	}
184
+            }
185
+        }
186
+    }
187
+
188
+    function processMB ( 
189
+        $ajax 
190
+        )
191
+    {
192
+        if (! isset ( $_REQUEST [ 'view_package' ] ))
193
+        {
194
+            sugar_die ( "no ModuleBuilder package set" ) ;
195
+        }
196
+
197
+        $this->editModule = $_REQUEST [ 'view_module' ] ;
198
+        $this->package = $_REQUEST [ 'view_package' ] ;
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 . '")') ;
203
+
204
+        switch ( $this->view )
205
+        {
206
+            case 'search':
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" ;
214
+                break;
215
+
216
+            case 'subpanel':
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' ;
222
+                break;
223
+
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' ;
231
+                break;
232
+
233
+
234
+            case 'popup':
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' ;
241
+                break;
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" ;
248
+        }
249
+    }
250
+
251
+
252
+    function generateStudioModuleButtons()
253
+    {
254
+        require_once ('modules/ModuleBuilder/Module/StudioBrowser.php') ;
255
+        $sb = new StudioBrowser ( ) ;
256
+        $sb->loadModules () ;
257
+        $nodes = $sb->getNodes () ;
258
+        $this->buttons = array ( ) ;
259
+        //$GLOBALS['log']->debug(print_r($nodes,true));
260
+        foreach ( $nodes as $module )
261
+        {
262
+            $this->buttons [ $module [ 'name' ] ] = array ( 'action' => $module [ 'action' ] , 'imageTitle' => ucfirst ( $module [ 'module' ] . "_32" ) , 'size' => '32', 'linkId' => 'studiolink_'.$module [ 'module' ] ) ;
263
+        }
264
+    }
265
+
266
+
267
+
268
+    function generateMBViewButtons()
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}" , 
273
+                'imageTitle' => 'EditView', 
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}" , 
279
+                'imageTitle' => 'DetailView', 
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}" , 
285
+                'imageTitle' => 'ListView', 
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}" , 
291
+                'imageTitle' => 'QuickCreate', 
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' , 
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}" , 
303
+                'imageTitle' => 'Dashlet', 
304
+                'help'=>'viewBtnDashlet' 
305
+            ) ;
306
+        $this->buttons [ $GLOBALS [ 'mod_strings' ] ['LBL_POPUP'] ] = 
307
+        array ( 
308
+            'imageTitle' => 'Popup',  
309
+            'action' => "module=ModuleBuilder&MB=true&action=wizard&view=popup&view_module={$this->editModule}&view_package={$this->package}", 
310
+            'help'=>'PopupListViewBtn'
311
+        );  
312
+    }
313
+
314
+    function generateMBDashletButtons() 
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');
318
+    }
319 319
 	
320
-	function generateMBPopupButtons() 
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');
324
-	}
320
+    function generateMBPopupButtons() 
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');
324
+    }
325 325
 	
326
-	function generateStudioDashletButtons() 
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');
330
-	}
326
+    function generateStudioDashletButtons() 
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');
330
+    }
331 331
 	
332
-	function generateStudioPopupButtons()
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');
336
-	}
332
+    function generateStudioPopupButtons()
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');
336
+    }
337 337
 	
338
-	function generateMBSearchButtons()
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" ) ;
342
-	}
338
+    function generateMBSearchButtons()
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" ) ;
342
+    }
343 343
 }
Please login to merge, or discard this 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.
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -54,8 +54,9 @@  discard block
 block discarded – undo
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
 
60 61
 		$this->editModule = (! empty ( $_REQUEST [ 'view_module' ] ) ) ? $_REQUEST [ 'view_module' ] : null ;
61 62
 		$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
@@ -114,8 +115,9 @@  discard block
 block discarded – undo
114 115
 			$this->question = translate('LBL_QUESTION_EDIT') ;
115 116
 			$this->title = translate( 'LBL_STUDIO' );
116 117
 			global $current_user;
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
+			if (is_admin($current_user)) {
119
+							$this->actions = "<input class=\"button\" type=\"button\" id=\"exportBtn\" name=\"exportBtn\" onclick=\"ModuleBuilder.getContent('module=ModuleBuilder&action=exportcustomizations');\" value=\"" . translate ( 'LBL_BTN_EXPORT' ) . '">' ;
120
+			}
119 121
 
120 122
 			$this->help = 'studioHelp' ;
121 123
 		} else
@@ -177,10 +179,11 @@  discard block
 block discarded – undo
177 179
 					$this->title = translate( 'LBL_EDIT' ) . " " . $module->name ;
178 180
 					$this->help = 'moduleHelp' ;
179 181
 					global $current_user;
180
-					if (is_admin($current_user))
181
-                        $this->actions = "<input class=\"button\" type=\"button\" id=\"exportBtn\" name=\"exportBtn\" " 
182
+					if (is_admin($current_user)) {
183
+					                        $this->actions = "<input class=\"button\" type=\"button\" id=\"exportBtn\" name=\"exportBtn\" " 
182 184
                         . "onclick=\"ModuleBuilder.getContent('module=ModuleBuilder&action=resetmodule&view_module=$this->editModule');\" value=\"" 
183 185
                         . translate( 'LBL_RESET_MODULE' ) . '">' ;
186
+					}
184 187
 			}
185 188
 		}
186 189
 	}
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.relationships.php 2 patches
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -46,16 +46,16 @@  discard block
 block discarded – undo
46 46
 class ViewRelationships extends SugarView
47 47
 {
48 48
     /**
49
-	 * @see SugarView::_getModuleTitleParams()
50
-	 */
51
-	protected function _getModuleTitleParams($browserTitle = false)
52
-	{
53
-	    global $mod_strings;
49
+     * @see SugarView::_getModuleTitleParams()
50
+     */
51
+    protected function _getModuleTitleParams($browserTitle = false)
52
+    {
53
+        global $mod_strings;
54 54
 	    
55
-    	return array(
56
-    	   translate('LBL_MODULE_NAME','Administration'),
57
-    	   ModuleBuilderController::getModuleTitle(),
58
-    	   );
55
+        return array(
56
+            translate('LBL_MODULE_NAME','Administration'),
57
+            ModuleBuilderController::getModuleTitle(),
58
+            );
59 59
     }
60 60
 
61 61
     function display()
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
         $ajax = new AjaxCompose ( ) ;
71 71
         $json = getJSONobj () ;
72
-		$this->fromModuleBuilder = !empty ( $_REQUEST [ 'MB' ] ) || (!empty($_REQUEST['view_package']) && $_REQUEST['view_package'] != 'studio') ;
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
         {
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
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
-			$package->loadModuleTitles();
100
+            $package->loadModuleTitles();
101 101
             $relationships = new UndeployedRelationships ( $module->getModuleDir () ) ;
102 102
             $ajaxRelationships = $this->getAjaxRelationships( $relationships ) ;
103 103
             $smarty->assign ( 'relationships', $json->encode ( $ajaxRelationships ) ) ;
@@ -129,23 +129,23 @@  discard block
 block discarded – undo
129 129
             
130 130
             //#28668  , translate the relationship type before render it .
131 131
             switch($rel['relationship_type']){
132
-            	case 'one-to-one':
133
-            	$rel['relationship_type']  = translate ( 'LBL_ONETOONE' );
134
-            	break;
135
-            	case 'one-to-many':
136
-            	$rel['relationship_type']  = translate ( 'LBL_ONETOMANY' );
137
-            	break;
138
-            	case 'many-to-one':
139
-            	$rel['relationship_type']  = translate ( 'LBL_MANYTOONE' );
140
-            	break;
141
-            	case 'many-to-many':
142
-            	$rel['relationship_type']  = translate ( 'LBL_MANYTOMANY' );
143
-            	break;
144
-            	default: $rel['relationship_type']  = '';
132
+                case 'one-to-one':
133
+                $rel['relationship_type']  = translate ( 'LBL_ONETOONE' );
134
+                break;
135
+                case 'one-to-many':
136
+                $rel['relationship_type']  = translate ( 'LBL_ONETOMANY' );
137
+                break;
138
+                case 'many-to-one':
139
+                $rel['relationship_type']  = translate ( 'LBL_MANYTOONE' );
140
+                break;
141
+                case 'many-to-many':
142
+                $rel['relationship_type']  = translate ( 'LBL_MANYTOMANY' );
143
+                break;
144
+                default: $rel['relationship_type']  = '';
145 145
             }
146 146
             $rel [ 'name' ] = $relationshipName ;
147 147
             if ($rel [ 'is_custom' ] && isset($rel [ 'from_studio' ]) && $rel [ 'from_studio' ]) {
148
-            	$rel [ 'name' ] = $relationshipName . "*";
148
+                $rel [ 'name' ] = $relationshipName . "*";
149 149
             }
150 150
             $ajaxrels [] = $rel ;
151 151
         }
Please login to merge, or discard this 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 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -43,22 +43,22 @@
 block discarded – undo
43 43
 class Viewdeletemodule extends SugarView
44 44
 {
45 45
 /**
46
-	 * @see SugarView::_getModuleTitleParams()
47
-	 */
48
-	protected function _getModuleTitleParams($browserTitle = false)
49
-	{
50
-	    global $mod_strings;
46
+ * @see SugarView::_getModuleTitleParams()
47
+ */
48
+    protected function _getModuleTitleParams($browserTitle = false)
49
+    {
50
+        global $mod_strings;
51 51
 	    
52
-    	return array(
53
-    	   translate('LBL_MODULE_NAME','Administration'),
54
-    	   ModuleBuilderController::getModuleTitle(),
55
-    	   );
52
+        return array(
53
+            translate('LBL_MODULE_NAME','Administration'),
54
+            ModuleBuilderController::getModuleTitle(),
55
+            );
56 56
     }
57 57
 
58
-	function display()
59
-	{
60
- 		$ajax = new AjaxCompose();
61
-		$ajax->addSection('center', 'Module Deleted', $_REQUEST['module'] . ' was deleted from ' . $_REQUEST['package']);
62
-		echo $ajax->getJavascript(); 
63
- 	}
58
+    function display()
59
+    {
60
+            $ajax = new AjaxCompose();
61
+        $ajax->addSection('center', 'Module Deleted', $_REQUEST['module'] . ' was deleted from ' . $_REQUEST['package']);
62
+        echo $ajax->getJavascript(); 
63
+        }
64 64
 }
65 65
\ No newline at end of file
Please login to merge, or discard this 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 3 patches
Indentation   +96 added lines, -96 removed lines patch added patch discarded remove patch
@@ -41,130 +41,130 @@
 block discarded – undo
41 41
 
42 42
 class ViewDropdown extends SugarView
43 43
 {
44
- 	/**
45
-	 * @see SugarView::_getModuleTitleParams()
46
-	 */
47
-	protected function _getModuleTitleParams($browserTitle = false)
48
-	{
49
-	    global $mod_strings;
44
+        /**
45
+         * @see SugarView::_getModuleTitleParams()
46
+         */
47
+    protected function _getModuleTitleParams($browserTitle = false)
48
+    {
49
+        global $mod_strings;
50 50
 	    
51
-    	return array(
52
-    	   translate('LBL_MODULE_NAME','Administration'),
53
-    	   ModuleBuilderController::getModuleTitle(),
54
-    	   );
51
+        return array(
52
+            translate('LBL_MODULE_NAME','Administration'),
53
+            ModuleBuilderController::getModuleTitle(),
54
+            );
55 55
     }
56 56
 
57
- 	function display()
58
- 	{
59
-		$ajax = new AjaxCompose();
60
-		$smarty = $this->generateSmarty();
57
+        function display()
58
+        {
59
+        $ajax = new AjaxCompose();
60
+        $smarty = $this->generateSmarty();
61 61
 		
62
-		if (isset($_REQUEST['refreshTree']))
63
-		{
64
-			require_once ('modules/ModuleBuilder/Module/DropDownTree.php');
65
-			$mbt = new DropDownTree();
66
-			$ajax->addSection('west', $mbt->getName(), $mbt->fetchNodes());
67
-			$smarty->assign('refreshTree',true);
68
-		}
62
+        if (isset($_REQUEST['refreshTree']))
63
+        {
64
+            require_once ('modules/ModuleBuilder/Module/DropDownTree.php');
65
+            $mbt = new DropDownTree();
66
+            $ajax->addSection('west', $mbt->getName(), $mbt->fetchNodes());
67
+            $smarty->assign('refreshTree',true);
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', ''
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 74
 ,null,null,'.gif',$mod_strings['LBL_EDIT']));
75
-		$smarty->assign('action', 'savedropdown');
76
-		$body = $smarty->fetch('modules/ModuleBuilder/tpls/MBModule/dropdown.tpl');
77
-		$ajax->addSection('east2', $mod_strings['LBL_SECTION_DROPDOWNED'], $body );
78
- 		echo $ajax->getJavascript();
79
- 	}
75
+        $smarty->assign('action', 'savedropdown');
76
+        $body = $smarty->fetch('modules/ModuleBuilder/tpls/MBModule/dropdown.tpl');
77
+        $ajax->addSection('east2', $mod_strings['LBL_SECTION_DROPDOWNED'], $body );
78
+            echo $ajax->getJavascript();
79
+        }
80 80
  	
81
- 	function generateSmarty()
82
- 	{
83
-		//get the selected language
84
-		$selected_lang = (!empty($_REQUEST['dropdown_lang'])?$_REQUEST['dropdown_lang']:$_SESSION['authenticated_user_language']);
85
-		$vardef = array();
86
-		$package_name = 'studio';
87
-		$package_strings = array();
88
-		$new =false;
89
-		$my_list_strings = return_app_list_strings_language( $selected_lang ) ;
81
+        function generateSmarty()
82
+        {
83
+        //get the selected language
84
+        $selected_lang = (!empty($_REQUEST['dropdown_lang'])?$_REQUEST['dropdown_lang']:$_SESSION['authenticated_user_language']);
85
+        $vardef = array();
86
+        $package_name = 'studio';
87
+        $package_strings = array();
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
-		//if we are using ModuleBuilder then process the following
95
-		if(!empty($_REQUEST['view_package']) && $_REQUEST['view_package'] != 'studio'){
96
-			require_once('modules/ModuleBuilder/MB/ModuleBuilder.php');
97
-			$mb = new ModuleBuilder();
98
-			$module = $mb->getPackageModule($_REQUEST['view_package'], $_REQUEST['view_module']);
99
-			$package = $mb->packages[$_REQUEST['view_package']];
100
-			$package_name = $package->name;
101
-			$module->getVardefs();
102
-			if(empty($_REQUEST['dropdown_name']) && !empty($_REQUEST['field'])){
103
-				$new = true;
104
-				$_REQUEST['dropdown_name'] = $_REQUEST['field']. '_list';
105
-			}
94
+        //if we are using ModuleBuilder then process the following
95
+        if(!empty($_REQUEST['view_package']) && $_REQUEST['view_package'] != 'studio'){
96
+            require_once('modules/ModuleBuilder/MB/ModuleBuilder.php');
97
+            $mb = new ModuleBuilder();
98
+            $module = $mb->getPackageModule($_REQUEST['view_package'], $_REQUEST['view_module']);
99
+            $package = $mb->packages[$_REQUEST['view_package']];
100
+            $package_name = $package->name;
101
+            $module->getVardefs();
102
+            if(empty($_REQUEST['dropdown_name']) && !empty($_REQUEST['field'])){
103
+                $new = true;
104
+                $_REQUEST['dropdown_name'] = $_REQUEST['field']. '_list';
105
+            }
106 106
 			
107
-			$vardef = (!empty($module->mbvardefs->fields[$_REQUEST['dropdown_name']]))? $module->mbvardefs->fields[$_REQUEST['dropdown_name']]: array();
108
-			$module->mblanguage->generateAppStrings(false) ;
107
+            $vardef = (!empty($module->mbvardefs->fields[$_REQUEST['dropdown_name']]))? $module->mbvardefs->fields[$_REQUEST['dropdown_name']]: array();
108
+            $module->mblanguage->generateAppStrings(false) ;
109 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 113
         $module_name = !empty($module->name) ?  $module->name : '';
114 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)){
118
-				unset($my_list_strings[$key]);
119
-			}
120
-		}
116
+        foreach($my_list_strings as $key=>$value){
117
+            if(!is_array($value)){
118
+                unset($my_list_strings[$key]);
119
+            }
120
+        }
121 121
 		
122
-		$dropdowns = array_keys($my_list_strings);
123
-		asort($dropdowns);
124
-		$keys = array_keys($dropdowns);
125
-		$first_string = $my_list_strings[$dropdowns[$keys[0]]];
122
+        $dropdowns = array_keys($my_list_strings);
123
+        asort($dropdowns);
124
+        $keys = array_keys($dropdowns);
125
+        $first_string = $my_list_strings[$dropdowns[$keys[0]]];
126 126
 
127
-		$name = '';
128
-		$selected_dropdown = array();
127
+        $name = '';
128
+        $selected_dropdown = array();
129 129
 
130
-		$json = getJSONobj();
130
+        $json = getJSONobj();
131 131
 
132
-		if(!empty($_REQUEST['dropdown_name']) && !$new){
133
-			$name = $_REQUEST['dropdown_name'];
132
+        if(!empty($_REQUEST['dropdown_name']) && !$new){
133
+            $name = $_REQUEST['dropdown_name'];
134 134
 			
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
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 138
                 $my_list_strings[$name] = array () ;
139 139
  
140
-			$selected_dropdown = (!empty($vardef['options']) && !empty($my_list_strings[$vardef['options']])) ? $my_list_strings[$vardef['options']] : $my_list_strings[$name];
141
-			$smarty->assign('ul_list', 'list = '.$json->encode(array_keys($selected_dropdown)));
142
-			$smarty->assign('dropdown_name', (!empty($vardef['options']) ? $vardef['options'] : $_REQUEST['dropdown_name']));
143
-			$smarty->assign('name', $_REQUEST['dropdown_name']);
144
-			$smarty->assign('options', $selected_dropdown);
145
-		}else{
146
-			$smarty->assign('ul_list', 'list = {}');
147
-			//we should try to find a name for this dropdown based on the field name.
148
-			$pre_pop_name = '';
149
-			if(!empty($_REQUEST['field']))
150
-				$pre_pop_name = $_REQUEST['field'];
151
-			//ensure this dropdown name does not already exist
152
-			$use_name = $pre_pop_name.'_list';
153
-			for($i = 0; $i < 100; $i++){
154
-				if(empty($my_list_strings[$use_name]))
155
-					break;
156
-				else
157
-					$use_name = $pre_pop_name.'_'.$i;
158
-			}
159
-			$smarty->assign('prepopulated_name', $use_name);
160
-		}
140
+            $selected_dropdown = (!empty($vardef['options']) && !empty($my_list_strings[$vardef['options']])) ? $my_list_strings[$vardef['options']] : $my_list_strings[$name];
141
+            $smarty->assign('ul_list', 'list = '.$json->encode(array_keys($selected_dropdown)));
142
+            $smarty->assign('dropdown_name', (!empty($vardef['options']) ? $vardef['options'] : $_REQUEST['dropdown_name']));
143
+            $smarty->assign('name', $_REQUEST['dropdown_name']);
144
+            $smarty->assign('options', $selected_dropdown);
145
+        }else{
146
+            $smarty->assign('ul_list', 'list = {}');
147
+            //we should try to find a name for this dropdown based on the field name.
148
+            $pre_pop_name = '';
149
+            if(!empty($_REQUEST['field']))
150
+                $pre_pop_name = $_REQUEST['field'];
151
+            //ensure this dropdown name does not already exist
152
+            $use_name = $pre_pop_name.'_list';
153
+            for($i = 0; $i < 100; $i++){
154
+                if(empty($my_list_strings[$use_name]))
155
+                    break;
156
+                else
157
+                    $use_name = $pre_pop_name.'_'.$i;
158
+            }
159
+            $smarty->assign('prepopulated_name', $use_name);
160
+        }
161 161
 
162
-		$smarty->assign('module_name', $module_name);
163
-		$smarty->assign('APP', $GLOBALS['app_strings']);
164
-		$smarty->assign('MOD', $GLOBALS['mod_strings']);
165
-		$smarty->assign('selected_lang', $selected_lang);
166
-		$smarty->assign('available_languages',get_languages());
167
-		$smarty->assign('package_name', $package_name);
168
- 		return $smarty;
169
- 	}
162
+        $smarty->assign('module_name', $module_name);
163
+        $smarty->assign('APP', $GLOBALS['app_strings']);
164
+        $smarty->assign('MOD', $GLOBALS['mod_strings']);
165
+        $smarty->assign('selected_lang', $selected_lang);
166
+        $smarty->assign('available_languages',get_languages());
167
+        $smarty->assign('package_name', $package_name);
168
+            return $smarty;
169
+        }
170 170
 }
171 171
\ No newline at end of file
Please login to merge, or discard this 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.
Braces   +12 added lines, -9 removed lines patch added patch discarded remove patch
@@ -134,27 +134,30 @@
 block discarded – undo
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
-            if (!isset($my_list_strings[$name]))
138
-                $my_list_strings[$name] = array () ;
137
+            if (!isset($my_list_strings[$name])) {
138
+                            $my_list_strings[$name] = array () ;
139
+            }
139 140
  
140 141
 			$selected_dropdown = (!empty($vardef['options']) && !empty($my_list_strings[$vardef['options']])) ? $my_list_strings[$vardef['options']] : $my_list_strings[$name];
141 142
 			$smarty->assign('ul_list', 'list = '.$json->encode(array_keys($selected_dropdown)));
142 143
 			$smarty->assign('dropdown_name', (!empty($vardef['options']) ? $vardef['options'] : $_REQUEST['dropdown_name']));
143 144
 			$smarty->assign('name', $_REQUEST['dropdown_name']);
144 145
 			$smarty->assign('options', $selected_dropdown);
145
-		}else{
146
+		} else{
146 147
 			$smarty->assign('ul_list', 'list = {}');
147 148
 			//we should try to find a name for this dropdown based on the field name.
148 149
 			$pre_pop_name = '';
149
-			if(!empty($_REQUEST['field']))
150
-				$pre_pop_name = $_REQUEST['field'];
150
+			if(!empty($_REQUEST['field'])) {
151
+							$pre_pop_name = $_REQUEST['field'];
152
+			}
151 153
 			//ensure this dropdown name does not already exist
152 154
 			$use_name = $pre_pop_name.'_list';
153 155
 			for($i = 0; $i < 100; $i++){
154
-				if(empty($my_list_strings[$use_name]))
155
-					break;
156
-				else
157
-					$use_name = $pre_pop_name.'_'.$i;
156
+				if(empty($my_list_strings[$use_name])) {
157
+									break;
158
+				} else {
159
+									$use_name = $pre_pop_name.'_'.$i;
160
+				}
158 161
 			}
159 162
 			$smarty->assign('prepopulated_name', $use_name);
160 163
 		}
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.listview.php 3 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -46,16 +46,16 @@  discard block
 block discarded – undo
46 46
 class ViewListView extends SugarView
47 47
 {
48 48
     /**
49
-	 * @see SugarView::_getModuleTitleParams()
50
-	 */
51
-	protected function _getModuleTitleParams($browserTitle = false)
52
-	{
53
-	    global $mod_strings;
49
+     * @see SugarView::_getModuleTitleParams()
50
+     */
51
+    protected function _getModuleTitleParams($browserTitle = false)
52
+    {
53
+        global $mod_strings;
54 54
 	    
55
-    	return array(
56
-    	   translate('LBL_MODULE_NAME','Administration'),
57
-    	   ModuleBuilderController::getModuleTitle(),
58
-    	   );
55
+        return array(
56
+            translate('LBL_MODULE_NAME','Administration'),
57
+            ModuleBuilderController::getModuleTitle(),
58
+            );
59 59
     }
60 60
 
61 61
     /*
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
 
113 113
 
114 114
         $labels = array (
115
-        			MB_LISTVIEW => 'LBL_LISTVIEW' ,
116
-        			) ;
115
+                    MB_LISTVIEW => 'LBL_LISTVIEW' ,
116
+                    ) ;
117 117
         $translatedViewType = '' ;
118
-		if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) )
119
-			$translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ;
120
-		$this->translatedViewType = $translatedViewType;
118
+        if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) )
119
+            $translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ;
120
+        $this->translatedViewType = $translatedViewType;
121 121
 
122 122
         if ($this->fromModuleBuilder)
123 123
         {
@@ -198,8 +198,8 @@  discard block
 block discarded – undo
198 198
                 $subRef = $subList[strtolower($this->subpanel)];
199 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';
@@ -321,11 +321,11 @@  discard block
 block discarded – undo
321 321
 
322 322
     function _buildImageButtons ($buttons , $horizontal = true)
323 323
     {
324
-    	$text = '<table cellspacing=2><tr>' ;
324
+        $text = '<table cellspacing=2><tr>' ;
325 325
         foreach ( $buttons as $button )
326 326
         {
327 327
             if (empty($button['id'])) {
328
-            	$button['id'] = $button['name'];
328
+                $button['id'] = $button['name'];
329 329
             }
330 330
             if (! $horizontal)
331 331
             {
Please login to merge, or discard this 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.
Braces   +17 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (! defined ( 'sugarEntry' ) || ! sugarEntry)
2
+if (! defined ( 'sugarEntry' ) || ! sugarEntry) {
3 3
     die ( 'Not A Valid Entry Point' ) ;
4
+}
4 5
 /*********************************************************************************
5 6
  * SugarCRM Community Edition is a customer relationship management program developed by
6 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -115,8 +116,9 @@  discard block
 block discarded – undo
115 116
         			MB_LISTVIEW => 'LBL_LISTVIEW' ,
116 117
         			) ;
117 118
         $translatedViewType = '' ;
118
-		if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) )
119
-			$translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ;
119
+		if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) ) {
120
+					$translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ;
121
+		}
120 122
 		$this->translatedViewType = $translatedViewType;
121 123
 
122 124
         if ($this->fromModuleBuilder)
@@ -131,8 +133,9 @@  discard block
 block discarded – undo
131 133
                 {
132 134
                     $subpanelLabel = $this->subpanelLabel;
133 135
                     // If the subpanel title has changed, use that for the label instead
134
-                    if( !empty($_REQUEST['subpanel_title'] ) && $_REQUEST['subpanelLabel'] != $_REQUEST['subpanel_title'] )
135
-                        $subpanelLabel = $_REQUEST['subpanel_title'];
136
+                    if( !empty($_REQUEST['subpanel_title'] ) && $_REQUEST['subpanelLabel'] != $_REQUEST['subpanel_title'] ) {
137
+                                            $subpanelLabel = $_REQUEST['subpanel_title'];
138
+                    }
136 139
 
137 140
                     $ajax->addCrumb( $subpanelLabel, '' );
138 141
                     $this->translatedViewType = $subpanelLabel . "&nbsp;" . translate("LBL_SUBPANEL", "ModuleBuilder");
@@ -158,8 +161,9 @@  discard block
 block discarded – undo
158 161
                 {
159 162
                     $subpanelLabel = $this->subpanelLabel;
160 163
                     // If the subpanel title has changed, use that for the label instead
161
-                    if( !empty($_REQUEST['subpanel_title'] ) && $_REQUEST['subpanelLabel'] != $_REQUEST['subpanel_title'] )
162
-                        $subpanelLabel = $_REQUEST['subpanel_title'];
164
+                    if( !empty($_REQUEST['subpanel_title'] ) && $_REQUEST['subpanelLabel'] != $_REQUEST['subpanel_title'] ) {
165
+                                            $subpanelLabel = $_REQUEST['subpanel_title'];
166
+                    }
163 167
 
164 168
                     $ajax->addCrumb( $subpanelLabel, '' );
165 169
                     $this->translatedViewType = $subpanelLabel . "&nbsp;" . translate("LBL_SUBPANEL", "ModuleBuilder");
@@ -241,12 +245,14 @@  discard block
 block discarded – undo
241 245
         $history = $parser->getHistory () ;
242 246
 
243 247
         $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")" ;
244
-        if ($this->subpanel)
245
-            $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$this->subpanel}\")" ;
248
+        if ($this->subpanel) {
249
+                    $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$this->subpanel}\")" ;
250
+        }
246 251
 
247 252
         $restoreAction = "onclick='ModuleBuilder.history.revert(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$history->getLast()}\", \"\")'";
248
-        if ($this->subpanel)
249
-            $restoreAction = "onclick='ModuleBuilder.history.revert(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$history->getLast()}\", \"{$this->subpanel}\")'";
253
+        if ($this->subpanel) {
254
+                    $restoreAction = "onclick='ModuleBuilder.history.revert(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$history->getLast()}\", \"{$this->subpanel}\")'";
255
+        }
250 256
 
251 257
         $buttons = array ( ) ;
252 258
         $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\" )'" ) ;
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.dashlet.php 3 patches
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -68,16 +68,16 @@  discard block
 block discarded – undo
68 68
     }
69 69
 
70 70
     /**
71
-	 * @see SugarView::_getModuleTitleParams()
72
-	 */
73
-	protected function _getModuleTitleParams($browserTitle = false)
74
-	{
75
-	    global $mod_strings;
71
+     * @see SugarView::_getModuleTitleParams()
72
+     */
73
+    protected function _getModuleTitleParams($browserTitle = false)
74
+    {
75
+        global $mod_strings;
76 76
 	    
77
-    	return array(
78
-    	   translate('LBL_MODULE_NAME','Administration'),
79
-    	   ModuleBuilderController::getModuleTitle(),
80
-    	   );
77
+        return array(
78
+            translate('LBL_MODULE_NAME','Administration'),
79
+            ModuleBuilderController::getModuleTitle(),
80
+            );
81 81
     }
82 82
 
83 83
     // DO NOT REMOVE - overrides parent ViewEdit preDisplay() which attempts to load a bean for a non-existent module
@@ -97,12 +97,12 @@  discard block
 block discarded – undo
97 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
 
@@ -145,11 +145,11 @@  discard block
 block discarded – undo
145 145
         $helpName = (isset( $_REQUEST['view']) && $_REQUEST['view']=='dashletsearch') ? 'searchViewEditor' : 'listViewEditor';
146 146
         $smarty->assign ( 'helpName', $helpName ) ;
147 147
         $smarty->assign ( 'helpDefault', 'modify' ) ;
148
-    	if ($this->fromModuleBuilder) {
149
-			$mb = new ModuleBuilder ( ) ;
148
+        if ($this->fromModuleBuilder) {
149
+            $mb = new ModuleBuilder ( ) ;
150 150
             $module = & $mb->getPackageModule ( $this->editPackage, $this->editModule ) ;
151
-		    $smarty->assign('current_mod_strings', $module->getModStrings());
152
-		}
151
+            $smarty->assign('current_mod_strings', $module->getModStrings());
152
+        }
153 153
         $smarty->assign ( 'title', $this->_constructTitle () ) ;
154 154
         $groups = array ( ) ;
155 155
         foreach ( $parser->columns as $column => $function )
Please login to merge, or discard this 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.
Braces   +16 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (! defined ( 'sugarEntry' ) || ! sugarEntry)
2
+if (! defined ( 'sugarEntry' ) || ! sugarEntry) {
3 3
     die ( 'Not A Valid Entry Point' ) ;
4
+}
4 5
 /*********************************************************************************
5 6
  * SugarCRM Community Edition is a customer relationship management program developed by
6 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -52,10 +53,11 @@  discard block
 block discarded – undo
52 53
     {
53 54
         $this->editModule = $_REQUEST [ 'view_module' ] ;
54 55
         $this->editLayout = $_REQUEST [ 'view' ] ;
55
-        if(isset ( $_REQUEST [ 'view_package' ] ) && ! empty ( $_REQUEST [ 'view_package' ] ))
56
-            $this->editPackage = $_REQUEST [ 'view_package' ];
57
-        else
58
-            $this->editPackage = null;
56
+        if(isset ( $_REQUEST [ 'view_package' ] ) && ! empty ( $_REQUEST [ 'view_package' ] )) {
57
+                    $this->editPackage = $_REQUEST [ 'view_package' ];
58
+        } else {
59
+                    $this->editPackage = null;
60
+        }
59 61
 
60 62
         $this->fromModuleBuilder = isset ( $_REQUEST [ 'MB' ] ) || (isset($_REQUEST['view_package']) && $_REQUEST['view_package'] && $_REQUEST['view_package'] != 'studio') ;
61 63
 
@@ -121,7 +123,7 @@  discard block
 block discarded – undo
121 123
 
122 124
             $ViewLabel = ($this->editLayout == MB_DASHLET) ? 'LBL_DASHLETLISTVIEW' : 'LBL_DASHLETSEARCHVIEW';
123 125
             $ajax->addCrumb ( translate ($ViewLabel, 'ModuleBuilder' ), '' ) ;
124
-        }else{
126
+        } else{
125 127
             $ajax->addCrumb ( translate($this->editModule), 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module=' . $this->editModule . '")' ) ;
126 128
             $ajax->addCrumb ( translate('LBL_LAYOUTS', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&layouts=1&view_module=' . $this->editModule . '")');
127 129
             $ajax->addCrumb ( translate('LBL_DASHLET', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=dashlet&view_module=' . $this->editModule . '")' );
@@ -182,8 +184,9 @@  discard block
 block discarded – undo
182 184
 
183 185
 
184 186
         $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")" ;
185
-        if (isset($this->searchlayout))
186
-            $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$this->searchlayout}\")" ;
187
+        if (isset($this->searchlayout)) {
188
+                    $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$this->searchlayout}\")" ;
189
+        }
187 190
 
188 191
         $buttons = array ( ) ;
189 192
         if (! $this->fromModuleBuilder)
@@ -221,10 +224,11 @@  discard block
 block discarded – undo
221 224
     {
222 225
         global $app_list_strings ;
223 226
 
224
-        if ($this->fromModuleBuilder)
225
-            $title = $this->editModule ;
226
-        else
227
-            $title =  $app_list_strings [ 'moduleList' ] [ $this->editModule ] ;
227
+        if ($this->fromModuleBuilder) {
228
+                    $title = $this->editModule ;
229
+        } else {
230
+                    $title =  $app_list_strings [ 'moduleList' ] [ $this->editModule ] ;
231
+        }
228 232
         
229 233
         return $GLOBALS [ 'mod_strings' ] [ 'LBL_LISTVIEW_EDIT' ] . ':&nbsp;' . $title ;
230 234
     }
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.modulelabels.php 2 patches
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -48,60 +48,60 @@
 block discarded – undo
48 48
 
49 49
 class ViewModulelabels extends SugarView
50 50
 {
51
- 	/**
52
-	 * @see SugarView::_getModuleTitleParams()
53
-	 */
54
-	protected function _getModuleTitleParams($browserTitle = false)
55
-	{
56
-	    global $mod_strings;
51
+        /**
52
+         * @see SugarView::_getModuleTitleParams()
53
+         */
54
+    protected function _getModuleTitleParams($browserTitle = false)
55
+    {
56
+        global $mod_strings;
57 57
 	    
58
-    	return array(
59
-    	   translate('LBL_MODULE_NAME','Administration'),
60
-    	   ModuleBuilderController::getModuleTitle(),
61
-    	   );
58
+        return array(
59
+            translate('LBL_MODULE_NAME','Administration'),
60
+            ModuleBuilderController::getModuleTitle(),
61
+            );
62 62
     }
63 63
 
64
-	function display()
65
-	{
66
- 		global $mod_strings;
64
+    function display()
65
+    {
66
+            global $mod_strings;
67 67
         $bak_mod_strings=$mod_strings;
68
- 		$smarty = new Sugar_Smarty();
68
+            $smarty = new Sugar_Smarty();
69 69
         $smarty->assign('mod_strings', $mod_strings);
70
- 		$package_name = $_REQUEST['view_package'];
71
- 		$module_name = $_REQUEST['view_module'];
70
+            $package_name = $_REQUEST['view_package'];
71
+            $module_name = $_REQUEST['view_module'];
72 72
 
73
-		require_once('modules/ModuleBuilder/MB/ModuleBuilder.php');
74
-		$mb = new ModuleBuilder();
75
-		$mb->getPackage($_REQUEST['view_package']);
76
-		$package = $mb->packages[$_REQUEST['view_package']];
77
-		$package->getModule($module_name);
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)){
81
-	    	$selected_lang = $GLOBALS['sugar_config']['default_language'];
82
-		}
83
-	        //need to change the following to interface with MBlanguage.
73
+        require_once('modules/ModuleBuilder/MB/ModuleBuilder.php');
74
+        $mb = new ModuleBuilder();
75
+        $mb->getPackage($_REQUEST['view_package']);
76
+        $package = $mb->packages[$_REQUEST['view_package']];
77
+        $package->getModule($module_name);
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)){
81
+            $selected_lang = $GLOBALS['sugar_config']['default_language'];
82
+        }
83
+            //need to change the following to interface with MBlanguage.
84 84
 
85 85
         $smarty->assign('MOD', $mbModule->getModStrings($selected_lang));
86
-		$smarty->assign('APP', $GLOBALS['app_strings']);
87
-		$smarty->assign('selected_lang', $selected_lang);
88
-		$smarty->assign('view_package', $package_name);
89
-		$smarty->assign('view_module', $module_name);
90
-		$smarty->assign('mb','1');
91
-		$smarty->assign('available_languages', get_languages());
92
-		///////////////////////////////////////////////////////////////////
93
- 		////ASSISTANT
94
- 		$smarty->assign('assistant',array('group'=>'module', 'key'=>'labels'));
95
-		/////////////////////////////////////////////////////////////////
96
-	 	////ASSISTANT
86
+        $smarty->assign('APP', $GLOBALS['app_strings']);
87
+        $smarty->assign('selected_lang', $selected_lang);
88
+        $smarty->assign('view_package', $package_name);
89
+        $smarty->assign('view_module', $module_name);
90
+        $smarty->assign('mb','1');
91
+        $smarty->assign('available_languages', get_languages());
92
+        ///////////////////////////////////////////////////////////////////
93
+            ////ASSISTANT
94
+            $smarty->assign('assistant',array('group'=>'module', 'key'=>'labels'));
95
+        /////////////////////////////////////////////////////////////////
96
+            ////ASSISTANT
97 97
 
98
-		$ajax = new AjaxCompose();
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. '")');
98
+        $ajax = new AjaxCompose();
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 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'));
104
-		echo $ajax->getJavascript();
105
-	}
103
+        $ajax->addSection('center', $bak_mod_strings['LBL_LABELS'],$smarty->fetch('modules/ModuleBuilder/tpls/labels.tpl'));
104
+        echo $ajax->getJavascript();
105
+    }
106 106
 }
107 107
 
Please login to merge, or discard this 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.history.php 3 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -47,19 +47,19 @@  discard block
 block discarded – undo
47 47
     var $pageSize = 10 ;
48 48
 
49 49
     /**
50
-	 * @see SugarView::_getModuleTitleParams()
51
-	 */
52
-	protected function _getModuleTitleParams($browserTitle = false)
53
-	{
54
-	    global $mod_strings;
50
+     * @see SugarView::_getModuleTitleParams()
51
+     */
52
+    protected function _getModuleTitleParams($browserTitle = false)
53
+    {
54
+        global $mod_strings;
55 55
 	    
56
-    	return array(
57
-    	   translate('LBL_MODULE_NAME','Administration'),
58
-    	   ModuleBuilderController::getModuleTitle(),
59
-    	   );
56
+        return array(
57
+            translate('LBL_MODULE_NAME','Administration'),
58
+            ModuleBuilderController::getModuleTitle(),
59
+            );
60 60
     }
61 61
 
62
-	function display ()
62
+    function display ()
63 63
     {
64 64
         $this->layout = strtolower ( $_REQUEST [ 'view' ] ) ;
65 65
         
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         }
136 136
         echo "<input type='button' name='close$sid' value='". translate ( 'LBL_BTN_CLOSE' )."' " . 
137 137
                 "class='button' onclick='ModuleBuilder.tabPanel.removeTab(ModuleBuilder.tabPanel.get(\"activeTab\"));' style='margin:5px;'>" . 
138
-             "<input type='button' name='restore$sid' value='" . translate ( 'LBL_MB_RESTORE' ) . "' " .  
138
+                "<input type='button' name='restore$sid' value='" . translate ( 'LBL_MB_RESTORE' ) . "' " .  
139 139
                 "class='button' onclick='ModuleBuilder.history.revert(\"$this->module\",\"{$this->layout}\",\"$sid\"$subpanel);' style='margin:5px;'>" ;
140 140
         $this->history->restoreByTimestamp ( $sid ) ;
141 141
         $view ;
@@ -149,12 +149,12 @@  discard block
 block discarded – undo
149 149
             $view = new ViewSearchView ( ) ;
150 150
         } else if ($this->layout == 'dashlet' || $this->layout == 'dashletsearch')
151 151
         {
152
-        	require_once ("modules/ModuleBuilder/views/view.dashlet.php") ;
153
-        	$view = new ViewDashlet ( ) ;
152
+            require_once ("modules/ModuleBuilder/views/view.dashlet.php") ;
153
+            $view = new ViewDashlet ( ) ;
154 154
         }  else if ($this->layout == 'popuplist' || $this->layout == 'popupsearch')
155 155
         {
156
-        	require_once ("modules/ModuleBuilder/views/view.popupview.php") ;
157
-        	$view = new ViewPopupview ( ) ;
156
+            require_once ("modules/ModuleBuilder/views/view.popupview.php") ;
157
+            $view = new ViewPopupview ( ) ;
158 158
         } else
159 159
         {
160 160
             require_once ("modules/ModuleBuilder/views/view.layoutview.php") ;
@@ -175,12 +175,12 @@  discard block
 block discarded – undo
175 175
         $this->history->restoreByTimestamp ( $sid ) ;
176 176
     }
177 177
 
178
-	/**
179
- 	 * Restores a layout to its current customized state. 
180
- 	 * Called when leaving a restored layout without saving.
181
- 	 */
178
+    /**
179
+     * Restores a layout to its current customized state. 
180
+     * Called when leaving a restored layout without saving.
181
+     */
182 182
     function unrestore() 
183 183
     {
184
-    	$this->history->undoRestore () ;
184
+        $this->history->undoRestore () ;
185 185
     }
186 186
 }
Please login to merge, or discard this patch.
Spacing   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -38,13 +38,13 @@  discard block
 block discarded – undo
38 38
  ********************************************************************************/
39 39
 
40 40
 
41
-require_once ('modules/ModuleBuilder/MB/AjaxCompose.php') ;
42
-require_once ('modules/ModuleBuilder/parsers/views/History.php') ;
43
-require_once ('modules/ModuleBuilder/parsers/ParserFactory.php') ;
41
+require_once ('modules/ModuleBuilder/MB/AjaxCompose.php');
42
+require_once ('modules/ModuleBuilder/parsers/views/History.php');
43
+require_once ('modules/ModuleBuilder/parsers/ParserFactory.php');
44 44
 
45 45
 class ViewHistory extends SugarView
46 46
 {
47
-    var $pageSize = 10 ;
47
+    var $pageSize = 10;
48 48
 
49 49
     /**
50 50
 	 * @see SugarView::_getModuleTitleParams()
@@ -54,125 +54,125 @@  discard block
 block discarded – undo
54 54
 	    global $mod_strings;
55 55
 	    
56 56
     	return array(
57
-    	   translate('LBL_MODULE_NAME','Administration'),
57
+    	   translate('LBL_MODULE_NAME', 'Administration'),
58 58
     	   ModuleBuilderController::getModuleTitle(),
59 59
     	   );
60 60
     }
61 61
 
62
-	function display ()
62
+	function display()
63 63
     {
64
-        $this->layout = strtolower ( $_REQUEST [ 'view' ] ) ;
64
+        $this->layout = strtolower($_REQUEST ['view']);
65 65
         
66
-        $subpanelName = null ;
67
-        if ((strtolower ( $this->layout ) == 'listview') && (!empty ( $_REQUEST [ 'subpanel' ] )))
66
+        $subpanelName = null;
67
+        if ((strtolower($this->layout) == 'listview') && (!empty ($_REQUEST ['subpanel'])))
68 68
         {
69
-            $subpanelName = $_REQUEST [ 'subpanel' ] ;
69
+            $subpanelName = $_REQUEST ['subpanel'];
70 70
             
71 71
         }
72 72
         
73
-        $packageName = (isset ( $_REQUEST [ 'view_package' ] ) && (strtolower ( $_REQUEST [ 'view_package' ] ) != 'studio')) ? $_REQUEST [ 'view_package' ] : null ;
74
-        $this->module = $_REQUEST [ 'view_module' ] ;
73
+        $packageName = (isset ($_REQUEST ['view_package']) && (strtolower($_REQUEST ['view_package']) != 'studio')) ? $_REQUEST ['view_package'] : null;
74
+        $this->module = $_REQUEST ['view_module'];
75 75
         
76
-        $this->parser = ParserFactory::getParser ( $this->layout, $this->module, $packageName, $subpanelName ) ;
77
-        $this->history = $this->parser->getHistory () ;
78
-        $action = ! empty ( $_REQUEST [ 'histAction' ] ) ? $_REQUEST [ 'histAction' ] : 'browse' ;
79
-        $GLOBALS['log']->debug( get_class($this)."->display(): performing History action {$action}" ) ;
80
-        $this->$action () ;
76
+        $this->parser = ParserFactory::getParser($this->layout, $this->module, $packageName, $subpanelName);
77
+        $this->history = $this->parser->getHistory();
78
+        $action = !empty ($_REQUEST ['histAction']) ? $_REQUEST ['histAction'] : 'browse';
79
+        $GLOBALS['log']->debug(get_class($this)."->display(): performing History action {$action}");
80
+        $this->$action();
81 81
     }
82 82
 
83
-    function browse ()
83
+    function browse()
84 84
     {
85
-        $smarty = new Sugar_Smarty ( ) ;
86
-        global $mod_strings ;
87
-        $smarty->assign ( 'mod_strings', $mod_strings ) ;
88
-        $smarty->assign ( 'view_module', $this->module ) ;
89
-        $smarty->assign ( 'view', $this->layout ) ;
85
+        $smarty = new Sugar_Smarty( );
86
+        global $mod_strings;
87
+        $smarty->assign('mod_strings', $mod_strings);
88
+        $smarty->assign('view_module', $this->module);
89
+        $smarty->assign('view', $this->layout);
90 90
         
91
-        if (! empty ( $_REQUEST [ 'subpanel' ] ))
91
+        if (!empty ($_REQUEST ['subpanel']))
92 92
         {
93
-            $smarty->assign ( 'subpanel', $_REQUEST [ 'subpanel' ] ) ;
93
+            $smarty->assign('subpanel', $_REQUEST ['subpanel']);
94 94
         }
95
-        $stamps = array ( ) ;
96
-        global $timedate ;
97
-        $userFormat = $timedate->get_date_time_format () ;
98
-        $page = ! empty ( $_REQUEST [ 'page' ] ) ? $_REQUEST [ 'page' ] : 0 ;
95
+        $stamps = array( );
96
+        global $timedate;
97
+        $userFormat = $timedate->get_date_time_format();
98
+        $page = !empty ($_REQUEST ['page']) ? $_REQUEST ['page'] : 0;
99 99
         $count = $this->history->getCount();
100
-        $ts = $this->history->getNth ( $page * $this->pageSize ) ;
101
-        $snapshots = array ( ) ;
102
-        for ( $i = 0 ; $i <= $this->pageSize && $ts > 0 ; $i ++ )
100
+        $ts = $this->history->getNth($page * $this->pageSize);
101
+        $snapshots = array( );
102
+        for ($i = 0; $i <= $this->pageSize && $ts > 0; $i++)
103 103
         {
104 104
             $dbDate = $timedate->fromTimestamp($ts)->asDb();
105
-            $displayTS = $timedate->to_display_date_time ( $dbDate ) ;
105
+            $displayTS = $timedate->to_display_date_time($dbDate);
106 106
             if ($page * $this->pageSize + $i + 1 == $count)
107 107
                 $displayTS = translate("LBL_MB_DEFAULT_LAYOUT");
108
-            $snapshots [ $ts ] = $displayTS ;
109
-            $ts = $this->history->getNext () ;
108
+            $snapshots [$ts] = $displayTS;
109
+            $ts = $this->history->getNext();
110 110
         }
111
-        if (count ( $snapshots ) > $this->pageSize)
111
+        if (count($snapshots) > $this->pageSize)
112 112
         {
113
-            $smarty->assign ( 'nextPage', true ) ;
113
+            $smarty->assign('nextPage', true);
114 114
         }
115
-        $snapshots = array_slice ( $snapshots, 0, $this->pageSize, true ) ;
116
-        $smarty->assign ( 'currentPage', $page ) ;
117
-        $smarty->assign ( 'snapshots', $snapshots ) ;
115
+        $snapshots = array_slice($snapshots, 0, $this->pageSize, true);
116
+        $smarty->assign('currentPage', $page);
117
+        $smarty->assign('snapshots', $snapshots);
118 118
         
119
-        $html = $smarty->fetch ( 'modules/ModuleBuilder/tpls/history.tpl' ) ;
120
-        echo $html ;
119
+        $html = $smarty->fetch('modules/ModuleBuilder/tpls/history.tpl');
120
+        echo $html;
121 121
     }
122 122
 
123
-    function preview ()
123
+    function preview()
124 124
     {
125
-        global $mod_strings ;
126
-        if (! isset ( $_REQUEST [ 'sid' ] ))
125
+        global $mod_strings;
126
+        if (!isset ($_REQUEST ['sid']))
127 127
         {
128
-            die ( 'SID Required' ) ;
128
+            die ('SID Required');
129 129
         }
130
-        $sid = $_REQUEST [ 'sid' ] ;
130
+        $sid = $_REQUEST ['sid'];
131 131
         $subpanel = '';
132
-        if (! empty ( $_REQUEST [ 'subpanel' ] ))
132
+        if (!empty ($_REQUEST ['subpanel']))
133 133
         {
134
-            $subpanel = ',"' . $_REQUEST [ 'subpanel' ] . '"' ;
134
+            $subpanel = ',"'.$_REQUEST ['subpanel'].'"';
135 135
         }
136
-        echo "<input type='button' name='close$sid' value='". translate ( 'LBL_BTN_CLOSE' )."' " . 
137
-                "class='button' onclick='ModuleBuilder.tabPanel.removeTab(ModuleBuilder.tabPanel.get(\"activeTab\"));' style='margin:5px;'>" . 
138
-             "<input type='button' name='restore$sid' value='" . translate ( 'LBL_MB_RESTORE' ) . "' " .  
139
-                "class='button' onclick='ModuleBuilder.history.revert(\"$this->module\",\"{$this->layout}\",\"$sid\"$subpanel);' style='margin:5px;'>" ;
140
-        $this->history->restoreByTimestamp ( $sid ) ;
141
-        $view ;
136
+        echo "<input type='button' name='close$sid' value='".translate('LBL_BTN_CLOSE')."' ". 
137
+                "class='button' onclick='ModuleBuilder.tabPanel.removeTab(ModuleBuilder.tabPanel.get(\"activeTab\"));' style='margin:5px;'>". 
138
+             "<input type='button' name='restore$sid' value='".translate('LBL_MB_RESTORE')."' ".  
139
+                "class='button' onclick='ModuleBuilder.history.revert(\"$this->module\",\"{$this->layout}\",\"$sid\"$subpanel);' style='margin:5px;'>";
140
+        $this->history->restoreByTimestamp($sid);
141
+        $view;
142 142
         if ($this->layout == 'listview')
143 143
         {
144
-            require_once ("modules/ModuleBuilder/views/view.listview.php") ;
145
-            $view = new ViewListView ( ) ;
144
+            require_once ("modules/ModuleBuilder/views/view.listview.php");
145
+            $view = new ViewListView( );
146 146
         } else if ($this->layout == 'basic_search' || $this->layout == 'advanced_search')
147 147
         {
148
-            require_once ("modules/ModuleBuilder/views/view.searchview.php") ;
149
-            $view = new ViewSearchView ( ) ;
148
+            require_once ("modules/ModuleBuilder/views/view.searchview.php");
149
+            $view = new ViewSearchView( );
150 150
         } else if ($this->layout == 'dashlet' || $this->layout == 'dashletsearch')
151 151
         {
152
-        	require_once ("modules/ModuleBuilder/views/view.dashlet.php") ;
153
-        	$view = new ViewDashlet ( ) ;
154
-        }  else if ($this->layout == 'popuplist' || $this->layout == 'popupsearch')
152
+        	require_once ("modules/ModuleBuilder/views/view.dashlet.php");
153
+        	$view = new ViewDashlet( );
154
+        } else if ($this->layout == 'popuplist' || $this->layout == 'popupsearch')
155 155
         {
156
-        	require_once ("modules/ModuleBuilder/views/view.popupview.php") ;
157
-        	$view = new ViewPopupview ( ) ;
156
+        	require_once ("modules/ModuleBuilder/views/view.popupview.php");
157
+        	$view = new ViewPopupview( );
158 158
         } else
159 159
         {
160
-            require_once ("modules/ModuleBuilder/views/view.layoutview.php") ;
161
-            $view = new ViewLayoutView ( ) ;
160
+            require_once ("modules/ModuleBuilder/views/view.layoutview.php");
161
+            $view = new ViewLayoutView( );
162 162
         }
163 163
         
164
-        $view->display ( true ) ;
165
-        $this->history->undoRestore () ;
164
+        $view->display(true);
165
+        $this->history->undoRestore();
166 166
     }
167 167
 
168
-    function restore ()
168
+    function restore()
169 169
     {
170
-        if (! isset ( $_REQUEST [ 'sid' ] ))
170
+        if (!isset ($_REQUEST ['sid']))
171 171
         {
172
-            die ( 'SID Required' ) ;
172
+            die ('SID Required');
173 173
         }
174
-        $sid = $_REQUEST [ 'sid' ] ;
175
-        $this->history->restoreByTimestamp ( $sid ) ;
174
+        $sid = $_REQUEST ['sid'];
175
+        $this->history->restoreByTimestamp($sid);
176 176
     }
177 177
 
178 178
 	/**
@@ -181,6 +181,6 @@  discard block
 block discarded – undo
181 181
  	 */
182 182
     function unrestore() 
183 183
     {
184
-    	$this->history->undoRestore () ;
184
+    	$this->history->undoRestore();
185 185
     }
186 186
 }
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -103,8 +103,9 @@  discard block
 block discarded – undo
103 103
         {
104 104
             $dbDate = $timedate->fromTimestamp($ts)->asDb();
105 105
             $displayTS = $timedate->to_display_date_time ( $dbDate ) ;
106
-            if ($page * $this->pageSize + $i + 1 == $count)
107
-                $displayTS = translate("LBL_MB_DEFAULT_LAYOUT");
106
+            if ($page * $this->pageSize + $i + 1 == $count) {
107
+                            $displayTS = translate("LBL_MB_DEFAULT_LAYOUT");
108
+            }
108 109
             $snapshots [ $ts ] = $displayTS ;
109 110
             $ts = $this->history->getNext () ;
110 111
         }
@@ -151,7 +152,7 @@  discard block
 block discarded – undo
151 152
         {
152 153
         	require_once ("modules/ModuleBuilder/views/view.dashlet.php") ;
153 154
         	$view = new ViewDashlet ( ) ;
154
-        }  else if ($this->layout == 'popuplist' || $this->layout == 'popupsearch')
155
+        } else if ($this->layout == 'popuplist' || $this->layout == 'popupsearch')
155 156
         {
156 157
         	require_once ("modules/ModuleBuilder/views/view.popupview.php") ;
157 158
         	$view = new ViewPopupview ( ) ;
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.labels.php 2 patches
Indentation   +89 added lines, -89 removed lines patch added patch discarded remove patch
@@ -48,73 +48,73 @@  discard block
 block discarded – undo
48 48
 class ViewLabels extends ViewModulefields
49 49
 {
50 50
     /**
51
-	 * @see SugarView::_getModuleTitleParams()
52
-	 */
53
-	protected function _getModuleTitleParams($browserTitle = false)
54
-	{
55
-	    global $mod_strings;
51
+     * @see SugarView::_getModuleTitleParams()
52
+     */
53
+    protected function _getModuleTitleParams($browserTitle = false)
54
+    {
55
+        global $mod_strings;
56 56
 
57
-    	return array(
58
-    	   translate('LBL_MODULE_NAME','Administration'),
59
-    	   ModuleBuilderController::getModuleTitle(),
60
-    	   );
57
+        return array(
58
+            translate('LBL_MODULE_NAME','Administration'),
59
+            ModuleBuilderController::getModuleTitle(),
60
+            );
61 61
     }
62 62
 
63
- 	//STUDIO LABELS ONLY//
64
- 	//TODO Bundle Studio and ModuleBuilder label handling to increase maintainability.
65
- 	function display()
66
- 	{
67
-		$editModule = $_REQUEST['view_module'];
68
-		$allLabels = (!empty($_REQUEST['labels']) && $_REQUEST['labels']== 'all');
63
+        //STUDIO LABELS ONLY//
64
+        //TODO Bundle Studio and ModuleBuilder label handling to increase maintainability.
65
+        function display()
66
+        {
67
+        $editModule = $_REQUEST['view_module'];
68
+        $allLabels = (!empty($_REQUEST['labels']) && $_REQUEST['labels']== 'all');
69 69
 
70
- 		if (!isset($_REQUEST['MB']))
71
-		{
72
-		    global $app_list_strings;
73
-		    $moduleNames = array_change_key_case($app_list_strings['moduleList']);
74
-		    $translatedEditModule = $moduleNames[strtolower($editModule)];
75
-		}
76
-		$selected_lang = (!empty($_REQUEST['selected_lang'])? $_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']);
77
-		if(empty($selected_lang)){
78
-		    $selected_lang = $GLOBALS['sugar_config']['default_language'];
79
-		}
70
+            if (!isset($_REQUEST['MB']))
71
+        {
72
+            global $app_list_strings;
73
+            $moduleNames = array_change_key_case($app_list_strings['moduleList']);
74
+            $translatedEditModule = $moduleNames[strtolower($editModule)];
75
+        }
76
+        $selected_lang = (!empty($_REQUEST['selected_lang'])? $_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']);
77
+        if(empty($selected_lang)){
78
+            $selected_lang = $GLOBALS['sugar_config']['default_language'];
79
+        }
80 80
 
81
-		$smarty = new Sugar_Smarty();
82
-		global $mod_strings;
81
+        $smarty = new Sugar_Smarty();
82
+        global $mod_strings;
83 83
         $smarty->assign('mod_strings', $mod_strings);
84
-		$smarty->assign('available_languages',get_languages());
84
+        $smarty->assign('available_languages',get_languages());
85 85
 
86 86
 
87 87
         $objectName = BeanFactory::getObjectName($editModule);
88 88
         VardefManager::loadVardef($editModule, $objectName);
89 89
         global $dictionary;
90 90
         $vnames = array();
91
-		//jchi 24557 . We should list all the lables in viewdefs(list,detail,edit,quickcreate) that the user can edit them.
92
-		require_once 'modules/ModuleBuilder/parsers/views/ListLayoutMetaDataParser.php' ;
91
+        //jchi 24557 . We should list all the lables in viewdefs(list,detail,edit,quickcreate) that the user can edit them.
92
+        require_once 'modules/ModuleBuilder/parsers/views/ListLayoutMetaDataParser.php' ;
93 93
         $parser = new ListLayoutMetaDataParser ( MB_LISTVIEW, $editModule ) ;
94 94
         foreach ( $parser->getLayout() as $key => $def )
95 95
         {
96
-        	if(isset($def['label']) ) {
97
-               $vnames[$def['label']] = $def['label'];
98
-        	}
96
+            if(isset($def['label']) ) {
97
+                $vnames[$def['label']] = $def['label'];
98
+            }
99 99
         }
100 100
 
101
-       require_once 'modules/ModuleBuilder/parsers/views/GridLayoutMetaDataParser.php' ;
101
+        require_once 'modules/ModuleBuilder/parsers/views/GridLayoutMetaDataParser.php' ;
102 102
         $variableMap = $this->getVariableMap($editModule);
103 103
         foreach($variableMap as $key => $value){
104
-        	$gridLayoutMetaDataParserTemp = new GridLayoutMetaDataParser ( $value, $editModule) ;
105
-        	foreach ( $gridLayoutMetaDataParserTemp->getLayout() as $panel)
106
-	        {
107
-	                foreach ( $panel as $row )
108
-	                {
109
-	                    foreach ( $row as $fieldArray )
110
-	                    { // fieldArray is an array('name'=>name,'label'=>label)
111
-	                        if (isset ( $fieldArray [ 'label' ] ))
112
-	                        {
113
-	                            $vnames[$fieldArray [ 'label' ] ] = $fieldArray [ 'label' ] ;
114
-	                        }
115
-	                    }
116
-	                }
117
-	        }
104
+            $gridLayoutMetaDataParserTemp = new GridLayoutMetaDataParser ( $value, $editModule) ;
105
+            foreach ( $gridLayoutMetaDataParserTemp->getLayout() as $panel)
106
+            {
107
+                    foreach ( $panel as $row )
108
+                    {
109
+                        foreach ( $row as $fieldArray )
110
+                        { // fieldArray is an array('name'=>name,'label'=>label)
111
+                            if (isset ( $fieldArray [ 'label' ] ))
112
+                            {
113
+                                $vnames[$fieldArray [ 'label' ] ] = $fieldArray [ 'label' ] ;
114
+                            }
115
+                        }
116
+                    }
117
+            }
118 118
         }
119 119
         //end
120 120
 
@@ -122,23 +122,23 @@  discard block
 block discarded – undo
122 122
         require_once ('include/SubPanel/SubPanel.php') ;
123 123
         $subList =  SubPanel::getModuleSubpanels ( $editModule );
124 124
         foreach($subList as $subpanel => $titleLabel) {
125
-        	$vnames[$titleLabel] = $titleLabel;
125
+            $vnames[$titleLabel] = $titleLabel;
126 126
         }
127 127
 
128 128
         foreach($dictionary[$objectName]['fields'] as $name=>$def) {
129
-        	if(isset($def['vname'])) {
130
-               $vnames[$def['vname']] = $def['vname'];
131
-        	}
132
-		}
133
- 	    $formatted_mod_strings = array();
129
+            if(isset($def['vname'])) {
130
+                $vnames[$def['vname']] = $def['vname'];
131
+            }
132
+        }
133
+            $formatted_mod_strings = array();
134 134
 
135
- 	    //we shouldn't set the $refresh=true here, or will lost template language mod_strings.
136
- 	    //return_module_language($selected_lang, $editModule,false) : the mod_strings will be included from cache files here.
135
+            //we shouldn't set the $refresh=true here, or will lost template language mod_strings.
136
+            //return_module_language($selected_lang, $editModule,false) : the mod_strings will be included from cache files here.
137 137
         foreach(return_module_language($selected_lang, $editModule,false) as $name=>$label) {
138
-        		//#25294
139
-        	 	if($allLabels || isset($vnames[$name]) || preg_match( '/lbl_city|lbl_country|lbl_billing_address|lbl_alt_address|lbl_shipping_address|lbl_postal_code|lbl_state$/si' , $name)) {
138
+                //#25294
139
+                    if($allLabels || isset($vnames[$name]) || preg_match( '/lbl_city|lbl_country|lbl_billing_address|lbl_alt_address|lbl_shipping_address|lbl_postal_code|lbl_state$/si' , $name)) {
140 140
                     $formatted_mod_strings[$name] = htmlentities($label, ENT_QUOTES, 'UTF-8');
141
-        	 	}
141
+                    }
142 142
         }
143 143
         //Grab everything from the custom files
144 144
         $mod_bak = $mod_strings;
@@ -147,49 +147,49 @@  discard block
 block discarded – undo
147 147
             "custom/modules/$editModule/Ext/Language/$selected_lang.lang.ext.php"
148 148
         );
149 149
         foreach($files as $langfile){
150
-        	$mod_strings = array();
151
-        	if (is_file($langfile))
152
-        	{
153
-        	   include($langfile);
154
-        	   foreach($mod_strings as $key => $label)
155
-        	   {
150
+            $mod_strings = array();
151
+            if (is_file($langfile))
152
+            {
153
+                include($langfile);
154
+                foreach($mod_strings as $key => $label)
155
+                {
156 156
                     $formatted_mod_strings[$key] = htmlentities($label, ENT_QUOTES, 'UTF-8');
157
-        	   }
158
-        	}
157
+                }
158
+            }
159 159
         }
160 160
         $mod_strings = $mod_bak;
161 161
         ksort($formatted_mod_strings);
162
-		$smarty->assign('MOD', $formatted_mod_strings);
163
-		$smarty->assign('view_module', $editModule);
164
-		$smarty->assign('APP', $GLOBALS['app_strings']);
165
-		$smarty->assign('selected_lang', $selected_lang);
166
-		$smarty->assign('defaultHelp', 'labelsBtn');
167
-		$smarty->assign('assistant', array('key'=>'labels', 'group'=>'module'));
168
-		$smarty->assign('labels_choice', $mod_strings['labelTypes']);
169
-		$smarty->assign('labels_current', $allLabels?"all":"");
162
+        $smarty->assign('MOD', $formatted_mod_strings);
163
+        $smarty->assign('view_module', $editModule);
164
+        $smarty->assign('APP', $GLOBALS['app_strings']);
165
+        $smarty->assign('selected_lang', $selected_lang);
166
+        $smarty->assign('defaultHelp', 'labelsBtn');
167
+        $smarty->assign('assistant', array('key'=>'labels', 'group'=>'module'));
168
+        $smarty->assign('labels_choice', $mod_strings['labelTypes']);
169
+        $smarty->assign('labels_current', $allLabels?"all":"");
170 170
 
171
-		$ajax = new AjaxCompose();
172
-		$ajax->addCrumb($mod_strings['LBL_STUDIO'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")');
173
-		$ajax->addCrumb($translatedEditModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module='.$editModule.'")');
174
-		$ajax->addCrumb($mod_strings['LBL_LABELS'], '');
171
+        $ajax = new AjaxCompose();
172
+        $ajax->addCrumb($mod_strings['LBL_STUDIO'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")');
173
+        $ajax->addCrumb($translatedEditModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module='.$editModule.'")');
174
+        $ajax->addCrumb($mod_strings['LBL_LABELS'], '');
175 175
 
176
- 		$html = $smarty->fetch('modules/ModuleBuilder/tpls/labels.tpl');
177
- 		$ajax->addSection('center', $GLOBALS['mod_strings']['LBL_SECTION_EDLABELS'], $html);
178
- 		echo $ajax->getJavascript();
179
- 	}
176
+            $html = $smarty->fetch('modules/ModuleBuilder/tpls/labels.tpl');
177
+            $ajax->addSection('center', $GLOBALS['mod_strings']['LBL_SECTION_EDLABELS'], $html);
178
+            echo $ajax->getJavascript();
179
+        }
180 180
     
181 181
     // fixing bug #39749: Quick Create in Studio
182 182
     function getVariableMap($module)
183 183
     {
184 184
         $variableMap = array(MB_EDITVIEW => 'EditView', 
185
-                             MB_DETAILVIEW => 'DetailView', 
186
-                             MB_QUICKCREATE => 'QuickCreate');
185
+                                MB_DETAILVIEW => 'DetailView', 
186
+                                MB_QUICKCREATE => 'QuickCreate');
187 187
         
188 188
         $hideQuickCreateForModules = array('KBDocuments',
189
-                                           'ProjectTask',
190
-                                           'Campaigns',
191
-                                           'Quotes',
192
-                                           'ProductTemplates');
189
+                                            'ProjectTask',
190
+                                            'Campaigns',
191
+                                            'Quotes',
192
+                                            'ProductTemplates');
193 193
         
194 194
         if(in_array($module, $hideQuickCreateForModules))
195 195
         {
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	    global $mod_strings;
56 56
 
57 57
     	return array(
58
-    	   translate('LBL_MODULE_NAME','Administration'),
58
+    	   translate('LBL_MODULE_NAME', 'Administration'),
59 59
     	   ModuleBuilderController::getModuleTitle(),
60 60
     	   );
61 61
     }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
  	function display()
66 66
  	{
67 67
 		$editModule = $_REQUEST['view_module'];
68
-		$allLabels = (!empty($_REQUEST['labels']) && $_REQUEST['labels']== 'all');
68
+		$allLabels = (!empty($_REQUEST['labels']) && $_REQUEST['labels'] == 'all');
69 69
 
70 70
  		if (!isset($_REQUEST['MB']))
71 71
 		{
@@ -73,15 +73,15 @@  discard block
 block discarded – undo
73 73
 		    $moduleNames = array_change_key_case($app_list_strings['moduleList']);
74 74
 		    $translatedEditModule = $moduleNames[strtolower($editModule)];
75 75
 		}
76
-		$selected_lang = (!empty($_REQUEST['selected_lang'])? $_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']);
77
-		if(empty($selected_lang)){
76
+		$selected_lang = (!empty($_REQUEST['selected_lang']) ? $_REQUEST['selected_lang'] : $_SESSION['authenticated_user_language']);
77
+		if (empty($selected_lang)) {
78 78
 		    $selected_lang = $GLOBALS['sugar_config']['default_language'];
79 79
 		}
80 80
 
81 81
 		$smarty = new Sugar_Smarty();
82 82
 		global $mod_strings;
83 83
         $smarty->assign('mod_strings', $mod_strings);
84
-		$smarty->assign('available_languages',get_languages());
84
+		$smarty->assign('available_languages', get_languages());
85 85
 
86 86
 
87 87
         $objectName = BeanFactory::getObjectName($editModule);
@@ -89,28 +89,28 @@  discard block
 block discarded – undo
89 89
         global $dictionary;
90 90
         $vnames = array();
91 91
 		//jchi 24557 . We should list all the lables in viewdefs(list,detail,edit,quickcreate) that the user can edit them.
92
-		require_once 'modules/ModuleBuilder/parsers/views/ListLayoutMetaDataParser.php' ;
93
-        $parser = new ListLayoutMetaDataParser ( MB_LISTVIEW, $editModule ) ;
94
-        foreach ( $parser->getLayout() as $key => $def )
92
+		require_once 'modules/ModuleBuilder/parsers/views/ListLayoutMetaDataParser.php';
93
+        $parser = new ListLayoutMetaDataParser(MB_LISTVIEW, $editModule);
94
+        foreach ($parser->getLayout() as $key => $def)
95 95
         {
96
-        	if(isset($def['label']) ) {
96
+        	if (isset($def['label'])) {
97 97
                $vnames[$def['label']] = $def['label'];
98 98
         	}
99 99
         }
100 100
 
101
-       require_once 'modules/ModuleBuilder/parsers/views/GridLayoutMetaDataParser.php' ;
101
+       require_once 'modules/ModuleBuilder/parsers/views/GridLayoutMetaDataParser.php';
102 102
         $variableMap = $this->getVariableMap($editModule);
103
-        foreach($variableMap as $key => $value){
104
-        	$gridLayoutMetaDataParserTemp = new GridLayoutMetaDataParser ( $value, $editModule) ;
105
-        	foreach ( $gridLayoutMetaDataParserTemp->getLayout() as $panel)
103
+        foreach ($variableMap as $key => $value) {
104
+        	$gridLayoutMetaDataParserTemp = new GridLayoutMetaDataParser($value, $editModule);
105
+        	foreach ($gridLayoutMetaDataParserTemp->getLayout() as $panel)
106 106
 	        {
107
-	                foreach ( $panel as $row )
107
+	                foreach ($panel as $row)
108 108
 	                {
109
-	                    foreach ( $row as $fieldArray )
109
+	                    foreach ($row as $fieldArray)
110 110
 	                    { // fieldArray is an array('name'=>name,'label'=>label)
111
-	                        if (isset ( $fieldArray [ 'label' ] ))
111
+	                        if (isset ($fieldArray ['label']))
112 112
 	                        {
113
-	                            $vnames[$fieldArray [ 'label' ] ] = $fieldArray [ 'label' ] ;
113
+	                            $vnames[$fieldArray ['label']] = $fieldArray ['label'];
114 114
 	                        }
115 115
 	                    }
116 116
 	                }
@@ -119,14 +119,14 @@  discard block
 block discarded – undo
119 119
         //end
120 120
 
121 121
         //Get Subpanel Labels:
122
-        require_once ('include/SubPanel/SubPanel.php') ;
123
-        $subList =  SubPanel::getModuleSubpanels ( $editModule );
124
-        foreach($subList as $subpanel => $titleLabel) {
122
+        require_once ('include/SubPanel/SubPanel.php');
123
+        $subList = SubPanel::getModuleSubpanels($editModule);
124
+        foreach ($subList as $subpanel => $titleLabel) {
125 125
         	$vnames[$titleLabel] = $titleLabel;
126 126
         }
127 127
 
128
-        foreach($dictionary[$objectName]['fields'] as $name=>$def) {
129
-        	if(isset($def['vname'])) {
128
+        foreach ($dictionary[$objectName]['fields'] as $name=>$def) {
129
+        	if (isset($def['vname'])) {
130 130
                $vnames[$def['vname']] = $def['vname'];
131 131
         	}
132 132
 		}
@@ -134,9 +134,9 @@  discard block
 block discarded – undo
134 134
 
135 135
  	    //we shouldn't set the $refresh=true here, or will lost template language mod_strings.
136 136
  	    //return_module_language($selected_lang, $editModule,false) : the mod_strings will be included from cache files here.
137
-        foreach(return_module_language($selected_lang, $editModule,false) as $name=>$label) {
137
+        foreach (return_module_language($selected_lang, $editModule, false) as $name=>$label) {
138 138
         		//#25294
139
-        	 	if($allLabels || isset($vnames[$name]) || preg_match( '/lbl_city|lbl_country|lbl_billing_address|lbl_alt_address|lbl_shipping_address|lbl_postal_code|lbl_state$/si' , $name)) {
139
+        	 	if ($allLabels || isset($vnames[$name]) || preg_match('/lbl_city|lbl_country|lbl_billing_address|lbl_alt_address|lbl_shipping_address|lbl_postal_code|lbl_state$/si', $name)) {
140 140
                     $formatted_mod_strings[$name] = htmlentities($label, ENT_QUOTES, 'UTF-8');
141 141
         	 	}
142 142
         }
@@ -146,12 +146,12 @@  discard block
 block discarded – undo
146 146
             "custom/modules/$editModule/language/$selected_lang.lang.php",
147 147
             "custom/modules/$editModule/Ext/Language/$selected_lang.lang.ext.php"
148 148
         );
149
-        foreach($files as $langfile){
149
+        foreach ($files as $langfile) {
150 150
         	$mod_strings = array();
151 151
         	if (is_file($langfile))
152 152
         	{
153 153
         	   include($langfile);
154
-        	   foreach($mod_strings as $key => $label)
154
+        	   foreach ($mod_strings as $key => $label)
155 155
         	   {
156 156
                     $formatted_mod_strings[$key] = htmlentities($label, ENT_QUOTES, 'UTF-8');
157 157
         	   }
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 		$smarty->assign('defaultHelp', 'labelsBtn');
167 167
 		$smarty->assign('assistant', array('key'=>'labels', 'group'=>'module'));
168 168
 		$smarty->assign('labels_choice', $mod_strings['labelTypes']);
169
-		$smarty->assign('labels_current', $allLabels?"all":"");
169
+		$smarty->assign('labels_current', $allLabels ? "all" : "");
170 170
 
171 171
 		$ajax = new AjaxCompose();
172 172
 		$ajax->addCrumb($mod_strings['LBL_STUDIO'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")');
@@ -191,17 +191,17 @@  discard block
 block discarded – undo
191 191
                                            'Quotes',
192 192
                                            'ProductTemplates');
193 193
         
194
-        if(in_array($module, $hideQuickCreateForModules))
194
+        if (in_array($module, $hideQuickCreateForModules))
195 195
         {
196
-            if(isset($variableMap['quickcreate']))
196
+            if (isset($variableMap['quickcreate']))
197 197
             {
198 198
                 unset($variableMap['quickcreate']);
199 199
             }
200 200
         }
201 201
         
202
-        if($module == 'KBDocuments')
202
+        if ($module == 'KBDocuments')
203 203
         {
204
-            $variableMap  = array();
204
+            $variableMap = array();
205 205
         }
206 206
         
207 207
         return $variableMap;
Please login to merge, or discard this patch.