本文整理汇总了PHP中ModuleBuilder类的典型用法代码示例。如果您正苦于以下问题:PHP ModuleBuilder类的具体用法?PHP ModuleBuilder怎么用?PHP ModuleBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ModuleBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
// Only run this when coming from a version lower than 7.2.0
if (version_compare($this->from_version, '7.2', '>=')) {
return;
}
// Find all the classes we want to convert.
$customModules = array();
$customFiles = glob('modules' . DIRECTORY_SEPARATOR . '*' . DIRECTORY_SEPARATOR . '*_sugar.php', GLOB_NOSORT);
foreach ($customFiles as $customFile) {
$moduleName = str_replace('_sugar', '', pathinfo($customFile, PATHINFO_FILENAME));
$customModules[] = $moduleName;
}
$customModules = array_flip($customModules);
// Go through all the modules using the ModuleBuilder
$mB = new ModuleBuilder();
$mB->getPackages();
foreach ($mB->packages as $package) {
$this->log("FixClassConstructor: Found a custom package {$package->name}");
foreach ($package->modules as $mbModule) {
if (!isset($customModules[$mbModule->key_name])) {
continue;
}
$this->replaceCustomModuleClasses($mbModule);
unset($customModules[$mbModule->key_name]);
}
}
$customModules = array_flip($customModules);
// Treat modules that have not been found by the ModuleBuilder
foreach ($customModules as $moduleName) {
$this->log("FixClassConstructor: Found a custom module {$moduleName} not recognized by ModuleBuilder");
$this->replaceCustomModuleClassesByReflection($moduleName);
}
}
示例2: display
function display()
{
global $mod_strings;
$smarty = new Sugar_Smarty();
$mb = new ModuleBuilder();
//if (!empty($_REQUEST['package'])) {
if (empty($_REQUEST['package']) && empty($_REQUEST['new'])) {
$this->generatePackageButtons($mb->getPackageList());
$smarty->assign('buttons', $this->buttons);
$smarty->assign('title', $GLOBALS['mod_strings']['LBL_MODULEBUILDER']);
$smarty->assign("question", $GLOBALS['mod_strings']['LBL_QUESTION_PACKAGE']);
$smarty->assign("defaultHelp", "mbHelp");
$ajax = new AjaxCompose();
$ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package")');
$ajax->addCrumb($GLOBALS['mod_strings']['LBL_PACKAGE_LIST'], '');
$ajax->addSection('center', $GLOBALS['mod_strings']['LBL_PACKAGE_LIST'], $smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl'));
echo $ajax->getJavascript();
} else {
$name = !empty($_REQUEST['package']) ? $_REQUEST['package'] : '';
$mb->getPackage($name);
require_once 'modules/ModuleBuilder/MB/MBPackageTree.php';
$mbt = new MBPackageTree();
$nodes = $mbt->fetchNodes();
$package_labels = array();
if (!empty($nodes['tree_data']['nodes'])) {
foreach ($nodes['tree_data']['nodes'] as $entry) {
if (!empty($entry['data']['label']) && $name != $entry['data']['label']) {
$package_labels[] = strtoupper($entry['data']['label']);
}
}
}
$json = getJSONobj();
$smarty->assign('package_labels', $json->encode($package_labels));
$this->package =& $mb->packages[$name];
$this->loadModuleTypes();
$this->loadPackageHelp($name);
$this->package->date_modified = $GLOBALS['timedate']->to_display_date_time($this->package->date_modified);
$smarty->assign('package', $this->package);
$smarty->assign('mod_strings', $mod_strings);
$smarty->assign('package_already_deployed', 'false');
foreach ($this->package->modules as $a_module) {
if (in_array($a_module->key_name, $GLOBALS['moduleList'])) {
$smarty->assign('package_already_deployed', 'true');
break;
}
}
$ajax = new AjaxCompose();
$ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package")');
if (empty($name)) {
$name = $mod_strings['LBL_NEW_PACKAGE'];
}
$ajax->addCrumb($name, '');
$html = $smarty->fetch('modules/ModuleBuilder/tpls/MBPackage/package.tpl');
if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'SavePackage') {
$html .= "<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>";
}
$ajax->addSection('center', translate('LBL_SECTION_PACKAGE', 'ModuleBuilder'), $html);
echo $ajax->getJavascript();
}
}
示例3: display
function display()
{
global $app_strings, $current_user, $mod_strings, $app_list_strings;
$smarty = new Sugar_Smarty();
require_once 'include/JSON.php';
//Load the field list from the target module
$selected_lang = $_SESSION['authenticated_user_language'];
$vardef = array();
//Copy app strings
$my_list_strings = array_merge($app_list_strings);
$child = $_REQUEST['field'];
//if we are using ModuleBuilder then process the following
if (!empty($_REQUEST['package']) && $_REQUEST['package'] != 'studio') {
require_once 'modules/ModuleBuilder/MB/ModuleBuilder.php';
$mb = new ModuleBuilder();
$this->module = $mb->getPackageModule($_REQUEST['package'], $_REQUEST['view_module']);
$vardef = $this->module->getVardefs();
$this->module->mblanguage->generateAppStrings(false);
$my_list_strings = array_merge($my_list_strings, $this->module->mblanguage->appListStrings[$selected_lang . '.lang.php']);
} else {
$vardef = BeanFactory::getBean($_REQUEST['view_module'])->field_defs;
}
foreach ($my_list_strings as $key => $value) {
if (!is_array($value)) {
unset($my_list_strings[$key]);
}
}
$parents = $this->getParentDDs($vardef, $child, $my_list_strings);
$visibility_grid = !empty($vardef[$child]['visibility_grid']) ? $vardef[$child]['visibility_grid'] : array();
$smarty->assign('app_strings', $app_strings);
$smarty->assign('mod', $mod_strings);
$smarty->assign('parents', JSON::encode($parents));
$smarty->assign('visibility_grid', JSON::encode($visibility_grid));
$smarty->display('modules/ExpressionEngine/tpls/ddEditor.tpl');
}
示例4: saveDropDown
/**
* Takes in the request params from a save request and processes
* them for the save.
*
* @param REQUEST params $params
*/
function saveDropDown($params)
{
require_once 'modules/Administration/Common.php';
$emptyMarker = translate('LBL_BLANK');
$selected_lang = !empty($params['dropdown_lang']) ? $params['dropdown_lang'] : $_SESSION['authenticated_user_language'];
$type = $_REQUEST['view_package'];
$dir = '';
$dropdown_name = $params['dropdown_name'];
$json = getJSONobj();
$list_value = str_replace('"":""', '"__empty__":""', $params['list_value']);
//Bug 21362 ENT_QUOTES- convert single quotes to escaped single quotes.
$dropdown = $json->decode(html_entity_decode(rawurldecode($list_value), ENT_QUOTES));
if (array_key_exists($emptyMarker, $dropdown)) {
unset($dropdown[$emptyMarker]);
$dropdown[''] = '';
}
if ($type != 'studio') {
$mb = new ModuleBuilder();
$module =& $mb->getPackageModule($params['view_package'], $params['view_module']);
$this->synchMBDropDown($dropdown_name, $dropdown, $selected_lang, $module);
//Can't use synch on selected lang as we want to overwrite values, not just keys
$module->mblanguage->appListStrings[$selected_lang . '.lang.php'][$dropdown_name] = $dropdown;
$module->mblanguage->save($module->key_name);
// tyoung - key is required parameter as of
} else {
$contents = return_custom_app_list_strings_file_contents($selected_lang);
$my_list_strings = return_app_list_strings_language($selected_lang);
if ($selected_lang == $GLOBALS['current_language']) {
$GLOBALS['app_list_strings'][$dropdown_name] = $dropdown;
}
//write to contents
$contents = str_replace("?>", '', $contents);
if (empty($contents)) {
$contents = "<?php";
}
//add new drop down to the bottom
if (!empty($params['use_push'])) {
//this is for handling moduleList and such where nothing should be deleted or anything but they can be renamed
foreach ($dropdown as $key => $value) {
//only if the value has changed or does not exist do we want to add it this way
if (!isset($my_list_strings[$dropdown_name][$key]) || strcmp($my_list_strings[$dropdown_name][$key], $value) != 0) {
//clear out the old value
$pattern_match = '/\\s*\\$app_list_strings\\s*\\[\\s*\'' . $dropdown_name . '\'\\s*\\]\\[\\s*\'' . $key . '\'\\s*\\]\\s*=\\s*[\'\\"]{1}.*?[\'\\"]{1};\\s*/ism';
$contents = preg_replace($pattern_match, "\n", $contents);
//add the new ones
$contents .= "\n\$GLOBALS['app_list_strings']['{$dropdown_name}']['{$key}']=" . var_export_helper($value) . ";";
}
}
} else {
//Now synch up the keys in other langauges to ensure that removed/added Drop down values work properly under all langs.
$this->synchDropDown($dropdown_name, $dropdown, $selected_lang, $dir);
$contents = $this->getNewCustomContents($dropdown_name, $dropdown, $selected_lang);
}
if (!empty($dir) && !is_dir($dir)) {
$continue = mkdir_recursive($dir);
}
save_custom_app_list_strings_contents($contents, $selected_lang, $dir);
}
sugar_cache_reset();
}
示例5: __construct
public function __construct()
{
parent::__construct();
foreach ($this->vars as $var) {
if (!isset($_REQUEST[$var])) {
sugar_die("Required paramter {$var} not set in ViewRelFields");
}
$this->{$var} = $_REQUEST[$var];
}
$mb = new ModuleBuilder();
$this->package = empty($_REQUEST['package']) || $_REQUEST['package'] == 'studio' ? "" : $mb->getPackage($_REQUEST['package']);
}
示例6: __construct
/**
* The constructor
* @param string $subpanelName
* @param string $moduleName
* @param string $packageName
* @param string $client
*/
public function __construct($subpanelName, $moduleName, $packageName, $client = '')
{
$this->mdc = new MetaDataConverter();
$this->_subpanelName = $subpanelName;
$this->_moduleName = $moduleName;
$this->client = empty($client) ? 'base' : $client;
// TODO: history
$this->historyPathname = "custom/history/modulebuilder/packages/{$packageName}/modules/{$moduleName}/metadata/" . self::HISTORYFILENAME;
$this->_history = new History($this->historyPathname);
//get the bean from ModuleBuilder
$mb = new ModuleBuilder();
$this->module = $mb->getPackageModule($packageName, $moduleName);
$this->module->mbvardefs->updateVardefs();
$templates = $this->module->config['templates'];
$template_def = "";
foreach ($templates as $template => $a) {
if ($a === 1) {
$template_def = $template;
}
}
$template_subpanel_def = "include/SugarObjects/templates/{$template_def}/clients/{$this->client}/views/subpanel-list/subpanel-list.php";
$viewdefs = array();
if (file_exists($template_subpanel_def)) {
include $template_subpanel_def;
if (isset($viewdefs['<module_name>'])) {
$viewdefs[$this->module->key_name] = $viewdefs['<module_name>'];
unset($viewdefs['<module_name>']);
}
}
if ($subpanelName != 'default' && !stristr($subpanelName, 'for')) {
$subpanelName = 'For' . ucfirst($subpanelName);
}
$this->sidecarSubpanelName = $this->mdc->fromLegacySubpanelName($subpanelName);
// Set the original view defs from the loaded file if there are any
$this->_originalViewdefs = $this->getNewViewDefs($viewdefs);
$this->sidecarFile = $this->module->getSubpanelFilePath($subpanelName, $this->client);
if (file_exists($this->sidecarFile)) {
include $this->sidecarFile;
}
$viewdefs = empty($viewdefs) ? array() : $viewdefs;
$this->_viewdefs = $this->getNewViewDefs($viewdefs);
$this->_fielddefs = $this->getFieldDefs();
$this->_paneldefs = isset($this->_viewdefs['panels']) ? $this->_viewdefs['panels'] : array();
// Set the global mod_strings directly as Sugar does not automatically load the
// language files for undeployed modules (how could it?)
$selected_lang = 'en_us';
if (isset($GLOBALS['current_language']) && !empty($GLOBALS['current_language'])) {
$selected_lang = $GLOBALS['current_language'];
}
$GLOBALS['mod_strings'] = array_merge($GLOBALS['mod_strings'], $this->module->getModStrings($selected_lang));
}
示例7: testGetModuleAliases
/**
* Testing ModuleBuilder::getModuleAliases
*
* @dataProvider getModuleAliasesData
* @group 46152
*/
public function testGetModuleAliases($module, $needAliases)
{
$aliases = ModuleBuilder::getModuleAliases($module);
foreach ($needAliases as $needAlias) {
$this->assertContains($needAlias, $aliases);
}
}
示例8: display
function display()
{
$moduleName = !empty($_REQUEST['view_module']) ? $_REQUEST['view_module'] : $_REQUEST['edit_module'];
$smarty = new Sugar_Smarty();
// set the mod_strings as we can be called after doing a Repair and the mod_strings are set to Administration
$GLOBALS['mod_strings'] = return_module_language($GLOBALS['current_language'], 'ModuleBuilder');
$smarty->assign('mod_strings', $GLOBALS['mod_strings']);
$smarty->assign('view_module', $moduleName);
$ajax = new AjaxCompose();
$json = getJSONobj();
$this->fromModuleBuilder = !empty($_REQUEST['MB']) || !empty($_REQUEST['view_package']) && $_REQUEST['view_package'] != 'studio';
$smarty->assign('fromModuleBuilder', $this->fromModuleBuilder);
if (!$this->fromModuleBuilder) {
$smarty->assign('view_package', '');
$relationships = new DeployedRelationships($moduleName);
$ajaxRelationships = $this->getAjaxRelationships($relationships);
$smarty->assign('relationships', $json->encode($ajaxRelationships));
$smarty->assign('empty', sizeof($ajaxRelationships) == 0);
$smarty->assign('studio', true);
//crumb
global $app_list_strings;
$moduleNames = array_change_key_case($app_list_strings['moduleList']);
$translatedModule = $moduleNames[strtolower($moduleName)];
$ajax->addCrumb(translate('LBL_STUDIO'), 'ModuleBuilder.main("studio")');
$ajax->addCrumb($translatedModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $moduleName . '")');
$ajax->addCrumb(translate('LBL_RELATIONSHIPS'), '');
$ajax->addSection('center', $moduleName . ' ' . translate('LBL_RELATIONSHIPS'), $this->fetchTemplate($smarty, 'modules/ModuleBuilder/tpls/studioRelationships.tpl'));
} else {
$smarty->assign('view_package', $_REQUEST['view_package']);
$mb = new ModuleBuilder();
$module =& $mb->getPackageModule($_REQUEST['view_package'], $_REQUEST['view_module']);
$package = $mb->packages[$_REQUEST['view_package']];
$package->loadModuleTitles();
$relationships = new UndeployedRelationships($module->getModuleDir());
$ajaxRelationships = $this->getAjaxRelationships($relationships);
$smarty->assign('relationships', $json->encode($ajaxRelationships));
$smarty->assign('empty', sizeof($ajaxRelationships) == 0);
$module->help['default'] = empty($_REQUEST['view_module']) ? 'create' : 'modify';
$module->help['group'] = 'module';
$ajax->addCrumb(translate('LBL_MODULEBUILDER'), 'ModuleBuilder.main("mb")');
$ajax->addCrumb($package->name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=' . $package->name . '")');
$ajax->addCrumb($moduleName, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package=' . $package->name . '&view_module=' . $moduleName . '")');
$ajax->addCrumb(translate('LBL_RELATIONSHIPS'), '');
$ajax->addSection('center', $moduleName . ' ' . translate('LBL_RELATIONSHIPS'), $this->fetchTemplate($smarty, 'modules/ModuleBuilder/tpls/studioRelationships.tpl'));
}
echo $ajax->getJavascript();
}
示例9: display
function display()
{
$this->ss = new Sugar_Smarty();
foreach ($this->vars as $var) {
if (isset($_REQUEST[$var])) {
$this->{$var} = $_REQUEST[$var];
$this->ss->assign($var, $_REQUEST[$var]);
}
}
$mapping = empty($_REQUEST['mapping']) ? array() : json_decode(html_entity_decode($_REQUEST['mapping']), true);
$this->ss->assign("mapping", $mapping);
if (empty($_REQUEST['package']) || $_REQUEST['package'] == 'studio') {
$sm = StudioModuleFactory::getStudioModule($_REQUEST['targetModule']);
$fields = $sm->getFields();
if (!empty($fields[$this->parentList]) && !empty($fields[$this->parentList]['options'])) {
$this->parentList = $fields[$this->parentList]['options'];
}
$parentOptions = translate($this->parentList);
$childOptions = translate($this->childList);
} else {
$mb = new ModuleBuilder();
$moduleName = $_REQUEST['targetModule'];
$sm = $mb->getPackageModule($_REQUEST['package'], $moduleName);
$sm->getVardefs();
$fields = $sm->mbvardefs->vardefs['fields'];
if (!empty($fields[$this->parentList]) && !empty($fields[$this->parentList]['options'])) {
$this->parentList = $fields[$this->parentList]['options'];
}
$parentOptions = $this->getMBOptions($this->parentList, $sm);
$childOptions = $this->getMBOptions($this->childList, $sm);
}
$this->ss->assign("parent_list_options", $parentOptions);
$parentOptionsArray = array();
foreach ($parentOptions as $value => $label) {
$parentOptionsArray[] = array("value" => $value, "label" => $label);
}
$this->ss->assign("parentOptions", json_encode($parentOptions));
$this->ss->assign("child_list_options", $childOptions);
$childOptionsArray = array();
foreach ($childOptions as $value => $label) {
$childOptionsArray[] = array("value" => $value, "label" => $label);
}
$this->ss->assign("childOptions", json_encode($childOptionsArray));
$this->ss->display("modules/ModuleBuilder/tpls/depdropdown.tpl");
}
示例10: __construct
function __construct($subpanelName, $moduleName, $packageName)
{
// Needed to tap into the abstract for loading and saving
$this->_view = 'subpanel_layout';
$this->_fileVariables['subpanel_layout'] = 'subpanel_layout';
$this->_subpanelName = $subpanelName;
$this->_moduleName = $moduleName;
// TODO: history
$this->historyPathname = 'custom/history/modulebuilder/packages/' . $packageName . '/modules/' . $moduleName . '/metadata/' . self::HISTORYFILENAME;
$this->_history = new History($this->historyPathname);
//get the bean from ModuleBuilder
$mb = new ModuleBuilder();
$this->module =& $mb->getPackageModule($packageName, $moduleName);
$this->module->mbvardefs->updateVardefs();
$this->_fielddefs =& $this->module->mbvardefs->vardefs['fields'];
$templates =& $this->module->config['templates'];
$template_def = "";
foreach ($templates as $template => $a) {
if ($a === 1) {
$template_def = $template;
}
}
$templateFile = 'include/SugarObjects/templates/' . $template_def . '/metadata/subpanels/default.php';
if (file_exists($templateFile)) {
$subpanel_layout = $this->_loadFromFile($templateFile);
if (!empty($subpanel_layout['list_fields'])) {
$originalDef = $subpanel_layout['list_fields'];
// This has to be done early because once they are in field defs
// they won't be picked up
$this->setNonFields($originalDef);
$this->_mergeFielddefs($this->_fielddefs, $originalDef);
}
}
$filename = $this->module->getSubpanelFilePath($this->_subpanelName, '', true);
$subpanel_layout = $this->_loadFromFile($filename);
$this->_originalViewdefs = $subpanel_layout['list_fields'];
$this->_viewdefs =& $subpanel_layout['list_fields'];
$this->_mergeFielddefs($this->_fielddefs, $this->_viewdefs);
// Set the global mod_strings directly as Sugar does not automatically load the language files for undeployed modules (how could it?)
$selected_lang = 'en_us';
if (isset($GLOBALS['current_language']) && !empty($GLOBALS['current_language'])) {
$selected_lang = $GLOBALS['current_language'];
}
$GLOBALS['mod_strings'] = array_merge($GLOBALS['mod_strings'], $this->module->getModStrings($selected_lang));
}
示例11: __construct
function __construct($subpanelName, $moduleName, $packageName)
{
$this->_subpanelName = $subpanelName;
$this->_moduleName = $moduleName;
// TODO: history
$this->historyPathname = 'custom/history/modulebuilder/packages/' . $packageName . '/modules/' . $moduleName . '/metadata/' . self::HISTORYFILENAME;
$this->_history = new History($this->historyPathname);
//get the bean from ModuleBuilder
$mb = new ModuleBuilder();
$this->module =& $mb->getPackageModule($packageName, $moduleName);
$this->module->mbvardefs->updateVardefs();
$this->_fielddefs =& $this->module->mbvardefs->vardefs['fields'];
$subpanel_layout = $this->module->getAvailibleSubpanelDef($this->_subpanelName);
$this->_viewdefs =& $subpanel_layout['list_fields'];
$this->_mergeFielddefs($this->_fielddefs, $this->_viewdefs);
// Set the global mod_strings directly as Sugar does not automatically load the language files for undeployed modules (how could it?)
$GLOBALS['mod_strings'] = array_merge($GLOBALS['mod_strings'], $this->module->getModStrings());
}
示例12: getPath
/** {@inheritDoc} */
public function getPath()
{
$path = $this->file->getPath();
switch ($this->location) {
case MB_HISTORYMETADATALOCATION:
$path = array_merge(explode('/', trim(MetaDataFiles::$paths[MB_WORKINGMETADATALOCATION], '/')), array('modulebuilder', 'packages', $this->package), $path);
break;
default:
// get the module again, all so we can call this method statically without relying
// on the module stored in the class variables
require_once 'modules/ModuleBuilder/MB/ModuleBuilder.php';
$mb = new ModuleBuilder();
array_shift($path);
$module = array_shift($path);
$path = array_merge(explode('/', trim($mb->getPackageModule($this->package, $module)->getModuleDir(), '/')), $path);
}
return $path;
}
示例13: display
function display()
{
$this->fromModuleBuilder = isset($_REQUEST['MB']) || !empty($_REQUEST['view_package']) && $_REQUEST['view_package'] != 'studio';
if ($this->fromModuleBuilder) {
return;
//no support for MB
}
global $current_user;
global $mod_strings;
$smarty = new Sugar_Smarty();
$smarty->assign('title', $mod_strings['LBL_DEVELOPER_TOOLS']);
$smarty->assign('question', $mod_strings['LBL_REMOVE_LAYOUT']);
$smarty->assign('mod_strings', $mod_strings);
$module_name = $_REQUEST['view_module'];
$smarty->assign('view_module', $module_name);
$groupLayout = $_REQUEST['grpLayout'];
$smarty->assign('groupLayout', $groupLayout);
require_once 'modules/SecurityGroups/SecurityGroup.php';
$groupFocus = new SecurityGroup();
$groupFocus->retrieve($groupLayout);
$groupName = $groupFocus->name;
// set up language files
//$smarty->assign ( 'language', $parser->getLanguage() ) ; // for sugar_translate in the smarty template
//$smarty->assign('from_mb',$this->fromModuleBuilder);
$mb = new ModuleBuilder();
if (!isset($_REQUEST['view_package'])) {
$_REQUEST['view_package'] = 'studio';
}
$module =& $mb->getPackageModule($_REQUEST['view_package'], $_REQUEST['view_module']);
$package = $mb->packages[$_REQUEST['view_package']];
$package->loadModuleTitles();
$ajax = new AjaxCompose();
$ajax->addCrumb(translate('LBL_STUDIO', 'ModuleBuilder'), 'ModuleBuilder.main("studio")');
$ajax->addCrumb(translate($module_name), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $module_name . '")');
$ajax->addCrumb(translate('LBL_LAYOUTS', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=addlayout&layouts=1&view_module=' . $module_name . '")');
$ajax->addCrumb(translate($groupName), '');
$ajax->addCrumb($mod_strings['LBL_REMOVE_LAYOUT'], '');
//$ajax->addSection ( 'center', $moduleName . ' ' . translate('LBL_ADD_LAYOUT'),
$ajax->addSection('center', $mod_strings['LBL_ADD_LAYOUT'], $smarty->fetch('modules/ModuleBuilder/tpls/removegrouplayoutprompt.tpl'));
echo $ajax->getJavascript();
}
示例14: display
public function display()
{
global $mod_strings, $locale;
$bak_mod_strings = $mod_strings;
$smarty = new Sugar_Smarty();
$smarty->assign('mod_strings', $mod_strings);
$package_name = $_REQUEST['view_package'];
$module_name = $_REQUEST['view_module'];
require_once 'modules/ModuleBuilder/MB/ModuleBuilder.php';
$mb = new ModuleBuilder();
$mb->getPackage($_REQUEST['view_package']);
$package = $mb->packages[$_REQUEST['view_package']];
$package->getModule($module_name);
$mbModule = $package->modules[$module_name];
if (!empty($_REQUEST['selected_lang'])) {
$selected_lang = $_REQUEST['selected_lang'];
} else {
$selected_lang = $locale->getAuthenticatedUserLanguage();
}
//need to change the following to interface with MBlanguage.
$smarty->assign('MOD', $mbModule->getModStrings($selected_lang));
$smarty->assign('APP', $GLOBALS['app_strings']);
$smarty->assign('selected_lang', $selected_lang);
$smarty->assign('view_package', $package_name);
$smarty->assign('view_module', $module_name);
$smarty->assign('mb', '1');
$smarty->assign('available_languages', get_languages());
///////////////////////////////////////////////////////////////////
////ASSISTANT
$smarty->assign('assistant', array('group' => 'module', 'key' => 'labels'));
/////////////////////////////////////////////////////////////////
////ASSISTANT
$ajax = new AjaxCompose();
$ajax->addCrumb($bak_mod_strings['LBL_MODULEBUILDER'], 'ModuleBuilder.main("mb")');
$ajax->addCrumb($package_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=' . $package->name . '")');
$ajax->addCrumb($module_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package=' . $package->name . '&view_module=' . $module_name . '")');
$ajax->addCrumb($bak_mod_strings['LBL_LABELS'], '');
$ajax->addSection('center', $bak_mod_strings['LBL_LABELS'], $smarty->fetch('modules/ModuleBuilder/tpls/labels.tpl'));
echo $ajax->getJavascript();
}
示例15: display
function display()
{
global $mod_strings;
$smarty = new Sugar_Smarty();
$mb = new ModuleBuilder();
//if (!empty($_REQUEST['package'])) {
if (empty($_REQUEST['package']) && empty($_REQUEST['new'])) {
$this->generatePackageButtons($mb->getPackageList());
$smarty->assign('buttons', $this->buttons);
$smarty->assign('title', $GLOBALS['mod_strings']['LBL_MODULEBUILDER']);
$smarty->assign("question", $GLOBALS['mod_strings']['LBL_QUESTION_PACKAGE']);
$smarty->assign("defaultHelp", "mbHelp");
$ajax = new AjaxCompose();
$ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package")');
$ajax->addCrumb($GLOBALS['mod_strings']['LBL_PACKAGE_LIST'], '');
$ajax->addSection('center', $GLOBALS['mod_strings']['LBL_PACKAGE_LIST'], $smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl'));
echo $ajax->getJavascript();
} else {
$name = !empty($_REQUEST['package']) ? $_REQUEST['package'] : '';
$mb->getPackage($name);
$this->package =& $mb->packages[$name];
$this->loadModuleTypes();
$this->loadPackageHelp($name);
$this->package->date_modified = $GLOBALS['timedate']->to_display_date_time($this->package->date_modified);
$smarty->assign('package', $this->package);
$smarty->assign('mod_strings', $mod_strings);
$ajax = new AjaxCompose();
$ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package")');
if (empty($name)) {
$name = $mod_strings['LBL_NEW_PACKAGE'];
}
$ajax->addCrumb($name, '');
$html = $smarty->fetch('modules/ModuleBuilder/tpls/MBPackage/package.tpl');
if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'SavePackage') {
$html .= "<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>";
}
$ajax->addSection('center', translate('LBL_SECTION_PACKAGE', 'ModuleBuilder'), $html);
echo $ajax->getJavascript();
}
}