-/**
- * Aliases for backwards compatibility with 1.6
- */
-define( 'MW_LOG_DELETED_ACTION', LogPage::DELETED_ACTION );
-define( 'MW_LOG_DELETED_USER', LogPage::DELETED_USER );
-define( 'MW_LOG_DELETED_COMMENT', LogPage::DELETED_COMMENT );
-define( 'MW_LOG_DELETED_RESTRICTED', LogPage::DELETED_RESTRICTED );
+
+ /**
+ * Name of the log.
+ * @return Message
+ * @since 1.19
+ */
+ public function getName() {
+ global $wgLogNames;
+
+ // BC
+ if ( isset( $wgLogNames[$this->type] ) ) {
+ $key = $wgLogNames[$this->type];
+ } else {
+ $key = 'log-name-' . $this->type;
+ }
+
+ return wfMessage( $key );
+ }
+
+ /**
+ * Description of this log type.
+ * @return Message
+ * @since 1.19
+ */
+ public function getDescription() {
+ global $wgLogHeaders;
+ // BC
+ if ( isset( $wgLogHeaders[$this->type] ) ) {
+ $key = $wgLogHeaders[$this->type];
+ } else {
+ $key = 'log-description-' . $this->type;
+ }
+ return wfMessage( $key );
+ }
+
+ /**
+ * Returns the right needed to read this log type.
+ * @return string
+ * @since 1.19
+ */
+ public function getRestriction() {
+ global $wgLogRestrictions;
+ if ( isset( $wgLogRestrictions[$this->type] ) ) {
+ $restriction = $wgLogRestrictions[$this->type];
+ } else {
+ // '' always returns true with $user->isAllowed()
+ $restriction = '';
+ }
+ return $restriction;
+ }
+
+ /**
+ * Tells if this log is not viewable by all.
+ * @return bool
+ * @since 1.19
+ */
+ public function isRestricted() {
+ $restriction = $this->getRestriction();
+ return $restriction !== '' && $restriction !== '*';
+ }
+
+}