@@ -49,16 +49,16 @@ discard block |
||
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 |
||
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 |
||
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 |
@@ -51,9 +51,9 @@ discard block |
||
51 | 51 | /** |
52 | 52 | * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead |
53 | 53 | */ |
54 | - function ViewProperty(){ |
|
54 | + function ViewProperty() { |
|
55 | 55 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
56 | - if(isset($GLOBALS['log'])) { |
|
56 | + if (isset($GLOBALS['log'])) { |
|
57 | 57 | $GLOBALS['log']->deprecated($deprecatedMessage); |
58 | 58 | } |
59 | 59 | else { |
@@ -71,45 +71,45 @@ discard block |
||
71 | 71 | global $mod_strings; |
72 | 72 | |
73 | 73 | return array( |
74 | - translate('LBL_MODULE_NAME','Administration'), |
|
74 | + translate('LBL_MODULE_NAME', 'Administration'), |
|
75 | 75 | ModuleBuilderController::getModuleTitle(), |
76 | 76 | ); |
77 | 77 | } |
78 | 78 | |
79 | 79 | |
80 | - function init () // pseduo-constuctor - given a well-known name to allow subclasses to call this classes constructor |
|
80 | + function init() // pseduo-constuctor - given a well-known name to allow subclasses to call this classes constructor |
|
81 | 81 | { |
82 | - $this->editModule = (! empty($_REQUEST['view_module'])) ? $_REQUEST['view_module'] : null; |
|
83 | - $this->editPackage = (! empty($_REQUEST['view_package'])) ? $_REQUEST['view_package'] : null; |
|
84 | - $this->id = (! empty($_REQUEST['id'])) ? $_REQUEST['id'] : null; |
|
85 | - $this->subpanel = (! empty($_REQUEST['subpanel'])) ? $_REQUEST['subpanel'] : ""; |
|
82 | + $this->editModule = (!empty($_REQUEST['view_module'])) ? $_REQUEST['view_module'] : null; |
|
83 | + $this->editPackage = (!empty($_REQUEST['view_package'])) ? $_REQUEST['view_package'] : null; |
|
84 | + $this->id = (!empty($_REQUEST['id'])) ? $_REQUEST['id'] : null; |
|
85 | + $this->subpanel = (!empty($_REQUEST['subpanel'])) ? $_REQUEST['subpanel'] : ""; |
|
86 | 86 | $this->properties = array(); |
87 | - foreach($_REQUEST as $key=>$value) |
|
87 | + foreach ($_REQUEST as $key=>$value) |
|
88 | 88 | { |
89 | - if (substr($key,0,4) == 'name') |
|
89 | + if (substr($key, 0, 4) == 'name') |
|
90 | 90 | { |
91 | - $this->properties[substr($key,5)]['name'] = $value; |
|
91 | + $this->properties[substr($key, 5)]['name'] = $value; |
|
92 | 92 | } |
93 | - if (substr($key,0,2) == 'id') |
|
93 | + if (substr($key, 0, 2) == 'id') |
|
94 | 94 | { |
95 | - $this->properties[substr($key,3)]['id'] = $value; |
|
95 | + $this->properties[substr($key, 3)]['id'] = $value; |
|
96 | 96 | } |
97 | - if (substr($key,0,5) == 'value') |
|
97 | + if (substr($key, 0, 5) == 'value') |
|
98 | 98 | { |
99 | - $this->properties[substr($key,6)]['value'] = $value; |
|
99 | + $this->properties[substr($key, 6)]['value'] = $value; |
|
100 | 100 | // tyoung - now a nasty hack to disable editing of labels which contain Smarty functions - this is envisaged to be a temporary fix to prevent admins modifying these functions then being unable to restore the original complicated value if they regret it |
101 | - if (substr($key,6) == 'label') |
|
101 | + if (substr($key, 6) == 'label') |
|
102 | 102 | { |
103 | 103 | //#29796 , we disable the edit function for sub panel label |
104 | - if (preg_match('/\{.*\}/',$value) || !empty($this->subpanel)) |
|
104 | + if (preg_match('/\{.*\}/', $value) || !empty($this->subpanel)) |
|
105 | 105 | { |
106 | - $this->properties[substr($key,6)]['hidden'] = 1; |
|
106 | + $this->properties[substr($key, 6)]['hidden'] = 1; |
|
107 | 107 | } |
108 | 108 | } |
109 | 109 | } |
110 | - if (substr($key,0,5) == 'title') |
|
110 | + if (substr($key, 0, 5) == 'title') |
|
111 | 111 | { |
112 | - $this->properties[substr($key,6)]['title'] = $value; |
|
112 | + $this->properties[substr($key, 6)]['title'] = $value; |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 | } |
@@ -125,8 +125,8 @@ discard block |
||
125 | 125 | $smarty->assign("view_package", $_REQUEST['view_package']); |
126 | 126 | } |
127 | 127 | |
128 | - $selected_lang = (!empty($_REQUEST['selected_lang'])?$_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']); |
|
129 | - if(empty($selected_lang)){ |
|
128 | + $selected_lang = (!empty($_REQUEST['selected_lang']) ? $_REQUEST['selected_lang'] : $_SESSION['authenticated_user_language']); |
|
129 | + if (empty($selected_lang)) { |
|
130 | 130 | $selected_lang = $GLOBALS['sugar_config']['default_language']; |
131 | 131 | } |
132 | 132 | $smarty->assign('available_languages', get_languages()); |
@@ -134,10 +134,10 @@ discard block |
||
134 | 134 | |
135 | 135 | ksort($this->properties); |
136 | 136 | |
137 | - $smarty->assign("properties",$this->properties); |
|
137 | + $smarty->assign("properties", $this->properties); |
|
138 | 138 | // $smarty->assign("id",$this->id); |
139 | 139 | |
140 | - $smarty->assign("mod_strings",$mod_strings); |
|
140 | + $smarty->assign("mod_strings", $mod_strings); |
|
141 | 141 | $smarty->assign('APP', $GLOBALS['app_strings']); |
142 | 142 | $smarty->assign("view_module", $this->editModule); |
143 | 143 | $smarty->assign("subpanel", $this->subpanel); |
@@ -55,8 +55,7 @@ discard block |
||
55 | 55 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
56 | 56 | if(isset($GLOBALS['log'])) { |
57 | 57 | $GLOBALS['log']->deprecated($deprecatedMessage); |
58 | - } |
|
59 | - else { |
|
58 | + } else { |
|
60 | 59 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
61 | 60 | } |
62 | 61 | self::__construct(); |
@@ -141,8 +140,9 @@ discard block |
||
141 | 140 | $smarty->assign('APP', $GLOBALS['app_strings']); |
142 | 141 | $smarty->assign("view_module", $this->editModule); |
143 | 142 | $smarty->assign("subpanel", $this->subpanel); |
144 | - if (isset($this->editPackage)) |
|
145 | - $smarty->assign("view_package", $this->editPackage); |
|
143 | + if (isset($this->editPackage)) { |
|
144 | + $smarty->assign("view_package", $this->editPackage); |
|
145 | + } |
|
146 | 146 | |
147 | 147 | $ajax->addSection('east', translate('LBL_SECTION_PROPERTIES', 'ModuleBuilder'), $smarty->fetch('modules/ModuleBuilder/tpls/editProperty.tpl')); |
148 | 148 | echo $ajax->getJavascript(); |
@@ -45,40 +45,40 @@ |
||
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 | } |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | |
41 | 41 | require_once('modules/ModuleBuilder/MB/AjaxCompose.php'); |
42 | 42 | require_once('modules/ModuleBuilder/Module/StudioModule.php'); |
43 | -require_once('modules/ModuleBuilder/Module/StudioBrowser.php') ; |
|
44 | -require_once('include/ytree/ExtNode.php') ; |
|
43 | +require_once('modules/ModuleBuilder/Module/StudioBrowser.php'); |
|
44 | +require_once('include/ytree/ExtNode.php'); |
|
45 | 45 | |
46 | 46 | class ViewHistory extends SugarView |
47 | 47 | { |
@@ -53,7 +53,7 @@ discard block |
||
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 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $root = new ExtNode('root', 'root', true); |
66 | 66 | $sb = new StudioBrowser(); |
67 | 67 | $sb->loadModules(); |
68 | - foreach($sb->modules as $name => $studioMod) { |
|
68 | + foreach ($sb->modules as $name => $studioMod) { |
|
69 | 69 | $root->add_node($this->buildStudioNode($studioMod)); |
70 | 70 | } |
71 | 71 | $json = getJSONobj(); |
@@ -48,19 +48,19 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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; |
@@ -37,12 +37,12 @@ discard block |
||
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/Module/StudioModule.php') ; |
|
43 | -require_once ('modules/ModuleBuilder/Module/StudioBrowser.php') ; |
|
44 | -require_once ('modules/DynamicFields/DynamicField.php') ; |
|
45 | -require_once 'modules/ModuleBuilder/Module/StudioModuleFactory.php' ; |
|
40 | +require_once ('modules/ModuleBuilder/MB/AjaxCompose.php'); |
|
41 | +require_once ('modules/ModuleBuilder/MB/ModuleBuilder.php'); |
|
42 | +require_once ('modules/ModuleBuilder/Module/StudioModule.php'); |
|
43 | +require_once ('modules/ModuleBuilder/Module/StudioBrowser.php'); |
|
44 | +require_once ('modules/DynamicFields/DynamicField.php'); |
|
45 | +require_once 'modules/ModuleBuilder/Module/StudioModuleFactory.php'; |
|
46 | 46 | require_once 'modules/ModuleBuilder/parsers/views/DeployedMetaDataImplementation.php'; |
47 | 47 | |
48 | 48 | class ViewResetmodule extends SugarView |
@@ -55,7 +55,7 @@ discard block |
||
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 | } |
@@ -67,12 +67,12 @@ discard block |
||
67 | 67 | return $this->handleSave(); |
68 | 68 | } |
69 | 69 | |
70 | - $ajax = new AjaxCompose ( ) ; |
|
71 | - $ajax->addCrumb ( translate('LBL_STUDIO'), 'ModuleBuilder.main("studio")' ) ; |
|
72 | - $ajax->addCrumb ( translate($moduleName), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $moduleName . '")' ) ; |
|
73 | - $ajax->addCrumb ( translate('LBL_RESET') . " " . translate($moduleName) , '') ; |
|
70 | + $ajax = new AjaxCompose( ); |
|
71 | + $ajax->addCrumb(translate('LBL_STUDIO'), 'ModuleBuilder.main("studio")'); |
|
72 | + $ajax->addCrumb(translate($moduleName), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module='.$moduleName.'")'); |
|
73 | + $ajax->addCrumb(translate('LBL_RESET')." ".translate($moduleName), ''); |
|
74 | 74 | |
75 | - $smarty = new Sugar_Smarty ( ) ; |
|
75 | + $smarty = new Sugar_Smarty( ); |
|
76 | 76 | $smarty->assign("module", $moduleName); |
77 | 77 | $smarty->assign("actions", array( |
78 | 78 | array("name" => "relationships", "label" => translate("LBL_CLEAR_RELATIONSHIPS")), |
@@ -82,13 +82,13 @@ discard block |
||
82 | 82 | array("name" => "extensions", "label" => translate("LBL_CLEAR_EXTENSIONS")), |
83 | 83 | )); |
84 | 84 | |
85 | - $ajax->addSection ( |
|
85 | + $ajax->addSection( |
|
86 | 86 | 'center', |
87 | - "Reset ". translate($moduleName) , |
|
87 | + "Reset ".translate($moduleName), |
|
88 | 88 | $smarty->fetch('modules/ModuleBuilder/tpls/resetModule.tpl') //"This works now" |
89 | - ) ; |
|
89 | + ); |
|
90 | 90 | |
91 | - echo $ajax->getJavascript () ; |
|
91 | + echo $ajax->getJavascript(); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | function handleSave() |
@@ -113,20 +113,20 @@ discard block |
||
113 | 113 | |
114 | 114 | $out .= "Complete!"; |
115 | 115 | |
116 | - $ajax = new AjaxCompose ( ) ; |
|
116 | + $ajax = new AjaxCompose( ); |
|
117 | 117 | |
118 | - $ajax->addCrumb ( translate('LBL_STUDIO'), 'ModuleBuilder.main("studio")' ) ; |
|
119 | - $ajax->addCrumb ( translate($this->module), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $this->module . '")' ) ; |
|
120 | - $ajax->addCrumb ( "Reset ". translate($this->module) , '') ; |
|
118 | + $ajax->addCrumb(translate('LBL_STUDIO'), 'ModuleBuilder.main("studio")'); |
|
119 | + $ajax->addCrumb(translate($this->module), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module='.$this->module.'")'); |
|
120 | + $ajax->addCrumb("Reset ".translate($this->module), ''); |
|
121 | 121 | |
122 | 122 | |
123 | - $ajax->addSection ( |
|
123 | + $ajax->addSection( |
|
124 | 124 | 'center', |
125 | - "Reset ". translate($this->module) , |
|
125 | + "Reset ".translate($this->module), |
|
126 | 126 | $out |
127 | - ) ; |
|
127 | + ); |
|
128 | 128 | |
129 | - echo $ajax->getJavascript () ; |
|
129 | + echo $ajax->getJavascript(); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
@@ -137,21 +137,21 @@ discard block |
||
137 | 137 | function removeCustomFields() |
138 | 138 | { |
139 | 139 | $moduleName = $this->module; |
140 | - $class_name = $GLOBALS [ 'beanList' ] [ $moduleName ] ; |
|
141 | - require_once ($GLOBALS [ 'beanFiles' ] [ $class_name ]) ; |
|
142 | - $seed = new $class_name ( ) ; |
|
143 | - $df = new DynamicField ( $moduleName ) ; |
|
144 | - $df->setup ( $seed ) ; |
|
140 | + $class_name = $GLOBALS ['beanList'] [$moduleName]; |
|
141 | + require_once ($GLOBALS ['beanFiles'] [$class_name]); |
|
142 | + $seed = new $class_name( ); |
|
143 | + $df = new DynamicField($moduleName); |
|
144 | + $df->setup($seed); |
|
145 | 145 | |
146 | 146 | |
147 | - $module = StudioModuleFactory::getStudioModule( $moduleName ) ; |
|
147 | + $module = StudioModuleFactory::getStudioModule($moduleName); |
|
148 | 148 | $customFields = array(); |
149 | - foreach($seed->field_defs as $def) { |
|
150 | - if(isset($def['source']) && $def['source'] == 'custom_fields') { |
|
149 | + foreach ($seed->field_defs as $def) { |
|
150 | + if (isset($def['source']) && $def['source'] == 'custom_fields') { |
|
151 | 151 | $field = $df->getFieldWidget($moduleName, $def['name']); |
152 | - $field->delete ( $df ) ; |
|
152 | + $field->delete($df); |
|
153 | 153 | |
154 | - $module->removeFieldFromLayouts( $def['name'] ); |
|
154 | + $module->removeFieldFromLayouts($def['name']); |
|
155 | 155 | $customFields[] = $def['name']; |
156 | 156 | } |
157 | 157 | } |
@@ -169,11 +169,11 @@ discard block |
||
169 | 169 | */ |
170 | 170 | function removeCustomLayouts() |
171 | 171 | { |
172 | - $module = StudioModuleFactory::getStudioModule( $this->module ) ; |
|
172 | + $module = StudioModuleFactory::getStudioModule($this->module); |
|
173 | 173 | $sources = $module->getViewMetadataSources(); |
174 | 174 | |
175 | 175 | $out = ""; |
176 | - foreach($sources as $view) |
|
176 | + foreach ($sources as $view) |
|
177 | 177 | { |
178 | 178 | $file = DeployedMetaDataImplementation::getFileName($view['type'], $this->module); |
179 | 179 | if (file_exists($file)) { |
@@ -183,8 +183,8 @@ discard block |
||
183 | 183 | } |
184 | 184 | |
185 | 185 | // now clear the cache |
186 | - include_once ('include/TemplateHandler/TemplateHandler.php') ; |
|
187 | - TemplateHandler::clearCache ( $this->module ) ; |
|
186 | + include_once ('include/TemplateHandler/TemplateHandler.php'); |
|
187 | + TemplateHandler::clearCache($this->module); |
|
188 | 188 | |
189 | 189 | return $out; |
190 | 190 | } |
@@ -196,21 +196,21 @@ discard block |
||
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 | - $relationships = new DeployedRelationships ( $this->module ) ; |
|
202 | + $relationships = new DeployedRelationships($this->module); |
|
203 | 203 | |
204 | - foreach ( $relationships->getRelationshipList () as $relationshipName ) |
|
204 | + foreach ($relationships->getRelationshipList() as $relationshipName) |
|
205 | 205 | { |
206 | - $rel = $relationships->get ( $relationshipName )->getDefinition () ; |
|
207 | - if ($rel [ 'is_custom' ] || (isset($rel [ 'from_studio' ]) && $rel [ 'from_studio' ])) { |
|
208 | - $relationships->delete ($relationshipName); |
|
206 | + $rel = $relationships->get($relationshipName)->getDefinition(); |
|
207 | + if ($rel ['is_custom'] || (isset($rel ['from_studio']) && $rel ['from_studio'])) { |
|
208 | + $relationships->delete($relationshipName); |
|
209 | 209 | $out .= "Removed relationship $relationshipName<br/>"; |
210 | 210 | } |
211 | 211 | } |
212 | 212 | if ($madeChanges) |
213 | - $relationships->save () ; |
|
213 | + $relationships->save(); |
|
214 | 214 | |
215 | 215 | return $out; |
216 | 216 | } |
@@ -222,11 +222,11 @@ discard block |
||
222 | 222 | if (is_dir($languageDir)) { |
223 | 223 | $files = scandir($languageDir); |
224 | 224 | foreach ($files as $langFile) { |
225 | - if (substr($langFile, 0 ,1) == '.') continue; |
|
225 | + if (substr($langFile, 0, 1) == '.') continue; |
|
226 | 226 | $language = substr($langFile, 0, strlen($langFile) - 9); |
227 | - unlink($languageDir . "/" . $langFile); |
|
227 | + unlink($languageDir."/".$langFile); |
|
228 | 228 | |
229 | - LanguageManager::clearLanguageCache ( $this->module, $language ) ; |
|
229 | + LanguageManager::clearLanguageCache($this->module, $language); |
|
230 | 230 | $out .= "Removed language file $langFile<br/>"; |
231 | 231 | } |
232 | 232 | } |
@@ -240,9 +240,9 @@ discard block |
||
240 | 240 | $extDir = "custom/Extension/modules/{$this->module}"; |
241 | 241 | if (is_dir($extDir)) { |
242 | 242 | rmdir_recursive($extDir); |
243 | - require_once ('modules/Administration/QuickRepairAndRebuild.php') ; |
|
244 | - $rac = new RepairAndClear ( ) ; |
|
245 | - $rac->repairAndClearAll ( array ( 'clearAll' ), array ( $this->module ), true, false ) ; |
|
243 | + require_once ('modules/Administration/QuickRepairAndRebuild.php'); |
|
244 | + $rac = new RepairAndClear( ); |
|
245 | + $rac->repairAndClearAll(array('clearAll'), array($this->module), true, false); |
|
246 | 246 | $rac->rebuildExtensions(); |
247 | 247 | $out .= "Cleared extensions for {$this->module}<br/>"; |
248 | 248 | } |
@@ -95,20 +95,25 @@ discard block |
||
95 | 95 | { |
96 | 96 | $out = "<script>ajaxStatus.flashStatus(SUGAR.language.get('app_strings', 'LBL_REQUEST_PROCESSED'), 2000);</script>"; |
97 | 97 | |
98 | - if (!empty($_REQUEST['relationships'])) |
|
99 | - $out .= $this->removeCustomRelationships(); |
|
98 | + if (!empty($_REQUEST['relationships'])) { |
|
99 | + $out .= $this->removeCustomRelationships(); |
|
100 | + } |
|
100 | 101 | |
101 | - if (!empty($_REQUEST['fields'])) |
|
102 | - $out .= $this->removeCustomFields(); |
|
102 | + if (!empty($_REQUEST['fields'])) { |
|
103 | + $out .= $this->removeCustomFields(); |
|
104 | + } |
|
103 | 105 | |
104 | - if (!empty($_REQUEST['layouts'])) |
|
105 | - $out .= $this->removeCustomLayouts(); |
|
106 | + if (!empty($_REQUEST['layouts'])) { |
|
107 | + $out .= $this->removeCustomLayouts(); |
|
108 | + } |
|
106 | 109 | |
107 | - if (!empty($_REQUEST['labels'])) |
|
108 | - $out .= $this->removeCustomLabels(); |
|
110 | + if (!empty($_REQUEST['labels'])) { |
|
111 | + $out .= $this->removeCustomLabels(); |
|
112 | + } |
|
109 | 113 | |
110 | - if (!empty($_REQUEST['extensions'])) |
|
111 | - $out .= $this->removeCustomExtensions(); |
|
114 | + if (!empty($_REQUEST['extensions'])) { |
|
115 | + $out .= $this->removeCustomExtensions(); |
|
116 | + } |
|
112 | 117 | |
113 | 118 | |
114 | 119 | $out .= "Complete!"; |
@@ -209,8 +214,9 @@ discard block |
||
209 | 214 | $out .= "Removed relationship $relationshipName<br/>"; |
210 | 215 | } |
211 | 216 | } |
212 | - if ($madeChanges) |
|
213 | - $relationships->save () ; |
|
217 | + if ($madeChanges) { |
|
218 | + $relationships->save () ; |
|
219 | + } |
|
214 | 220 | |
215 | 221 | return $out; |
216 | 222 | } |
@@ -222,7 +228,9 @@ discard block |
||
222 | 228 | if (is_dir($languageDir)) { |
223 | 229 | $files = scandir($languageDir); |
224 | 230 | foreach ($files as $langFile) { |
225 | - if (substr($langFile, 0 ,1) == '.') continue; |
|
231 | + if (substr($langFile, 0 ,1) == '.') { |
|
232 | + continue; |
|
233 | + } |
|
226 | 234 | $language = substr($langFile, 0, strlen($langFile) - 9); |
227 | 235 | unlink($languageDir . "/" . $langFile); |
228 | 236 |
@@ -41,127 +41,127 @@ |
||
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 |
@@ -49,7 +49,7 @@ discard block |
||
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 | } |
@@ -70,25 +70,25 @@ discard block |
||
70 | 70 | |
71 | 71 | $ajax = new AjaxCompose(); |
72 | 72 | $ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package")'); |
73 | - $ajax->addCrumb($GLOBALS['mod_strings']['LBL_PACKAGE_LIST'],''); |
|
73 | + $ajax->addCrumb($GLOBALS['mod_strings']['LBL_PACKAGE_LIST'], ''); |
|
74 | 74 | $ajax->addSection('center', $GLOBALS['mod_strings']['LBL_PACKAGE_LIST'], $smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl')); |
75 | 75 | echo $ajax->getJavascript(); |
76 | 76 | } |
77 | 77 | else { |
78 | 78 | |
79 | - $name = (!empty($_REQUEST['package']))?$_REQUEST['package']:''; |
|
79 | + $name = (!empty($_REQUEST['package'])) ? $_REQUEST['package'] : ''; |
|
80 | 80 | $mb->getPackage($name); |
81 | 81 | |
82 | - require_once ('modules/ModuleBuilder/MB/MBPackageTree.php') ; |
|
82 | + require_once ('modules/ModuleBuilder/MB/MBPackageTree.php'); |
|
83 | 83 | $mbt = new MBPackageTree(); |
84 | 84 | $nodes = $mbt->fetchNodes(); |
85 | 85 | |
86 | 86 | $package_labels = array(); |
87 | - if(!empty($nodes['tree_data']['nodes'])) |
|
87 | + if (!empty($nodes['tree_data']['nodes'])) |
|
88 | 88 | { |
89 | - foreach($nodes['tree_data']['nodes'] as $entry) |
|
89 | + foreach ($nodes['tree_data']['nodes'] as $entry) |
|
90 | 90 | { |
91 | - if(!empty($entry['data']['label']) && $name != $entry['data']['label']) |
|
91 | + if (!empty($entry['data']['label']) && $name != $entry['data']['label']) |
|
92 | 92 | { |
93 | 93 | $package_labels[] = strtoupper($entry['data']['label']); |
94 | 94 | } |
@@ -98,15 +98,15 @@ discard block |
||
98 | 98 | $json = getJSONobj(); |
99 | 99 | $smarty->assign('package_labels', $json->encode($package_labels)); |
100 | 100 | |
101 | - $this->package =& $mb->packages[$name]; |
|
101 | + $this->package = & $mb->packages[$name]; |
|
102 | 102 | $this->loadModuleTypes(); |
103 | 103 | $this->loadPackageHelp($name); |
104 | 104 | $this->package->date_modified = $GLOBALS['timedate']->to_display_date_time($this->package->date_modified); |
105 | 105 | $smarty->assign('package', $this->package); |
106 | - $smarty->assign('mod_strings',$mod_strings); |
|
106 | + $smarty->assign('mod_strings', $mod_strings); |
|
107 | 107 | $smarty->assign('package_already_deployed', 'false'); |
108 | - foreach($this->package->modules as $a_module){ |
|
109 | - if(in_array($a_module->key_name, $GLOBALS['moduleList'])){ |
|
108 | + foreach ($this->package->modules as $a_module) { |
|
109 | + if (in_array($a_module->key_name, $GLOBALS['moduleList'])) { |
|
110 | 110 | $smarty->assign('package_already_deployed', 'true'); |
111 | 111 | break; |
112 | 112 | } |
@@ -114,11 +114,11 @@ discard block |
||
114 | 114 | |
115 | 115 | $ajax = new AjaxCompose(); |
116 | 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>"; |
|
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 | 122 | $ajax->addSection('center', translate('LBL_SECTION_PACKAGE', 'ModuleBuilder'), $html); |
123 | 123 | echo $ajax->getJavascript(); |
124 | 124 | } |
@@ -128,8 +128,8 @@ discard block |
||
128 | 128 | { |
129 | 129 | $this->package->moduleTypes = array(); |
130 | 130 | $this->package->loadModules(); |
131 | - foreach(array_keys($this->package->modules) as $name){ |
|
132 | - foreach($this->package->modules[$name]->config['templates'] as $template=>$var){ |
|
131 | + foreach (array_keys($this->package->modules) as $name) { |
|
132 | + foreach ($this->package->modules[$name]->config['templates'] as $template=>$var) { |
|
133 | 133 | |
134 | 134 | $this->package->moduleTypes[$name] = $template; |
135 | 135 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $name |
141 | 141 | ) |
142 | 142 | { |
143 | - $this->package->help['default'] = (empty($name))?'create':'modify'; |
|
143 | + $this->package->help['default'] = (empty($name)) ? 'create' : 'modify'; |
|
144 | 144 | $this->package->help['group'] = 'package'; |
145 | 145 | } |
146 | 146 | |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | 'help' => 'newPackage', |
157 | 157 | 'linkId' => 'newPackageLink' |
158 | 158 | ); |
159 | - foreach($packages as $package) { |
|
159 | + foreach ($packages as $package) { |
|
160 | 160 | $this->buttons[$package] = array( |
161 | 161 | 'action' =>"module=ModuleBuilder&action=package&package={$package}", |
162 | 162 | 'imageTitle' => 'package', |
@@ -73,8 +73,7 @@ discard block |
||
73 | 73 | $ajax->addCrumb($GLOBALS['mod_strings']['LBL_PACKAGE_LIST'],''); |
74 | 74 | $ajax->addSection('center', $GLOBALS['mod_strings']['LBL_PACKAGE_LIST'], $smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl')); |
75 | 75 | echo $ajax->getJavascript(); |
76 | - } |
|
77 | - else { |
|
76 | + } else { |
|
78 | 77 | |
79 | 78 | $name = (!empty($_REQUEST['package']))?$_REQUEST['package']:''; |
80 | 79 | $mb->getPackage($name); |
@@ -114,11 +113,14 @@ discard block |
||
114 | 113 | |
115 | 114 | $ajax = new AjaxCompose(); |
116 | 115 | $ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package")'); |
117 | - if(empty($name))$name = $mod_strings['LBL_NEW_PACKAGE']; |
|
116 | + if(empty($name)) { |
|
117 | + $name = $mod_strings['LBL_NEW_PACKAGE']; |
|
118 | + } |
|
118 | 119 | $ajax->addCrumb($name,''); |
119 | 120 | $html=$smarty->fetch('modules/ModuleBuilder/tpls/MBPackage/package.tpl'); |
120 | - if(!empty($_REQUEST['action']) && $_REQUEST['action']=='SavePackage') |
|
121 | - $html.="<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>"; |
|
121 | + if(!empty($_REQUEST['action']) && $_REQUEST['action']=='SavePackage') { |
|
122 | + $html.="<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>"; |
|
123 | + } |
|
122 | 124 | $ajax->addSection('center', translate('LBL_SECTION_PACKAGE', 'ModuleBuilder'), $html); |
123 | 125 | echo $ajax->getJavascript(); |
124 | 126 | } |
@@ -43,301 +43,301 @@ |
||
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 | } |
@@ -37,27 +37,27 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -54,8 +54,9 @@ discard block |
||
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 |
||
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 |
||
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 | } |
@@ -46,16 +46,16 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -37,11 +37,11 @@ discard block |
||
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 |
||
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 | /** |
@@ -43,22 +43,22 @@ |
||
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 |
@@ -50,7 +50,7 @@ discard block |
||
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 |
||
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 |
@@ -41,130 +41,130 @@ |
||
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 |
@@ -49,7 +49,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -134,27 +134,30 @@ |
||
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 | } |
@@ -46,16 +46,16 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | { |
@@ -1,6 +1,6 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 . " " . translate("LBL_SUBPANEL", "ModuleBuilder"); |
|
137 | + $ajax->addCrumb($subpanelLabel, ''); |
|
138 | + $this->translatedViewType = $subpanelLabel." ".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 . " " . translate("LBL_SUBPANEL", "ModuleBuilder"); |
|
164 | + $ajax->addCrumb($subpanelLabel, ''); |
|
165 | + $this->translatedViewType = $subpanelLabel." ".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 |
||
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' ] . ': ' . $title ; |
|
318 | + return $GLOBALS ['mod_strings'] ['LBL_LISTVIEW_EDIT'].': '.$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 |
||
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 | } |
@@ -1,6 +1,7 @@ discard block |
||
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 |
||
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 |
||
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 . " " . translate("LBL_SUBPANEL", "ModuleBuilder"); |
@@ -158,8 +161,9 @@ discard block |
||
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 . " " . translate("LBL_SUBPANEL", "ModuleBuilder"); |
@@ -241,12 +245,14 @@ discard block |
||
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\" )'" ) ; |