本文整理汇总了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']);
}
}
示例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';
}
示例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');
}
}