function admin_create_metadata()
 {
     $request =& HTTPRequest::instance();
     $_gid = (int) $request->get('group_id');
     $_name = trim($request->get('name'));
     $_description = $request->get('descr');
     $_emptyallowed = (int) $request->get('empty_allowed');
     $_multiplevaluesallowed = (int) $request->get('multiplevalues_allowed');
     $_dfltvalue = $request->get('dflt_value');
     $_useit = $request->get('use_it');
     $_type = (int) $request->get('type');
     $mdFactory = new Docman_MetadataFactory($_gid);
     //$mdrow['group_id'] = $_gid;
     $mdrow['name'] = $_name;
     $mdrow['description'] = $_description;
     $mdrow['data_type'] = $_type;
     //$mdrow['label'] =
     $mdrow['required'] = false;
     $mdrow['empty_ok'] = $_emptyallowed;
     if ($_type == PLUGIN_DOCMAN_METADATA_TYPE_LIST) {
         $mdrow['mul_val_ok'] = $_multiplevaluesallowed;
     } else {
         $mdrow['mul_val_ok'] = false;
     }
     $mdrow['special'] = false;
     $mdrow['default_value'] = $_dfltvalue;
     $mdrow['use_it'] = $_useit;
     $md =& $mdFactory->_createFromRow($mdrow);
     $mdId = $mdFactory->create($md);
     if ($mdId !== false) {
         $this->_controler->feedback->log('info', $GLOBALS['Language']->getText('plugin_docman', 'admin_metadata_create'));
     } else {
         $this->_controler->feedback->log('error', $GLOBALS['Language']->getText('plugin_docman', 'admin_metadata_error_creation'));
     }
 }