@@ -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 | } |
@@ -44,301 +44,301 @@ |
||
44 | 44 | |
45 | 45 | class ModuleBuilderViewWizard extends SugarView |
46 | 46 | { |
47 | - private $view = null ; // the wizard view to display |
|
48 | - private $actions ; |
|
49 | - private $buttons ; |
|
50 | - private $question ; |
|
51 | - private $title ; |
|
52 | - private $help ; |
|
53 | - |
|
54 | - private $editModule ; |
|
55 | - |
|
56 | - function __construct() |
|
57 | - { |
|
58 | - if ( isset ( $_REQUEST [ 'view' ] ) ) |
|
59 | - $this->view = $_REQUEST [ 'view' ] ; |
|
60 | - |
|
61 | - $this->editModule = (! empty ( $_REQUEST [ 'view_module' ] ) ) ? $_REQUEST [ 'view_module' ] : null ; |
|
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 |
|
63 | - } |
|
47 | + private $view = null ; // the wizard view to display |
|
48 | + private $actions ; |
|
49 | + private $buttons ; |
|
50 | + private $question ; |
|
51 | + private $title ; |
|
52 | + private $help ; |
|
53 | + |
|
54 | + private $editModule ; |
|
55 | + |
|
56 | + function __construct() |
|
57 | + { |
|
58 | + if ( isset ( $_REQUEST [ 'view' ] ) ) |
|
59 | + $this->view = $_REQUEST [ 'view' ] ; |
|
60 | + |
|
61 | + $this->editModule = (! empty ( $_REQUEST [ 'view_module' ] ) ) ? $_REQUEST [ 'view_module' ] : null ; |
|
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 |
|
63 | + } |
|
64 | 64 | |
65 | - /** |
|
66 | - * @see SugarView::_getModuleTitleParams() |
|
67 | - */ |
|
68 | - protected function _getModuleTitleParams($browserTitle = false) |
|
69 | - { |
|
70 | - global $mod_strings; |
|
65 | + /** |
|
66 | + * @see SugarView::_getModuleTitleParams() |
|
67 | + */ |
|
68 | + protected function _getModuleTitleParams($browserTitle = false) |
|
69 | + { |
|
70 | + global $mod_strings; |
|
71 | 71 | |
72 | - return array( |
|
73 | - translate('LBL_MODULE_NAME','Administration'), |
|
74 | - ModuleBuilderController::getModuleTitle(), |
|
75 | - ); |
|
72 | + return array( |
|
73 | + translate('LBL_MODULE_NAME','Administration'), |
|
74 | + ModuleBuilderController::getModuleTitle(), |
|
75 | + ); |
|
76 | + } |
|
77 | + |
|
78 | + function display() |
|
79 | + { |
|
80 | + $this->ajax = new AjaxCompose ( ) ; |
|
81 | + $smarty = new Sugar_Smarty ( ) ; |
|
82 | + |
|
83 | + if (isset ( $_REQUEST [ 'MB' ] )) |
|
84 | + { |
|
85 | + $this->processMB ( $this->ajax ) ; |
|
86 | + } else |
|
87 | + { |
|
88 | + |
|
89 | + $this->processStudio ( $this->ajax ) ; |
|
90 | + |
|
91 | + } |
|
92 | + |
|
93 | + $smarty->assign ( 'buttons', $this->buttons ) ; |
|
94 | + $smarty->assign ( 'image_path', $GLOBALS [ 'image_path' ] ) ; |
|
95 | + $smarty->assign ( "title", $this->title ) ; |
|
96 | + $smarty->assign ( "question", $this->question ) ; |
|
97 | + $smarty->assign ( "defaultHelp", $this->help ) ; |
|
98 | + $smarty->assign ( "actions", $this->actions ) ; |
|
99 | + |
|
100 | + $this->ajax->addSection ( 'center', $this->title, $smarty->fetch ( 'modules/ModuleBuilder/tpls/wizard.tpl' ) ) ; |
|
101 | + echo $this->ajax->getJavascript () ; |
|
76 | 102 | } |
77 | 103 | |
78 | - function display() |
|
79 | - { |
|
80 | - $this->ajax = new AjaxCompose ( ) ; |
|
81 | - $smarty = new Sugar_Smarty ( ) ; |
|
82 | - |
|
83 | - if (isset ( $_REQUEST [ 'MB' ] )) |
|
84 | - { |
|
85 | - $this->processMB ( $this->ajax ) ; |
|
86 | - } else |
|
87 | - { |
|
88 | - |
|
89 | - $this->processStudio ( $this->ajax ) ; |
|
90 | - |
|
91 | - } |
|
92 | - |
|
93 | - $smarty->assign ( 'buttons', $this->buttons ) ; |
|
94 | - $smarty->assign ( 'image_path', $GLOBALS [ 'image_path' ] ) ; |
|
95 | - $smarty->assign ( "title", $this->title ) ; |
|
96 | - $smarty->assign ( "question", $this->question ) ; |
|
97 | - $smarty->assign ( "defaultHelp", $this->help ) ; |
|
98 | - $smarty->assign ( "actions", $this->actions ) ; |
|
99 | - |
|
100 | - $this->ajax->addSection ( 'center', $this->title, $smarty->fetch ( 'modules/ModuleBuilder/tpls/wizard.tpl' ) ) ; |
|
101 | - echo $this->ajax->getJavascript () ; |
|
102 | - } |
|
103 | - |
|
104 | - function processStudio( |
|
105 | - $ajax |
|
106 | - ) |
|
107 | - { |
|
108 | - |
|
109 | - $this->ajax->addCrumb ( translate( 'LBL_STUDIO' ), 'ModuleBuilder.main("studio")' ) ; |
|
110 | - |
|
111 | - if (! isset ( $this->editModule )) |
|
112 | - { |
|
113 | - //Studio Select Module Page |
|
114 | - $this->generateStudioModuleButtons () ; |
|
115 | - $this->question = translate('LBL_QUESTION_EDIT') ; |
|
116 | - $this->title = translate( 'LBL_STUDIO' ); |
|
117 | - global $current_user; |
|
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 | - |
|
121 | - $this->help = 'studioHelp' ; |
|
122 | - } else |
|
123 | - { |
|
124 | - $module = StudioModuleFactory::getStudioModule( $this->editModule ) ; |
|
125 | - $this->ajax->addCrumb ( $module->name, !empty($this->view) ? 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $this->editModule . '")' : '' ) ; |
|
126 | - switch ( $this->view ) |
|
127 | - { |
|
128 | - case 'layouts': |
|
129 | - //Studio Select Layout page |
|
130 | - $this->buttons = $module->getLayouts() ; |
|
131 | - $this->title = $module->name . " " . translate('LBL_LAYOUTS') ; |
|
132 | - $this->question = translate( 'LBL_QUESTION_LAYOUT' ) ; |
|
133 | - $this->help = 'layoutsHelp' ; |
|
134 | - $this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), '' ) ; |
|
135 | - break; |
|
136 | - |
|
137 | - |
|
138 | - case 'subpanels': |
|
139 | - //Studio Select Subpanel page. |
|
140 | - $this->buttons = $module->getSubpanels() ; |
|
141 | - $this->title = $module->name . " " . translate( 'LBL_SUBPANELS' ) ; |
|
142 | - $this->question = translate( 'LBL_QUESTION_SUBPANEL' ) ; |
|
143 | - $this->ajax->addCrumb ( translate( 'LBL_SUBPANELS' ), '' ) ; |
|
144 | - $this->help = 'subpanelHelp' ; |
|
145 | - break; |
|
146 | - |
|
147 | - case 'search': |
|
148 | - //Studio Select Search Layout page. |
|
149 | - $this->buttons = $module->getSearch() ; |
|
150 | - $this->title = $module->name . " " . translate('LBL_FILTER'); |
|
151 | - $this->question = translate( 'LBL_QUESTION_SEARCH' ) ; |
|
152 | - $this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&view_module=' . $this->editModule . '")' ) ; |
|
153 | - $this->ajax->addCrumb ( translate( 'LBL_FILTER' ), '' ) ; |
|
154 | - $this->help = 'searchHelp' ; |
|
155 | - break; |
|
156 | - |
|
157 | - case 'dashlet': |
|
158 | - $this->generateStudioDashletButtons(); |
|
159 | - $this->title = $this->editModule ." " .translate('LBL_DASHLET'); |
|
160 | - $this->question = translate( 'LBL_QUESTION_DASHLET' ) ; |
|
161 | - $this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&view_module=' . $this->editModule . '")' ) ; |
|
162 | - $this->ajax->addCrumb ( translate( 'LBL_DASHLET' ), '' ) ; |
|
163 | - $this->help = 'dashletHelp' ; |
|
164 | - break; |
|
104 | + function processStudio( |
|
105 | + $ajax |
|
106 | + ) |
|
107 | + { |
|
108 | + |
|
109 | + $this->ajax->addCrumb ( translate( 'LBL_STUDIO' ), 'ModuleBuilder.main("studio")' ) ; |
|
110 | + |
|
111 | + if (! isset ( $this->editModule )) |
|
112 | + { |
|
113 | + //Studio Select Module Page |
|
114 | + $this->generateStudioModuleButtons () ; |
|
115 | + $this->question = translate('LBL_QUESTION_EDIT') ; |
|
116 | + $this->title = translate( 'LBL_STUDIO' ); |
|
117 | + global $current_user; |
|
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 | + |
|
121 | + $this->help = 'studioHelp' ; |
|
122 | + } else |
|
123 | + { |
|
124 | + $module = StudioModuleFactory::getStudioModule( $this->editModule ) ; |
|
125 | + $this->ajax->addCrumb ( $module->name, !empty($this->view) ? 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $this->editModule . '")' : '' ) ; |
|
126 | + switch ( $this->view ) |
|
127 | + { |
|
128 | + case 'layouts': |
|
129 | + //Studio Select Layout page |
|
130 | + $this->buttons = $module->getLayouts() ; |
|
131 | + $this->title = $module->name . " " . translate('LBL_LAYOUTS') ; |
|
132 | + $this->question = translate( 'LBL_QUESTION_LAYOUT' ) ; |
|
133 | + $this->help = 'layoutsHelp' ; |
|
134 | + $this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), '' ) ; |
|
135 | + break; |
|
136 | + |
|
137 | + |
|
138 | + case 'subpanels': |
|
139 | + //Studio Select Subpanel page. |
|
140 | + $this->buttons = $module->getSubpanels() ; |
|
141 | + $this->title = $module->name . " " . translate( 'LBL_SUBPANELS' ) ; |
|
142 | + $this->question = translate( 'LBL_QUESTION_SUBPANEL' ) ; |
|
143 | + $this->ajax->addCrumb ( translate( 'LBL_SUBPANELS' ), '' ) ; |
|
144 | + $this->help = 'subpanelHelp' ; |
|
145 | + break; |
|
146 | + |
|
147 | + case 'search': |
|
148 | + //Studio Select Search Layout page. |
|
149 | + $this->buttons = $module->getSearch() ; |
|
150 | + $this->title = $module->name . " " . translate('LBL_FILTER'); |
|
151 | + $this->question = translate( 'LBL_QUESTION_SEARCH' ) ; |
|
152 | + $this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&view_module=' . $this->editModule . '")' ) ; |
|
153 | + $this->ajax->addCrumb ( translate( 'LBL_FILTER' ), '' ) ; |
|
154 | + $this->help = 'searchHelp' ; |
|
155 | + break; |
|
156 | + |
|
157 | + case 'dashlet': |
|
158 | + $this->generateStudioDashletButtons(); |
|
159 | + $this->title = $this->editModule ." " .translate('LBL_DASHLET'); |
|
160 | + $this->question = translate( 'LBL_QUESTION_DASHLET' ) ; |
|
161 | + $this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&view_module=' . $this->editModule . '")' ) ; |
|
162 | + $this->ajax->addCrumb ( translate( 'LBL_DASHLET' ), '' ) ; |
|
163 | + $this->help = 'dashletHelp' ; |
|
164 | + break; |
|
165 | 165 | |
166 | - case 'popup': |
|
167 | - $this->generateStudioPopupButtons(); |
|
168 | - $this->title = $this->editModule ." " .translate('LBL_POPUP'); |
|
169 | - $this->question = translate( 'LBL_QUESTION_POPUP' ) ; |
|
170 | - $this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&view_module=' . $this->editModule . '")' ) ; |
|
171 | - $this->ajax->addCrumb ( translate( 'LBL_POPUP' ), '' ) ; |
|
172 | - $this->help = 'popupHelp' ; |
|
173 | - break; |
|
174 | - default: |
|
175 | - //Studio Edit Module Page |
|
176 | - $this->buttons = $module->getModule () ; |
|
177 | - $this->question = translate( 'LBL_QUESTION_MODULE' ) ; |
|
178 | - $this->title = translate( 'LBL_EDIT' ) . " " . $module->name ; |
|
179 | - $this->help = 'moduleHelp' ; |
|
180 | - global $current_user; |
|
181 | - if (is_admin($current_user)) |
|
166 | + case 'popup': |
|
167 | + $this->generateStudioPopupButtons(); |
|
168 | + $this->title = $this->editModule ." " .translate('LBL_POPUP'); |
|
169 | + $this->question = translate( 'LBL_QUESTION_POPUP' ) ; |
|
170 | + $this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&view_module=' . $this->editModule . '")' ) ; |
|
171 | + $this->ajax->addCrumb ( translate( 'LBL_POPUP' ), '' ) ; |
|
172 | + $this->help = 'popupHelp' ; |
|
173 | + break; |
|
174 | + default: |
|
175 | + //Studio Edit Module Page |
|
176 | + $this->buttons = $module->getModule () ; |
|
177 | + $this->question = translate( 'LBL_QUESTION_MODULE' ) ; |
|
178 | + $this->title = translate( 'LBL_EDIT' ) . " " . $module->name ; |
|
179 | + $this->help = 'moduleHelp' ; |
|
180 | + global $current_user; |
|
181 | + if (is_admin($current_user)) |
|
182 | 182 | $this->actions = "<input class=\"button\" type=\"button\" id=\"exportBtn\" name=\"exportBtn\" " |
183 | 183 | . "onclick=\"ModuleBuilder.getContent('module=ModuleBuilder&action=resetmodule&view_module=$this->editModule');\" value=\"" |
184 | 184 | . translate( 'LBL_RESET_MODULE' ) . '">' ; |
185 | - } |
|
186 | - } |
|
187 | - } |
|
188 | - |
|
189 | - function processMB ( |
|
190 | - $ajax |
|
191 | - ) |
|
192 | - { |
|
193 | - if (! isset ( $_REQUEST [ 'view_package' ] )) |
|
194 | - { |
|
195 | - sugar_die ( "no ModuleBuilder package set" ) ; |
|
196 | - } |
|
197 | - |
|
198 | - $this->editModule = $_REQUEST [ 'view_module' ] ; |
|
199 | - $this->package = $_REQUEST [ 'view_package' ] ; |
|
200 | - |
|
201 | - $ajax->addCrumb ( translate ( 'LBL_MODULEBUILDER', 'ModuleBuilder' ), 'ModuleBuilder.main("mb")' ) ; |
|
202 | - $ajax->addCrumb ( $this->package, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&view_package=' . $this->package . '")' ) ; |
|
203 | - $ajax->addCrumb ( $this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module=' . $this->editModule . '&view_package=' . $this->package . '")') ; |
|
204 | - |
|
205 | - switch ( $this->view ) |
|
206 | - { |
|
207 | - case 'search': |
|
208 | - //MB Select Search Layout page. |
|
209 | - $this->generateMBSearchButtons () ; |
|
210 | - $this->title = $this->editModule . " " . translate( 'LBL_SEARCH' ) ; |
|
211 | - $this->question = translate( 'LBL_QUESTION_SEARCH' ) ; |
|
212 | - $ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view_module=' . $this->editModule . '&view_package=' . $this->package . '")' ) ; |
|
213 | - $ajax->addCrumb ( translate( 'LBL_SEARCH_FORMS' ), '' ) ; |
|
214 | - $this->help = "searchHelp" ; |
|
215 | - break; |
|
216 | - |
|
217 | - case 'subpanel': |
|
218 | - //ModuleBuilder Select Subpanel |
|
219 | - $ajax->addCrumb ( $this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module=' . $this->editModule . '&view_package=' . $this->package . '")' ) ; |
|
220 | - $ajax->addCrumb ( translate( 'LBL_SUBPANELS' ), '' ) ; |
|
221 | - $this->question = translate( 'LBL_QUESTION_SUBPANEL' ) ; |
|
222 | - $this->help = 'subpanelHelp' ; |
|
223 | - break; |
|
224 | - |
|
225 | - case 'dashlet': |
|
226 | - $this->generateMBDashletButtons (); |
|
227 | - $this->title = $this->editModule ." " .translate('LBL_DASHLET'); |
|
228 | - $this->question = translate( 'LBL_QUESTION_DASHLET' ) ; |
|
229 | - $this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&MB=1&view_package='.$this->package.'&view_module=' . $this->editModule . '")' ) ; |
|
230 | - $this->ajax->addCrumb ( translate( 'LBL_DASHLET' ), '' ) ; |
|
231 | - $this->help = 'dashletHelp' ; |
|
232 | - break; |
|
233 | - |
|
234 | - |
|
235 | - case 'popup': |
|
236 | - $this->generateMBPopupButtons(); |
|
237 | - $this->title = $this->editModule ." " .translate('LBL_POPUP'); |
|
238 | - $this->question = translate( 'LBL_QUESTION_POPUP' ) ; |
|
239 | - $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 . '")' ) ; |
|
240 | - $this->ajax->addCrumb ( translate( 'LBL_POPUP' ), '' ) ; |
|
241 | - $this->help = 'popupHelp' ; |
|
242 | - break; |
|
243 | - default: |
|
244 | - $ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), '' ) ; |
|
245 | - $this->generateMBViewButtons () ; |
|
246 | - $this->title = $this->editModule . " " . translate( 'LBL_LAYOUTS' ) ; |
|
247 | - $this->question = translate( 'LBL_QUESTION_LAYOUT' ) ; |
|
248 | - $this->help = "layoutsHelp" ; |
|
249 | - } |
|
250 | - } |
|
251 | - |
|
252 | - |
|
253 | - function generateStudioModuleButtons() |
|
254 | - { |
|
255 | - require_once ('modules/ModuleBuilder/Module/StudioBrowser.php') ; |
|
256 | - $sb = new StudioBrowser ( ) ; |
|
257 | - $sb->loadModules () ; |
|
258 | - $nodes = $sb->getNodes () ; |
|
259 | - $this->buttons = array ( ) ; |
|
260 | - //$GLOBALS['log']->debug(print_r($nodes,true)); |
|
261 | - foreach ( $nodes as $module ) |
|
262 | - { |
|
263 | - $this->buttons [ $module [ 'name' ] ] = array ( 'action' => $module [ 'action' ] , 'imageTitle' => ucfirst ( $module [ 'module' ] . "_32" ) , 'size' => '32', 'linkId' => 'studiolink_'.$module [ 'module' ] ) ; |
|
264 | - } |
|
265 | - } |
|
266 | - |
|
267 | - |
|
268 | - |
|
269 | - function generateMBViewButtons() |
|
270 | - { |
|
271 | - $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_EDITVIEW' ] ] = |
|
272 | - array ( |
|
273 | - 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_EDITVIEW."&view_module={$this->editModule}&view_package={$this->package}" , |
|
274 | - 'imageTitle' => 'EditView', |
|
275 | - 'help'=>'viewBtnEditView' |
|
276 | - ) ; |
|
277 | - $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_DETAILVIEW' ] ] = |
|
278 | - array ( |
|
279 | - 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_DETAILVIEW."&view_module={$this->editModule}&view_package={$this->package}" , |
|
280 | - 'imageTitle' => 'DetailView', |
|
281 | - 'help'=>'viewBtnListView' |
|
282 | - ) ; |
|
283 | - $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_LISTVIEW' ] ] = |
|
284 | - array ( |
|
285 | - 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_LISTVIEW."&view_module={$this->editModule}&view_package={$this->package}" , |
|
286 | - 'imageTitle' => 'ListView', |
|
287 | - 'help'=>'viewBtnListView' |
|
288 | - ) ; |
|
289 | - $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_QUICKCREATE' ] ] = |
|
290 | - array ( |
|
291 | - 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_QUICKCREATE."&view_module={$this->editModule}&view_package={$this->package}" , |
|
292 | - 'imageTitle' => 'QuickCreate', |
|
293 | - 'help'=>'viewBtnQuickCreate' |
|
294 | - ) ; |
|
295 | - $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_SEARCH' ] ] = |
|
296 | - array ( |
|
297 | - 'action' => "module=ModuleBuilder&MB=true&action=wizard&view=search&view_module={$this->editModule}&view_package={$this->package}" , |
|
298 | - 'imageTitle' => 'SearchForm' , |
|
299 | - 'help'=> 'searchBtn' |
|
300 | - ) ; |
|
301 | - $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_DASHLET' ] ] = |
|
302 | - array ( |
|
303 | - 'action' => "module=ModuleBuilder&MB=true&action=wizard&view=dashlet&view_module={$this->editModule}&view_package={$this->package}" , |
|
304 | - 'imageTitle' => 'Dashlet', |
|
305 | - 'help'=>'viewBtnDashlet' |
|
306 | - ) ; |
|
307 | - $this->buttons [ $GLOBALS [ 'mod_strings' ] ['LBL_POPUP'] ] = |
|
308 | - array ( |
|
309 | - 'imageTitle' => 'Popup', |
|
310 | - 'action' => "module=ModuleBuilder&MB=true&action=wizard&view=popup&view_module={$this->editModule}&view_package={$this->package}", |
|
311 | - 'help'=>'PopupListViewBtn' |
|
312 | - ); |
|
313 | - } |
|
314 | - |
|
315 | - function generateMBDashletButtons() |
|
316 | - { |
|
317 | - $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'); |
|
318 | - $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'); |
|
319 | - } |
|
185 | + } |
|
186 | + } |
|
187 | + } |
|
188 | + |
|
189 | + function processMB ( |
|
190 | + $ajax |
|
191 | + ) |
|
192 | + { |
|
193 | + if (! isset ( $_REQUEST [ 'view_package' ] )) |
|
194 | + { |
|
195 | + sugar_die ( "no ModuleBuilder package set" ) ; |
|
196 | + } |
|
197 | + |
|
198 | + $this->editModule = $_REQUEST [ 'view_module' ] ; |
|
199 | + $this->package = $_REQUEST [ 'view_package' ] ; |
|
200 | + |
|
201 | + $ajax->addCrumb ( translate ( 'LBL_MODULEBUILDER', 'ModuleBuilder' ), 'ModuleBuilder.main("mb")' ) ; |
|
202 | + $ajax->addCrumb ( $this->package, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&view_package=' . $this->package . '")' ) ; |
|
203 | + $ajax->addCrumb ( $this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module=' . $this->editModule . '&view_package=' . $this->package . '")') ; |
|
204 | + |
|
205 | + switch ( $this->view ) |
|
206 | + { |
|
207 | + case 'search': |
|
208 | + //MB Select Search Layout page. |
|
209 | + $this->generateMBSearchButtons () ; |
|
210 | + $this->title = $this->editModule . " " . translate( 'LBL_SEARCH' ) ; |
|
211 | + $this->question = translate( 'LBL_QUESTION_SEARCH' ) ; |
|
212 | + $ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view_module=' . $this->editModule . '&view_package=' . $this->package . '")' ) ; |
|
213 | + $ajax->addCrumb ( translate( 'LBL_SEARCH_FORMS' ), '' ) ; |
|
214 | + $this->help = "searchHelp" ; |
|
215 | + break; |
|
216 | + |
|
217 | + case 'subpanel': |
|
218 | + //ModuleBuilder Select Subpanel |
|
219 | + $ajax->addCrumb ( $this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module=' . $this->editModule . '&view_package=' . $this->package . '")' ) ; |
|
220 | + $ajax->addCrumb ( translate( 'LBL_SUBPANELS' ), '' ) ; |
|
221 | + $this->question = translate( 'LBL_QUESTION_SUBPANEL' ) ; |
|
222 | + $this->help = 'subpanelHelp' ; |
|
223 | + break; |
|
224 | + |
|
225 | + case 'dashlet': |
|
226 | + $this->generateMBDashletButtons (); |
|
227 | + $this->title = $this->editModule ." " .translate('LBL_DASHLET'); |
|
228 | + $this->question = translate( 'LBL_QUESTION_DASHLET' ) ; |
|
229 | + $this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&MB=1&view_package='.$this->package.'&view_module=' . $this->editModule . '")' ) ; |
|
230 | + $this->ajax->addCrumb ( translate( 'LBL_DASHLET' ), '' ) ; |
|
231 | + $this->help = 'dashletHelp' ; |
|
232 | + break; |
|
233 | + |
|
234 | + |
|
235 | + case 'popup': |
|
236 | + $this->generateMBPopupButtons(); |
|
237 | + $this->title = $this->editModule ." " .translate('LBL_POPUP'); |
|
238 | + $this->question = translate( 'LBL_QUESTION_POPUP' ) ; |
|
239 | + $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 . '")' ) ; |
|
240 | + $this->ajax->addCrumb ( translate( 'LBL_POPUP' ), '' ) ; |
|
241 | + $this->help = 'popupHelp' ; |
|
242 | + break; |
|
243 | + default: |
|
244 | + $ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), '' ) ; |
|
245 | + $this->generateMBViewButtons () ; |
|
246 | + $this->title = $this->editModule . " " . translate( 'LBL_LAYOUTS' ) ; |
|
247 | + $this->question = translate( 'LBL_QUESTION_LAYOUT' ) ; |
|
248 | + $this->help = "layoutsHelp" ; |
|
249 | + } |
|
250 | + } |
|
251 | + |
|
252 | + |
|
253 | + function generateStudioModuleButtons() |
|
254 | + { |
|
255 | + require_once ('modules/ModuleBuilder/Module/StudioBrowser.php') ; |
|
256 | + $sb = new StudioBrowser ( ) ; |
|
257 | + $sb->loadModules () ; |
|
258 | + $nodes = $sb->getNodes () ; |
|
259 | + $this->buttons = array ( ) ; |
|
260 | + //$GLOBALS['log']->debug(print_r($nodes,true)); |
|
261 | + foreach ( $nodes as $module ) |
|
262 | + { |
|
263 | + $this->buttons [ $module [ 'name' ] ] = array ( 'action' => $module [ 'action' ] , 'imageTitle' => ucfirst ( $module [ 'module' ] . "_32" ) , 'size' => '32', 'linkId' => 'studiolink_'.$module [ 'module' ] ) ; |
|
264 | + } |
|
265 | + } |
|
266 | + |
|
267 | + |
|
268 | + |
|
269 | + function generateMBViewButtons() |
|
270 | + { |
|
271 | + $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_EDITVIEW' ] ] = |
|
272 | + array ( |
|
273 | + 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_EDITVIEW."&view_module={$this->editModule}&view_package={$this->package}" , |
|
274 | + 'imageTitle' => 'EditView', |
|
275 | + 'help'=>'viewBtnEditView' |
|
276 | + ) ; |
|
277 | + $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_DETAILVIEW' ] ] = |
|
278 | + array ( |
|
279 | + 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_DETAILVIEW."&view_module={$this->editModule}&view_package={$this->package}" , |
|
280 | + 'imageTitle' => 'DetailView', |
|
281 | + 'help'=>'viewBtnListView' |
|
282 | + ) ; |
|
283 | + $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_LISTVIEW' ] ] = |
|
284 | + array ( |
|
285 | + 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_LISTVIEW."&view_module={$this->editModule}&view_package={$this->package}" , |
|
286 | + 'imageTitle' => 'ListView', |
|
287 | + 'help'=>'viewBtnListView' |
|
288 | + ) ; |
|
289 | + $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_QUICKCREATE' ] ] = |
|
290 | + array ( |
|
291 | + 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_QUICKCREATE."&view_module={$this->editModule}&view_package={$this->package}" , |
|
292 | + 'imageTitle' => 'QuickCreate', |
|
293 | + 'help'=>'viewBtnQuickCreate' |
|
294 | + ) ; |
|
295 | + $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_SEARCH' ] ] = |
|
296 | + array ( |
|
297 | + 'action' => "module=ModuleBuilder&MB=true&action=wizard&view=search&view_module={$this->editModule}&view_package={$this->package}" , |
|
298 | + 'imageTitle' => 'SearchForm' , |
|
299 | + 'help'=> 'searchBtn' |
|
300 | + ) ; |
|
301 | + $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_DASHLET' ] ] = |
|
302 | + array ( |
|
303 | + 'action' => "module=ModuleBuilder&MB=true&action=wizard&view=dashlet&view_module={$this->editModule}&view_package={$this->package}" , |
|
304 | + 'imageTitle' => 'Dashlet', |
|
305 | + 'help'=>'viewBtnDashlet' |
|
306 | + ) ; |
|
307 | + $this->buttons [ $GLOBALS [ 'mod_strings' ] ['LBL_POPUP'] ] = |
|
308 | + array ( |
|
309 | + 'imageTitle' => 'Popup', |
|
310 | + 'action' => "module=ModuleBuilder&MB=true&action=wizard&view=popup&view_module={$this->editModule}&view_package={$this->package}", |
|
311 | + 'help'=>'PopupListViewBtn' |
|
312 | + ); |
|
313 | + } |
|
314 | + |
|
315 | + function generateMBDashletButtons() |
|
316 | + { |
|
317 | + $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'); |
|
318 | + $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'); |
|
319 | + } |
|
320 | 320 | |
321 | - function generateMBPopupButtons() |
|
322 | - { |
|
323 | - $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'); |
|
324 | - $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'); |
|
325 | - } |
|
321 | + function generateMBPopupButtons() |
|
322 | + { |
|
323 | + $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'); |
|
324 | + $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'); |
|
325 | + } |
|
326 | 326 | |
327 | - function generateStudioDashletButtons() |
|
328 | - { |
|
329 | - $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'); |
|
330 | - $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'); |
|
331 | - } |
|
327 | + function generateStudioDashletButtons() |
|
328 | + { |
|
329 | + $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'); |
|
330 | + $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'); |
|
331 | + } |
|
332 | 332 | |
333 | - function generateStudioPopupButtons() |
|
334 | - { |
|
335 | - $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'); |
|
336 | - $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'); |
|
337 | - } |
|
333 | + function generateStudioPopupButtons() |
|
334 | + { |
|
335 | + $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'); |
|
336 | + $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'); |
|
337 | + } |
|
338 | 338 | |
339 | - function generateMBSearchButtons() |
|
340 | - { |
|
341 | - $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" ) ; |
|
342 | - $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" ) ; |
|
343 | - } |
|
339 | + function generateMBSearchButtons() |
|
340 | + { |
|
341 | + $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" ) ; |
|
342 | + $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" ) ; |
|
343 | + } |
|
344 | 344 | } |
@@ -38,27 +38,27 @@ discard block |
||
38 | 38 | * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". |
39 | 39 | */ |
40 | 40 | |
41 | -require_once ('modules/ModuleBuilder/MB/AjaxCompose.php') ; |
|
42 | -require_once ('modules/ModuleBuilder/Module/StudioModuleFactory.php') ; |
|
43 | -require_once ('include/MVC/View/SugarView.php') ; |
|
41 | +require_once ('modules/ModuleBuilder/MB/AjaxCompose.php'); |
|
42 | +require_once ('modules/ModuleBuilder/Module/StudioModuleFactory.php'); |
|
43 | +require_once ('include/MVC/View/SugarView.php'); |
|
44 | 44 | |
45 | 45 | class ModuleBuilderViewWizard extends SugarView |
46 | 46 | { |
47 | - private $view = null ; // the wizard view to display |
|
48 | - private $actions ; |
|
49 | - private $buttons ; |
|
50 | - private $question ; |
|
51 | - private $title ; |
|
52 | - private $help ; |
|
47 | + private $view = null; // the wizard view to display |
|
48 | + private $actions; |
|
49 | + private $buttons; |
|
50 | + private $question; |
|
51 | + private $title; |
|
52 | + private $help; |
|
53 | 53 | |
54 | - private $editModule ; |
|
54 | + private $editModule; |
|
55 | 55 | |
56 | 56 | function __construct() |
57 | 57 | { |
58 | - if ( isset ( $_REQUEST [ 'view' ] ) ) |
|
59 | - $this->view = $_REQUEST [ 'view' ] ; |
|
58 | + if (isset ($_REQUEST ['view'])) |
|
59 | + $this->view = $_REQUEST ['view']; |
|
60 | 60 | |
61 | - $this->editModule = (! empty ( $_REQUEST [ 'view_module' ] ) ) ? $_REQUEST [ 'view_module' ] : null ; |
|
61 | + $this->editModule = (!empty ($_REQUEST ['view_module'])) ? $_REQUEST ['view_module'] : null; |
|
62 | 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 |
63 | 63 | } |
64 | 64 | |
@@ -70,35 +70,35 @@ discard block |
||
70 | 70 | global $mod_strings; |
71 | 71 | |
72 | 72 | return array( |
73 | - translate('LBL_MODULE_NAME','Administration'), |
|
73 | + translate('LBL_MODULE_NAME', 'Administration'), |
|
74 | 74 | ModuleBuilderController::getModuleTitle(), |
75 | 75 | ); |
76 | 76 | } |
77 | 77 | |
78 | 78 | function display() |
79 | 79 | { |
80 | - $this->ajax = new AjaxCompose ( ) ; |
|
81 | - $smarty = new Sugar_Smarty ( ) ; |
|
80 | + $this->ajax = new AjaxCompose( ); |
|
81 | + $smarty = new Sugar_Smarty( ); |
|
82 | 82 | |
83 | - if (isset ( $_REQUEST [ 'MB' ] )) |
|
83 | + if (isset ($_REQUEST ['MB'])) |
|
84 | 84 | { |
85 | - $this->processMB ( $this->ajax ) ; |
|
85 | + $this->processMB($this->ajax); |
|
86 | 86 | } else |
87 | 87 | { |
88 | 88 | |
89 | - $this->processStudio ( $this->ajax ) ; |
|
89 | + $this->processStudio($this->ajax); |
|
90 | 90 | |
91 | 91 | } |
92 | 92 | |
93 | - $smarty->assign ( 'buttons', $this->buttons ) ; |
|
94 | - $smarty->assign ( 'image_path', $GLOBALS [ 'image_path' ] ) ; |
|
95 | - $smarty->assign ( "title", $this->title ) ; |
|
96 | - $smarty->assign ( "question", $this->question ) ; |
|
97 | - $smarty->assign ( "defaultHelp", $this->help ) ; |
|
98 | - $smarty->assign ( "actions", $this->actions ) ; |
|
93 | + $smarty->assign('buttons', $this->buttons); |
|
94 | + $smarty->assign('image_path', $GLOBALS ['image_path']); |
|
95 | + $smarty->assign("title", $this->title); |
|
96 | + $smarty->assign("question", $this->question); |
|
97 | + $smarty->assign("defaultHelp", $this->help); |
|
98 | + $smarty->assign("actions", $this->actions); |
|
99 | 99 | |
100 | - $this->ajax->addSection ( 'center', $this->title, $smarty->fetch ( 'modules/ModuleBuilder/tpls/wizard.tpl' ) ) ; |
|
101 | - echo $this->ajax->getJavascript () ; |
|
100 | + $this->ajax->addSection('center', $this->title, $smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl')); |
|
101 | + echo $this->ajax->getJavascript(); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | function processStudio( |
@@ -106,161 +106,161 @@ discard block |
||
106 | 106 | ) |
107 | 107 | { |
108 | 108 | |
109 | - $this->ajax->addCrumb ( translate( 'LBL_STUDIO' ), 'ModuleBuilder.main("studio")' ) ; |
|
109 | + $this->ajax->addCrumb(translate('LBL_STUDIO'), 'ModuleBuilder.main("studio")'); |
|
110 | 110 | |
111 | - if (! isset ( $this->editModule )) |
|
111 | + if (!isset ($this->editModule)) |
|
112 | 112 | { |
113 | 113 | //Studio Select Module Page |
114 | - $this->generateStudioModuleButtons () ; |
|
115 | - $this->question = translate('LBL_QUESTION_EDIT') ; |
|
116 | - $this->title = translate( 'LBL_STUDIO' ); |
|
114 | + $this->generateStudioModuleButtons(); |
|
115 | + $this->question = translate('LBL_QUESTION_EDIT'); |
|
116 | + $this->title = translate('LBL_STUDIO'); |
|
117 | 117 | global $current_user; |
118 | 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' ) . '">' ; |
|
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 | 120 | |
121 | - $this->help = 'studioHelp' ; |
|
121 | + $this->help = 'studioHelp'; |
|
122 | 122 | } else |
123 | 123 | { |
124 | - $module = StudioModuleFactory::getStudioModule( $this->editModule ) ; |
|
125 | - $this->ajax->addCrumb ( $module->name, !empty($this->view) ? 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $this->editModule . '")' : '' ) ; |
|
126 | - switch ( $this->view ) |
|
124 | + $module = StudioModuleFactory::getStudioModule($this->editModule); |
|
125 | + $this->ajax->addCrumb($module->name, !empty($this->view) ? 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module='.$this->editModule.'")' : ''); |
|
126 | + switch ($this->view) |
|
127 | 127 | { |
128 | 128 | case 'layouts': |
129 | 129 | //Studio Select Layout page |
130 | - $this->buttons = $module->getLayouts() ; |
|
131 | - $this->title = $module->name . " " . translate('LBL_LAYOUTS') ; |
|
132 | - $this->question = translate( 'LBL_QUESTION_LAYOUT' ) ; |
|
133 | - $this->help = 'layoutsHelp' ; |
|
134 | - $this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), '' ) ; |
|
130 | + $this->buttons = $module->getLayouts(); |
|
131 | + $this->title = $module->name." ".translate('LBL_LAYOUTS'); |
|
132 | + $this->question = translate('LBL_QUESTION_LAYOUT'); |
|
133 | + $this->help = 'layoutsHelp'; |
|
134 | + $this->ajax->addCrumb(translate('LBL_LAYOUTS'), ''); |
|
135 | 135 | break; |
136 | 136 | |
137 | 137 | |
138 | 138 | case 'subpanels': |
139 | 139 | //Studio Select Subpanel page. |
140 | - $this->buttons = $module->getSubpanels() ; |
|
141 | - $this->title = $module->name . " " . translate( 'LBL_SUBPANELS' ) ; |
|
142 | - $this->question = translate( 'LBL_QUESTION_SUBPANEL' ) ; |
|
143 | - $this->ajax->addCrumb ( translate( 'LBL_SUBPANELS' ), '' ) ; |
|
144 | - $this->help = 'subpanelHelp' ; |
|
140 | + $this->buttons = $module->getSubpanels(); |
|
141 | + $this->title = $module->name." ".translate('LBL_SUBPANELS'); |
|
142 | + $this->question = translate('LBL_QUESTION_SUBPANEL'); |
|
143 | + $this->ajax->addCrumb(translate('LBL_SUBPANELS'), ''); |
|
144 | + $this->help = 'subpanelHelp'; |
|
145 | 145 | break; |
146 | 146 | |
147 | 147 | case 'search': |
148 | 148 | //Studio Select Search Layout page. |
149 | - $this->buttons = $module->getSearch() ; |
|
150 | - $this->title = $module->name . " " . translate('LBL_FILTER'); |
|
151 | - $this->question = translate( 'LBL_QUESTION_SEARCH' ) ; |
|
152 | - $this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&view_module=' . $this->editModule . '")' ) ; |
|
153 | - $this->ajax->addCrumb ( translate( 'LBL_FILTER' ), '' ) ; |
|
154 | - $this->help = 'searchHelp' ; |
|
149 | + $this->buttons = $module->getSearch(); |
|
150 | + $this->title = $module->name." ".translate('LBL_FILTER'); |
|
151 | + $this->question = translate('LBL_QUESTION_SEARCH'); |
|
152 | + $this->ajax->addCrumb(translate('LBL_LAYOUTS'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&view_module='.$this->editModule.'")'); |
|
153 | + $this->ajax->addCrumb(translate('LBL_FILTER'), ''); |
|
154 | + $this->help = 'searchHelp'; |
|
155 | 155 | break; |
156 | 156 | |
157 | 157 | case 'dashlet': |
158 | 158 | $this->generateStudioDashletButtons(); |
159 | - $this->title = $this->editModule ." " .translate('LBL_DASHLET'); |
|
160 | - $this->question = translate( 'LBL_QUESTION_DASHLET' ) ; |
|
161 | - $this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&view_module=' . $this->editModule . '")' ) ; |
|
162 | - $this->ajax->addCrumb ( translate( 'LBL_DASHLET' ), '' ) ; |
|
163 | - $this->help = 'dashletHelp' ; |
|
159 | + $this->title = $this->editModule." ".translate('LBL_DASHLET'); |
|
160 | + $this->question = translate('LBL_QUESTION_DASHLET'); |
|
161 | + $this->ajax->addCrumb(translate('LBL_LAYOUTS'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&view_module='.$this->editModule.'")'); |
|
162 | + $this->ajax->addCrumb(translate('LBL_DASHLET'), ''); |
|
163 | + $this->help = 'dashletHelp'; |
|
164 | 164 | break; |
165 | 165 | |
166 | 166 | case 'popup': |
167 | 167 | $this->generateStudioPopupButtons(); |
168 | - $this->title = $this->editModule ." " .translate('LBL_POPUP'); |
|
169 | - $this->question = translate( 'LBL_QUESTION_POPUP' ) ; |
|
170 | - $this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&view_module=' . $this->editModule . '")' ) ; |
|
171 | - $this->ajax->addCrumb ( translate( 'LBL_POPUP' ), '' ) ; |
|
172 | - $this->help = 'popupHelp' ; |
|
168 | + $this->title = $this->editModule." ".translate('LBL_POPUP'); |
|
169 | + $this->question = translate('LBL_QUESTION_POPUP'); |
|
170 | + $this->ajax->addCrumb(translate('LBL_LAYOUTS'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&view_module='.$this->editModule.'")'); |
|
171 | + $this->ajax->addCrumb(translate('LBL_POPUP'), ''); |
|
172 | + $this->help = 'popupHelp'; |
|
173 | 173 | break; |
174 | 174 | default: |
175 | 175 | //Studio Edit Module Page |
176 | - $this->buttons = $module->getModule () ; |
|
177 | - $this->question = translate( 'LBL_QUESTION_MODULE' ) ; |
|
178 | - $this->title = translate( 'LBL_EDIT' ) . " " . $module->name ; |
|
179 | - $this->help = 'moduleHelp' ; |
|
176 | + $this->buttons = $module->getModule(); |
|
177 | + $this->question = translate('LBL_QUESTION_MODULE'); |
|
178 | + $this->title = translate('LBL_EDIT')." ".$module->name; |
|
179 | + $this->help = 'moduleHelp'; |
|
180 | 180 | global $current_user; |
181 | 181 | if (is_admin($current_user)) |
182 | 182 | $this->actions = "<input class=\"button\" type=\"button\" id=\"exportBtn\" name=\"exportBtn\" " |
183 | 183 | . "onclick=\"ModuleBuilder.getContent('module=ModuleBuilder&action=resetmodule&view_module=$this->editModule');\" value=\"" |
184 | - . translate( 'LBL_RESET_MODULE' ) . '">' ; |
|
184 | + . translate('LBL_RESET_MODULE').'">'; |
|
185 | 185 | } |
186 | 186 | } |
187 | 187 | } |
188 | 188 | |
189 | - function processMB ( |
|
189 | + function processMB( |
|
190 | 190 | $ajax |
191 | 191 | ) |
192 | 192 | { |
193 | - if (! isset ( $_REQUEST [ 'view_package' ] )) |
|
193 | + if (!isset ($_REQUEST ['view_package'])) |
|
194 | 194 | { |
195 | - sugar_die ( "no ModuleBuilder package set" ) ; |
|
195 | + sugar_die("no ModuleBuilder package set"); |
|
196 | 196 | } |
197 | 197 | |
198 | - $this->editModule = $_REQUEST [ 'view_module' ] ; |
|
199 | - $this->package = $_REQUEST [ 'view_package' ] ; |
|
198 | + $this->editModule = $_REQUEST ['view_module']; |
|
199 | + $this->package = $_REQUEST ['view_package']; |
|
200 | 200 | |
201 | - $ajax->addCrumb ( translate ( 'LBL_MODULEBUILDER', 'ModuleBuilder' ), 'ModuleBuilder.main("mb")' ) ; |
|
202 | - $ajax->addCrumb ( $this->package, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&view_package=' . $this->package . '")' ) ; |
|
203 | - $ajax->addCrumb ( $this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module=' . $this->editModule . '&view_package=' . $this->package . '")') ; |
|
201 | + $ajax->addCrumb(translate('LBL_MODULEBUILDER', 'ModuleBuilder'), 'ModuleBuilder.main("mb")'); |
|
202 | + $ajax->addCrumb($this->package, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&view_package='.$this->package.'")'); |
|
203 | + $ajax->addCrumb($this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module='.$this->editModule.'&view_package='.$this->package.'")'); |
|
204 | 204 | |
205 | - switch ( $this->view ) |
|
205 | + switch ($this->view) |
|
206 | 206 | { |
207 | 207 | case 'search': |
208 | 208 | //MB Select Search Layout page. |
209 | - $this->generateMBSearchButtons () ; |
|
210 | - $this->title = $this->editModule . " " . translate( 'LBL_SEARCH' ) ; |
|
211 | - $this->question = translate( 'LBL_QUESTION_SEARCH' ) ; |
|
212 | - $ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view_module=' . $this->editModule . '&view_package=' . $this->package . '")' ) ; |
|
213 | - $ajax->addCrumb ( translate( 'LBL_SEARCH_FORMS' ), '' ) ; |
|
214 | - $this->help = "searchHelp" ; |
|
209 | + $this->generateMBSearchButtons(); |
|
210 | + $this->title = $this->editModule." ".translate('LBL_SEARCH'); |
|
211 | + $this->question = translate('LBL_QUESTION_SEARCH'); |
|
212 | + $ajax->addCrumb(translate('LBL_LAYOUTS'), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view_module='.$this->editModule.'&view_package='.$this->package.'")'); |
|
213 | + $ajax->addCrumb(translate('LBL_SEARCH_FORMS'), ''); |
|
214 | + $this->help = "searchHelp"; |
|
215 | 215 | break; |
216 | 216 | |
217 | 217 | case 'subpanel': |
218 | 218 | //ModuleBuilder Select Subpanel |
219 | - $ajax->addCrumb ( $this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module=' . $this->editModule . '&view_package=' . $this->package . '")' ) ; |
|
220 | - $ajax->addCrumb ( translate( 'LBL_SUBPANELS' ), '' ) ; |
|
221 | - $this->question = translate( 'LBL_QUESTION_SUBPANEL' ) ; |
|
222 | - $this->help = 'subpanelHelp' ; |
|
219 | + $ajax->addCrumb($this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module='.$this->editModule.'&view_package='.$this->package.'")'); |
|
220 | + $ajax->addCrumb(translate('LBL_SUBPANELS'), ''); |
|
221 | + $this->question = translate('LBL_QUESTION_SUBPANEL'); |
|
222 | + $this->help = 'subpanelHelp'; |
|
223 | 223 | break; |
224 | 224 | |
225 | 225 | case 'dashlet': |
226 | - $this->generateMBDashletButtons (); |
|
227 | - $this->title = $this->editModule ." " .translate('LBL_DASHLET'); |
|
228 | - $this->question = translate( 'LBL_QUESTION_DASHLET' ) ; |
|
229 | - $this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&MB=1&view_package='.$this->package.'&view_module=' . $this->editModule . '")' ) ; |
|
230 | - $this->ajax->addCrumb ( translate( 'LBL_DASHLET' ), '' ) ; |
|
231 | - $this->help = 'dashletHelp' ; |
|
226 | + $this->generateMBDashletButtons(); |
|
227 | + $this->title = $this->editModule." ".translate('LBL_DASHLET'); |
|
228 | + $this->question = translate('LBL_QUESTION_DASHLET'); |
|
229 | + $this->ajax->addCrumb(translate('LBL_LAYOUTS'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&MB=1&view_package='.$this->package.'&view_module='.$this->editModule.'")'); |
|
230 | + $this->ajax->addCrumb(translate('LBL_DASHLET'), ''); |
|
231 | + $this->help = 'dashletHelp'; |
|
232 | 232 | break; |
233 | 233 | |
234 | 234 | |
235 | 235 | case 'popup': |
236 | 236 | $this->generateMBPopupButtons(); |
237 | - $this->title = $this->editModule ." " .translate('LBL_POPUP'); |
|
238 | - $this->question = translate( 'LBL_QUESTION_POPUP' ) ; |
|
239 | - $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 . '")' ) ; |
|
240 | - $this->ajax->addCrumb ( translate( 'LBL_POPUP' ), '' ) ; |
|
241 | - $this->help = 'popupHelp' ; |
|
237 | + $this->title = $this->editModule." ".translate('LBL_POPUP'); |
|
238 | + $this->question = translate('LBL_QUESTION_POPUP'); |
|
239 | + $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.'")'); |
|
240 | + $this->ajax->addCrumb(translate('LBL_POPUP'), ''); |
|
241 | + $this->help = 'popupHelp'; |
|
242 | 242 | break; |
243 | 243 | default: |
244 | - $ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), '' ) ; |
|
245 | - $this->generateMBViewButtons () ; |
|
246 | - $this->title = $this->editModule . " " . translate( 'LBL_LAYOUTS' ) ; |
|
247 | - $this->question = translate( 'LBL_QUESTION_LAYOUT' ) ; |
|
248 | - $this->help = "layoutsHelp" ; |
|
244 | + $ajax->addCrumb(translate('LBL_LAYOUTS'), ''); |
|
245 | + $this->generateMBViewButtons(); |
|
246 | + $this->title = $this->editModule." ".translate('LBL_LAYOUTS'); |
|
247 | + $this->question = translate('LBL_QUESTION_LAYOUT'); |
|
248 | + $this->help = "layoutsHelp"; |
|
249 | 249 | } |
250 | 250 | } |
251 | 251 | |
252 | 252 | |
253 | 253 | function generateStudioModuleButtons() |
254 | 254 | { |
255 | - require_once ('modules/ModuleBuilder/Module/StudioBrowser.php') ; |
|
256 | - $sb = new StudioBrowser ( ) ; |
|
257 | - $sb->loadModules () ; |
|
258 | - $nodes = $sb->getNodes () ; |
|
259 | - $this->buttons = array ( ) ; |
|
255 | + require_once ('modules/ModuleBuilder/Module/StudioBrowser.php'); |
|
256 | + $sb = new StudioBrowser( ); |
|
257 | + $sb->loadModules(); |
|
258 | + $nodes = $sb->getNodes(); |
|
259 | + $this->buttons = array( ); |
|
260 | 260 | //$GLOBALS['log']->debug(print_r($nodes,true)); |
261 | - foreach ( $nodes as $module ) |
|
261 | + foreach ($nodes as $module) |
|
262 | 262 | { |
263 | - $this->buttons [ $module [ 'name' ] ] = array ( 'action' => $module [ 'action' ] , 'imageTitle' => ucfirst ( $module [ 'module' ] . "_32" ) , 'size' => '32', 'linkId' => 'studiolink_'.$module [ 'module' ] ) ; |
|
263 | + $this->buttons [$module ['name']] = array('action' => $module ['action'], 'imageTitle' => ucfirst($module ['module']."_32"), 'size' => '32', 'linkId' => 'studiolink_'.$module ['module']); |
|
264 | 264 | } |
265 | 265 | } |
266 | 266 | |
@@ -268,44 +268,44 @@ discard block |
||
268 | 268 | |
269 | 269 | function generateMBViewButtons() |
270 | 270 | { |
271 | - $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_EDITVIEW' ] ] = |
|
272 | - array ( |
|
273 | - 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_EDITVIEW."&view_module={$this->editModule}&view_package={$this->package}" , |
|
271 | + $this->buttons [$GLOBALS ['mod_strings'] ['LBL_EDITVIEW']] = |
|
272 | + array( |
|
273 | + 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_EDITVIEW."&view_module={$this->editModule}&view_package={$this->package}", |
|
274 | 274 | 'imageTitle' => 'EditView', |
275 | 275 | 'help'=>'viewBtnEditView' |
276 | - ) ; |
|
277 | - $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_DETAILVIEW' ] ] = |
|
278 | - array ( |
|
279 | - 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_DETAILVIEW."&view_module={$this->editModule}&view_package={$this->package}" , |
|
276 | + ); |
|
277 | + $this->buttons [$GLOBALS ['mod_strings'] ['LBL_DETAILVIEW']] = |
|
278 | + array( |
|
279 | + 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_DETAILVIEW."&view_module={$this->editModule}&view_package={$this->package}", |
|
280 | 280 | 'imageTitle' => 'DetailView', |
281 | 281 | 'help'=>'viewBtnListView' |
282 | - ) ; |
|
283 | - $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_LISTVIEW' ] ] = |
|
284 | - array ( |
|
285 | - 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_LISTVIEW."&view_module={$this->editModule}&view_package={$this->package}" , |
|
282 | + ); |
|
283 | + $this->buttons [$GLOBALS ['mod_strings'] ['LBL_LISTVIEW']] = |
|
284 | + array( |
|
285 | + 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_LISTVIEW."&view_module={$this->editModule}&view_package={$this->package}", |
|
286 | 286 | 'imageTitle' => 'ListView', |
287 | 287 | 'help'=>'viewBtnListView' |
288 | - ) ; |
|
289 | - $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_QUICKCREATE' ] ] = |
|
290 | - array ( |
|
291 | - 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_QUICKCREATE."&view_module={$this->editModule}&view_package={$this->package}" , |
|
288 | + ); |
|
289 | + $this->buttons [$GLOBALS ['mod_strings'] ['LBL_QUICKCREATE']] = |
|
290 | + array( |
|
291 | + 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_QUICKCREATE."&view_module={$this->editModule}&view_package={$this->package}", |
|
292 | 292 | 'imageTitle' => 'QuickCreate', |
293 | 293 | 'help'=>'viewBtnQuickCreate' |
294 | - ) ; |
|
295 | - $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_SEARCH' ] ] = |
|
296 | - array ( |
|
297 | - 'action' => "module=ModuleBuilder&MB=true&action=wizard&view=search&view_module={$this->editModule}&view_package={$this->package}" , |
|
298 | - 'imageTitle' => 'SearchForm' , |
|
294 | + ); |
|
295 | + $this->buttons [$GLOBALS ['mod_strings'] ['LBL_SEARCH']] = |
|
296 | + array( |
|
297 | + 'action' => "module=ModuleBuilder&MB=true&action=wizard&view=search&view_module={$this->editModule}&view_package={$this->package}", |
|
298 | + 'imageTitle' => 'SearchForm', |
|
299 | 299 | 'help'=> 'searchBtn' |
300 | - ) ; |
|
301 | - $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_DASHLET' ] ] = |
|
302 | - array ( |
|
303 | - 'action' => "module=ModuleBuilder&MB=true&action=wizard&view=dashlet&view_module={$this->editModule}&view_package={$this->package}" , |
|
300 | + ); |
|
301 | + $this->buttons [$GLOBALS ['mod_strings'] ['LBL_DASHLET']] = |
|
302 | + array( |
|
303 | + 'action' => "module=ModuleBuilder&MB=true&action=wizard&view=dashlet&view_module={$this->editModule}&view_package={$this->package}", |
|
304 | 304 | 'imageTitle' => 'Dashlet', |
305 | 305 | 'help'=>'viewBtnDashlet' |
306 | - ) ; |
|
307 | - $this->buttons [ $GLOBALS [ 'mod_strings' ] ['LBL_POPUP'] ] = |
|
308 | - array ( |
|
306 | + ); |
|
307 | + $this->buttons [$GLOBALS ['mod_strings'] ['LBL_POPUP']] = |
|
308 | + array( |
|
309 | 309 | 'imageTitle' => 'Popup', |
310 | 310 | 'action' => "module=ModuleBuilder&MB=true&action=wizard&view=popup&view_module={$this->editModule}&view_package={$this->package}", |
311 | 311 | 'help'=>'PopupListViewBtn' |
@@ -314,31 +314,31 @@ discard block |
||
314 | 314 | |
315 | 315 | function generateMBDashletButtons() |
316 | 316 | { |
317 | - $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'); |
|
318 | - $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'); |
|
317 | + $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'); |
|
318 | + $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'); |
|
319 | 319 | } |
320 | 320 | |
321 | 321 | function generateMBPopupButtons() |
322 | 322 | { |
323 | - $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'); |
|
324 | - $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'); |
|
323 | + $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'); |
|
324 | + $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'); |
|
325 | 325 | } |
326 | 326 | |
327 | 327 | function generateStudioDashletButtons() |
328 | 328 | { |
329 | - $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'); |
|
330 | - $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'); |
|
329 | + $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'); |
|
330 | + $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'); |
|
331 | 331 | } |
332 | 332 | |
333 | 333 | function generateStudioPopupButtons() |
334 | 334 | { |
335 | - $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'); |
|
336 | - $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'); |
|
335 | + $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'); |
|
336 | + $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'); |
|
337 | 337 | } |
338 | 338 | |
339 | 339 | function generateMBSearchButtons() |
340 | 340 | { |
341 | - $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" ) ; |
|
342 | - $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" ) ; |
|
341 | + $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"); |
|
342 | + $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"); |
|
343 | 343 | } |
344 | 344 | } |
@@ -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 |
@@ -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 | } |
@@ -41,129 +41,129 @@ |
||
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', '',null,null,'.gif',$mod_strings['LBL_EDIT'], true, '.gif')); |
|
74 | - $smarty->assign('action', 'savedropdown'); |
|
75 | - $body = $smarty->fetch('modules/ModuleBuilder/tpls/MBModule/dropdown.tpl'); |
|
76 | - $ajax->addSection('east2', $mod_strings['LBL_SECTION_DROPDOWNED'], $body ); |
|
77 | - echo $ajax->getJavascript(); |
|
78 | - } |
|
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', '',null,null,'.gif',$mod_strings['LBL_EDIT'], true, '.gif')); |
|
74 | + $smarty->assign('action', 'savedropdown'); |
|
75 | + $body = $smarty->fetch('modules/ModuleBuilder/tpls/MBModule/dropdown.tpl'); |
|
76 | + $ajax->addSection('east2', $mod_strings['LBL_SECTION_DROPDOWNED'], $body ); |
|
77 | + echo $ajax->getJavascript(); |
|
78 | + } |
|
79 | 79 | |
80 | - function generateSmarty() |
|
81 | - { |
|
82 | - //get the selected language |
|
83 | - $selected_lang = (!empty($_REQUEST['dropdown_lang'])?$_REQUEST['dropdown_lang']:$_SESSION['authenticated_user_language']); |
|
84 | - $vardef = array(); |
|
85 | - $package_name = 'studio'; |
|
86 | - $package_strings = array(); |
|
87 | - $new =false; |
|
88 | - $my_list_strings = return_app_list_strings_language( $selected_lang ) ; |
|
80 | + function generateSmarty() |
|
81 | + { |
|
82 | + //get the selected language |
|
83 | + $selected_lang = (!empty($_REQUEST['dropdown_lang'])?$_REQUEST['dropdown_lang']:$_SESSION['authenticated_user_language']); |
|
84 | + $vardef = array(); |
|
85 | + $package_name = 'studio'; |
|
86 | + $package_strings = array(); |
|
87 | + $new =false; |
|
88 | + $my_list_strings = return_app_list_strings_language( $selected_lang ) ; |
|
89 | 89 | // $my_list_strings = $GLOBALS['app_list_strings']; |
90 | 90 | |
91 | 91 | $smarty = new Sugar_Smarty(); |
92 | 92 | |
93 | - //if we are using ModuleBuilder then process the following |
|
94 | - if(!empty($_REQUEST['view_package']) && $_REQUEST['view_package'] != 'studio'){ |
|
95 | - require_once('modules/ModuleBuilder/MB/ModuleBuilder.php'); |
|
96 | - $mb = new ModuleBuilder(); |
|
97 | - $module = $mb->getPackageModule($_REQUEST['view_package'], $_REQUEST['view_module']); |
|
98 | - $package = $mb->packages[$_REQUEST['view_package']]; |
|
99 | - $package_name = $package->name; |
|
100 | - $module->getVardefs(); |
|
101 | - if(empty($_REQUEST['dropdown_name']) && !empty($_REQUEST['field'])){ |
|
102 | - $new = true; |
|
103 | - $_REQUEST['dropdown_name'] = $_REQUEST['field']. '_list'; |
|
104 | - } |
|
93 | + //if we are using ModuleBuilder then process the following |
|
94 | + if(!empty($_REQUEST['view_package']) && $_REQUEST['view_package'] != 'studio'){ |
|
95 | + require_once('modules/ModuleBuilder/MB/ModuleBuilder.php'); |
|
96 | + $mb = new ModuleBuilder(); |
|
97 | + $module = $mb->getPackageModule($_REQUEST['view_package'], $_REQUEST['view_module']); |
|
98 | + $package = $mb->packages[$_REQUEST['view_package']]; |
|
99 | + $package_name = $package->name; |
|
100 | + $module->getVardefs(); |
|
101 | + if(empty($_REQUEST['dropdown_name']) && !empty($_REQUEST['field'])){ |
|
102 | + $new = true; |
|
103 | + $_REQUEST['dropdown_name'] = $_REQUEST['field']. '_list'; |
|
104 | + } |
|
105 | 105 | |
106 | - $vardef = (!empty($module->mbvardefs->fields[$_REQUEST['dropdown_name']]))? $module->mbvardefs->fields[$_REQUEST['dropdown_name']]: array(); |
|
107 | - $module->mblanguage->generateAppStrings(false) ; |
|
106 | + $vardef = (!empty($module->mbvardefs->fields[$_REQUEST['dropdown_name']]))? $module->mbvardefs->fields[$_REQUEST['dropdown_name']]: array(); |
|
107 | + $module->mblanguage->generateAppStrings(false) ; |
|
108 | 108 | $my_list_strings = array_merge( $my_list_strings, $module->mblanguage->appListStrings[$selected_lang.'.lang.php'] ); |
109 | 109 | $smarty->assign('module_name', $module->name); |
110 | - } |
|
110 | + } |
|
111 | 111 | |
112 | 112 | $module_name = !empty($module->name) ? $module->name : ''; |
113 | 113 | $module_name = (empty($module_name) && !empty($_REQUEST['view_module'])) ? $_REQUEST['view_module'] : $module_name; |
114 | 114 | |
115 | - foreach($my_list_strings as $key=>$value){ |
|
116 | - if(!is_array($value)){ |
|
117 | - unset($my_list_strings[$key]); |
|
118 | - } |
|
119 | - } |
|
115 | + foreach($my_list_strings as $key=>$value){ |
|
116 | + if(!is_array($value)){ |
|
117 | + unset($my_list_strings[$key]); |
|
118 | + } |
|
119 | + } |
|
120 | 120 | |
121 | - $dropdowns = array_keys($my_list_strings); |
|
122 | - asort($dropdowns); |
|
123 | - $keys = array_keys($dropdowns); |
|
124 | - $first_string = $my_list_strings[$dropdowns[$keys[0]]]; |
|
121 | + $dropdowns = array_keys($my_list_strings); |
|
122 | + asort($dropdowns); |
|
123 | + $keys = array_keys($dropdowns); |
|
124 | + $first_string = $my_list_strings[$dropdowns[$keys[0]]]; |
|
125 | 125 | |
126 | - $name = ''; |
|
127 | - $selected_dropdown = array(); |
|
126 | + $name = ''; |
|
127 | + $selected_dropdown = array(); |
|
128 | 128 | |
129 | - $json = getJSONobj(); |
|
129 | + $json = getJSONobj(); |
|
130 | 130 | |
131 | - if(!empty($_REQUEST['dropdown_name']) && !$new){ |
|
132 | - $name = $_REQUEST['dropdown_name']; |
|
131 | + if(!empty($_REQUEST['dropdown_name']) && !$new){ |
|
132 | + $name = $_REQUEST['dropdown_name']; |
|
133 | 133 | |
134 | - // 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 |
|
134 | + // 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 | 135 | // 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 |
136 | 136 | if (!isset($my_list_strings[$name])) |
137 | 137 | $my_list_strings[$name] = array () ; |
138 | 138 | |
139 | - $selected_dropdown = (!empty($vardef['options']) && !empty($my_list_strings[$vardef['options']])) ? $my_list_strings[$vardef['options']] : $my_list_strings[$name]; |
|
140 | - $smarty->assign('ul_list', 'list = '.$json->encode(array_keys($selected_dropdown))); |
|
141 | - $smarty->assign('dropdown_name', (!empty($vardef['options']) ? $vardef['options'] : $_REQUEST['dropdown_name'])); |
|
142 | - $smarty->assign('name', $_REQUEST['dropdown_name']); |
|
143 | - $smarty->assign('options', $selected_dropdown); |
|
144 | - }else{ |
|
145 | - $smarty->assign('ul_list', 'list = {}'); |
|
146 | - //we should try to find a name for this dropdown based on the field name. |
|
147 | - $pre_pop_name = ''; |
|
148 | - if(!empty($_REQUEST['field'])) |
|
149 | - $pre_pop_name = $_REQUEST['field']; |
|
150 | - //ensure this dropdown name does not already exist |
|
151 | - $use_name = $pre_pop_name.'_list'; |
|
152 | - for($i = 0; $i < 100; $i++){ |
|
153 | - if(empty($my_list_strings[$use_name])) |
|
154 | - break; |
|
155 | - else |
|
156 | - $use_name = $pre_pop_name.'_'.$i; |
|
157 | - } |
|
158 | - $smarty->assign('prepopulated_name', $use_name); |
|
159 | - } |
|
139 | + $selected_dropdown = (!empty($vardef['options']) && !empty($my_list_strings[$vardef['options']])) ? $my_list_strings[$vardef['options']] : $my_list_strings[$name]; |
|
140 | + $smarty->assign('ul_list', 'list = '.$json->encode(array_keys($selected_dropdown))); |
|
141 | + $smarty->assign('dropdown_name', (!empty($vardef['options']) ? $vardef['options'] : $_REQUEST['dropdown_name'])); |
|
142 | + $smarty->assign('name', $_REQUEST['dropdown_name']); |
|
143 | + $smarty->assign('options', $selected_dropdown); |
|
144 | + }else{ |
|
145 | + $smarty->assign('ul_list', 'list = {}'); |
|
146 | + //we should try to find a name for this dropdown based on the field name. |
|
147 | + $pre_pop_name = ''; |
|
148 | + if(!empty($_REQUEST['field'])) |
|
149 | + $pre_pop_name = $_REQUEST['field']; |
|
150 | + //ensure this dropdown name does not already exist |
|
151 | + $use_name = $pre_pop_name.'_list'; |
|
152 | + for($i = 0; $i < 100; $i++){ |
|
153 | + if(empty($my_list_strings[$use_name])) |
|
154 | + break; |
|
155 | + else |
|
156 | + $use_name = $pre_pop_name.'_'.$i; |
|
157 | + } |
|
158 | + $smarty->assign('prepopulated_name', $use_name); |
|
159 | + } |
|
160 | 160 | |
161 | - $smarty->assign('module_name', $module_name); |
|
162 | - $smarty->assign('APP', $GLOBALS['app_strings']); |
|
163 | - $smarty->assign('MOD', $GLOBALS['mod_strings']); |
|
164 | - $smarty->assign('selected_lang', $selected_lang); |
|
165 | - $smarty->assign('available_languages',get_languages()); |
|
166 | - $smarty->assign('package_name', $package_name); |
|
167 | - return $smarty; |
|
168 | - } |
|
161 | + $smarty->assign('module_name', $module_name); |
|
162 | + $smarty->assign('APP', $GLOBALS['app_strings']); |
|
163 | + $smarty->assign('MOD', $GLOBALS['mod_strings']); |
|
164 | + $smarty->assign('selected_lang', $selected_lang); |
|
165 | + $smarty->assign('available_languages',get_languages()); |
|
166 | + $smarty->assign('package_name', $package_name); |
|
167 | + return $smarty; |
|
168 | + } |
|
169 | 169 | } |
170 | 170 | \ 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,56 +64,56 @@ 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', '',null,null,'.gif',$mod_strings['LBL_EDIT'], true, '.gif')); |
|
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', '', null, null, '.gif', $mod_strings['LBL_EDIT'], true, '.gif')); |
|
74 | 74 | $smarty->assign('action', 'savedropdown'); |
75 | 75 | $body = $smarty->fetch('modules/ModuleBuilder/tpls/MBModule/dropdown.tpl'); |
76 | - $ajax->addSection('east2', $mod_strings['LBL_SECTION_DROPDOWNED'], $body ); |
|
76 | + $ajax->addSection('east2', $mod_strings['LBL_SECTION_DROPDOWNED'], $body); |
|
77 | 77 | echo $ajax->getJavascript(); |
78 | 78 | } |
79 | 79 | |
80 | 80 | function generateSmarty() |
81 | 81 | { |
82 | 82 | //get the selected language |
83 | - $selected_lang = (!empty($_REQUEST['dropdown_lang'])?$_REQUEST['dropdown_lang']:$_SESSION['authenticated_user_language']); |
|
83 | + $selected_lang = (!empty($_REQUEST['dropdown_lang']) ? $_REQUEST['dropdown_lang'] : $_SESSION['authenticated_user_language']); |
|
84 | 84 | $vardef = array(); |
85 | 85 | $package_name = 'studio'; |
86 | 86 | $package_strings = array(); |
87 | - $new =false; |
|
88 | - $my_list_strings = return_app_list_strings_language( $selected_lang ) ; |
|
87 | + $new = false; |
|
88 | + $my_list_strings = return_app_list_strings_language($selected_lang); |
|
89 | 89 | // $my_list_strings = $GLOBALS['app_list_strings']; |
90 | 90 | |
91 | 91 | $smarty = new Sugar_Smarty(); |
92 | 92 | |
93 | 93 | //if we are using ModuleBuilder then process the following |
94 | - if(!empty($_REQUEST['view_package']) && $_REQUEST['view_package'] != 'studio'){ |
|
94 | + if (!empty($_REQUEST['view_package']) && $_REQUEST['view_package'] != 'studio') { |
|
95 | 95 | require_once('modules/ModuleBuilder/MB/ModuleBuilder.php'); |
96 | 96 | $mb = new ModuleBuilder(); |
97 | 97 | $module = $mb->getPackageModule($_REQUEST['view_package'], $_REQUEST['view_module']); |
98 | 98 | $package = $mb->packages[$_REQUEST['view_package']]; |
99 | 99 | $package_name = $package->name; |
100 | 100 | $module->getVardefs(); |
101 | - if(empty($_REQUEST['dropdown_name']) && !empty($_REQUEST['field'])){ |
|
101 | + if (empty($_REQUEST['dropdown_name']) && !empty($_REQUEST['field'])) { |
|
102 | 102 | $new = true; |
103 | - $_REQUEST['dropdown_name'] = $_REQUEST['field']. '_list'; |
|
103 | + $_REQUEST['dropdown_name'] = $_REQUEST['field'].'_list'; |
|
104 | 104 | } |
105 | 105 | |
106 | - $vardef = (!empty($module->mbvardefs->fields[$_REQUEST['dropdown_name']]))? $module->mbvardefs->fields[$_REQUEST['dropdown_name']]: array(); |
|
107 | - $module->mblanguage->generateAppStrings(false) ; |
|
108 | - $my_list_strings = array_merge( $my_list_strings, $module->mblanguage->appListStrings[$selected_lang.'.lang.php'] ); |
|
106 | + $vardef = (!empty($module->mbvardefs->fields[$_REQUEST['dropdown_name']])) ? $module->mbvardefs->fields[$_REQUEST['dropdown_name']] : array(); |
|
107 | + $module->mblanguage->generateAppStrings(false); |
|
108 | + $my_list_strings = array_merge($my_list_strings, $module->mblanguage->appListStrings[$selected_lang.'.lang.php']); |
|
109 | 109 | $smarty->assign('module_name', $module->name); |
110 | 110 | } |
111 | 111 | |
112 | - $module_name = !empty($module->name) ? $module->name : ''; |
|
113 | - $module_name = (empty($module_name) && !empty($_REQUEST['view_module'])) ? $_REQUEST['view_module'] : $module_name; |
|
112 | + $module_name = !empty($module->name) ? $module->name : ''; |
|
113 | + $module_name = (empty($module_name) && !empty($_REQUEST['view_module'])) ? $_REQUEST['view_module'] : $module_name; |
|
114 | 114 | |
115 | - foreach($my_list_strings as $key=>$value){ |
|
116 | - if(!is_array($value)){ |
|
115 | + foreach ($my_list_strings as $key=>$value) { |
|
116 | + if (!is_array($value)) { |
|
117 | 117 | unset($my_list_strings[$key]); |
118 | 118 | } |
119 | 119 | } |
@@ -128,29 +128,29 @@ discard block |
||
128 | 128 | |
129 | 129 | $json = getJSONobj(); |
130 | 130 | |
131 | - if(!empty($_REQUEST['dropdown_name']) && !$new){ |
|
131 | + if (!empty($_REQUEST['dropdown_name']) && !$new) { |
|
132 | 132 | $name = $_REQUEST['dropdown_name']; |
133 | 133 | |
134 | 134 | // 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 | 135 | // 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 |
136 | 136 | if (!isset($my_list_strings[$name])) |
137 | - $my_list_strings[$name] = array () ; |
|
137 | + $my_list_strings[$name] = array(); |
|
138 | 138 | |
139 | 139 | $selected_dropdown = (!empty($vardef['options']) && !empty($my_list_strings[$vardef['options']])) ? $my_list_strings[$vardef['options']] : $my_list_strings[$name]; |
140 | 140 | $smarty->assign('ul_list', 'list = '.$json->encode(array_keys($selected_dropdown))); |
141 | 141 | $smarty->assign('dropdown_name', (!empty($vardef['options']) ? $vardef['options'] : $_REQUEST['dropdown_name'])); |
142 | 142 | $smarty->assign('name', $_REQUEST['dropdown_name']); |
143 | 143 | $smarty->assign('options', $selected_dropdown); |
144 | - }else{ |
|
144 | + } else { |
|
145 | 145 | $smarty->assign('ul_list', 'list = {}'); |
146 | 146 | //we should try to find a name for this dropdown based on the field name. |
147 | 147 | $pre_pop_name = ''; |
148 | - if(!empty($_REQUEST['field'])) |
|
148 | + if (!empty($_REQUEST['field'])) |
|
149 | 149 | $pre_pop_name = $_REQUEST['field']; |
150 | 150 | //ensure this dropdown name does not already exist |
151 | 151 | $use_name = $pre_pop_name.'_list'; |
152 | - for($i = 0; $i < 100; $i++){ |
|
153 | - if(empty($my_list_strings[$use_name])) |
|
152 | + for ($i = 0; $i < 100; $i++) { |
|
153 | + if (empty($my_list_strings[$use_name])) |
|
154 | 154 | break; |
155 | 155 | else |
156 | 156 | $use_name = $pre_pop_name.'_'.$i; |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $smarty->assign('APP', $GLOBALS['app_strings']); |
163 | 163 | $smarty->assign('MOD', $GLOBALS['mod_strings']); |
164 | 164 | $smarty->assign('selected_lang', $selected_lang); |
165 | - $smarty->assign('available_languages',get_languages()); |
|
165 | + $smarty->assign('available_languages', get_languages()); |
|
166 | 166 | $smarty->assign('package_name', $package_name); |
167 | 167 | return $smarty; |
168 | 168 | } |
@@ -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\" )'" ) ; |
@@ -68,16 +68,16 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
71 | - * @see SugarView::_getModuleTitleParams() |
|
72 | - */ |
|
73 | - protected function _getModuleTitleParams($browserTitle = false) |
|
74 | - { |
|
75 | - global $mod_strings; |
|
71 | + * @see SugarView::_getModuleTitleParams() |
|
72 | + */ |
|
73 | + protected function _getModuleTitleParams($browserTitle = false) |
|
74 | + { |
|
75 | + global $mod_strings; |
|
76 | 76 | |
77 | - return array( |
|
78 | - translate('LBL_MODULE_NAME','Administration'), |
|
79 | - ModuleBuilderController::getModuleTitle(), |
|
80 | - ); |
|
77 | + return array( |
|
78 | + translate('LBL_MODULE_NAME','Administration'), |
|
79 | + ModuleBuilderController::getModuleTitle(), |
|
80 | + ); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | // DO NOT REMOVE - overrides parent ViewEdit preDisplay() which attempts to load a bean for a non-existent module |
@@ -97,12 +97,12 @@ discard block |
||
97 | 97 | $smarty = $this->constructSmarty ( $parser ) ; |
98 | 98 | if ($preview) |
99 | 99 | { |
100 | - echo $smarty->fetch ( "modules/ModuleBuilder/tpls/Preview/listView.tpl" ) ; |
|
100 | + echo $smarty->fetch ( "modules/ModuleBuilder/tpls/Preview/listView.tpl" ) ; |
|
101 | 101 | } else |
102 | 102 | { |
103 | - $ajax = $this->constructAjax () ; |
|
104 | - $ajax->addSection ( 'center', translate('LBL_DASHLET'), $smarty->fetch ( "modules/ModuleBuilder/tpls/listView.tpl" ) ) ; |
|
105 | - echo $ajax->getJavascript () ; |
|
103 | + $ajax = $this->constructAjax () ; |
|
104 | + $ajax->addSection ( 'center', translate('LBL_DASHLET'), $smarty->fetch ( "modules/ModuleBuilder/tpls/listView.tpl" ) ) ; |
|
105 | + echo $ajax->getJavascript () ; |
|
106 | 106 | } |
107 | 107 | } |
108 | 108 | |
@@ -145,11 +145,11 @@ discard block |
||
145 | 145 | $helpName = (isset( $_REQUEST['view']) && $_REQUEST['view']=='dashletsearch') ? 'searchViewEditor' : 'listViewEditor'; |
146 | 146 | $smarty->assign ( 'helpName', $helpName ) ; |
147 | 147 | $smarty->assign ( 'helpDefault', 'modify' ) ; |
148 | - if ($this->fromModuleBuilder) { |
|
149 | - $mb = new ModuleBuilder ( ) ; |
|
148 | + if ($this->fromModuleBuilder) { |
|
149 | + $mb = new ModuleBuilder ( ) ; |
|
150 | 150 | $module = & $mb->getPackageModule ( $this->editPackage, $this->editModule ) ; |
151 | - $smarty->assign('current_mod_strings', $module->getModStrings()); |
|
152 | - } |
|
151 | + $smarty->assign('current_mod_strings', $module->getModStrings()); |
|
152 | + } |
|
153 | 153 | $smarty->assign ( 'title', $this->_constructTitle () ) ; |
154 | 154 | $groups = array ( ) ; |
155 | 155 | foreach ( $parser->columns as $column => $function ) |
@@ -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. |
@@ -43,27 +43,27 @@ discard block |
||
43 | 43 | |
44 | 44 | |
45 | 45 | |
46 | -require_once ('modules/ModuleBuilder/views/view.listview.php') ; |
|
47 | -require_once 'modules/ModuleBuilder/parsers/constants.php' ; |
|
46 | +require_once ('modules/ModuleBuilder/views/view.listview.php'); |
|
47 | +require_once 'modules/ModuleBuilder/parsers/constants.php'; |
|
48 | 48 | |
49 | 49 | class ViewDashlet extends ViewListView |
50 | 50 | { |
51 | 51 | function __construct() |
52 | 52 | { |
53 | - $this->editModule = $_REQUEST [ 'view_module' ] ; |
|
54 | - $this->editLayout = $_REQUEST [ 'view' ] ; |
|
55 | - if(isset ( $_REQUEST [ 'view_package' ] ) && ! empty ( $_REQUEST [ 'view_package' ] )) |
|
56 | - $this->editPackage = $_REQUEST [ 'view_package' ]; |
|
53 | + $this->editModule = $_REQUEST ['view_module']; |
|
54 | + $this->editLayout = $_REQUEST ['view']; |
|
55 | + if (isset ($_REQUEST ['view_package']) && !empty ($_REQUEST ['view_package'])) |
|
56 | + $this->editPackage = $_REQUEST ['view_package']; |
|
57 | 57 | else |
58 | 58 | $this->editPackage = null; |
59 | 59 | |
60 | - $this->fromModuleBuilder = isset ( $_REQUEST [ 'MB' ] ) || (isset($_REQUEST['view_package']) && $_REQUEST['view_package'] && $_REQUEST['view_package'] != 'studio') ; |
|
60 | + $this->fromModuleBuilder = isset ($_REQUEST ['MB']) || (isset($_REQUEST['view_package']) && $_REQUEST['view_package'] && $_REQUEST['view_package'] != 'studio'); |
|
61 | 61 | |
62 | 62 | if (!$this->fromModuleBuilder) |
63 | 63 | { |
64 | - global $app_list_strings ; |
|
65 | - $moduleNames = array_change_key_case ( $app_list_strings [ 'moduleList' ] ) ; |
|
66 | - $this->translatedEditModule = $moduleNames [ strtolower ( $this->editModule ) ] ; |
|
64 | + global $app_list_strings; |
|
65 | + $moduleNames = array_change_key_case($app_list_strings ['moduleList']); |
|
66 | + $this->translatedEditModule = $moduleNames [strtolower($this->editModule)]; |
|
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | global $mod_strings; |
76 | 76 | |
77 | 77 | return array( |
78 | - translate('LBL_MODULE_NAME','Administration'), |
|
78 | + translate('LBL_MODULE_NAME', 'Administration'), |
|
79 | 79 | ModuleBuilderController::getModuleTitle(), |
80 | 80 | ); |
81 | 81 | } |
@@ -91,141 +91,141 @@ discard block |
||
91 | 91 | { |
92 | 92 | |
93 | 93 | |
94 | - require_once 'modules/ModuleBuilder/parsers/ParserFactory.php' ; |
|
95 | - $parser = ParserFactory::getParser ( $this->editLayout, $this->editModule, $this->editPackage) ; |
|
94 | + require_once 'modules/ModuleBuilder/parsers/ParserFactory.php'; |
|
95 | + $parser = ParserFactory::getParser($this->editLayout, $this->editModule, $this->editPackage); |
|
96 | 96 | |
97 | - $smarty = $this->constructSmarty ( $parser ) ; |
|
97 | + $smarty = $this->constructSmarty($parser); |
|
98 | 98 | if ($preview) |
99 | 99 | { |
100 | - echo $smarty->fetch ( "modules/ModuleBuilder/tpls/Preview/listView.tpl" ) ; |
|
100 | + echo $smarty->fetch("modules/ModuleBuilder/tpls/Preview/listView.tpl"); |
|
101 | 101 | } else |
102 | 102 | { |
103 | - $ajax = $this->constructAjax () ; |
|
104 | - $ajax->addSection ( 'center', translate('LBL_DASHLET'), $smarty->fetch ( "modules/ModuleBuilder/tpls/listView.tpl" ) ) ; |
|
105 | - echo $ajax->getJavascript () ; |
|
103 | + $ajax = $this->constructAjax(); |
|
104 | + $ajax->addSection('center', translate('LBL_DASHLET'), $smarty->fetch("modules/ModuleBuilder/tpls/listView.tpl")); |
|
105 | + echo $ajax->getJavascript(); |
|
106 | 106 | } |
107 | 107 | } |
108 | 108 | |
109 | 109 | function constructAjax() |
110 | 110 | { |
111 | - require_once ('modules/ModuleBuilder/MB/AjaxCompose.php') ; |
|
112 | - $ajax = new AjaxCompose ( ) ; |
|
111 | + require_once ('modules/ModuleBuilder/MB/AjaxCompose.php'); |
|
112 | + $ajax = new AjaxCompose( ); |
|
113 | 113 | |
114 | 114 | if ($this->fromModuleBuilder) |
115 | 115 | { |
116 | - $ajax->addCrumb ( translate ( 'LBL_MODULEBUILDER', 'ModuleBuilder' ), 'ModuleBuilder.main("mb")' ) ; |
|
117 | - $ajax->addCrumb ( $_REQUEST [ 'view_package' ], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=' . $this->editPackage . '")' ) ; |
|
118 | - $ajax->addCrumb ( $this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package=' . $this->editPackage . '&view_module=' . $this->editModule . '")' ) ; |
|
119 | - $ajax->addCrumb ( translate('LBL_LAYOUTS', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&layouts=1&MB=1&view_package='.$this->editPackage.'&view_module=' . $this->editModule . '")'); |
|
120 | - $ajax->addCrumb ( translate('LBL_DASHLET', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=dashlet&MB=1&view_package='.$this->editPackage.'&view_module=' . $this->editModule . '")' ); |
|
116 | + $ajax->addCrumb(translate('LBL_MODULEBUILDER', 'ModuleBuilder'), 'ModuleBuilder.main("mb")'); |
|
117 | + $ajax->addCrumb($_REQUEST ['view_package'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$this->editPackage.'")'); |
|
118 | + $ajax->addCrumb($this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package='.$this->editPackage.'&view_module='.$this->editModule.'")'); |
|
119 | + $ajax->addCrumb(translate('LBL_LAYOUTS', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&layouts=1&MB=1&view_package='.$this->editPackage.'&view_module='.$this->editModule.'")'); |
|
120 | + $ajax->addCrumb(translate('LBL_DASHLET', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=dashlet&MB=1&view_package='.$this->editPackage.'&view_module='.$this->editModule.'")'); |
|
121 | 121 | |
122 | 122 | $ViewLabel = ($this->editLayout == MB_DASHLET) ? 'LBL_DASHLETLISTVIEW' : 'LBL_DASHLETSEARCHVIEW'; |
123 | - $ajax->addCrumb ( translate ($ViewLabel, 'ModuleBuilder' ), '' ) ; |
|
124 | - }else{ |
|
125 | - $ajax->addCrumb ( translate($this->editModule), 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module=' . $this->editModule . '")' ) ; |
|
126 | - $ajax->addCrumb ( translate('LBL_LAYOUTS', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&layouts=1&view_module=' . $this->editModule . '")'); |
|
127 | - $ajax->addCrumb ( translate('LBL_DASHLET', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=dashlet&view_module=' . $this->editModule . '")' ); |
|
123 | + $ajax->addCrumb(translate($ViewLabel, 'ModuleBuilder'), ''); |
|
124 | + } else { |
|
125 | + $ajax->addCrumb(translate($this->editModule), 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module='.$this->editModule.'")'); |
|
126 | + $ajax->addCrumb(translate('LBL_LAYOUTS', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&layouts=1&view_module='.$this->editModule.'")'); |
|
127 | + $ajax->addCrumb(translate('LBL_DASHLET', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=dashlet&view_module='.$this->editModule.'")'); |
|
128 | 128 | $ViewLabel = ($this->editLayout == MB_DASHLET) ? 'LBL_DASHLETLISTVIEW' : 'LBL_DASHLETSEARCHVIEW'; |
129 | - $ajax->addCrumb ( translate ($ViewLabel, 'ModuleBuilder' ), '' ) ; |
|
129 | + $ajax->addCrumb(translate($ViewLabel, 'ModuleBuilder'), ''); |
|
130 | 130 | } |
131 | - return $ajax ; |
|
131 | + return $ajax; |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | function constructSmarty($parser) |
135 | 135 | { |
136 | - $smarty = new Sugar_Smarty ( ) ; |
|
137 | - $smarty->assign ( 'translate', true ) ; |
|
138 | - $smarty->assign ( 'language', $parser->getLanguage () ) ; |
|
136 | + $smarty = new Sugar_Smarty( ); |
|
137 | + $smarty->assign('translate', true); |
|
138 | + $smarty->assign('language', $parser->getLanguage()); |
|
139 | 139 | |
140 | - $smarty->assign ( 'view', $this->editLayout ) ; |
|
141 | - $smarty->assign ( 'action', 'dashletSave' ) ; |
|
142 | - $smarty->assign( 'module', 'ModuleBuilder'); |
|
143 | - $smarty->assign ( 'view_module', $this->editModule ) ; |
|
144 | - $smarty->assign ( 'field_defs', $parser->getFieldDefs () ) ; |
|
145 | - $helpName = (isset( $_REQUEST['view']) && $_REQUEST['view']=='dashletsearch') ? 'searchViewEditor' : 'listViewEditor'; |
|
146 | - $smarty->assign ( 'helpName', $helpName ) ; |
|
147 | - $smarty->assign ( 'helpDefault', 'modify' ) ; |
|
140 | + $smarty->assign('view', $this->editLayout); |
|
141 | + $smarty->assign('action', 'dashletSave'); |
|
142 | + $smarty->assign('module', 'ModuleBuilder'); |
|
143 | + $smarty->assign('view_module', $this->editModule); |
|
144 | + $smarty->assign('field_defs', $parser->getFieldDefs()); |
|
145 | + $helpName = (isset($_REQUEST['view']) && $_REQUEST['view'] == 'dashletsearch') ? 'searchViewEditor' : 'listViewEditor'; |
|
146 | + $smarty->assign('helpName', $helpName); |
|
147 | + $smarty->assign('helpDefault', 'modify'); |
|
148 | 148 | if ($this->fromModuleBuilder) { |
149 | - $mb = new ModuleBuilder ( ) ; |
|
150 | - $module = & $mb->getPackageModule ( $this->editPackage, $this->editModule ) ; |
|
149 | + $mb = new ModuleBuilder( ); |
|
150 | + $module = & $mb->getPackageModule($this->editPackage, $this->editModule); |
|
151 | 151 | $smarty->assign('current_mod_strings', $module->getModStrings()); |
152 | 152 | } |
153 | - $smarty->assign ( 'title', $this->_constructTitle () ) ; |
|
154 | - $groups = array ( ) ; |
|
155 | - foreach ( $parser->columns as $column => $function ) |
|
153 | + $smarty->assign('title', $this->_constructTitle()); |
|
154 | + $groups = array( ); |
|
155 | + foreach ($parser->columns as $column => $function) |
|
156 | 156 | { |
157 | 157 | // update this so that each field has a properties set |
158 | 158 | // properties are name, value, title (optional) |
159 | - $groups [ $GLOBALS [ 'mod_strings' ] [ $column ] ] = $parser->$function () ; // call the parser functions to populate the list view columns, by default 'default', 'available' and 'hidden' |
|
159 | + $groups [$GLOBALS ['mod_strings'] [$column]] = $parser->$function(); // call the parser functions to populate the list view columns, by default 'default', 'available' and 'hidden' |
|
160 | 160 | } |
161 | - foreach ( $groups as $groupKey => $group ) |
|
161 | + foreach ($groups as $groupKey => $group) |
|
162 | 162 | { |
163 | - foreach ( $group as $fieldKey => $field ) |
|
163 | + foreach ($group as $fieldKey => $field) |
|
164 | 164 | { |
165 | - if (isset ( $field [ 'width' ] )) |
|
165 | + if (isset ($field ['width'])) |
|
166 | 166 | { |
167 | - if (substr ( $field [ 'width' ], - 1, 1 ) == '%') |
|
167 | + if (substr($field ['width'], - 1, 1) == '%') |
|
168 | 168 | { |
169 | 169 | |
170 | - $groups [ $groupKey ] [ $fieldKey ] [ 'width' ] = substr ( $field [ 'width' ], 0, strlen ( $field [ 'width' ] ) - 1 ) ; |
|
170 | + $groups [$groupKey] [$fieldKey] ['width'] = substr($field ['width'], 0, strlen($field ['width']) - 1); |
|
171 | 171 | } |
172 | 172 | } |
173 | 173 | } |
174 | 174 | } |
175 | 175 | |
176 | - $smarty->assign ( 'groups', $groups ) ; |
|
176 | + $smarty->assign('groups', $groups); |
|
177 | 177 | |
178 | 178 | global $image_path, $mod_strings; |
179 | - $imageSave = SugarThemeRegistry::current()->getImage('studio_save','',null,null,'.gif',$mod_strings['LBL_BTN_SAVE']) ; |
|
179 | + $imageSave = SugarThemeRegistry::current()->getImage('studio_save', '', null, null, '.gif', $mod_strings['LBL_BTN_SAVE']); |
|
180 | 180 | |
181 | 181 | // $imageHelp = SugarThemeRegistry::current()->getImage('help','',null,null,'.gif',$mod_strings['LBL_SECTION_HELP']) ; |
182 | 182 | |
183 | 183 | |
184 | - $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")" ; |
|
184 | + $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")"; |
|
185 | 185 | if (isset($this->searchlayout)) |
186 | - $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$this->searchlayout}\")" ; |
|
186 | + $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$this->searchlayout}\")"; |
|
187 | 187 | |
188 | - $buttons = array ( ) ; |
|
189 | - if (! $this->fromModuleBuilder) |
|
188 | + $buttons = array( ); |
|
189 | + if (!$this->fromModuleBuilder) |
|
190 | 190 | { |
191 | - $buttons [] = array ( 'name' => 'savebtn' , 'image' => $imageSave , 'text' => $GLOBALS [ 'mod_strings' ] [ 'LBL_BTN_SAVEPUBLISH' ] , 'actionScript' => "onclick='studiotabs.generateGroupForm(\"edittabs\");ModuleBuilder.state.isDirty=false;ModuleBuilder.submitForm(\"edittabs\" )'" ) ; |
|
191 | + $buttons [] = array('name' => 'savebtn', 'image' => $imageSave, 'text' => $GLOBALS ['mod_strings'] ['LBL_BTN_SAVEPUBLISH'], 'actionScript' => "onclick='studiotabs.generateGroupForm(\"edittabs\");ModuleBuilder.state.isDirty=false;ModuleBuilder.submitForm(\"edittabs\" )'"); |
|
192 | 192 | } else |
193 | 193 | { |
194 | - $buttons [] = array ( 'name' => 'mbsavebtn' , 'image' => $imageSave , 'text' => $GLOBALS [ 'mod_strings' ] [ 'LBL_BTN_SAVE' ] , 'actionScript' => "onclick='studiotabs.generateGroupForm(\"edittabs\");ModuleBuilder.state.isDirty=false;ModuleBuilder.submitForm(\"edittabs\" )'" ) ; |
|
194 | + $buttons [] = array('name' => 'mbsavebtn', 'image' => $imageSave, 'text' => $GLOBALS ['mod_strings'] ['LBL_BTN_SAVE'], 'actionScript' => "onclick='studiotabs.generateGroupForm(\"edittabs\");ModuleBuilder.state.isDirty=false;ModuleBuilder.submitForm(\"edittabs\" )'"); |
|
195 | 195 | } |
196 | - $buttons [] = array ( 'name' => 'historyBtn' , 'text' => translate ( 'LBL_HISTORY' ) , 'actionScript' => "onclick='$histaction'" ) ; |
|
197 | - $smarty->assign ( 'buttons', $this->_buildImageButtons ( $buttons ) ) ; |
|
198 | - $editImage = SugarThemeRegistry::current()->getImage('edit_inline','',null,null,'.gif',$mod_strings['LBL_EDIT']) ; |
|
196 | + $buttons [] = array('name' => 'historyBtn', 'text' => translate('LBL_HISTORY'), 'actionScript' => "onclick='$histaction'"); |
|
197 | + $smarty->assign('buttons', $this->_buildImageButtons($buttons)); |
|
198 | + $editImage = SugarThemeRegistry::current()->getImage('edit_inline', '', null, null, '.gif', $mod_strings['LBL_EDIT']); |
|
199 | 199 | |
200 | - $smarty->assign ( 'editImage', $editImage ) ; |
|
201 | - $deleteImage = SugarThemeRegistry::current()->getImage('delete_inline','',null,null,'.gif',$mod_strings['LBL_MB_DELETE']) ; |
|
200 | + $smarty->assign('editImage', $editImage); |
|
201 | + $deleteImage = SugarThemeRegistry::current()->getImage('delete_inline', '', null, null, '.gif', $mod_strings['LBL_MB_DELETE']); |
|
202 | 202 | |
203 | - $smarty->assign ( 'deleteImage', $deleteImage ) ; |
|
204 | - $smarty->assign ( 'MOD', $GLOBALS [ 'mod_strings' ] ) ; |
|
203 | + $smarty->assign('deleteImage', $deleteImage); |
|
204 | + $smarty->assign('MOD', $GLOBALS ['mod_strings']); |
|
205 | 205 | |
206 | 206 | if ($this->fromModuleBuilder) |
207 | 207 | { |
208 | - $smarty->assign ( 'MB', true ) ; |
|
209 | - $smarty->assign ( 'view_package', $this->editPackage ) ; |
|
210 | - $smarty->assign ( 'description', $GLOBALS [ 'mod_strings' ] [ 'LBL_LISTVIEW_DESCRIPTION' ] ) ; |
|
208 | + $smarty->assign('MB', true); |
|
209 | + $smarty->assign('view_package', $this->editPackage); |
|
210 | + $smarty->assign('description', $GLOBALS ['mod_strings'] ['LBL_LISTVIEW_DESCRIPTION']); |
|
211 | 211 | |
212 | 212 | } else |
213 | 213 | { |
214 | - $smarty->assign ( 'description', $GLOBALS [ 'mod_strings' ] [ 'LBL_LISTVIEW_DESCRIPTION' ] ) ; |
|
214 | + $smarty->assign('description', $GLOBALS ['mod_strings'] ['LBL_LISTVIEW_DESCRIPTION']); |
|
215 | 215 | } |
216 | 216 | |
217 | - return $smarty ; |
|
217 | + return $smarty; |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | function _constructTitle() |
221 | 221 | { |
222 | - global $app_list_strings ; |
|
222 | + global $app_list_strings; |
|
223 | 223 | |
224 | 224 | if ($this->fromModuleBuilder) |
225 | - $title = $this->editModule ; |
|
225 | + $title = $this->editModule; |
|
226 | 226 | else |
227 | - $title = $app_list_strings [ 'moduleList' ] [ $this->editModule ] ; |
|
227 | + $title = $app_list_strings ['moduleList'] [$this->editModule]; |
|
228 | 228 | |
229 | - return $GLOBALS [ 'mod_strings' ] [ 'LBL_LISTVIEW_EDIT' ] . ': ' . $title ; |
|
229 | + return $GLOBALS ['mod_strings'] ['LBL_LISTVIEW_EDIT'].': '.$title; |
|
230 | 230 | } |
231 | 231 | } |
@@ -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. |
@@ -52,10 +53,11 @@ discard block |
||
52 | 53 | { |
53 | 54 | $this->editModule = $_REQUEST [ 'view_module' ] ; |
54 | 55 | $this->editLayout = $_REQUEST [ 'view' ] ; |
55 | - if(isset ( $_REQUEST [ 'view_package' ] ) && ! empty ( $_REQUEST [ 'view_package' ] )) |
|
56 | - $this->editPackage = $_REQUEST [ 'view_package' ]; |
|
57 | - else |
|
58 | - $this->editPackage = null; |
|
56 | + if(isset ( $_REQUEST [ 'view_package' ] ) && ! empty ( $_REQUEST [ 'view_package' ] )) { |
|
57 | + $this->editPackage = $_REQUEST [ 'view_package' ]; |
|
58 | + } else { |
|
59 | + $this->editPackage = null; |
|
60 | + } |
|
59 | 61 | |
60 | 62 | $this->fromModuleBuilder = isset ( $_REQUEST [ 'MB' ] ) || (isset($_REQUEST['view_package']) && $_REQUEST['view_package'] && $_REQUEST['view_package'] != 'studio') ; |
61 | 63 | |
@@ -121,7 +123,7 @@ discard block |
||
121 | 123 | |
122 | 124 | $ViewLabel = ($this->editLayout == MB_DASHLET) ? 'LBL_DASHLETLISTVIEW' : 'LBL_DASHLETSEARCHVIEW'; |
123 | 125 | $ajax->addCrumb ( translate ($ViewLabel, 'ModuleBuilder' ), '' ) ; |
124 | - }else{ |
|
126 | + } else{ |
|
125 | 127 | $ajax->addCrumb ( translate($this->editModule), 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module=' . $this->editModule . '")' ) ; |
126 | 128 | $ajax->addCrumb ( translate('LBL_LAYOUTS', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&layouts=1&view_module=' . $this->editModule . '")'); |
127 | 129 | $ajax->addCrumb ( translate('LBL_DASHLET', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=dashlet&view_module=' . $this->editModule . '")' ); |
@@ -182,8 +184,9 @@ discard block |
||
182 | 184 | |
183 | 185 | |
184 | 186 | $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")" ; |
185 | - if (isset($this->searchlayout)) |
|
186 | - $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$this->searchlayout}\")" ; |
|
187 | + if (isset($this->searchlayout)) { |
|
188 | + $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$this->searchlayout}\")" ; |
|
189 | + } |
|
187 | 190 | |
188 | 191 | $buttons = array ( ) ; |
189 | 192 | if (! $this->fromModuleBuilder) |
@@ -221,10 +224,11 @@ discard block |
||
221 | 224 | { |
222 | 225 | global $app_list_strings ; |
223 | 226 | |
224 | - if ($this->fromModuleBuilder) |
|
225 | - $title = $this->editModule ; |
|
226 | - else |
|
227 | - $title = $app_list_strings [ 'moduleList' ] [ $this->editModule ] ; |
|
227 | + if ($this->fromModuleBuilder) { |
|
228 | + $title = $this->editModule ; |
|
229 | + } else { |
|
230 | + $title = $app_list_strings [ 'moduleList' ] [ $this->editModule ] ; |
|
231 | + } |
|
228 | 232 | |
229 | 233 | return $GLOBALS [ 'mod_strings' ] [ 'LBL_LISTVIEW_EDIT' ] . ': ' . $title ; |
230 | 234 | } |
@@ -48,60 +48,60 @@ |
||
48 | 48 | |
49 | 49 | class ViewModulelabels extends SugarView |
50 | 50 | { |
51 | - /** |
|
52 | - * @see SugarView::_getModuleTitleParams() |
|
53 | - */ |
|
54 | - protected function _getModuleTitleParams($browserTitle = false) |
|
55 | - { |
|
56 | - global $mod_strings; |
|
51 | + /** |
|
52 | + * @see SugarView::_getModuleTitleParams() |
|
53 | + */ |
|
54 | + protected function _getModuleTitleParams($browserTitle = false) |
|
55 | + { |
|
56 | + global $mod_strings; |
|
57 | 57 | |
58 | - return array( |
|
59 | - translate('LBL_MODULE_NAME','Administration'), |
|
60 | - ModuleBuilderController::getModuleTitle(), |
|
61 | - ); |
|
58 | + return array( |
|
59 | + translate('LBL_MODULE_NAME','Administration'), |
|
60 | + ModuleBuilderController::getModuleTitle(), |
|
61 | + ); |
|
62 | 62 | } |
63 | 63 | |
64 | - function display() |
|
65 | - { |
|
66 | - global $mod_strings; |
|
64 | + function display() |
|
65 | + { |
|
66 | + global $mod_strings; |
|
67 | 67 | $bak_mod_strings=$mod_strings; |
68 | - $smarty = new Sugar_Smarty(); |
|
68 | + $smarty = new Sugar_Smarty(); |
|
69 | 69 | $smarty->assign('mod_strings', $mod_strings); |
70 | - $package_name = $_REQUEST['view_package']; |
|
71 | - $module_name = $_REQUEST['view_module']; |
|
70 | + $package_name = $_REQUEST['view_package']; |
|
71 | + $module_name = $_REQUEST['view_module']; |
|
72 | 72 | |
73 | - require_once('modules/ModuleBuilder/MB/ModuleBuilder.php'); |
|
74 | - $mb = new ModuleBuilder(); |
|
75 | - $mb->getPackage($_REQUEST['view_package']); |
|
76 | - $package = $mb->packages[$_REQUEST['view_package']]; |
|
77 | - $package->getModule($module_name); |
|
78 | - $mbModule = $package->modules[$module_name]; |
|
79 | - $selected_lang = (!empty($_REQUEST['selected_lang'])?$_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']); |
|
80 | - if(empty($selected_lang)){ |
|
81 | - $selected_lang = $GLOBALS['sugar_config']['default_language']; |
|
82 | - } |
|
83 | - //need to change the following to interface with MBlanguage. |
|
73 | + require_once('modules/ModuleBuilder/MB/ModuleBuilder.php'); |
|
74 | + $mb = new ModuleBuilder(); |
|
75 | + $mb->getPackage($_REQUEST['view_package']); |
|
76 | + $package = $mb->packages[$_REQUEST['view_package']]; |
|
77 | + $package->getModule($module_name); |
|
78 | + $mbModule = $package->modules[$module_name]; |
|
79 | + $selected_lang = (!empty($_REQUEST['selected_lang'])?$_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']); |
|
80 | + if(empty($selected_lang)){ |
|
81 | + $selected_lang = $GLOBALS['sugar_config']['default_language']; |
|
82 | + } |
|
83 | + //need to change the following to interface with MBlanguage. |
|
84 | 84 | |
85 | 85 | $smarty->assign('MOD', $mbModule->getModStrings($selected_lang)); |
86 | - $smarty->assign('APP', $GLOBALS['app_strings']); |
|
87 | - $smarty->assign('selected_lang', $selected_lang); |
|
88 | - $smarty->assign('view_package', $package_name); |
|
89 | - $smarty->assign('view_module', $module_name); |
|
90 | - $smarty->assign('mb','1'); |
|
91 | - $smarty->assign('available_languages', get_languages()); |
|
92 | - /////////////////////////////////////////////////////////////////// |
|
93 | - ////ASSISTANT |
|
94 | - $smarty->assign('assistant',array('group'=>'module', 'key'=>'labels')); |
|
95 | - ///////////////////////////////////////////////////////////////// |
|
96 | - ////ASSISTANT |
|
86 | + $smarty->assign('APP', $GLOBALS['app_strings']); |
|
87 | + $smarty->assign('selected_lang', $selected_lang); |
|
88 | + $smarty->assign('view_package', $package_name); |
|
89 | + $smarty->assign('view_module', $module_name); |
|
90 | + $smarty->assign('mb','1'); |
|
91 | + $smarty->assign('available_languages', get_languages()); |
|
92 | + /////////////////////////////////////////////////////////////////// |
|
93 | + ////ASSISTANT |
|
94 | + $smarty->assign('assistant',array('group'=>'module', 'key'=>'labels')); |
|
95 | + ///////////////////////////////////////////////////////////////// |
|
96 | + ////ASSISTANT |
|
97 | 97 | |
98 | - $ajax = new AjaxCompose(); |
|
99 | - $ajax->addCrumb($bak_mod_strings['LBL_MODULEBUILDER'], 'ModuleBuilder.main("mb")'); |
|
100 | - $ajax->addCrumb($package_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$package->name. '")'); |
|
98 | + $ajax = new AjaxCompose(); |
|
99 | + $ajax->addCrumb($bak_mod_strings['LBL_MODULEBUILDER'], 'ModuleBuilder.main("mb")'); |
|
100 | + $ajax->addCrumb($package_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$package->name. '")'); |
|
101 | 101 | $ajax->addCrumb($module_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package='.$package->name.'&view_module='. $module_name . '")'); |
102 | 102 | $ajax->addCrumb($bak_mod_strings['LBL_LABELS'], ''); |
103 | - $ajax->addSection('center', $bak_mod_strings['LBL_LABELS'],$smarty->fetch('modules/ModuleBuilder/tpls/labels.tpl')); |
|
104 | - echo $ajax->getJavascript(); |
|
105 | - } |
|
103 | + $ajax->addSection('center', $bak_mod_strings['LBL_LABELS'],$smarty->fetch('modules/ModuleBuilder/tpls/labels.tpl')); |
|
104 | + echo $ajax->getJavascript(); |
|
105 | + } |
|
106 | 106 | } |
107 | 107 |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | global $mod_strings; |
57 | 57 | |
58 | 58 | return array( |
59 | - translate('LBL_MODULE_NAME','Administration'), |
|
59 | + translate('LBL_MODULE_NAME', 'Administration'), |
|
60 | 60 | ModuleBuilderController::getModuleTitle(), |
61 | 61 | ); |
62 | 62 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | function display() |
65 | 65 | { |
66 | 66 | global $mod_strings; |
67 | - $bak_mod_strings=$mod_strings; |
|
67 | + $bak_mod_strings = $mod_strings; |
|
68 | 68 | $smarty = new Sugar_Smarty(); |
69 | 69 | $smarty->assign('mod_strings', $mod_strings); |
70 | 70 | $package_name = $_REQUEST['view_package']; |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | $package = $mb->packages[$_REQUEST['view_package']]; |
77 | 77 | $package->getModule($module_name); |
78 | 78 | $mbModule = $package->modules[$module_name]; |
79 | - $selected_lang = (!empty($_REQUEST['selected_lang'])?$_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']); |
|
80 | - if(empty($selected_lang)){ |
|
79 | + $selected_lang = (!empty($_REQUEST['selected_lang']) ? $_REQUEST['selected_lang'] : $_SESSION['authenticated_user_language']); |
|
80 | + if (empty($selected_lang)) { |
|
81 | 81 | $selected_lang = $GLOBALS['sugar_config']['default_language']; |
82 | 82 | } |
83 | 83 | //need to change the following to interface with MBlanguage. |
@@ -87,20 +87,20 @@ discard block |
||
87 | 87 | $smarty->assign('selected_lang', $selected_lang); |
88 | 88 | $smarty->assign('view_package', $package_name); |
89 | 89 | $smarty->assign('view_module', $module_name); |
90 | - $smarty->assign('mb','1'); |
|
90 | + $smarty->assign('mb', '1'); |
|
91 | 91 | $smarty->assign('available_languages', get_languages()); |
92 | 92 | /////////////////////////////////////////////////////////////////// |
93 | 93 | ////ASSISTANT |
94 | - $smarty->assign('assistant',array('group'=>'module', 'key'=>'labels')); |
|
94 | + $smarty->assign('assistant', array('group'=>'module', 'key'=>'labels')); |
|
95 | 95 | ///////////////////////////////////////////////////////////////// |
96 | 96 | ////ASSISTANT |
97 | 97 | |
98 | 98 | $ajax = new AjaxCompose(); |
99 | 99 | $ajax->addCrumb($bak_mod_strings['LBL_MODULEBUILDER'], 'ModuleBuilder.main("mb")'); |
100 | - $ajax->addCrumb($package_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$package->name. '")'); |
|
101 | - $ajax->addCrumb($module_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package='.$package->name.'&view_module='. $module_name . '")'); |
|
100 | + $ajax->addCrumb($package_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$package->name.'")'); |
|
101 | + $ajax->addCrumb($module_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package='.$package->name.'&view_module='.$module_name.'")'); |
|
102 | 102 | $ajax->addCrumb($bak_mod_strings['LBL_LABELS'], ''); |
103 | - $ajax->addSection('center', $bak_mod_strings['LBL_LABELS'],$smarty->fetch('modules/ModuleBuilder/tpls/labels.tpl')); |
|
103 | + $ajax->addSection('center', $bak_mod_strings['LBL_LABELS'], $smarty->fetch('modules/ModuleBuilder/tpls/labels.tpl')); |
|
104 | 104 | echo $ajax->getJavascript(); |
105 | 105 | } |
106 | 106 | } |
@@ -47,19 +47,19 @@ discard block |
||
47 | 47 | var $pageSize = 10 ; |
48 | 48 | |
49 | 49 | /** |
50 | - * @see SugarView::_getModuleTitleParams() |
|
51 | - */ |
|
52 | - protected function _getModuleTitleParams($browserTitle = false) |
|
53 | - { |
|
54 | - global $mod_strings; |
|
50 | + * @see SugarView::_getModuleTitleParams() |
|
51 | + */ |
|
52 | + protected function _getModuleTitleParams($browserTitle = false) |
|
53 | + { |
|
54 | + global $mod_strings; |
|
55 | 55 | |
56 | - return array( |
|
57 | - translate('LBL_MODULE_NAME','Administration'), |
|
58 | - ModuleBuilderController::getModuleTitle(), |
|
59 | - ); |
|
56 | + return array( |
|
57 | + translate('LBL_MODULE_NAME','Administration'), |
|
58 | + ModuleBuilderController::getModuleTitle(), |
|
59 | + ); |
|
60 | 60 | } |
61 | 61 | |
62 | - function display () |
|
62 | + function display () |
|
63 | 63 | { |
64 | 64 | $this->layout = strtolower ( $_REQUEST [ 'view' ] ) ; |
65 | 65 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | } |
136 | 136 | echo "<input type='button' name='close$sid' value='". translate ( 'LBL_BTN_CLOSE' )."' " . |
137 | 137 | "class='button' onclick='ModuleBuilder.tabPanel.removeTab(ModuleBuilder.tabPanel.get(\"activeTab\"));' style='margin:5px;'>" . |
138 | - "<input type='button' name='restore$sid' value='" . translate ( 'LBL_MB_RESTORE' ) . "' " . |
|
138 | + "<input type='button' name='restore$sid' value='" . translate ( 'LBL_MB_RESTORE' ) . "' " . |
|
139 | 139 | "class='button' onclick='ModuleBuilder.history.revert(\"$this->module\",\"{$this->layout}\",\"$sid\"$subpanel);' style='margin:5px;'>" ; |
140 | 140 | $this->history->restoreByTimestamp ( $sid ) ; |
141 | 141 | $view ; |
@@ -149,12 +149,12 @@ discard block |
||
149 | 149 | $view = new ViewSearchView ( ) ; |
150 | 150 | } else if ($this->layout == 'dashlet' || $this->layout == 'dashletsearch') |
151 | 151 | { |
152 | - require_once ("modules/ModuleBuilder/views/view.dashlet.php") ; |
|
153 | - $view = new ViewDashlet ( ) ; |
|
152 | + require_once ("modules/ModuleBuilder/views/view.dashlet.php") ; |
|
153 | + $view = new ViewDashlet ( ) ; |
|
154 | 154 | } else if ($this->layout == 'popuplist' || $this->layout == 'popupsearch') |
155 | 155 | { |
156 | - require_once ("modules/ModuleBuilder/views/view.popupview.php") ; |
|
157 | - $view = new ViewPopupview ( ) ; |
|
156 | + require_once ("modules/ModuleBuilder/views/view.popupview.php") ; |
|
157 | + $view = new ViewPopupview ( ) ; |
|
158 | 158 | } else |
159 | 159 | { |
160 | 160 | require_once ("modules/ModuleBuilder/views/view.layoutview.php") ; |
@@ -175,12 +175,12 @@ discard block |
||
175 | 175 | $this->history->restoreByTimestamp ( $sid ) ; |
176 | 176 | } |
177 | 177 | |
178 | - /** |
|
179 | - * Restores a layout to its current customized state. |
|
180 | - * Called when leaving a restored layout without saving. |
|
181 | - */ |
|
178 | + /** |
|
179 | + * Restores a layout to its current customized state. |
|
180 | + * Called when leaving a restored layout without saving. |
|
181 | + */ |
|
182 | 182 | function unrestore() |
183 | 183 | { |
184 | - $this->history->undoRestore () ; |
|
184 | + $this->history->undoRestore () ; |
|
185 | 185 | } |
186 | 186 | } |
@@ -38,13 +38,13 @@ discard block |
||
38 | 38 | ********************************************************************************/ |
39 | 39 | |
40 | 40 | |
41 | -require_once ('modules/ModuleBuilder/MB/AjaxCompose.php') ; |
|
42 | -require_once ('modules/ModuleBuilder/parsers/views/History.php') ; |
|
43 | -require_once ('modules/ModuleBuilder/parsers/ParserFactory.php') ; |
|
41 | +require_once ('modules/ModuleBuilder/MB/AjaxCompose.php'); |
|
42 | +require_once ('modules/ModuleBuilder/parsers/views/History.php'); |
|
43 | +require_once ('modules/ModuleBuilder/parsers/ParserFactory.php'); |
|
44 | 44 | |
45 | 45 | class ViewHistory extends SugarView |
46 | 46 | { |
47 | - var $pageSize = 10 ; |
|
47 | + var $pageSize = 10; |
|
48 | 48 | |
49 | 49 | /** |
50 | 50 | * @see SugarView::_getModuleTitleParams() |
@@ -54,125 +54,125 @@ discard block |
||
54 | 54 | global $mod_strings; |
55 | 55 | |
56 | 56 | return array( |
57 | - translate('LBL_MODULE_NAME','Administration'), |
|
57 | + translate('LBL_MODULE_NAME', 'Administration'), |
|
58 | 58 | ModuleBuilderController::getModuleTitle(), |
59 | 59 | ); |
60 | 60 | } |
61 | 61 | |
62 | - function display () |
|
62 | + function display() |
|
63 | 63 | { |
64 | - $this->layout = strtolower ( $_REQUEST [ 'view' ] ) ; |
|
64 | + $this->layout = strtolower($_REQUEST ['view']); |
|
65 | 65 | |
66 | - $subpanelName = null ; |
|
67 | - if ((strtolower ( $this->layout ) == 'listview') && (!empty ( $_REQUEST [ 'subpanel' ] ))) |
|
66 | + $subpanelName = null; |
|
67 | + if ((strtolower($this->layout) == 'listview') && (!empty ($_REQUEST ['subpanel']))) |
|
68 | 68 | { |
69 | - $subpanelName = $_REQUEST [ 'subpanel' ] ; |
|
69 | + $subpanelName = $_REQUEST ['subpanel']; |
|
70 | 70 | |
71 | 71 | } |
72 | 72 | |
73 | - $packageName = (isset ( $_REQUEST [ 'view_package' ] ) && (strtolower ( $_REQUEST [ 'view_package' ] ) != 'studio')) ? $_REQUEST [ 'view_package' ] : null ; |
|
74 | - $this->module = $_REQUEST [ 'view_module' ] ; |
|
73 | + $packageName = (isset ($_REQUEST ['view_package']) && (strtolower($_REQUEST ['view_package']) != 'studio')) ? $_REQUEST ['view_package'] : null; |
|
74 | + $this->module = $_REQUEST ['view_module']; |
|
75 | 75 | |
76 | - $this->parser = ParserFactory::getParser ( $this->layout, $this->module, $packageName, $subpanelName ) ; |
|
77 | - $this->history = $this->parser->getHistory () ; |
|
78 | - $action = ! empty ( $_REQUEST [ 'histAction' ] ) ? $_REQUEST [ 'histAction' ] : 'browse' ; |
|
79 | - $GLOBALS['log']->debug( get_class($this)."->display(): performing History action {$action}" ) ; |
|
80 | - $this->$action () ; |
|
76 | + $this->parser = ParserFactory::getParser($this->layout, $this->module, $packageName, $subpanelName); |
|
77 | + $this->history = $this->parser->getHistory(); |
|
78 | + $action = !empty ($_REQUEST ['histAction']) ? $_REQUEST ['histAction'] : 'browse'; |
|
79 | + $GLOBALS['log']->debug(get_class($this)."->display(): performing History action {$action}"); |
|
80 | + $this->$action(); |
|
81 | 81 | } |
82 | 82 | |
83 | - function browse () |
|
83 | + function browse() |
|
84 | 84 | { |
85 | - $smarty = new Sugar_Smarty ( ) ; |
|
86 | - global $mod_strings ; |
|
87 | - $smarty->assign ( 'mod_strings', $mod_strings ) ; |
|
88 | - $smarty->assign ( 'view_module', $this->module ) ; |
|
89 | - $smarty->assign ( 'view', $this->layout ) ; |
|
85 | + $smarty = new Sugar_Smarty( ); |
|
86 | + global $mod_strings; |
|
87 | + $smarty->assign('mod_strings', $mod_strings); |
|
88 | + $smarty->assign('view_module', $this->module); |
|
89 | + $smarty->assign('view', $this->layout); |
|
90 | 90 | |
91 | - if (! empty ( $_REQUEST [ 'subpanel' ] )) |
|
91 | + if (!empty ($_REQUEST ['subpanel'])) |
|
92 | 92 | { |
93 | - $smarty->assign ( 'subpanel', $_REQUEST [ 'subpanel' ] ) ; |
|
93 | + $smarty->assign('subpanel', $_REQUEST ['subpanel']); |
|
94 | 94 | } |
95 | - $stamps = array ( ) ; |
|
96 | - global $timedate ; |
|
97 | - $userFormat = $timedate->get_date_time_format () ; |
|
98 | - $page = ! empty ( $_REQUEST [ 'page' ] ) ? $_REQUEST [ 'page' ] : 0 ; |
|
95 | + $stamps = array( ); |
|
96 | + global $timedate; |
|
97 | + $userFormat = $timedate->get_date_time_format(); |
|
98 | + $page = !empty ($_REQUEST ['page']) ? $_REQUEST ['page'] : 0; |
|
99 | 99 | $count = $this->history->getCount(); |
100 | - $ts = $this->history->getNth ( $page * $this->pageSize ) ; |
|
101 | - $snapshots = array ( ) ; |
|
102 | - for ( $i = 0 ; $i <= $this->pageSize && $ts > 0 ; $i ++ ) |
|
100 | + $ts = $this->history->getNth($page * $this->pageSize); |
|
101 | + $snapshots = array( ); |
|
102 | + for ($i = 0; $i <= $this->pageSize && $ts > 0; $i++) |
|
103 | 103 | { |
104 | 104 | $dbDate = $timedate->fromTimestamp($ts)->asDb(); |
105 | - $displayTS = $timedate->to_display_date_time ( $dbDate ) ; |
|
105 | + $displayTS = $timedate->to_display_date_time($dbDate); |
|
106 | 106 | if ($page * $this->pageSize + $i + 1 == $count) |
107 | 107 | $displayTS = translate("LBL_MB_DEFAULT_LAYOUT"); |
108 | - $snapshots [ $ts ] = $displayTS ; |
|
109 | - $ts = $this->history->getNext () ; |
|
108 | + $snapshots [$ts] = $displayTS; |
|
109 | + $ts = $this->history->getNext(); |
|
110 | 110 | } |
111 | - if (count ( $snapshots ) > $this->pageSize) |
|
111 | + if (count($snapshots) > $this->pageSize) |
|
112 | 112 | { |
113 | - $smarty->assign ( 'nextPage', true ) ; |
|
113 | + $smarty->assign('nextPage', true); |
|
114 | 114 | } |
115 | - $snapshots = array_slice ( $snapshots, 0, $this->pageSize, true ) ; |
|
116 | - $smarty->assign ( 'currentPage', $page ) ; |
|
117 | - $smarty->assign ( 'snapshots', $snapshots ) ; |
|
115 | + $snapshots = array_slice($snapshots, 0, $this->pageSize, true); |
|
116 | + $smarty->assign('currentPage', $page); |
|
117 | + $smarty->assign('snapshots', $snapshots); |
|
118 | 118 | |
119 | - $html = $smarty->fetch ( 'modules/ModuleBuilder/tpls/history.tpl' ) ; |
|
120 | - echo $html ; |
|
119 | + $html = $smarty->fetch('modules/ModuleBuilder/tpls/history.tpl'); |
|
120 | + echo $html; |
|
121 | 121 | } |
122 | 122 | |
123 | - function preview () |
|
123 | + function preview() |
|
124 | 124 | { |
125 | - global $mod_strings ; |
|
126 | - if (! isset ( $_REQUEST [ 'sid' ] )) |
|
125 | + global $mod_strings; |
|
126 | + if (!isset ($_REQUEST ['sid'])) |
|
127 | 127 | { |
128 | - die ( 'SID Required' ) ; |
|
128 | + die ('SID Required'); |
|
129 | 129 | } |
130 | - $sid = $_REQUEST [ 'sid' ] ; |
|
130 | + $sid = $_REQUEST ['sid']; |
|
131 | 131 | $subpanel = ''; |
132 | - if (! empty ( $_REQUEST [ 'subpanel' ] )) |
|
132 | + if (!empty ($_REQUEST ['subpanel'])) |
|
133 | 133 | { |
134 | - $subpanel = ',"' . $_REQUEST [ 'subpanel' ] . '"' ; |
|
134 | + $subpanel = ',"'.$_REQUEST ['subpanel'].'"'; |
|
135 | 135 | } |
136 | - echo "<input type='button' name='close$sid' value='". translate ( 'LBL_BTN_CLOSE' )."' " . |
|
137 | - "class='button' onclick='ModuleBuilder.tabPanel.removeTab(ModuleBuilder.tabPanel.get(\"activeTab\"));' style='margin:5px;'>" . |
|
138 | - "<input type='button' name='restore$sid' value='" . translate ( 'LBL_MB_RESTORE' ) . "' " . |
|
139 | - "class='button' onclick='ModuleBuilder.history.revert(\"$this->module\",\"{$this->layout}\",\"$sid\"$subpanel);' style='margin:5px;'>" ; |
|
140 | - $this->history->restoreByTimestamp ( $sid ) ; |
|
141 | - $view ; |
|
136 | + echo "<input type='button' name='close$sid' value='".translate('LBL_BTN_CLOSE')."' ". |
|
137 | + "class='button' onclick='ModuleBuilder.tabPanel.removeTab(ModuleBuilder.tabPanel.get(\"activeTab\"));' style='margin:5px;'>". |
|
138 | + "<input type='button' name='restore$sid' value='".translate('LBL_MB_RESTORE')."' ". |
|
139 | + "class='button' onclick='ModuleBuilder.history.revert(\"$this->module\",\"{$this->layout}\",\"$sid\"$subpanel);' style='margin:5px;'>"; |
|
140 | + $this->history->restoreByTimestamp($sid); |
|
141 | + $view; |
|
142 | 142 | if ($this->layout == 'listview') |
143 | 143 | { |
144 | - require_once ("modules/ModuleBuilder/views/view.listview.php") ; |
|
145 | - $view = new ViewListView ( ) ; |
|
144 | + require_once ("modules/ModuleBuilder/views/view.listview.php"); |
|
145 | + $view = new ViewListView( ); |
|
146 | 146 | } else if ($this->layout == 'basic_search' || $this->layout == 'advanced_search') |
147 | 147 | { |
148 | - require_once ("modules/ModuleBuilder/views/view.searchview.php") ; |
|
149 | - $view = new ViewSearchView ( ) ; |
|
148 | + require_once ("modules/ModuleBuilder/views/view.searchview.php"); |
|
149 | + $view = new ViewSearchView( ); |
|
150 | 150 | } else if ($this->layout == 'dashlet' || $this->layout == 'dashletsearch') |
151 | 151 | { |
152 | - require_once ("modules/ModuleBuilder/views/view.dashlet.php") ; |
|
153 | - $view = new ViewDashlet ( ) ; |
|
154 | - } else if ($this->layout == 'popuplist' || $this->layout == 'popupsearch') |
|
152 | + require_once ("modules/ModuleBuilder/views/view.dashlet.php"); |
|
153 | + $view = new ViewDashlet( ); |
|
154 | + } else if ($this->layout == 'popuplist' || $this->layout == 'popupsearch') |
|
155 | 155 | { |
156 | - require_once ("modules/ModuleBuilder/views/view.popupview.php") ; |
|
157 | - $view = new ViewPopupview ( ) ; |
|
156 | + require_once ("modules/ModuleBuilder/views/view.popupview.php"); |
|
157 | + $view = new ViewPopupview( ); |
|
158 | 158 | } else |
159 | 159 | { |
160 | - require_once ("modules/ModuleBuilder/views/view.layoutview.php") ; |
|
161 | - $view = new ViewLayoutView ( ) ; |
|
160 | + require_once ("modules/ModuleBuilder/views/view.layoutview.php"); |
|
161 | + $view = new ViewLayoutView( ); |
|
162 | 162 | } |
163 | 163 | |
164 | - $view->display ( true ) ; |
|
165 | - $this->history->undoRestore () ; |
|
164 | + $view->display(true); |
|
165 | + $this->history->undoRestore(); |
|
166 | 166 | } |
167 | 167 | |
168 | - function restore () |
|
168 | + function restore() |
|
169 | 169 | { |
170 | - if (! isset ( $_REQUEST [ 'sid' ] )) |
|
170 | + if (!isset ($_REQUEST ['sid'])) |
|
171 | 171 | { |
172 | - die ( 'SID Required' ) ; |
|
172 | + die ('SID Required'); |
|
173 | 173 | } |
174 | - $sid = $_REQUEST [ 'sid' ] ; |
|
175 | - $this->history->restoreByTimestamp ( $sid ) ; |
|
174 | + $sid = $_REQUEST ['sid']; |
|
175 | + $this->history->restoreByTimestamp($sid); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | /** |
@@ -181,6 +181,6 @@ discard block |
||
181 | 181 | */ |
182 | 182 | function unrestore() |
183 | 183 | { |
184 | - $this->history->undoRestore () ; |
|
184 | + $this->history->undoRestore(); |
|
185 | 185 | } |
186 | 186 | } |
@@ -103,8 +103,9 @@ discard block |
||
103 | 103 | { |
104 | 104 | $dbDate = $timedate->fromTimestamp($ts)->asDb(); |
105 | 105 | $displayTS = $timedate->to_display_date_time ( $dbDate ) ; |
106 | - if ($page * $this->pageSize + $i + 1 == $count) |
|
107 | - $displayTS = translate("LBL_MB_DEFAULT_LAYOUT"); |
|
106 | + if ($page * $this->pageSize + $i + 1 == $count) { |
|
107 | + $displayTS = translate("LBL_MB_DEFAULT_LAYOUT"); |
|
108 | + } |
|
108 | 109 | $snapshots [ $ts ] = $displayTS ; |
109 | 110 | $ts = $this->history->getNext () ; |
110 | 111 | } |
@@ -151,7 +152,7 @@ discard block |
||
151 | 152 | { |
152 | 153 | require_once ("modules/ModuleBuilder/views/view.dashlet.php") ; |
153 | 154 | $view = new ViewDashlet ( ) ; |
154 | - } else if ($this->layout == 'popuplist' || $this->layout == 'popupsearch') |
|
155 | + } else if ($this->layout == 'popuplist' || $this->layout == 'popupsearch') |
|
155 | 156 | { |
156 | 157 | require_once ("modules/ModuleBuilder/views/view.popupview.php") ; |
157 | 158 | $view = new ViewPopupview ( ) ; |
@@ -48,73 +48,73 @@ discard block |
||
48 | 48 | class ViewLabels extends ViewModulefields |
49 | 49 | { |
50 | 50 | /** |
51 | - * @see SugarView::_getModuleTitleParams() |
|
52 | - */ |
|
53 | - protected function _getModuleTitleParams($browserTitle = false) |
|
54 | - { |
|
55 | - global $mod_strings; |
|
51 | + * @see SugarView::_getModuleTitleParams() |
|
52 | + */ |
|
53 | + protected function _getModuleTitleParams($browserTitle = false) |
|
54 | + { |
|
55 | + global $mod_strings; |
|
56 | 56 | |
57 | - return array( |
|
58 | - translate('LBL_MODULE_NAME','Administration'), |
|
59 | - ModuleBuilderController::getModuleTitle(), |
|
60 | - ); |
|
57 | + return array( |
|
58 | + translate('LBL_MODULE_NAME','Administration'), |
|
59 | + ModuleBuilderController::getModuleTitle(), |
|
60 | + ); |
|
61 | 61 | } |
62 | 62 | |
63 | - //STUDIO LABELS ONLY// |
|
64 | - //TODO Bundle Studio and ModuleBuilder label handling to increase maintainability. |
|
65 | - function display() |
|
66 | - { |
|
67 | - $editModule = $_REQUEST['view_module']; |
|
68 | - $allLabels = (!empty($_REQUEST['labels']) && $_REQUEST['labels']== 'all'); |
|
63 | + //STUDIO LABELS ONLY// |
|
64 | + //TODO Bundle Studio and ModuleBuilder label handling to increase maintainability. |
|
65 | + function display() |
|
66 | + { |
|
67 | + $editModule = $_REQUEST['view_module']; |
|
68 | + $allLabels = (!empty($_REQUEST['labels']) && $_REQUEST['labels']== 'all'); |
|
69 | 69 | |
70 | - if (!isset($_REQUEST['MB'])) |
|
71 | - { |
|
72 | - global $app_list_strings; |
|
73 | - $moduleNames = array_change_key_case($app_list_strings['moduleList']); |
|
74 | - $translatedEditModule = $moduleNames[strtolower($editModule)]; |
|
75 | - } |
|
76 | - $selected_lang = (!empty($_REQUEST['selected_lang'])? $_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']); |
|
77 | - if(empty($selected_lang)){ |
|
78 | - $selected_lang = $GLOBALS['sugar_config']['default_language']; |
|
79 | - } |
|
70 | + if (!isset($_REQUEST['MB'])) |
|
71 | + { |
|
72 | + global $app_list_strings; |
|
73 | + $moduleNames = array_change_key_case($app_list_strings['moduleList']); |
|
74 | + $translatedEditModule = $moduleNames[strtolower($editModule)]; |
|
75 | + } |
|
76 | + $selected_lang = (!empty($_REQUEST['selected_lang'])? $_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']); |
|
77 | + if(empty($selected_lang)){ |
|
78 | + $selected_lang = $GLOBALS['sugar_config']['default_language']; |
|
79 | + } |
|
80 | 80 | |
81 | - $smarty = new Sugar_Smarty(); |
|
82 | - global $mod_strings; |
|
81 | + $smarty = new Sugar_Smarty(); |
|
82 | + global $mod_strings; |
|
83 | 83 | $smarty->assign('mod_strings', $mod_strings); |
84 | - $smarty->assign('available_languages',get_languages()); |
|
84 | + $smarty->assign('available_languages',get_languages()); |
|
85 | 85 | |
86 | 86 | |
87 | 87 | $objectName = BeanFactory::getObjectName($editModule); |
88 | 88 | VardefManager::loadVardef($editModule, $objectName); |
89 | 89 | global $dictionary; |
90 | 90 | $vnames = array(); |
91 | - //jchi 24557 . We should list all the lables in viewdefs(list,detail,edit,quickcreate) that the user can edit them. |
|
92 | - require_once 'modules/ModuleBuilder/parsers/views/ListLayoutMetaDataParser.php' ; |
|
91 | + //jchi 24557 . We should list all the lables in viewdefs(list,detail,edit,quickcreate) that the user can edit them. |
|
92 | + require_once 'modules/ModuleBuilder/parsers/views/ListLayoutMetaDataParser.php' ; |
|
93 | 93 | $parser = new ListLayoutMetaDataParser ( MB_LISTVIEW, $editModule ) ; |
94 | 94 | foreach ( $parser->getLayout() as $key => $def ) |
95 | 95 | { |
96 | - if(isset($def['label']) ) { |
|
97 | - $vnames[$def['label']] = $def['label']; |
|
98 | - } |
|
96 | + if(isset($def['label']) ) { |
|
97 | + $vnames[$def['label']] = $def['label']; |
|
98 | + } |
|
99 | 99 | } |
100 | 100 | |
101 | - require_once 'modules/ModuleBuilder/parsers/views/GridLayoutMetaDataParser.php' ; |
|
101 | + require_once 'modules/ModuleBuilder/parsers/views/GridLayoutMetaDataParser.php' ; |
|
102 | 102 | $variableMap = $this->getVariableMap($editModule); |
103 | 103 | foreach($variableMap as $key => $value){ |
104 | - $gridLayoutMetaDataParserTemp = new GridLayoutMetaDataParser ( $value, $editModule) ; |
|
105 | - foreach ( $gridLayoutMetaDataParserTemp->getLayout() as $panel) |
|
106 | - { |
|
107 | - foreach ( $panel as $row ) |
|
108 | - { |
|
109 | - foreach ( $row as $fieldArray ) |
|
110 | - { // fieldArray is an array('name'=>name,'label'=>label) |
|
111 | - if (isset ( $fieldArray [ 'label' ] )) |
|
112 | - { |
|
113 | - $vnames[$fieldArray [ 'label' ] ] = $fieldArray [ 'label' ] ; |
|
114 | - } |
|
115 | - } |
|
116 | - } |
|
117 | - } |
|
104 | + $gridLayoutMetaDataParserTemp = new GridLayoutMetaDataParser ( $value, $editModule) ; |
|
105 | + foreach ( $gridLayoutMetaDataParserTemp->getLayout() as $panel) |
|
106 | + { |
|
107 | + foreach ( $panel as $row ) |
|
108 | + { |
|
109 | + foreach ( $row as $fieldArray ) |
|
110 | + { // fieldArray is an array('name'=>name,'label'=>label) |
|
111 | + if (isset ( $fieldArray [ 'label' ] )) |
|
112 | + { |
|
113 | + $vnames[$fieldArray [ 'label' ] ] = $fieldArray [ 'label' ] ; |
|
114 | + } |
|
115 | + } |
|
116 | + } |
|
117 | + } |
|
118 | 118 | } |
119 | 119 | //end |
120 | 120 | |
@@ -122,23 +122,23 @@ discard block |
||
122 | 122 | require_once ('include/SubPanel/SubPanel.php') ; |
123 | 123 | $subList = SubPanel::getModuleSubpanels ( $editModule ); |
124 | 124 | foreach($subList as $subpanel => $titleLabel) { |
125 | - $vnames[$titleLabel] = $titleLabel; |
|
125 | + $vnames[$titleLabel] = $titleLabel; |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | foreach($dictionary[$objectName]['fields'] as $name=>$def) { |
129 | - if(isset($def['vname'])) { |
|
130 | - $vnames[$def['vname']] = $def['vname']; |
|
131 | - } |
|
132 | - } |
|
133 | - $formatted_mod_strings = array(); |
|
129 | + if(isset($def['vname'])) { |
|
130 | + $vnames[$def['vname']] = $def['vname']; |
|
131 | + } |
|
132 | + } |
|
133 | + $formatted_mod_strings = array(); |
|
134 | 134 | |
135 | - //we shouldn't set the $refresh=true here, or will lost template language mod_strings. |
|
136 | - //return_module_language($selected_lang, $editModule,false) : the mod_strings will be included from cache files here. |
|
135 | + //we shouldn't set the $refresh=true here, or will lost template language mod_strings. |
|
136 | + //return_module_language($selected_lang, $editModule,false) : the mod_strings will be included from cache files here. |
|
137 | 137 | foreach(return_module_language($selected_lang, $editModule,false) as $name=>$label) { |
138 | - //#25294 |
|
139 | - if($allLabels || isset($vnames[$name]) || preg_match( '/lbl_city|lbl_country|lbl_billing_address|lbl_alt_address|lbl_shipping_address|lbl_postal_code|lbl_state$/si' , $name)) { |
|
138 | + //#25294 |
|
139 | + if($allLabels || isset($vnames[$name]) || preg_match( '/lbl_city|lbl_country|lbl_billing_address|lbl_alt_address|lbl_shipping_address|lbl_postal_code|lbl_state$/si' , $name)) { |
|
140 | 140 | $formatted_mod_strings[$name] = htmlentities($label, ENT_QUOTES, 'UTF-8'); |
141 | - } |
|
141 | + } |
|
142 | 142 | } |
143 | 143 | //Grab everything from the custom files |
144 | 144 | $mod_bak = $mod_strings; |
@@ -147,49 +147,49 @@ discard block |
||
147 | 147 | "custom/modules/$editModule/Ext/Language/$selected_lang.lang.ext.php" |
148 | 148 | ); |
149 | 149 | foreach($files as $langfile){ |
150 | - $mod_strings = array(); |
|
151 | - if (is_file($langfile)) |
|
152 | - { |
|
153 | - include($langfile); |
|
154 | - foreach($mod_strings as $key => $label) |
|
155 | - { |
|
150 | + $mod_strings = array(); |
|
151 | + if (is_file($langfile)) |
|
152 | + { |
|
153 | + include($langfile); |
|
154 | + foreach($mod_strings as $key => $label) |
|
155 | + { |
|
156 | 156 | $formatted_mod_strings[$key] = htmlentities($label, ENT_QUOTES, 'UTF-8'); |
157 | - } |
|
158 | - } |
|
157 | + } |
|
158 | + } |
|
159 | 159 | } |
160 | 160 | $mod_strings = $mod_bak; |
161 | 161 | ksort($formatted_mod_strings); |
162 | - $smarty->assign('MOD', $formatted_mod_strings); |
|
163 | - $smarty->assign('view_module', $editModule); |
|
164 | - $smarty->assign('APP', $GLOBALS['app_strings']); |
|
165 | - $smarty->assign('selected_lang', $selected_lang); |
|
166 | - $smarty->assign('defaultHelp', 'labelsBtn'); |
|
167 | - $smarty->assign('assistant', array('key'=>'labels', 'group'=>'module')); |
|
168 | - $smarty->assign('labels_choice', $mod_strings['labelTypes']); |
|
169 | - $smarty->assign('labels_current', $allLabels?"all":""); |
|
162 | + $smarty->assign('MOD', $formatted_mod_strings); |
|
163 | + $smarty->assign('view_module', $editModule); |
|
164 | + $smarty->assign('APP', $GLOBALS['app_strings']); |
|
165 | + $smarty->assign('selected_lang', $selected_lang); |
|
166 | + $smarty->assign('defaultHelp', 'labelsBtn'); |
|
167 | + $smarty->assign('assistant', array('key'=>'labels', 'group'=>'module')); |
|
168 | + $smarty->assign('labels_choice', $mod_strings['labelTypes']); |
|
169 | + $smarty->assign('labels_current', $allLabels?"all":""); |
|
170 | 170 | |
171 | - $ajax = new AjaxCompose(); |
|
172 | - $ajax->addCrumb($mod_strings['LBL_STUDIO'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")'); |
|
173 | - $ajax->addCrumb($translatedEditModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module='.$editModule.'")'); |
|
174 | - $ajax->addCrumb($mod_strings['LBL_LABELS'], ''); |
|
171 | + $ajax = new AjaxCompose(); |
|
172 | + $ajax->addCrumb($mod_strings['LBL_STUDIO'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")'); |
|
173 | + $ajax->addCrumb($translatedEditModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module='.$editModule.'")'); |
|
174 | + $ajax->addCrumb($mod_strings['LBL_LABELS'], ''); |
|
175 | 175 | |
176 | - $html = $smarty->fetch('modules/ModuleBuilder/tpls/labels.tpl'); |
|
177 | - $ajax->addSection('center', $GLOBALS['mod_strings']['LBL_SECTION_EDLABELS'], $html); |
|
178 | - echo $ajax->getJavascript(); |
|
179 | - } |
|
176 | + $html = $smarty->fetch('modules/ModuleBuilder/tpls/labels.tpl'); |
|
177 | + $ajax->addSection('center', $GLOBALS['mod_strings']['LBL_SECTION_EDLABELS'], $html); |
|
178 | + echo $ajax->getJavascript(); |
|
179 | + } |
|
180 | 180 | |
181 | 181 | // fixing bug #39749: Quick Create in Studio |
182 | 182 | function getVariableMap($module) |
183 | 183 | { |
184 | 184 | $variableMap = array(MB_EDITVIEW => 'EditView', |
185 | - MB_DETAILVIEW => 'DetailView', |
|
186 | - MB_QUICKCREATE => 'QuickCreate'); |
|
185 | + MB_DETAILVIEW => 'DetailView', |
|
186 | + MB_QUICKCREATE => 'QuickCreate'); |
|
187 | 187 | |
188 | 188 | $hideQuickCreateForModules = array('KBDocuments', |
189 | - 'ProjectTask', |
|
190 | - 'Campaigns', |
|
191 | - 'Quotes', |
|
192 | - 'ProductTemplates'); |
|
189 | + 'ProjectTask', |
|
190 | + 'Campaigns', |
|
191 | + 'Quotes', |
|
192 | + 'ProductTemplates'); |
|
193 | 193 | |
194 | 194 | if(in_array($module, $hideQuickCreateForModules)) |
195 | 195 | { |
@@ -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 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | function display() |
66 | 66 | { |
67 | 67 | $editModule = $_REQUEST['view_module']; |
68 | - $allLabels = (!empty($_REQUEST['labels']) && $_REQUEST['labels']== 'all'); |
|
68 | + $allLabels = (!empty($_REQUEST['labels']) && $_REQUEST['labels'] == 'all'); |
|
69 | 69 | |
70 | 70 | if (!isset($_REQUEST['MB'])) |
71 | 71 | { |
@@ -73,15 +73,15 @@ discard block |
||
73 | 73 | $moduleNames = array_change_key_case($app_list_strings['moduleList']); |
74 | 74 | $translatedEditModule = $moduleNames[strtolower($editModule)]; |
75 | 75 | } |
76 | - $selected_lang = (!empty($_REQUEST['selected_lang'])? $_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']); |
|
77 | - if(empty($selected_lang)){ |
|
76 | + $selected_lang = (!empty($_REQUEST['selected_lang']) ? $_REQUEST['selected_lang'] : $_SESSION['authenticated_user_language']); |
|
77 | + if (empty($selected_lang)) { |
|
78 | 78 | $selected_lang = $GLOBALS['sugar_config']['default_language']; |
79 | 79 | } |
80 | 80 | |
81 | 81 | $smarty = new Sugar_Smarty(); |
82 | 82 | global $mod_strings; |
83 | 83 | $smarty->assign('mod_strings', $mod_strings); |
84 | - $smarty->assign('available_languages',get_languages()); |
|
84 | + $smarty->assign('available_languages', get_languages()); |
|
85 | 85 | |
86 | 86 | |
87 | 87 | $objectName = BeanFactory::getObjectName($editModule); |
@@ -89,28 +89,28 @@ discard block |
||
89 | 89 | global $dictionary; |
90 | 90 | $vnames = array(); |
91 | 91 | //jchi 24557 . We should list all the lables in viewdefs(list,detail,edit,quickcreate) that the user can edit them. |
92 | - require_once 'modules/ModuleBuilder/parsers/views/ListLayoutMetaDataParser.php' ; |
|
93 | - $parser = new ListLayoutMetaDataParser ( MB_LISTVIEW, $editModule ) ; |
|
94 | - foreach ( $parser->getLayout() as $key => $def ) |
|
92 | + require_once 'modules/ModuleBuilder/parsers/views/ListLayoutMetaDataParser.php'; |
|
93 | + $parser = new ListLayoutMetaDataParser(MB_LISTVIEW, $editModule); |
|
94 | + foreach ($parser->getLayout() as $key => $def) |
|
95 | 95 | { |
96 | - if(isset($def['label']) ) { |
|
96 | + if (isset($def['label'])) { |
|
97 | 97 | $vnames[$def['label']] = $def['label']; |
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
101 | - require_once 'modules/ModuleBuilder/parsers/views/GridLayoutMetaDataParser.php' ; |
|
101 | + require_once 'modules/ModuleBuilder/parsers/views/GridLayoutMetaDataParser.php'; |
|
102 | 102 | $variableMap = $this->getVariableMap($editModule); |
103 | - foreach($variableMap as $key => $value){ |
|
104 | - $gridLayoutMetaDataParserTemp = new GridLayoutMetaDataParser ( $value, $editModule) ; |
|
105 | - foreach ( $gridLayoutMetaDataParserTemp->getLayout() as $panel) |
|
103 | + foreach ($variableMap as $key => $value) { |
|
104 | + $gridLayoutMetaDataParserTemp = new GridLayoutMetaDataParser($value, $editModule); |
|
105 | + foreach ($gridLayoutMetaDataParserTemp->getLayout() as $panel) |
|
106 | 106 | { |
107 | - foreach ( $panel as $row ) |
|
107 | + foreach ($panel as $row) |
|
108 | 108 | { |
109 | - foreach ( $row as $fieldArray ) |
|
109 | + foreach ($row as $fieldArray) |
|
110 | 110 | { // fieldArray is an array('name'=>name,'label'=>label) |
111 | - if (isset ( $fieldArray [ 'label' ] )) |
|
111 | + if (isset ($fieldArray ['label'])) |
|
112 | 112 | { |
113 | - $vnames[$fieldArray [ 'label' ] ] = $fieldArray [ 'label' ] ; |
|
113 | + $vnames[$fieldArray ['label']] = $fieldArray ['label']; |
|
114 | 114 | } |
115 | 115 | } |
116 | 116 | } |
@@ -119,14 +119,14 @@ discard block |
||
119 | 119 | //end |
120 | 120 | |
121 | 121 | //Get Subpanel Labels: |
122 | - require_once ('include/SubPanel/SubPanel.php') ; |
|
123 | - $subList = SubPanel::getModuleSubpanels ( $editModule ); |
|
124 | - foreach($subList as $subpanel => $titleLabel) { |
|
122 | + require_once ('include/SubPanel/SubPanel.php'); |
|
123 | + $subList = SubPanel::getModuleSubpanels($editModule); |
|
124 | + foreach ($subList as $subpanel => $titleLabel) { |
|
125 | 125 | $vnames[$titleLabel] = $titleLabel; |
126 | 126 | } |
127 | 127 | |
128 | - foreach($dictionary[$objectName]['fields'] as $name=>$def) { |
|
129 | - if(isset($def['vname'])) { |
|
128 | + foreach ($dictionary[$objectName]['fields'] as $name=>$def) { |
|
129 | + if (isset($def['vname'])) { |
|
130 | 130 | $vnames[$def['vname']] = $def['vname']; |
131 | 131 | } |
132 | 132 | } |
@@ -134,9 +134,9 @@ discard block |
||
134 | 134 | |
135 | 135 | //we shouldn't set the $refresh=true here, or will lost template language mod_strings. |
136 | 136 | //return_module_language($selected_lang, $editModule,false) : the mod_strings will be included from cache files here. |
137 | - foreach(return_module_language($selected_lang, $editModule,false) as $name=>$label) { |
|
137 | + foreach (return_module_language($selected_lang, $editModule, false) as $name=>$label) { |
|
138 | 138 | //#25294 |
139 | - if($allLabels || isset($vnames[$name]) || preg_match( '/lbl_city|lbl_country|lbl_billing_address|lbl_alt_address|lbl_shipping_address|lbl_postal_code|lbl_state$/si' , $name)) { |
|
139 | + if ($allLabels || isset($vnames[$name]) || preg_match('/lbl_city|lbl_country|lbl_billing_address|lbl_alt_address|lbl_shipping_address|lbl_postal_code|lbl_state$/si', $name)) { |
|
140 | 140 | $formatted_mod_strings[$name] = htmlentities($label, ENT_QUOTES, 'UTF-8'); |
141 | 141 | } |
142 | 142 | } |
@@ -146,12 +146,12 @@ discard block |
||
146 | 146 | "custom/modules/$editModule/language/$selected_lang.lang.php", |
147 | 147 | "custom/modules/$editModule/Ext/Language/$selected_lang.lang.ext.php" |
148 | 148 | ); |
149 | - foreach($files as $langfile){ |
|
149 | + foreach ($files as $langfile) { |
|
150 | 150 | $mod_strings = array(); |
151 | 151 | if (is_file($langfile)) |
152 | 152 | { |
153 | 153 | include($langfile); |
154 | - foreach($mod_strings as $key => $label) |
|
154 | + foreach ($mod_strings as $key => $label) |
|
155 | 155 | { |
156 | 156 | $formatted_mod_strings[$key] = htmlentities($label, ENT_QUOTES, 'UTF-8'); |
157 | 157 | } |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | $smarty->assign('defaultHelp', 'labelsBtn'); |
167 | 167 | $smarty->assign('assistant', array('key'=>'labels', 'group'=>'module')); |
168 | 168 | $smarty->assign('labels_choice', $mod_strings['labelTypes']); |
169 | - $smarty->assign('labels_current', $allLabels?"all":""); |
|
169 | + $smarty->assign('labels_current', $allLabels ? "all" : ""); |
|
170 | 170 | |
171 | 171 | $ajax = new AjaxCompose(); |
172 | 172 | $ajax->addCrumb($mod_strings['LBL_STUDIO'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")'); |
@@ -191,17 +191,17 @@ discard block |
||
191 | 191 | 'Quotes', |
192 | 192 | 'ProductTemplates'); |
193 | 193 | |
194 | - if(in_array($module, $hideQuickCreateForModules)) |
|
194 | + if (in_array($module, $hideQuickCreateForModules)) |
|
195 | 195 | { |
196 | - if(isset($variableMap['quickcreate'])) |
|
196 | + if (isset($variableMap['quickcreate'])) |
|
197 | 197 | { |
198 | 198 | unset($variableMap['quickcreate']); |
199 | 199 | } |
200 | 200 | } |
201 | 201 | |
202 | - if($module == 'KBDocuments') |
|
202 | + if ($module == 'KBDocuments') |
|
203 | 203 | { |
204 | - $variableMap = array(); |
|
204 | + $variableMap = array(); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | return $variableMap; |