當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ModuleBuilder::save方法代碼示例

本文整理匯總了PHP中ModuleBuilder::save方法的典型用法代碼示例。如果您正苦於以下問題:PHP ModuleBuilder::save方法的具體用法?PHP ModuleBuilder::save怎麽用?PHP ModuleBuilder::save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ModuleBuilder的用法示例。


在下文中一共展示了ModuleBuilder::save方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: DynamicField

 function action_DeleteField()
 {
     require_once 'modules/DynamicFields/FieldCases.php';
     $field = get_widget($_REQUEST['type']);
     $field->name = $_REQUEST['name'];
     if (!isset($_REQUEST['view_package'])) {
         if (!empty($_REQUEST['name']) && !empty($_REQUEST['view_module'])) {
             require_once 'modules/DynamicFields/DynamicField.php';
             $moduleName = $_REQUEST['view_module'];
             // bug 51325 make sure we make this switch or delete will not work
             if ($moduleName == 'Employees') {
                 $moduleName = 'Users';
             }
             $class_name = $GLOBALS['beanList'][$moduleName];
             require_once $GLOBALS['beanFiles'][$class_name];
             $seed = new $class_name();
             $df = new DynamicField($moduleName);
             $df->setup($seed);
             //Need to load the entire field_meta_data for some field types
             $field = $df->getFieldWidget($moduleName, $field->name);
             $field->delete($df);
             $GLOBALS['mod_strings']['LBL_ALL_MODULES'] = 'all_modules';
             $_REQUEST['execute_sql'] = true;
             include_once 'modules/Administration/QuickRepairAndRebuild.php';
             $repair = new RepairAndClear();
             $repair->repairAndClearAll(array('rebuildExtensions', 'clearVardefs', 'clearTpls'), array($class_name), true, false);
             require_once 'modules/ModuleBuilder/Module/StudioModuleFactory.php';
             $module = StudioModuleFactory::getStudioModule($moduleName);
         }
     } else {
         $mb = new ModuleBuilder();
         $module =& $mb->getPackageModule($_REQUEST['view_package'], $_REQUEST['view_module']);
         $field = $module->getField($field->name);
         $field->delete($module);
         $mb->save();
     }
     $module->removeFieldFromLayouts($field->name);
     $this->view = 'modulefields';
     if (isset($GLOBALS['current_language']) && isset($_REQUEST['label']) && isset($_REQUEST['labelValue']) && isset($_REQUEST['view_module'])) {
         $this->DeleteLabel($GLOBALS['current_language'], $_REQUEST['label'], $_REQUEST['labelValue'], $_REQUEST['view_module']);
     }
 }
開發者ID:butschster,項目名稱:sugarcrm_dev,代碼行數:42,代碼來源:controller.php

示例2: DynamicField

 function action_DeleteField()
 {
     require_once 'modules/DynamicFields/FieldCases.php';
     $field = get_widget($_POST['type']);
     $field->name = $_REQUEST['name'];
     if (!isset($_REQUEST['view_package'])) {
         if (!empty($_REQUEST['name']) && !empty($_REQUEST['view_module'])) {
             require_once 'modules/DynamicFields/DynamicField.php';
             $moduleName = $_REQUEST['view_module'];
             $class_name = $GLOBALS['beanList'][$moduleName];
             require_once $GLOBALS['beanFiles'][$class_name];
             $seed = new $class_name();
             $df = new DynamicField($moduleName);
             $df->setup($seed);
             //Need to load the entire field_meta_data for some field types
             $field = $df->getFieldWidget($moduleName, $field->name);
             $field->delete($df);
             require_once 'modules/ModuleBuilder/Module/StudioModule.php';
             $module = new StudioModule($moduleName);
         }
     } else {
         $mb = new ModuleBuilder();
         $module =& $mb->getPackageModule($_REQUEST['view_package'], $_REQUEST['view_module']);
         $field->delete($module);
         $mb->save();
     }
     $module->removeFieldFromLayouts($field->name);
     $this->view = 'modulefields';
 }
開發者ID:klr2003,項目名稱:sourceread,代碼行數:29,代碼來源:controller.php

示例3: action_DeleteField

 public function action_DeleteField()
 {
     $field = get_widget($_REQUEST['type']);
     $field->name = $_REQUEST['name'];
     if (!isset($_REQUEST['view_package'])) {
         if (!empty($_REQUEST['name']) && !empty($_REQUEST['view_module'])) {
             $moduleName = $_REQUEST['view_module'];
             // bug 51325 make sure we make this switch or delete will not work
             if ($moduleName == 'Employees') {
                 $moduleName = 'Users';
             }
             $seed = BeanFactory::getBean($moduleName);
             $df = new DynamicField($moduleName);
             $df->setup($seed);
             //Need to load the entire field_meta_data for some field types
             $field = $df->getFieldWidget($moduleName, $field->name);
             $field->delete($df);
             $GLOBALS['mod_strings']['LBL_ALL_MODULES'] = 'all_modules';
             $_REQUEST['execute_sql'] = true;
             include_once 'modules/Administration/QuickRepairAndRebuild.php';
             $repair = new RepairAndClear();
             $repair->repairAndClearAll(array('rebuildExtensions', 'clearVardefs', 'clearTpls'), array($moduleName), true, false);
             require_once 'modules/ModuleBuilder/Module/StudioModuleFactory.php';
             $module = StudioModuleFactory::getStudioModule($moduleName);
         }
     } else {
         $mb = new ModuleBuilder();
         $module =& $mb->getPackageModule($_REQUEST['view_package'], $_REQUEST['view_module']);
         $field = $module->getField($field->name);
         $field->delete($module);
         $mb->save();
     }
     $module->removeFieldFromLayouts($field->name);
     $this->view = 'modulefields';
     if (isset($GLOBALS['current_language']) && isset($_REQUEST['label']) && isset($_REQUEST['labelValue']) && isset($_REQUEST['view_module'])) {
         $this->DeleteLabel($GLOBALS['current_language'], $_REQUEST['label'], $_REQUEST['labelValue'], $_REQUEST['view_module']);
         $this->metadataApiCacheCleared = true;
     }
     // Clear the metadata cache if it hasn't been done already
     if (!$this->metadataApiCacheCleared && !empty($moduleName)) {
         // This removes the labels associated with the field and rebuilds
         // the api cache for the module
         $repair->module_list = array($moduleName);
         $repair->repairMetadataAPICache('labels');
     }
 }
開發者ID:jglaine,項目名稱:sugar761-ent,代碼行數:46,代碼來源:controller.php


注:本文中的ModuleBuilder::save方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。