当前位置: 首页>>代码示例>>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;未经允许,请勿转载。