Test Failed
Push — CI ( 0f01dd...c95a04 )
by Adam
55:13
created
modules/ModuleBuilder/views/view.dropdowns.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -41,31 +41,31 @@  discard block
 block discarded – undo
41 41
 
42 42
 class ViewDropdowns 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 = new Sugar_Smarty();
57
+    function display()
58
+        {
59
+        $ajax = new AjaxCompose();
60
+        $smarty = new Sugar_Smarty();
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
         $ajax->addCrumb($mod_strings['LBL_DROPDOWNEDITOR'], 'ModuleBuilder.main("dropdowns")');
@@ -75,12 +75,12 @@  discard block
 block discarded – undo
75 75
         
76 76
         $smarty->assign('LBL_BTN_ADDDROPDOWN',translate('LBL_BTN_ADDDROPDOWN'));
77 77
         $smarty->assign('dropdowns', $dd->getNodes());
78
-		$smarty->assign('deleteImage', SugarThemeRegistry::current()->getImage( 'delete_inline', '',null,null,'.gif',$mod_strings['LBL_MB_DELETE']));
79
-		$smarty->assign('editImage', SugarThemeRegistry::current()->getImage( 'edit_inline', '',null,null,'.gif',$mod_strings['LBL_EDIT']));
80
-		$smarty->assign('action', 'savedropdown');
78
+        $smarty->assign('deleteImage', SugarThemeRegistry::current()->getImage( 'delete_inline', '',null,null,'.gif',$mod_strings['LBL_MB_DELETE']));
79
+        $smarty->assign('editImage', SugarThemeRegistry::current()->getImage( 'edit_inline', '',null,null,'.gif',$mod_strings['LBL_EDIT']));
80
+        $smarty->assign('action', 'savedropdown');
81 81
 		
82 82
 
83
-		$ajax->addSection('center', $GLOBALS['mod_strings']['LBL_DROPDOWNEDITOR'], $smarty->fetch('modules/ModuleBuilder/tpls/MBModule/dropdowns.tpl') );
84
- 		echo $ajax->getJavascript();
85
- 	}
83
+        $ajax->addSection('center', $GLOBALS['mod_strings']['LBL_DROPDOWNEDITOR'], $smarty->fetch('modules/ModuleBuilder/tpls/MBModule/dropdowns.tpl') );
84
+            echo $ajax->getJavascript();
85
+        }
86 86
 }
87 87
\ No newline at end of file
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.popupview.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -62,16 +62,16 @@  discard block
 block discarded – undo
62 62
     }
63 63
     
64 64
     /**
65
-	 * @see SugarView::_getModuleTitleParams()
66
-	 */
67
-	protected function _getModuleTitleParams($browserTitle = false)
68
-	{
69
-	    global $mod_strings;
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 75
     }
76 76
 
77 77
 //    /*
@@ -101,12 +101,12 @@  discard block
 block discarded – undo
101 101
 
102 102
         if ($preview)
103 103
         {
104
-        	echo $smarty->fetch ( "modules/ModuleBuilder/tpls/Preview/listView.tpl" ) ;
104
+            echo $smarty->fetch ( "modules/ModuleBuilder/tpls/Preview/listView.tpl" ) ;
105 105
         } else
106 106
         {
107
-        	$ajax = $this->constructAjax () ;
108
-        	$ajax->addSection ( 'center', translate('LBL_POPUP'), $smarty->fetch ( "modules/ModuleBuilder/tpls/listView.tpl" ) ) ;
109
-        	echo $ajax->getJavascript () ;
107
+            $ajax = $this->constructAjax () ;
108
+            $ajax->addSection ( 'center', translate('LBL_POPUP'), $smarty->fetch ( "modules/ModuleBuilder/tpls/listView.tpl" ) ) ;
109
+            echo $ajax->getJavascript () ;
110 110
         }
111 111
     }
112 112
 
@@ -151,11 +151,11 @@  discard block
 block discarded – undo
151 151
         $helpName = (isset( $_REQUEST['view']) && $_REQUEST['view']==MB_POPUPSEARCH) ? 'searchViewEditor' : 'popupListViewEditor';
152 152
         $smarty->assign ( 'helpName', $helpName ) ;
153 153
         $smarty->assign ( 'helpDefault', 'modify' ) ;
154
-   	 	if ($this->fromModuleBuilder) {
155
-			$mb = new ModuleBuilder ( ) ;
154
+            if ($this->fromModuleBuilder) {
155
+            $mb = new ModuleBuilder ( ) ;
156 156
             $module = & $mb->getPackageModule ( $this->editPackage, $this->editModule ) ;
157
-		    $smarty->assign('current_mod_strings', $module->getModStrings());
158
-		}
157
+            $smarty->assign('current_mod_strings', $module->getModStrings());
158
+        }
159 159
 
160 160
         $smarty->assign ( 'title', $this->_constructTitle () ) ;
161 161
         $groups = array ( ) ;
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
                 {
172 172
                     if (substr ( $field [ 'width' ], - 1, 1 ) == '%')
173 173
                     {
174
-						$groups [ $groupKey ] [ $fieldKey ] [ 'width' ] = substr ( $field [ 'width' ], 0, strlen ( $field [ 'width' ] ) - 1 ) ;
174
+                        $groups [ $groupKey ] [ $fieldKey ] [ 'width' ] = substr ( $field [ 'width' ], 0, strlen ( $field [ 'width' ] ) - 1 ) ;
175 175
                     }
176 176
                 }
177 177
             }
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.property.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -49,16 +49,16 @@  discard block
 block discarded – undo
49 49
     }
50 50
     
51 51
     /**
52
-	 * @see SugarView::_getModuleTitleParams()
53
-	 */
54
-	protected function _getModuleTitleParams($browserTitle = false)
55
-	{
56
-	    global $mod_strings;
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 64
 	
@@ -97,12 +97,12 @@  discard block
 block discarded – undo
97 97
                 $this->properties[substr($key,6)]['title'] = $value;
98 98
             }
99 99
         }
100
-     }
100
+        }
101 101
 
102 102
     function display()
103 103
     {
104 104
         global $mod_strings;
105
-    	$ajax = new AjaxCompose();
105
+        $ajax = new AjaxCompose();
106 106
         $smarty = new Sugar_Smarty();
107 107
         if (isset($_REQUEST['MB']) && $_REQUEST['MB'] == "1")
108 108
         {
@@ -111,11 +111,11 @@  discard block
 block discarded – undo
111 111
         }
112 112
 
113 113
         $selected_lang = (!empty($_REQUEST['selected_lang'])?$_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']);
114
-		if(empty($selected_lang)){
115
-		    $selected_lang = $GLOBALS['sugar_config']['default_language'];
116
-		}
117
-		$smarty->assign('available_languages', get_languages());
118
-		$smarty->assign('selected_lang', $selected_lang);
114
+        if(empty($selected_lang)){
115
+            $selected_lang = $GLOBALS['sugar_config']['default_language'];
116
+        }
117
+        $smarty->assign('available_languages', get_languages());
118
+        $smarty->assign('selected_lang', $selected_lang);
119 119
 		
120 120
         ksort($this->properties);
121 121
 
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.tree.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -45,40 +45,40 @@
 block discarded – undo
45 45
 
46 46
 class ViewHistory extends SugarView 
47 47
 {
48
- 	/**
49
-	 * @see SugarView::_getModuleTitleParams()
50
-	 */
51
-	protected function _getModuleTitleParams($browserTitle = false)
52
-	{
53
-	    global $mod_strings;
48
+        /**
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
-	//STUDIO LABELS ONLY//
62
- 	//TODO Bundle Studio and ModuleBuilder label handling to increase maintainability.
63
- 	function display()
64
- 	{
65
-		$root = new ExtNode('root', 'root', true);
66
-		$sb = new StudioBrowser();
67
-		$sb->loadModules();
68
-		foreach($sb->modules as $name => $studioMod) {
69
-			$root->add_node($this->buildStudioNode($studioMod));
70
-		}
71
-		$json = getJSONobj();
72
-		echo($json->encode($root));
73
- 	}
61
+    //STUDIO LABELS ONLY//
62
+        //TODO Bundle Studio and ModuleBuilder label handling to increase maintainability.
63
+        function display()
64
+        {
65
+        $root = new ExtNode('root', 'root', true);
66
+        $sb = new StudioBrowser();
67
+        $sb->loadModules();
68
+        foreach($sb->modules as $name => $studioMod) {
69
+            $root->add_node($this->buildStudioNode($studioMod));
70
+        }
71
+        $json = getJSONobj();
72
+        echo($json->encode($root));
73
+        }
74 74
 	
75
-	/**
76
-	 * 
77
-	 * @return ExtNode built from the passed StudioModule
78
-	 * @param $module StudioModule
79
-	 */
80
-	function buildStudioNode($module) {
75
+    /**
76
+     * 
77
+     * @return ExtNode built from the passed StudioModule
78
+     * @param $module StudioModule
79
+     */
80
+    function buildStudioNode($module) {
81 81
 		
82
-	}
82
+    }
83 83
 
84 84
 }
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.resetmodule.php 1 patch
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -48,19 +48,19 @@  discard block
 block discarded – undo
48 48
 class ViewResetmodule extends SugarView
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
-	function display()
63
+    function display()
64 64
     {
65 65
         $moduleName = $this->module = $_REQUEST['view_module'];
66 66
         if (isset($_REQUEST['handle']) && $_REQUEST['handle'] == "execute") {
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             array("name" => "fields", "label" => translate("LBL_REMOVE_FIELDS")),
80 80
             array("name" => "layouts", "label" => translate("LBL_RESET_LAYOUTS")),
81 81
             array("name" => "labels", "label" => translate("LBL_RESET_LABELS")),
82
-			array("name" => "extensions", "label" => translate("LBL_CLEAR_EXTENSIONS")),
82
+            array("name" => "extensions", "label" => translate("LBL_CLEAR_EXTENSIONS")),
83 83
         ));
84 84
         
85 85
         $ajax->addSection ( 
@@ -104,10 +104,10 @@  discard block
 block discarded – undo
104 104
         if (!empty($_REQUEST['layouts']))
105 105
             $out .= $this->removeCustomLayouts();
106 106
 			
107
-		if (!empty($_REQUEST['labels']))
107
+        if (!empty($_REQUEST['labels']))
108 108
             $out .= $this->removeCustomLabels();
109 109
 			
110
-		if (!empty($_REQUEST['extensions']))
110
+        if (!empty($_REQUEST['extensions']))
111 111
             $out .= $this->removeCustomExtensions();	
112 112
 			
113 113
         
@@ -148,11 +148,11 @@  discard block
 block discarded – undo
148 148
         $customFields = array();
149 149
         foreach($seed->field_defs as $def) {
150 150
             if(isset($def['source']) && $def['source'] == 'custom_fields') {
151
-               $field = $df->getFieldWidget($moduleName, $def['name']);
152
-               $field->delete ( $df ) ;
151
+                $field = $df->getFieldWidget($moduleName, $def['name']);
152
+                $field->delete ( $df ) ;
153 153
                
154
-               $module->removeFieldFromLayouts( $def['name'] );
155
-               $customFields[] = $def['name'];
154
+                $module->removeFieldFromLayouts( $def['name'] );
155
+                $customFields[] = $def['name'];
156 156
             }
157 157
         }
158 158
         $out = "";
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
      */
197 197
     function removeCustomRelationships() 
198 198
     {
199
-    	require_once 'modules/ModuleBuilder/parsers/relationships/DeployedRelationships.php' ;
199
+        require_once 'modules/ModuleBuilder/parsers/relationships/DeployedRelationships.php' ;
200 200
         $out = "";
201 201
         $madeChanges = false;
202 202
         $relationships = new DeployedRelationships ( $this->module ) ;
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
             }
211 211
         }
212 212
         if ($madeChanges)
213
-           $relationships->save () ;
213
+            $relationships->save () ;
214 214
         
215 215
         return $out;
216 216
     }
@@ -218,33 +218,33 @@  discard block
 block discarded – undo
218 218
     function removeCustomLabels() 
219 219
     {
220 220
         $out = "";
221
-		$languageDir = "custom/modules/{$this->module}/language";
221
+        $languageDir = "custom/modules/{$this->module}/language";
222 222
         if (is_dir($languageDir)) {
223 223
             $files = scandir($languageDir);
224 224
             foreach ($files as $langFile) {
225 225
                 if (substr($langFile, 0 ,1) == '.') continue;
226
-				$language = substr($langFile, 0, strlen($langFile) - 9);
227
-				unlink($languageDir . "/" . $langFile);
226
+                $language = substr($langFile, 0, strlen($langFile) - 9);
227
+                unlink($languageDir . "/" . $langFile);
228 228
 				
229
-				LanguageManager::clearLanguageCache ( $this->module, $language ) ;
230
-				$out .= "Removed language file $langFile<br/>";
229
+                LanguageManager::clearLanguageCache ( $this->module, $language ) ;
230
+                $out .= "Removed language file $langFile<br/>";
231 231
             }
232 232
         }
233 233
 		
234
-		return $out;
234
+        return $out;
235 235
     }
236 236
 	
237
-	function removeCustomExtensions() 
238
-	{
237
+    function removeCustomExtensions() 
238
+    {
239 239
         $out = "";
240 240
         $extDir = "custom/Extension/modules/{$this->module}";
241 241
         if (is_dir($extDir)) {
242
-        	rmdir_recursive($extDir);
243
-        	require_once ('modules/Administration/QuickRepairAndRebuild.php') ;
242
+            rmdir_recursive($extDir);
243
+            require_once ('modules/Administration/QuickRepairAndRebuild.php') ;
244 244
             $rac = new RepairAndClear ( ) ;
245 245
             $rac->repairAndClearAll ( array ( 'clearAll' ), array ( $this->module ), true, false ) ;
246
-			$rac->rebuildExtensions();
247
-        	$out .= "Cleared extensions for {$this->module}<br/>";
246
+            $rac->rebuildExtensions();
247
+            $out .= "Cleared extensions for {$this->module}<br/>";
248 248
         }
249 249
 		
250 250
         return $out;
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.displaydeployresult.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -41,32 +41,32 @@
 block discarded – undo
41 41
 
42 42
 class ViewDisplaydeployresult extends SugarView
43 43
 {
44
-	function ViewDisplaydeployresult(){
45
-		$this->show_header = false;
46
-		$this->show_title = false;
47
- 		$this->show_subpanels = false;
48
- 		$this->show_search = false;
49
- 		$this->show_footer = true;
50
- 		$this->show_javascript = true;
51
- 		$this->view_print = false;
52
-	}
44
+    function ViewDisplaydeployresult(){
45
+        $this->show_header = false;
46
+        $this->show_title = false;
47
+            $this->show_subpanels = false;
48
+            $this->show_search = false;
49
+            $this->show_footer = true;
50
+            $this->show_javascript = true;
51
+            $this->view_print = false;
52
+    }
53 53
 
54
-	/**
55
-	 * @see SugarView::_getModuleTitleParams()
56
-	 */
57
-	protected function _getModuleTitleParams($browserTitle = false)
58
-	{
59
-	    global $mod_strings;
54
+    /**
55
+     * @see SugarView::_getModuleTitleParams()
56
+     */
57
+    protected function _getModuleTitleParams($browserTitle = false)
58
+    {
59
+        global $mod_strings;
60 60
 
61
-    	return array(
62
-    	   translate('LBL_MODULE_NAME','Administration'),
63
-    	   ModuleBuilderController::getModuleTitle(),
64
-    	   );
61
+        return array(
62
+            translate('LBL_MODULE_NAME','Administration'),
63
+            ModuleBuilderController::getModuleTitle(),
64
+            );
65 65
     }
66 66
 
67
-	function display()
68
-	{
69
-		$message = $this->view_object_map['message'];
70
-		echo $message.getVersionedScript('cache/include/javascript/sugar_grp1_yui.js?')."<script type='text/javascript' language='Javascript'>YAHOO.util.Connect.asyncRequest('GET', 'index.php?module=Administration&action=RebuildRelationship&silent=true');</script>";
71
-	}
67
+    function display()
68
+    {
69
+        $message = $this->view_object_map['message'];
70
+        echo $message.getVersionedScript('cache/include/javascript/sugar_grp1_yui.js?')."<script type='text/javascript' language='Javascript'>YAHOO.util.Connect.asyncRequest('GET', 'index.php?module=Administration&action=RebuildRelationship&silent=true');</script>";
71
+    }
72 72
 }
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.package.php 1 patch
Indentation   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -41,127 +41,127 @@
 block discarded – undo
41 41
 require_once('modules/ModuleBuilder/MB/ModuleBuilder.php');
42 42
 class Viewpackage 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
- 		global $mod_strings;
60
- 		$smarty = new Sugar_Smarty();
61
- 		$mb = new ModuleBuilder();
62
- 		//if (!empty($_REQUEST['package'])) {
63
- 		if (empty($_REQUEST['package']) && empty($_REQUEST['new'])) {
64
- 			$this->generatePackageButtons($mb->getPackageList());
57
+    function display()
58
+    {
59
+            global $mod_strings;
60
+            $smarty = new Sugar_Smarty();
61
+            $mb = new ModuleBuilder();
62
+            //if (!empty($_REQUEST['package'])) {
63
+            if (empty($_REQUEST['package']) && empty($_REQUEST['new'])) {
64
+                $this->generatePackageButtons($mb->getPackageList());
65 65
 
66
- 			$smarty->assign('buttons', $this->buttons);
67
- 			$smarty->assign('title', $GLOBALS['mod_strings']['LBL_MODULEBUILDER']);
68
- 			$smarty->assign("question", $GLOBALS['mod_strings']['LBL_QUESTION_PACKAGE']);
69
- 			$smarty->assign("defaultHelp", "mbHelp");
66
+                $smarty->assign('buttons', $this->buttons);
67
+                $smarty->assign('title', $GLOBALS['mod_strings']['LBL_MODULEBUILDER']);
68
+                $smarty->assign("question", $GLOBALS['mod_strings']['LBL_QUESTION_PACKAGE']);
69
+                $smarty->assign("defaultHelp", "mbHelp");
70 70
 
71
- 			$ajax = new AjaxCompose();
72
- 			$ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package")');
73
-			$ajax->addCrumb($GLOBALS['mod_strings']['LBL_PACKAGE_LIST'],'');
74
- 			$ajax->addSection('center', $GLOBALS['mod_strings']['LBL_PACKAGE_LIST'], $smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl'));
75
-			echo $ajax->getJavascript();
76
- 		}
77
- 		else {
71
+                $ajax = new AjaxCompose();
72
+                $ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package")');
73
+            $ajax->addCrumb($GLOBALS['mod_strings']['LBL_PACKAGE_LIST'],'');
74
+                $ajax->addSection('center', $GLOBALS['mod_strings']['LBL_PACKAGE_LIST'], $smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl'));
75
+            echo $ajax->getJavascript();
76
+            }
77
+            else {
78 78
  			
79
- 			$name = (!empty($_REQUEST['package']))?$_REQUEST['package']:'';
80
-			$mb->getPackage($name);
79
+                $name = (!empty($_REQUEST['package']))?$_REQUEST['package']:'';
80
+            $mb->getPackage($name);
81 81
 			
82 82
             require_once ('modules/ModuleBuilder/MB/MBPackageTree.php') ;
83 83
             $mbt = new MBPackageTree();
84 84
             $nodes = $mbt->fetchNodes();
85 85
             
86
-			$package_labels = array();
87
-			if(!empty($nodes['tree_data']['nodes']))
88
-			{
89
-				foreach($nodes['tree_data']['nodes'] as $entry) 
90
-				{
91
-					if(!empty($entry['data']['label']) && $name != $entry['data']['label'])
92
-					{
93
-						$package_labels[] = strtoupper($entry['data']['label']);
94
-					}
95
-				}
96
-			}
86
+            $package_labels = array();
87
+            if(!empty($nodes['tree_data']['nodes']))
88
+            {
89
+                foreach($nodes['tree_data']['nodes'] as $entry) 
90
+                {
91
+                    if(!empty($entry['data']['label']) && $name != $entry['data']['label'])
92
+                    {
93
+                        $package_labels[] = strtoupper($entry['data']['label']);
94
+                    }
95
+                }
96
+            }
97 97
 			
98
-			$json = getJSONobj();
99
-			$smarty->assign('package_labels', $json->encode($package_labels));            	
98
+            $json = getJSONobj();
99
+            $smarty->assign('package_labels', $json->encode($package_labels));            	
100 100
 			
101
-	 		$this->package =& $mb->packages[$name];
102
-	 		$this->loadModuleTypes();
103
-	 		$this->loadPackageHelp($name);
104
-	 		$this->package->date_modified = $GLOBALS['timedate']->to_display_date_time($this->package->date_modified);
105
-	 		$smarty->assign('package', $this->package);
106
-			$smarty->assign('mod_strings',$mod_strings);
107
-	 		$smarty->assign('package_already_deployed', 'false');
101
+                $this->package =& $mb->packages[$name];
102
+                $this->loadModuleTypes();
103
+                $this->loadPackageHelp($name);
104
+                $this->package->date_modified = $GLOBALS['timedate']->to_display_date_time($this->package->date_modified);
105
+                $smarty->assign('package', $this->package);
106
+            $smarty->assign('mod_strings',$mod_strings);
107
+                $smarty->assign('package_already_deployed', 'false');
108 108
             foreach($this->package->modules as $a_module){
109 109
                 if(in_array($a_module->key_name, $GLOBALS['moduleList'])){
110
-	 		        $smarty->assign('package_already_deployed', 'true');
110
+                        $smarty->assign('package_already_deployed', 'true');
111 111
                     break;
112 112
                 }
113 113
             }
114 114
 
115
-	 		$ajax = new AjaxCompose();
116
-	 		$ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package")');
117
-			if(empty($name))$name = $mod_strings['LBL_NEW_PACKAGE'];
118
-	 		$ajax->addCrumb($name,'');
119
-	 		$html=$smarty->fetch('modules/ModuleBuilder/tpls/MBPackage/package.tpl');
120
-	 		if(!empty($_REQUEST['action']) && $_REQUEST['action']=='SavePackage')
121
-	 			$html.="<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>";
122
-	 		$ajax->addSection('center', translate('LBL_SECTION_PACKAGE', 'ModuleBuilder'), $html);
123
-			echo $ajax->getJavascript();
124
- 		}
125
- 	}
115
+                $ajax = new AjaxCompose();
116
+                $ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package")');
117
+            if(empty($name))$name = $mod_strings['LBL_NEW_PACKAGE'];
118
+                $ajax->addCrumb($name,'');
119
+                $html=$smarty->fetch('modules/ModuleBuilder/tpls/MBPackage/package.tpl');
120
+                if(!empty($_REQUEST['action']) && $_REQUEST['action']=='SavePackage')
121
+                    $html.="<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>";
122
+                $ajax->addSection('center', translate('LBL_SECTION_PACKAGE', 'ModuleBuilder'), $html);
123
+            echo $ajax->getJavascript();
124
+            }
125
+        }
126 126
 
127
- 	function loadModuleTypes()
128
- 	{
129
- 		$this->package->moduleTypes = array();
130
- 		$this->package->loadModules();
131
- 		foreach(array_keys($this->package->modules) as $name){
132
- 			foreach($this->package->modules[$name]->config['templates'] as $template=>$var){
127
+        function loadModuleTypes()
128
+        {
129
+            $this->package->moduleTypes = array();
130
+            $this->package->loadModules();
131
+            foreach(array_keys($this->package->modules) as $name){
132
+                foreach($this->package->modules[$name]->config['templates'] as $template=>$var){
133 133
 
134
- 					$this->package->moduleTypes[$name] = $template;
134
+                        $this->package->moduleTypes[$name] = $template;
135 135
 
136
- 			}
137
- 		}
138
- 	}
139
- 	function loadPackageHelp(
140
- 	    $name
141
- 	    )
142
- 	{
143
- 			$this->package->help['default'] = (empty($name))?'create':'modify';
144
- 			$this->package->help['group'] = 'package';
145
- 	}
136
+                }
137
+            }
138
+        }
139
+        function loadPackageHelp(
140
+            $name
141
+            )
142
+        {
143
+                $this->package->help['default'] = (empty($name))?'create':'modify';
144
+                $this->package->help['group'] = 'package';
145
+        }
146 146
 
147
- 	function generatePackageButtons(
148
- 	    $packages
149
- 	    )
150
- 	{
151
- 		global $mod_strings;
152
- 		$this->buttons[$mod_strings['LBL_NEW_PACKAGE']] = array(
153
- 										'action' => "module=ModuleBuilder&action=package&new=1",
154
- 										'imageTitle' => 'package_create',
155
- 										'size' => '64',
156
-										'help' => 'newPackage',
147
+        function generatePackageButtons(
148
+            $packages
149
+            )
150
+        {
151
+            global $mod_strings;
152
+            $this->buttons[$mod_strings['LBL_NEW_PACKAGE']] = array(
153
+                                            'action' => "module=ModuleBuilder&action=package&new=1",
154
+                                            'imageTitle' => 'package_create',
155
+                                            'size' => '64',
156
+                                        'help' => 'newPackage',
157 157
                                         'linkId' => 'newPackageLink'
158
- 										);
159
- 		foreach($packages as $package) {
160
- 			$this->buttons[$package] = array(
161
- 										'action' =>"module=ModuleBuilder&action=package&package={$package}",
162
-										'imageTitle' => 'package',
163
-										'size' => '64',
164
- 										);
165
- 		}
166
- 	}
158
+                                            );
159
+            foreach($packages as $package) {
160
+                $this->buttons[$package] = array(
161
+                                            'action' =>"module=ModuleBuilder&action=package&package={$package}",
162
+                                        'imageTitle' => 'package',
163
+                                        'size' => '64',
164
+                                            );
165
+            }
166
+        }
167 167
 }
168 168
\ No newline at end of file
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.wizard.php 1 patch
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.
modules/ModuleBuilder/views/view.main.php 1 patch
Indentation   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -40,84 +40,84 @@
 block discarded – undo
40 40
 
41 41
 class ViewMain extends SugarView
42 42
 { 	
43
- 	function ViewMain(){
44
-		$this->options['show_footer'] = true;
45
- 		parent::SugarView();
46
- 	}
43
+        function ViewMain(){
44
+        $this->options['show_footer'] = true;
45
+            parent::SugarView();
46
+        }
47 47
  	
48
- 	/**
49
-	 * @see SugarView::_getModuleTitleParams()
50
-	 */
51
-	protected function _getModuleTitleParams($browserTitle = false)
52
-	{
53
-	    global $mod_strings;
48
+        /**
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
- 	function display()
62
- 	{
63
-		global $app_strings, $current_user, $mod_strings, $theme;
61
+        function display()
62
+        {
63
+        global $app_strings, $current_user, $mod_strings, $theme;
64 64
 
65
- 		$smarty = new Sugar_Smarty();
66
- 		$type = (!empty($_REQUEST['type']))?$_REQUEST['type']:'main';
67
- 		$mbt = false;
68
- 		$admin = false;
69
- 		$mb = strtolower($type);
70
- 		$smarty->assign('TYPE', $type);
71
- 		$smarty->assign('app_strings', $app_strings);
72
- 		$smarty->assign('mod', $mod_strings);
73
- 		//Replaced by javascript function "setMode"
74
- 		switch($type){
75
- 			case 'studio':
76
- 				//$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")');
77
- 				require_once('modules/ModuleBuilder/Module/StudioTree.php');
78
-				$mbt = new StudioTree();
79
-				break;
80
- 			case 'mb':
81
- 				//$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=")');
82
- 				require_once('modules/ModuleBuilder/MB/MBPackageTree.php');
83
-				$mbt = new MBPackageTree();
84
-				break;
85
- 			case 'dropdowns':
86
- 			   // $admin = is_admin($current_user);
87
- 			    require_once('modules/ModuleBuilder/Module/DropDownTree.php');
88
- 			    $mbt = new DropDownTree();
89
- 			    break;
90
- 			default:
91
- 				//$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=home")');	
92
-				require_once('modules/ModuleBuilder/Module/MainTree.php');
93
-				$mbt = new MainTree();
94
- 		}
95
- 		$smarty->assign('TEST_STUDIO', displayStudioForCurrentUser());
96
- 		$smarty->assign('ADMIN', is_admin($current_user));
97
- 		$smarty->display('modules/ModuleBuilder/tpls/includes.tpl');
98
-		if($mbt)
99
-		{
100
-			$smarty->assign('TREE',$mbt->fetch());
101
-			$smarty->assign('TREElabel', $mbt->getName());
102
-		}
103
-		$userPref = $current_user->getPreference('mb_assist', 'Assistant');
104
-		if(!$userPref) $userPref="na"; 
105
-		$smarty->assign('userPref',$userPref);
65
+            $smarty = new Sugar_Smarty();
66
+            $type = (!empty($_REQUEST['type']))?$_REQUEST['type']:'main';
67
+            $mbt = false;
68
+            $admin = false;
69
+            $mb = strtolower($type);
70
+            $smarty->assign('TYPE', $type);
71
+            $smarty->assign('app_strings', $app_strings);
72
+            $smarty->assign('mod', $mod_strings);
73
+            //Replaced by javascript function "setMode"
74
+            switch($type){
75
+                case 'studio':
76
+                 //$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")');
77
+                 require_once('modules/ModuleBuilder/Module/StudioTree.php');
78
+                $mbt = new StudioTree();
79
+                break;
80
+                case 'mb':
81
+                 //$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=")');
82
+                 require_once('modules/ModuleBuilder/MB/MBPackageTree.php');
83
+                $mbt = new MBPackageTree();
84
+                break;
85
+                case 'dropdowns':
86
+                // $admin = is_admin($current_user);
87
+                 require_once('modules/ModuleBuilder/Module/DropDownTree.php');
88
+                    $mbt = new DropDownTree();
89
+                    break;
90
+                default:
91
+                 //$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=home")');	
92
+                require_once('modules/ModuleBuilder/Module/MainTree.php');
93
+                $mbt = new MainTree();
94
+            }
95
+            $smarty->assign('TEST_STUDIO', displayStudioForCurrentUser());
96
+            $smarty->assign('ADMIN', is_admin($current_user));
97
+            $smarty->display('modules/ModuleBuilder/tpls/includes.tpl');
98
+        if($mbt)
99
+        {
100
+            $smarty->assign('TREE',$mbt->fetch());
101
+            $smarty->assign('TREElabel', $mbt->getName());
102
+        }
103
+        $userPref = $current_user->getPreference('mb_assist', 'Assistant');
104
+        if(!$userPref) $userPref="na"; 
105
+        $smarty->assign('userPref',$userPref);
106 106
 		
107
-		///////////////////////////////////
108
-	    require_once('include/SugarTinyMCE.php');
109
-	    $tiny = new SugarTinyMCE();
110
-	    $tiny->defaultConfig['width']=300;
111
-	    $tiny->defaultConfig['height']=300;
112
-	    $tiny->buttonConfig = "code,separator,bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,
107
+        ///////////////////////////////////
108
+        require_once('include/SugarTinyMCE.php');
109
+        $tiny = new SugarTinyMCE();
110
+        $tiny->defaultConfig['width']=300;
111
+        $tiny->defaultConfig['height']=300;
112
+        $tiny->buttonConfig = "code,separator,bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,
113 113
 	                         justifyfull,separator,forecolor,backcolor,
114 114
 	                         ";
115
-	    $tiny->buttonConfig2 = "pastetext,pasteword,fontselect,fontsizeselect,";
116
-	    $tiny->buttonConfig3 = "";
117
-	    $ed = $tiny->getInstance();
118
-	    $smarty->assign("tiny", $ed);
115
+        $tiny->buttonConfig2 = "pastetext,pasteword,fontselect,fontsizeselect,";
116
+        $tiny->buttonConfig3 = "";
117
+        $ed = $tiny->getInstance();
118
+        $smarty->assign("tiny", $ed);
119 119
 		
120
-		$smarty->display('modules/ModuleBuilder/tpls/index.tpl');
120
+        $smarty->display('modules/ModuleBuilder/tpls/index.tpl');
121 121
 		
122
- 	}
122
+        }
123 123
 }
124 124
\ No newline at end of file
Please login to merge, or discard this patch.