@@ -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 | /** |
@@ -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 |
@@ -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,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 | } |
@@ -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 | } |
@@ -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 | } |
@@ -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; |
@@ -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 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | $ajax = new AjaxCompose(); |
63 | 63 | $ajax->addSection('center', $mod_strings['LBL_PACKAGE_DELETED'], |
64 | - str_replace('[[package]]',$_REQUEST['package'],$mod_strings['LBL_PACKAGE_WAS_DELETED'])); |
|
64 | + str_replace('[[package]]', $_REQUEST['package'], $mod_strings['LBL_PACKAGE_WAS_DELETED'])); |
|
65 | 65 | echo $ajax->getJavascript(); |
66 | 66 | } |
67 | 67 | } |
68 | 68 | \ No newline at end of file |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | global $mod_strings; |
49 | 49 | |
50 | 50 | return array( |
51 | - translate('LBL_MODULE_NAME','Administration'), |
|
51 | + translate('LBL_MODULE_NAME', 'Administration'), |
|
52 | 52 | ModuleBuilderController::getModuleTitle(), |
53 | 53 | ); |
54 | 54 | } |
@@ -58,19 +58,19 @@ discard block |
||
58 | 58 | global $current_user; |
59 | 59 | global $mod_strings; |
60 | 60 | $smarty = new Sugar_Smarty(); |
61 | - $smarty->assign('title' , $mod_strings['LBL_DEVELOPER_TOOLS']); |
|
61 | + $smarty->assign('title', $mod_strings['LBL_DEVELOPER_TOOLS']); |
|
62 | 62 | $smarty->assign('question', $mod_strings['LBL_QUESTION_EDITOR']); |
63 | 63 | $smarty->assign('defaultHelp', 'mainHelp'); |
64 | 64 | $this->generateHomeButtons(); |
65 | 65 | $smarty->assign('buttons', $this->buttons); |
66 | - $assistant=array('group'=>'main', 'key'=>'welcome'); |
|
67 | - $smarty->assign('assistant',$assistant); |
|
66 | + $assistant = array('group'=>'main', 'key'=>'welcome'); |
|
67 | + $smarty->assign('assistant', $assistant); |
|
68 | 68 | //initialize Assistant's display property. |
69 | 69 | $userPref = $current_user->getPreference('mb_assist', 'Assistant'); |
70 | - if(!$userPref) $userPref="na"; |
|
71 | - $smarty->assign('userPref',$userPref); |
|
70 | + if (!$userPref) $userPref = "na"; |
|
71 | + $smarty->assign('userPref', $userPref); |
|
72 | 72 | $ajax = new AjaxCompose(); |
73 | - $ajax->addSection('center', $mod_strings['LBL_HOME'],$smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl')); |
|
73 | + $ajax->addSection('center', $mod_strings['LBL_HOME'], $smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl')); |
|
74 | 74 | echo $ajax->getJavascript(); |
75 | 75 | } |
76 | 76 | |
@@ -78,13 +78,13 @@ discard block |
||
78 | 78 | function generateHomeButtons() |
79 | 79 | { |
80 | 80 | global $current_user; |
81 | - if(displayStudioForCurrentUser() == true) { |
|
81 | + if (displayStudioForCurrentUser() == true) { |
|
82 | 82 | //$this->buttons['Application'] = array ('action' => '', 'imageTitle' => 'Application', 'size' => '128', 'help'=>'appBtn'); |
83 | - $this->buttons[$GLOBALS['mod_strings']['LBL_STUDIO']] = array ('action' => 'javascript:ModuleBuilder.main("studio")', 'imageTitle' => 'Studio', 'size' => '128', 'help'=>'studioBtn'); |
|
83 | + $this->buttons[$GLOBALS['mod_strings']['LBL_STUDIO']] = array('action' => 'javascript:ModuleBuilder.main("studio")', 'imageTitle' => 'Studio', 'size' => '128', 'help'=>'studioBtn'); |
|
84 | 84 | } |
85 | - if(is_admin($current_user)) { |
|
86 | - $this->buttons[$GLOBALS['mod_strings']['LBL_MODULEBUILDER']] = array ('action' => 'javascript:ModuleBuilder.main("mb")', 'imageTitle' => 'ModuleBuilder', 'size' => '128', 'help'=>'mbBtn'); |
|
85 | + if (is_admin($current_user)) { |
|
86 | + $this->buttons[$GLOBALS['mod_strings']['LBL_MODULEBUILDER']] = array('action' => 'javascript:ModuleBuilder.main("mb")', 'imageTitle' => 'ModuleBuilder', 'size' => '128', 'help'=>'mbBtn'); |
|
87 | 87 | } |
88 | - $this->buttons[$GLOBALS['mod_strings']['LBL_DROPDOWNEDITOR']] = array ('action' => 'javascript:ModuleBuilder.main("dropdowns")', 'imageTitle' => $GLOBALS['mod_strings']['LBL_HOME_EDIT_DROPDOWNS'], 'imageName' => 'DropDownEditor', 'size' => '128', 'help'=>'dropDownEditorBtn'); |
|
88 | + $this->buttons[$GLOBALS['mod_strings']['LBL_DROPDOWNEDITOR']] = array('action' => 'javascript:ModuleBuilder.main("dropdowns")', 'imageTitle' => $GLOBALS['mod_strings']['LBL_HOME_EDIT_DROPDOWNS'], 'imageName' => 'DropDownEditor', 'size' => '128', 'help'=>'dropDownEditorBtn'); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | \ No newline at end of file |