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


PHP DynamicField::getAllBeanFieldsView方法代码示例

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


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

示例1: array

$required_opt = !empty($_REQUEST['required_option']) ? 'required' : 'optional';
$id = !empty($_REQUEST['id']) ? $_REQUEST['id'] : '';
if (empty($id)) {
    $custom_fields->addField($_REQUEST['name'], $label, $_REQUEST['data_type'], $max_size, $required_opt, $default_value, $ext1, $ext2, $ext3, $audit_value, $mass_update, $ext4, $help, $_REQUEST['duplicate_merge']);
} else {
    $values = array('max_size' => $max_size, 'required_option' => $required_opt, 'default_value' => $default_value, 'audited' => $audit_value, 'mass_update' => $mass_update, 'ext4' => $ext4, 'help' => $help, 'duplicate_merge' => $_REQUEST['duplicate_merge']);
    if (!empty($ext1)) {
        $values['ext1'] = $ext1;
    }
    $custom_fields->updateField($id, $values);
}
if (!empty($_REQUEST['popup'])) {
    ob_clean();
    $name = $custom_fields->getDBName($_REQUEST['name']);
    $files = StudioParser::getFiles($module);
    $view = StudioParser::getFileType($files[$_SESSION['studio']['selectedFileId']]['type']);
    $custom_fields->avail_fields = array();
    $custom_fields->getAvailableFields(true);
    $field = $custom_fields->getField($name);
    $custom_fields->bean->field_defs[$name] = $field->get_field_def();
    $custom_fields->bean->field_defs[$name]['type'] = $custom_fields->bean->field_defs[$name]['custom_type'];
    $html = $custom_fields->getAllBeanFieldsView($view, 'html');
    $html = $html[$name];
    $string = '[NAME]' . $name . '[TYPE]' . $html['fieldType'] . '[LABEL]' . translate(str_replace(array('{', '}', 'MOD.', 'mod.', 'APP.', 'app.'), '', $html['label']), $module);
    $string .= '[DATA]' . $html['html'];
    echo str_replace(array('{', '}', 'MOD.', 'mod.', 'APP.', 'app.'), '', $string);
    sugar_cleanup(true);
} else {
    header("Location: index.php?module=Studio&action=wizard&wizard=EditCustomFieldsWizard&option=ViewCustomFields");
    sugar_cleanup(true);
}
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:31,代码来源:Save.php

示例2: DynamicField

     require_once 'modules/DynamicFields/DynamicField.php';
     if (!empty($_REQUEST['mod_class'])) {
         $temp_mod = $_REQUEST['mod_class'];
         $class_name = $beanList[$temp_mod];
         $class_file = $beanFiles[$class_name];
         require_once $class_file;
         $customFields = new DynamicField($temp_mod);
     } else {
         $class_name = $beanList[$the_module];
         $class_file = $beanFiles[$class_name];
         require_once $class_file;
         $customFields = new DynamicField($the_module);
     }
     $mod = new $class_name();
     $customFields->setup($mod);
     $result = $customFields->getAllBeanFieldsView($fileType, 'html');
     foreach ($result as $f_name => $f_field) {
         $addfield->add_field($f_name, $f_field['html'], $f_field['label'], '', 'sugar_fields_MSI');
     }
 }
 $deleteFields->load_deleted_fields();
 foreach ($deleteFields->deleted_fields as $dl) {
     $addfield->add_deleted_field($dl);
 }
 $sp->parse_file($file);
 echo $sp->get_javascript_swap();
 //$view = str_replace('<!-- END: main -->',  $addfield->get_script()."\n<!-- END: main -->", $sp->get_edit_view() );
 echo $addfield->get_script();
 $view = $sp->get_edit_view();
 $slotCount = sizeof($sp->slots);
 echo "<script> setModuleName('{$the_module}'); setFileType('{$fileType}'); setSlotCount({$slotCount}); </script>";
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:31,代码来源:index.php

示例3: indexPage

 function indexPage()
 {
     if (isset($_REQUEST['edit_col_MSI'])) {
         require_once 'modules/DynamicLayout/plugins/SubPanelColParser.php';
         $sp = new SubPanelColParser();
     } else {
         $sp = new SubPanelParser();
     }
     global $beanList, $beanFiles, $mod_strings;
     //if the last request was a save lets do that
     $parent_module = $_REQUEST['select_subpanel_module'];
     $subpanel = $_REQUEST['subpanel'];
     //$layout_def = SubPanel::getSubPanelDefine($parent_module, $subpanel);
     if (!empty($_REQUEST['save_subpanel_MSI'])) {
         $sp->set_subpanel($parent_module, $subpanel);
         $sp->parse_text();
         $file = $sp->save_layout();
     }
     $sp->set_subpanel($parent_module, $subpanel);
     $sp->parse_text();
     echo $sp->get_javascript_swap();
     $view = $sp->get_edit_view();
     $prev_mod = $mod_strings;
     echo $sp->get_form();
     echo $view;
     $mod_strings = $prev_mod;
     $prev_mod = $mod_strings;
     $slotCount = sizeof($sp->slots);
     echo "<script> setModuleName('{$sp->child_module}'); setFileType('subpanel'); setSlotCount({$slotCount}); </script>";
     require_once 'modules/DynamicLayout/AddField.php';
     $addfield = new AddField();
     require_once 'modules/DynamicFields/DynamicField.php';
     $submodulename = $sp->panel->_instance_properties['module'];
     $submoduleclass = $beanList[$submodulename];
     require_once $beanFiles[$submoduleclass];
     $child_module = new $submoduleclass();
     $customFields = new DynamicField($child_module);
     $customFields->setup($child_module);
     $result = $customFields->getAllBeanFieldsView('list', 'html');
     foreach ($result as $f_name => $f_field) {
         if (isset($child_module->field_defs[$f_name]['vname'])) {
             $addfield->add_field_no_label($f_name, translate($child_module->field_defs[$f_name]['vname'], 'Contacts'), '', 'sugar_fields_MSI', true);
         }
     }
     echo $addfield->get_script();
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:46,代码来源:SubPanelParser.php


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