Page MenuHomePhabricator

SMW-last-editor_is-a-new-page-2.patch

Authored By
bzimport
Nov 22 2014, 12:11 AM
Size
3 KB
Referenced Files
None
Subscribers
None

SMW-last-editor_is-a-new-page-2.patch

Index: languages/SMW_LanguageEn.php
===================================================================
--- languages/SMW_LanguageEn.php (revision 111228)
+++ languages/SMW_LanguageEn.php (working copy)
@@ -66,6 +66,8 @@
'_PVAL' => 'Allows value',
'_MDAT' => 'Modification date',
'_CDAT' => 'Creation date',
+ '_NEWP' => 'Is a new page',
+ '_LEDT' => 'Last editor is',
'_ERRP' => 'Has improper value for',
'_LIST' => 'Has fields',
'_SOBJ' => 'Has subobject',
Index: languages/SMW_Language.php
===================================================================
--- languages/SMW_Language.php (revision 111228)
+++ languages/SMW_Language.php (working copy)
@@ -80,6 +80,8 @@
'Allows value' => '_PVAL',
'Modification date' => '_MDAT',
'Creation date' => '_CDAT',
+ 'Is a new page' => '_NEWP',
+ 'Last editor is' => '_LEDT',
'Has improper value for' => '_ERRP',
'Has fields' => '_LIST',
'Has subobject' => '_SOBJ',
Index: languages/SMW_LanguageRu.php
===================================================================
--- languages/SMW_LanguageRu.php (revision 111228)
+++ languages/SMW_LanguageRu.php (working copy)
@@ -62,6 +62,8 @@
'_PVAL' => 'Допустимое значение',
'_MDAT' => 'Дата последней правки',
'_CDAT' => 'Дата создания',
+ '_NEWP' => 'Новая страница',
+ '_LEDT' => 'Последний редактор',
'_ERRP' => 'Has improper value for', // TODO: translate
'_LIST' => 'Имеет поля',
'_SOBJ' => 'Has subobject', // TODO: translate
Index: includes/SMW_ParseData.php
===================================================================
--- includes/SMW_ParseData.php (revision 111228)
+++ includes/SMW_ParseData.php (working copy)
@@ -204,6 +204,14 @@
$timestamp = $title->getFirstRevision()->getTimestamp();
$datum = self::getDataItemFromMWTimestamp( $timestamp );
break;
+ case '_NEWP' :
+ $datum = new SMWDIBoolean( $title->isNewPage() );
+ break;
+ case '_LEDT' :
+ $revision = Revision::newFromId( $title->getLatestRevID() );
+ $user = User::newFromId( $revision->getUser() );
+ $datum = SMWDIWikiPage::newFromTitle( $user->getUserPage() );
+ break;
}
if ( !is_null( $datum ) ) {
Index: includes/storage/SMW_SQLStore2.php
===================================================================
--- includes/storage/SMW_SQLStore2.php (revision 111228)
+++ includes/storage/SMW_SQLStore2.php (working copy)
@@ -73,6 +73,8 @@
'_LIST' => 28,
'_MDAT' => 29,
'_CDAT' => 30,
+ '_NEWP' => 31,
+ '_LEDT' => 32,
);
/// Use special tables for Very Important Properties
Index: includes/dataitems/SMW_DI_Property.php
===================================================================
--- includes/dataitems/SMW_DI_Property.php (revision 111228)
+++ includes/dataitems/SMW_DI_Property.php (working copy)
@@ -331,6 +331,8 @@
'_CONC' => array( '__con', false ), // associated concept
'_MDAT' => array( '_dat', false ), // "modification date"
'_CDAT' => array( '_dat', false ), // "creation date"
+ '_NEWP' => array( '_boo', false ), // "page is new"
+ '_LEDT' => array( '_wpg', false ), // "page is new"
'_ERRP' => array( '_wpp', false ), // "has improper value for"
'_LIST' => array( '__pls', true ), // "has fields"
'_SKEY' => array( '__key', false ), // sort key of a page

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
8391
Default Alt Text
SMW-last-editor_is-a-new-page-2.patch (3 KB)

Event Timeline