• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ModuleBuilder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中ModuleBuilder的典型用法代码示例。如果您正苦于以下问题:PHP ModuleBuilder类的具体用法?PHP ModuleBuilder怎么用?PHP ModuleBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ModuleBuilder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:34,代码来源:4_FixClassConstructor.php


示例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();
     }
 }
开发者ID:thsonvt,项目名称:sugarcrm_dev,代码行数:60,代码来源:view.package.php


示例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');
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:35,代码来源:view.editDepDropdown.php


示例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('&quot;&quot;:&quot;&quot;', '&quot;__empty__&quot;:&quot;&quot;', $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();
 }
开发者ID:nerdystudmuffin,项目名称:dashlet-subpanels,代码行数:66,代码来源:parser.dropdown.php


示例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']);
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:12,代码来源:view.selectrelatedfield.php


示例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));
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:58,代码来源:UndeployedSidecarSubpanelImplementation.php


示例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);
     }
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:13,代码来源:Bug46152_P1Test.php


示例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();
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:47,代码来源:view.relationships.php


示例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");
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:45,代码来源:view.depdropdown.php


示例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));
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:45,代码来源:UndeployedSubpanelImplementation.php


示例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());
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:18,代码来源:UndeployedSubpanelImplementation.php


示例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;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:19,代码来源:MetaDataFileUndeployed.php


示例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();
 }
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:41,代码来源:view.removegrouplayoutprompt.php


示例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();
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:40,代码来源:view.modulelabels.php


示例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();
     }
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:40,代码来源:view.package.php


示例16: __construct

 /**
  * The constructor
  * @param string $moduleName
  * @param string $packageName
  * @param string $client
  */
 public function __construct($moduleName, $packageName, $client = '')
 {
     $this->_moduleName = $moduleName;
     $this->client = empty($client) ? 'base' : $client;
     // TODO: history
     $this->historyPathname = "custom/history/modulebuilder/packages/{$packageName}/modules/{$moduleName}/clients/{$client}/filters/default/" . 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_filter_def = "include/SugarObjects/templates/{$template_def}/clients/{$this->client}/filters/default/default.php";
     if (file_exists($template_filter_def)) {
         include $template_filter_def;
     }
     $this->sidecarFile = "{$this->module->getModuleDir()}/clients/{$client}/filters/default/default.php";
     if (file_exists($this->sidecarFile)) {
         include $this->sidecarFile;
     }
     $viewdefs = empty($viewdefs) ? array('fields' => array()) : $viewdefs;
     $this->_viewdefs = $this->getNewViewDefs($viewdefs);
     $this->_fielddefs = $this->getFieldDefs();
     $this->_paneldefs = $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));
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:44,代码来源:UndeployedSidecarFilterImplementation.php


示例17: display

 function display()
 {
     global $mod_strings;
     $smarty = new Sugar_Smarty();
     require_once 'modules/ModuleBuilder/MB/ModuleBuilder.php';
     $mb = new ModuleBuilder();
     $mb->getPackage($_REQUEST['view_package']);
     $package = $mb->packages[$_REQUEST['view_package']];
     $module_name = !empty($_REQUEST['view_module']) ? $_REQUEST['view_module'] : '';
     $package->getModule($module_name);
     $this->mbModule = $package->modules[$module_name];
     $this->loadPackageHelp($module_name);
     // set up the list of either available types for a new module, or implemented types for an existing one
     $types = empty($module_name) ? MBModule::getTypes() : $this->mbModule->mbvardefs->templates;
     foreach ($types as $type => $definition) {
         $translated_type[$type] = translate('LBL_TYPE_' . strtoupper($type), 'ModuleBuilder');
     }
     natcasesort($translated_type);
     $smarty->assign('types', $translated_type);
     $smarty->assign('package', $package);
     $smarty->assign('module', $this->mbModule);
     $smarty->assign('mod_strings', $mod_strings);
     $ajax = new AjaxCompose();
     $ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.main("mb")');
     $ajax->addCrumb(' ' . $package->name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=' . $package->name . '")');
     if (empty($module_name)) {
         $module_name = translate('LBL_NEW_MODULE', 'ModuleBuilder');
     }
     $ajax->addCrumb($module_name, '');
     $html = $smarty->fetch('modules/ModuleBuilder/tpls/MBModule/module.tpl');
     if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'SaveModule') {
         $html .= "<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>";
     }
     $ajax->addSection('center', translate('LBL_SECTION_MODULE', 'ModuleBuilder'), $html);
     echo $ajax->getJavascript();
 }
开发者ID:butschster,项目名称:sugarcrm_dev,代码行数:36,代码来源:view.module.php


示例18: __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'];
     $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 . '/metadata/subpanels/default.php';
     if (file_exists($template_subpanel_def)) {
         include $template_subpanel_def;
         if (!empty($subpanel_layout['list_fields'])) {
             $this->_mergeFielddefs($this->_fielddefs, $subpanel_layout['list_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?)
     $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));
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:36,代码来源:UndeployedSubpanelImplementation.php


示例19: display

 function display()
 {
     $selected_lang = !empty($_REQUEST['relationship_lang']) ? $_REQUEST['relationship_lang'] : $_SESSION['authenticated_user_language'];
     $this->smarty = new Sugar_Smarty();
     $ac = new AjaxCompose();
     $this->fromModuleBuilder = isset($_REQUEST['MB']) || !empty($_REQUEST[ 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ModuleBuilderController类代码示例发布时间:2022-05-23
下一篇:
PHP ModuleAdminController类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap