Index: trunk/extensions/RecordAdmin/RecordAdmin_body.php |
— | — | @@ -25,8 +25,7 @@ |
26 | 26 | $wgRecordAdminTag, $wgRecordAdminTableMagic, $wgRecordAdminDataMagic; |
27 | 27 | |
28 | 28 | # Name to use for creating a new record either via RecordAdmin or a public form |
29 | | - # todo: should add a hook here for custom default-naming |
30 | | - $this->guid = strftime( '%Y%m%d', time() ) . '-' . substr( strtoupper( uniqid('', true) ), -5 ); |
| 29 | + $this->guid(); |
31 | 30 | wfLoadExtensionMessages ( 'RecordAdmin' ); |
32 | 31 | SpecialPage::SpecialPage( 'RecordAdmin', 'recordadmin', true, false, 'default', true ); |
33 | 32 | |
— | — | @@ -1087,4 +1086,11 @@ |
1088 | 1087 | return $this->guid ? substr( $this->guid, -5 ) : ''; |
1089 | 1088 | } |
1090 | 1089 | |
| 1090 | + /** |
| 1091 | + * Generate a guid - check $wgRecordAdminGuidFormat array for specialised formats |
| 1092 | + */ |
| 1093 | + function guid() { |
| 1094 | + return $this->guid = strftime( '%Y%m%d', time() ) . '-' . substr( strtoupper( uniqid('', true) ), -5 ); |
| 1095 | + } |
| 1096 | + |
1091 | 1097 | } |