Index: trunk/extensions/EducationProgram/pages/EPPage.php |
— | — | @@ -165,6 +165,10 @@ |
166 | 166 | return static::$info['list']; |
167 | 167 | } |
168 | 168 | |
| 169 | + public function getLogType() { |
| 170 | + return static::$info['log-type']; |
| 171 | + } |
| 172 | + |
169 | 173 | public static function displayDeletionLog( IContextSource $context, $messageKey ) { |
170 | 174 | $out = $context->getOutput(); |
171 | 175 | |
Index: trunk/extensions/EducationProgram/includes/EPOrgs.php |
— | — | @@ -143,4 +143,12 @@ |
144 | 144 | return EP_NS_INSTITUTION; |
145 | 145 | } |
146 | 146 | |
| 147 | + /** |
| 148 | + * (non-PHPdoc) |
| 149 | + * @see EPPageTable::getEditRight() |
| 150 | + */ |
| 151 | + public function getEditRight() { |
| 152 | + return 'ep-org'; |
| 153 | + } |
| 154 | + |
147 | 155 | } |
Index: trunk/extensions/EducationProgram/includes/EPPageTable.php |
— | — | @@ -31,6 +31,15 @@ |
32 | 32 | */ |
33 | 33 | public abstract function getNamespace(); |
34 | 34 | |
| 35 | + /** |
| 36 | + * Returns the right needed to edit items in this table. |
| 37 | + * |
| 38 | + * @since 0.1 |
| 39 | + * |
| 40 | + * @return string |
| 41 | + */ |
| 42 | + public abstract function getEditRight(); |
| 43 | + |
35 | 44 | public function hasIdentifier( $identifier ) { |
36 | 45 | return $this->has( array( $this->getIdentifierField() => $identifier ) ); |
37 | 46 | } |
— | — | @@ -69,17 +78,6 @@ |
70 | 79 | } |
71 | 80 | |
72 | 81 | /** |
73 | | - * (non-PHPdoc) |
74 | | - * @see EPRevisionedObject::getLogInfo() |
75 | | - */ |
76 | | - public function getLogInfoForTitle( Title $title ) { |
77 | | - return array( |
78 | | - 'type' => static::$info['log-type'], |
79 | | - 'title' => $title, |
80 | | - ); |
81 | | - } |
82 | | - |
83 | | - /** |
84 | 82 | * Construct a new title for an object of this type with the provided identifier value. |
85 | 83 | * |
86 | 84 | * @since 0.1 |
Index: trunk/extensions/EducationProgram/includes/EPPageObject.php |
— | — | @@ -59,7 +59,7 @@ |
60 | 60 | * @see DBDataObject::save() |
61 | 61 | */ |
62 | 62 | public function save() { |
63 | | - if ( $this->hasField( $this->getIdentifierField() ) && is_null( $this->getTitle() ) ) { |
| 63 | + if ( $this->hasField( $this->table->getIdentifierField() ) && is_null( $this->getTitle() ) ) { |
64 | 64 | throw new MWException( 'The title for a EPPageObject needs to be valid when saving.' ); |
65 | 65 | return false; |
66 | 66 | } |
— | — | @@ -78,7 +78,10 @@ |
79 | 79 | return false; |
80 | 80 | } |
81 | 81 | else { |
82 | | - return $this->table->getLogInfoForTitle( $this->getTitle() ); |
| 82 | + return array( |
| 83 | + 'type' => EPPage::factory( $title )->getLogType(), |
| 84 | + 'title' => $title, |
| 85 | + ); |
83 | 86 | } |
84 | 87 | } |
85 | 88 | |
Index: trunk/extensions/EducationProgram/includes/EPRevisionPager.php |
— | — | @@ -107,8 +107,7 @@ |
108 | 108 | ); |
109 | 109 | } |
110 | 110 | |
111 | | - // TODO: $this->getUser()->isAllowed( $this->table->getEditRight() ) |
112 | | - if ( false ) { |
| 111 | + if ( $this->getUser()->isAllowed( $this->table->getEditRight() ) ) { |
113 | 112 | $actionLinks = array(); |
114 | 113 | |
115 | 114 | if ( $this->mOffset !== '' || $this->rowNr < $this->mResult->numRows() - 1 ) { |
Index: trunk/extensions/EducationProgram/includes/EPCourses.php |
— | — | @@ -175,4 +175,12 @@ |
176 | 176 | return $conditions; |
177 | 177 | } |
178 | 178 | |
| 179 | + /** |
| 180 | + * (non-PHPdoc) |
| 181 | + * @see EPPageTable::getEditRight() |
| 182 | + */ |
| 183 | + public function getEditRight() { |
| 184 | + return 'ep-course'; |
| 185 | + } |
| 186 | + |
179 | 187 | } |