PHP   发布时间:2022-04-04  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了php-自定义形式的Drupal Imagfield / Filefield大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

我已经创建了一个带有此功能的模块:

<?PHP
function ils_ladda_upp_form() {
    $form['upload'] = array(
        '#method' => 'post',
        '#attributes' => array(
            'enctype' => 'multipart/form-data',
        )
    );
    $form['upload']['album_name'] = array(
        '#type' => 'textfield',
        '#title' => t('Albumnamn'),
        '#required' => 1
    );
    $form['upload']['album_LOCATIOn'] = array(
        '#type' => 'textfield',
        '#title' => t('Plats'),
    );
    $form['upload']['album_date'] = array(
        '#type' => 'date',
        '#title' => t('Datum'),
        '#required' => 1,
        '#suffix' => '(då bilderna togs)'
    );
    $form['upload']['album_description'] = array(
        '#type' => 'textarea',
        '#title' => t('Beskrivning'),
        '#resizable' => false,
    );
    $form['upload']['school'] = array(
        '#type' => 'hierarchical_SELEct',
        '#title' => t('Skola & Klass'),
        '#size' => 1,
        '#required' => 1,
        '#config' => array(
            'module' => 'hs_taxonomy',
            'params' => array(
            'vid' => 1,
            ),
            'save_lineage'    => 0,
            'enforce_deepest' => 0,
            'entity_count'    => 0,
            'require_entity'  => 0,
            'resizable'       => 0,
            'level_labels' => array(
            'status' => 0,
            'labels' => array(
                0 => t('Main category'),
                1 => t('Subcategory'),
                2 => t('Third level category'),
            ),
        ),
            'dropBox' => array(
            'status'   => 0,
            'title'    => t('All SELEctions'),
            'limit'    => 0,
            'reset_hs' => 1,
        ),
            'editability' => array(
            'status'           => 0,
            'item_types'       => array(),
            'allowed_levels'   => array(
            0 => 0,
            1 => 0,
            2 => 1,
            ),
            'allow_new_levels' => 0,
            'max_levels'       => 3,
        ),
            # these setTings cAnnot be configured through the UI: they can only be
            # overridden through code.
            'animation_delay'    => 400,
            'special_items'      => array(),
            'render_flat_SELEct' => 0,
            'path'               => 'hierarchical_SELEct_json',
        ),
        #'#default_value' => '83',
    );
    $form['upload']['file'] = array(
        '#type' => 'file',
        '#title' => t('Bild'),
    );
    $form['upload']['name'] = array(
        '#type' => 'textfield',
        '#required' => true,
        '#title' => t('Ditt namn')
    );
    $form['upload']['submit'] = array('#type' => 'submit', '#value' => t('Ladda upp'));
    return $form['upload'];
}
?>

是否可以在表单中插入CCK Filefield / imagefield?如果是这样,我该怎么办

Drupal v.6.15

问候,
乔尔

解决方法:

像这样? http://sysadminsjourney.com/content/2010/01/26/display-cck-filefield-or-imagefield-upload-widget-your-own-custom-form

大佬总结

以上是大佬教程为你收集整理的php-自定义形式的Drupal Imagfield / Filefield全部内容,希望文章能够帮你解决php-自定义形式的Drupal Imagfield / Filefield所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: