当前位置: 首页>>代码示例>>PHP>>正文


PHP ModuleInstaller::rebuild_layoutdefs方法代码示例

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


在下文中一共展示了ModuleInstaller::rebuild_layoutdefs方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: tearDown

 public function tearDown()
 {
     SugarTestUserUtilities::removeAllCreatedAnonymousUsers();
     unset($GLOBALS['current_user']);
     require_once 'ModuleInstall/ModuleInstaller.php';
     $moduleInstaller = new ModuleInstaller();
     $moduleInstaller->silent = true;
     // make sure that the ModuleInstaller->log() function doesn't echo while rebuilding the layoutdefs
     $moduleInstaller->rebuild_layoutdefs();
 }
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:10,代码来源:ITR27836Test.php

示例2: saveSubPanelDefOverride

 function saveSubPanelDefOverride($panel, $subsection, $override)
 {
     global $layout_defs, $beanList;
     //save the new subpanel
     $name = "subpanel_layout['list_fields']";
     //bugfix: load looks for moduleName/metadata/subpanels, not moduleName/subpanels
     $path = 'custom/modules/' . $panel->_instance_properties['module'] . '/metadata/subpanels';
     //bug# 40171: "Custom subpanels not working as expected"
     //each custom subpanel needs to have a unique custom def file
     $filename = $panel->parent_bean->object_name . "_subpanel_" . $panel->name;
     //bug 42262 (filename with $panel->_instance_properties['get_subpanel_data'] can create problem if had word "function" in it)
     $oldName1 = '_override' . $panel->parent_bean->object_name . $panel->_instance_properties['module'] . $panel->_instance_properties['subpanel_name'];
     $oldName2 = '_override' . $panel->parent_bean->object_name . $panel->_instance_properties['get_subpanel_data'];
     if (file_exists('custom/Extension/modules/' . $panel->parent_bean->module_dir . "/Ext/Layoutdefs/{$oldName1}.php")) {
         unlink('custom/Extension/modules/' . $panel->parent_bean->module_dir . "/Ext/Layoutdefs/{$oldName1}.php");
     }
     if (file_exists('custom/Extension/modules/' . $panel->parent_bean->module_dir . "/Ext/Layoutdefs/{$oldName2}.php")) {
         unlink('custom/Extension/modules/' . $panel->parent_bean->module_dir . "/Ext/Layoutdefs/{$oldName2}.php");
     }
     $extname = '_override' . $filename;
     //end of bug# 40171
     mkdir_recursive($path, true);
     write_array_to_file($name, $override, $path . '/' . $filename . '.php');
     //save the override for the layoutdef
     //tyoung 10.12.07 pushed panel->name to lowercase to match case in subpaneldefs.php files -
     //gave error on bad index 'module' as this override key didn't match the key in the subpaneldefs
     $name = "layout_defs['" . $panel->parent_bean->module_dir . "']['subpanel_setup']['" . strtolower($panel->name) . "']";
     //  	$GLOBALS['log']->debug('SubPanel.php->saveSubPanelDefOverride(): '.$name);
     $newValue = override_value_to_string($name, 'override_subpanel_name', $filename);
     mkdir_recursive('custom/Extension/modules/' . $panel->parent_bean->module_dir . '/Ext/Layoutdefs', true);
     $fp = sugar_fopen('custom/Extension/modules/' . $panel->parent_bean->module_dir . "/Ext/Layoutdefs/{$extname}.php", 'w');
     fwrite($fp, "<?php\n//auto-generated file DO NOT EDIT\n{$newValue}\n?>");
     fclose($fp);
     require_once 'ModuleInstall/ModuleInstaller.php';
     $moduleInstaller = new ModuleInstaller();
     $moduleInstaller->silent = true;
     // make sure that the ModuleInstaller->log() function doesn't echo while rebuilding the layoutdefs
     $moduleInstaller->rebuild_layoutdefs();
     if (file_exists('modules/' . $panel->parent_bean->module_dir . '/layout_defs.php')) {
         include 'modules/' . $panel->parent_bean->module_dir . '/layout_defs.php';
     }
     if (file_exists('custom/modules/' . $panel->parent_bean->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php')) {
         include 'custom/modules/' . $panel->parent_bean->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php';
     }
 }
开发者ID:recci,项目名称:SuiteCRM,代码行数:45,代码来源:SubPanel.php

示例3: rebuildExtensions

 /**
  * Rebuild extension cache for updated modules.
  * Need for covering class by test.
  * @param array $modules
  */
 protected function rebuildExtensions($modules)
 {
     if (!empty($modules)) {
         $mi = new ModuleInstaller();
         $mi->modules = $modules;
         $mi->rebuild_layoutdefs();
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:13,代码来源:4_ClearSubpanels.php

示例4: saveSubPanelDefOverride

 function saveSubPanelDefOverride($panel, $subsection, $override)
 {
     global $layout_defs, $beanList;
     //save the new subpanel
     $name = "subpanel_layout['list_fields']";
     $path = 'custom/modules/' . $panel->_instance_properties['module'] . '/subpanels';
     $filename = $panel->parent_bean->object_name . $panel->_instance_properties['subpanel_name'];
     $extname = $panel->parent_bean->object_name . $panel->_instance_properties['module'] . $panel->_instance_properties['subpanel_name'];
     mkdir_recursive('custom/modules/' . $panel->_instance_properties['module'] . '/subpanels', true);
     write_array_to_file($name, $override, $path . '/' . $filename . '.php');
     //save the override for the layoutdef
     $name = "layout_defs['" . $panel->parent_bean->module_dir . "']['subpanel_setup']['" . $panel->name . "']";
     $newValue = override_value_to_string($name, 'override_subpanel_name', $filename);
     mkdir_recursive('custom/Extension/modules/' . $panel->parent_bean->module_dir . '/Ext/Layoutdefs', true);
     $fp = fopen('custom/Extension/modules/' . $panel->parent_bean->module_dir . "/Ext/Layoutdefs/{$extname}.php", 'w');
     fwrite($fp, "<?php\n//auto-generated file DO NOT EDIT\n{$newValue}\n?>");
     fclose($fp);
     require_once 'ModuleInstall/ModuleInstaller.php';
     $moduleInstaller = new ModuleInstaller();
     $moduleInstaller->rebuild_layoutdefs();
     include 'modules/' . $panel->parent_bean->module_dir . '/layout_defs.php';
     include 'custom/modules/' . $panel->parent_bean->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php';
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:23,代码来源:SubPanel.php


注:本文中的ModuleInstaller::rebuild_layoutdefs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。