當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。