Configuring file registration

From ARK
Revision as of 10:47, 12 June 2008 by 86.129.124.255 (talk)

Jump to: navigation, search

First set two settings in the settings.php

 $file_upload_dir = $ark_dir . '/data/upload/';
 $file_registration_dir = $ark_dir . '/data/registered/';

Now add a field to handle the files in field_settings.php

 $conf_field_file =
   array(
       'dataclass' => 'file',
       'classtype' => 'recflag',
       'alias_tbl' => 'cor_lut_attributetype',
       'alias_col' => 'attributetype',
       'alias_src_key' => 'recflag',
       'alias_type' => '1',
       'editable' => TRUE,
       'hidden' => FALSE,
       'add_validation' => $attr_add_validation,
       'edt_validation' => $attr_edt_validation
 );

Finally add the field to the conf_register array in the mod_settings file, for example:

 $conf_register =
   array(
       'view_state' => 'max',
       'edit_state' => 'edit',
       'sf_title' => 'register', //appears in the titlebar of the subform (mk nname)
       'sf_html_id' => 'sph_cd_register', //the form id tag (must be unique)
       'script' => 'php/data_entry/register.php',
       'op_label' => 'save',
       'op_input' => 'save',
       'op_reg_mode' => 'sgl',
       'op_no_rows' => 15,
       'fields' => 
           array(
               $conf_field_itemkey,
               $conf_field_short_desc,
               $conf_field_cxtxmi,
               $conf_field_takenby,
               $conf_field_takenon,
               $conf_field_file,
               $conf_reg_op
       )
 );