r65352 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65351‎ | r65352 | r65353 >
Date:02:05, 21 April 2010
Author:nad
Status:deferred
Tags:
Comment:
Move guid generation into its own method
Modified paths:
  • /trunk/extensions/RecordAdmin/RecordAdmin_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/RecordAdmin/RecordAdmin_body.php
@@ -25,8 +25,7 @@
2626 $wgRecordAdminTag, $wgRecordAdminTableMagic, $wgRecordAdminDataMagic;
2727
2828 # 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();
3130 wfLoadExtensionMessages ( 'RecordAdmin' );
3231 SpecialPage::SpecialPage( 'RecordAdmin', 'recordadmin', true, false, 'default', true );
3332
@@ -1087,4 +1086,11 @@
10881087 return $this->guid ? substr( $this->guid, -5 ) : '';
10891088 }
10901089
 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+
10911097 }

Status & tagging log