Index: trunk/extensions/EducationProgram/EducationProgram.php |
— | — | @@ -92,6 +92,7 @@ |
93 | 93 | $wgAutoloadClasses['EPRevision'] = dirname( __FILE__ ) . '/includes/EPRevision.php'; |
94 | 94 | $wgAutoloadClasses['EPRevisionPager'] = dirname( __FILE__ ) . '/includes/EPRevisionPager.php'; |
95 | 95 | $wgAutoloadClasses['EPPageObject'] = dirname( __FILE__ ) . '/includes/EPPageObject.php'; |
| 96 | +$wgAutoloadClasses['EPPageTable'] = dirname( __FILE__ ) . '/includes/EPPageTable.php'; |
96 | 97 | $wgAutoloadClasses['EPFailForm'] = dirname( __FILE__ ) . '/includes/EPFailForm.php'; |
97 | 98 | $wgAutoloadClasses['EPIRole'] = dirname( __FILE__ ) . '/includes/EPIRole.php'; |
98 | 99 | $wgAutoloadClasses['EPRevisionedObject'] = dirname( __FILE__ ) . '/includes/EPRevisionedObject.php'; |
— | — | @@ -107,6 +108,7 @@ |
108 | 109 | $wgAutoloadClasses['EPCAs'] = dirname( __FILE__ ) . '/includes/EPCAs.php'; |
109 | 110 | $wgAutoloadClasses['EPInstructors'] = dirname( __FILE__ ) . '/includes/EPInstructors.php'; |
110 | 111 | $wgAutoloadClasses['EPRevisions'] = dirname( __FILE__ ) . '/includes/EPRevisions.php'; |
| 112 | +$wgAutoloadClasses['EPArticles'] = dirname( __FILE__ ) . '/includes/EPArticles.php'; |
111 | 113 | |
112 | 114 | $wgAutoloadClasses['CoursePage'] = dirname( __FILE__ ) . '/pages/CoursePage.php'; |
113 | 115 | $wgAutoloadClasses['EPPage'] = dirname( __FILE__ ) . '/pages/EPPage.php'; |
Index: trunk/extensions/EducationProgram/actions/ViewCourseAction.php |
— | — | @@ -13,15 +13,23 @@ |
14 | 14 | * @author Jeroen De Dauw < jeroendedauw@gmail.com > |
15 | 15 | */ |
16 | 16 | class ViewCourseAction extends EPViewAction { |
17 | | - |
| 17 | + |
| 18 | + /** |
| 19 | + * Constructor. |
| 20 | + * |
| 21 | + * @since 0.1 |
| 22 | + * |
| 23 | + * @param Page $page |
| 24 | + * @param IContextSource $context |
| 25 | + */ |
| 26 | + protected function __construct( Page $page, IContextSource $context = null ) { |
| 27 | + parent::__construct( $page, $context, EPCourses::singleton() ); |
| 28 | + } |
| 29 | + |
18 | 30 | public function getName() { |
19 | 31 | return 'viewcourse'; |
20 | 32 | } |
21 | 33 | |
22 | | - protected function getItemClass() { |
23 | | - return 'EPCourse'; |
24 | | - } |
25 | | - |
26 | 34 | protected function displayPage( DBDataObject $course ) { |
27 | 35 | parent::displayPage( $course ); |
28 | 36 | |
— | — | @@ -62,8 +70,8 @@ |
63 | 71 | protected function getSummaryData( DBDataObject $course ) { |
64 | 72 | $stats = array(); |
65 | 73 | |
66 | | - $orgName = EPOrg::selectFieldsRow( 'name', array( 'id' => $course->getField( 'org_id' ) ) ); |
67 | | - $stats['org'] = EPOrg::getLinkFor( $orgName ); |
| 74 | + $orgName = EPOrgs::singleton()->selectFieldsRow( 'name', array( 'id' => $course->getField( 'org_id' ) ) ); |
| 75 | + $stats['org'] = EPOrgs::singleton()->getLinkFor( $orgName ); |
68 | 76 | |
69 | 77 | $lang = $this->getLanguage(); |
70 | 78 | |
Index: trunk/extensions/EducationProgram/actions/EditOrgAction.php |
— | — | @@ -13,8 +13,20 @@ |
14 | 14 | * @author Jeroen De Dauw < jeroendedauw@gmail.com > |
15 | 15 | */ |
16 | 16 | class EditOrgAction extends EPEditAction { |
17 | | - |
| 17 | + |
18 | 18 | /** |
| 19 | + * Constructor. |
| 20 | + * |
| 21 | + * @since 0.1 |
| 22 | + * |
| 23 | + * @param Page $page |
| 24 | + * @param IContextSource $context |
| 25 | + */ |
| 26 | + protected function __construct( Page $page, IContextSource $context = null ) { |
| 27 | + parent::__construct( $page, $context, EPOrgs::singleton() ); |
| 28 | + } |
| 29 | + |
| 30 | + /** |
19 | 31 | * (non-PHPdoc) |
20 | 32 | * @see Action::getName() |
21 | 33 | */ |
— | — | @@ -32,14 +44,6 @@ |
33 | 45 | |
34 | 46 | /** |
35 | 47 | * (non-PHPdoc) |
36 | | - * @see EPEditAction::getItemClass() |
37 | | - */ |
38 | | - protected function getItemClass() { |
39 | | - return 'EPOrg'; |
40 | | - } |
41 | | - |
42 | | - /** |
43 | | - * (non-PHPdoc) |
44 | 48 | * @see Action::getRestriction() |
45 | 49 | */ |
46 | 50 | public function getRestriction() { |
Index: trunk/extensions/EducationProgram/actions/EPViewAction.php |
— | — | @@ -15,13 +15,24 @@ |
16 | 16 | abstract class EPViewAction extends FormlessAction { |
17 | 17 | |
18 | 18 | /** |
19 | | - * Returns the class name of the DBDataObject this action handles. |
| 19 | + * @since 0.1 |
| 20 | + * @var DBTable |
| 21 | + */ |
| 22 | + protected $table; |
| 23 | + |
| 24 | + /** |
| 25 | + * Constructor. |
20 | 26 | * |
21 | 27 | * @since 0.1 |
22 | 28 | * |
23 | | - * @return string |
| 29 | + * @param Page $page |
| 30 | + * @param IContextSource $context |
| 31 | + * @param DBTable $table |
24 | 32 | */ |
25 | | - protected abstract function getItemClass(); |
| 33 | + protected function __construct( Page $page, IContextSource $context = null, DBTable $table ) { |
| 34 | + $this->table = $table; |
| 35 | + parent::__construct( $page, $context ); |
| 36 | + } |
26 | 37 | |
27 | 38 | /** |
28 | 39 | * (non-PHPdoc) |
— | — | @@ -30,12 +41,11 @@ |
31 | 42 | public function onView() { |
32 | 43 | $out = $this->getOutput(); |
33 | 44 | $name = $this->getTitle()->getText(); |
34 | | - $class = $this->getItemClass(); |
35 | 45 | |
36 | 46 | $object = false; |
37 | 47 | |
38 | 48 | if ( $this->getRequest()->getCheck( 'revid' ) ) { |
39 | | - $currentObject = $class::get( $name, 'id' ); |
| 49 | + $currentObject = $this->table->get( $name, 'id' ); |
40 | 50 | |
41 | 51 | if ( $currentObject !== false ) { |
42 | 52 | $rev = EPRevision::selectRow( null, array( |
— | — | @@ -54,19 +64,19 @@ |
55 | 65 | } |
56 | 66 | |
57 | 67 | if ( $object === false ) { |
58 | | - $object = $class::get( $name ); |
| 68 | + $object = $this->table->get( $name ); |
59 | 69 | } |
60 | 70 | |
61 | 71 | if ( $object === false ) { |
62 | 72 | $this->displayNavigation(); |
63 | 73 | |
64 | | - if ( $this->getUser()->isAllowed( $class::getEditRight() ) ) { |
| 74 | + if ( $this->getUser()->isAllowed( $this->table->getEditRight() ) ) { |
65 | 75 | $out->redirect( $this->getTitle()->getLocalURL( array( 'action' => 'edit' ) ) ); |
66 | 76 | } |
67 | 77 | else { |
68 | 78 | $out->addWikiMsg( strtolower( get_called_class() ) . '-none', $name ); |
69 | | - |
70 | | - $class::displayDeletionLog( |
| 79 | + |
| 80 | + $this->table->displayDeletionLog( |
71 | 81 | $this->getContext(), |
72 | 82 | 'ep-' . strtolower( $this->getName() ) . '-deleted' |
73 | 83 | ); |
Index: trunk/extensions/EducationProgram/actions/CourseHistoryAction.php |
— | — | @@ -13,8 +13,19 @@ |
14 | 14 | * @author Jeroen De Dauw < jeroendedauw@gmail.com > |
15 | 15 | */ |
16 | 16 | class CourseHistoryAction extends EPHistoryAction { |
17 | | - |
18 | | - |
| 17 | + |
| 18 | + /** |
| 19 | + * Constructor. |
| 20 | + * |
| 21 | + * @since 0.1 |
| 22 | + * |
| 23 | + * @param Page $page |
| 24 | + * @param IContextSource $context |
| 25 | + */ |
| 26 | + protected function __construct( Page $page, IContextSource $context = null ) { |
| 27 | + parent::__construct( $page, $context, EPCourses::singleton() ); |
| 28 | + } |
| 29 | + |
19 | 30 | public function getName() { |
20 | 31 | return 'coursehistory'; |
21 | 32 | } |
— | — | @@ -27,9 +38,5 @@ |
28 | 39 | array( 'page' => $this->getTitle()->getPrefixedText() ) |
29 | 40 | ); |
30 | 41 | } |
31 | | - |
32 | | - protected function getItemClass() { |
33 | | - return 'EPCourse'; |
34 | | - } |
35 | 42 | |
36 | 43 | } |
\ No newline at end of file |
Index: trunk/extensions/EducationProgram/actions/ViewOrgAction.php |
— | — | @@ -13,15 +13,23 @@ |
14 | 14 | * @author Jeroen De Dauw < jeroendedauw@gmail.com > |
15 | 15 | */ |
16 | 16 | class ViewOrgAction extends EPViewAction { |
17 | | - |
| 17 | + |
| 18 | + /** |
| 19 | + * Constructor. |
| 20 | + * |
| 21 | + * @since 0.1 |
| 22 | + * |
| 23 | + * @param Page $page |
| 24 | + * @param IContextSource $context |
| 25 | + */ |
| 26 | + protected function __construct( Page $page, IContextSource $context = null ) { |
| 27 | + parent::__construct( $page, $context, EPOrgs::singleton() ); |
| 28 | + } |
| 29 | + |
18 | 30 | public function getName() { |
19 | 31 | return 'vieworg'; |
20 | 32 | } |
21 | 33 | |
22 | | - protected function getItemClass() { |
23 | | - return 'EPOrg'; |
24 | | - } |
25 | | - |
26 | 34 | protected function displayPage( DBDataObject $org ) { |
27 | 35 | parent::displayPage( $org ); |
28 | 36 | |
Index: trunk/extensions/EducationProgram/actions/EPHistoryAction.php |
— | — | @@ -15,13 +15,24 @@ |
16 | 16 | abstract class EPHistoryAction extends FormlessAction { |
17 | 17 | |
18 | 18 | /** |
19 | | - * Returns the class name of the EPPageObject this action handles. |
| 19 | + * @since 0.1 |
| 20 | + * @var DBTable |
| 21 | + */ |
| 22 | + protected $table; |
| 23 | + |
| 24 | + /** |
| 25 | + * Constructor. |
20 | 26 | * |
21 | 27 | * @since 0.1 |
22 | 28 | * |
23 | | - * @return string |
| 29 | + * @param Page $page |
| 30 | + * @param IContextSource $context |
| 31 | + * @param DBTable $table |
24 | 32 | */ |
25 | | - protected abstract function getItemClass(); |
| 33 | + protected function __construct( Page $page, IContextSource $context = null, DBTable $table ) { |
| 34 | + $this->table = $table; |
| 35 | + parent::__construct( $page, $context ); |
| 36 | + } |
26 | 37 | |
27 | 38 | /** |
28 | 39 | * (non-PHPdoc) |
— | — | @@ -30,9 +41,7 @@ |
31 | 42 | public function onView() { |
32 | 43 | $this->getOutput()->setPageTitle( $this->getPageTitle() ); |
33 | 44 | |
34 | | - $c = $this->getItemClass(); // Yeah, this is needed in PHP 5.3 >_> |
35 | | - |
36 | | - $object = $c::get( $this->getTitle()->getText() ); |
| 45 | + $object = $this->table->get( $this->getTitle()->getText() ); |
37 | 46 | |
38 | 47 | if ( $object === false ) { |
39 | 48 | $this->displayNoRevisions(); |
— | — | @@ -47,9 +56,7 @@ |
48 | 57 | protected function displayNoRevisions() { |
49 | 58 | $this->getOutput()->addWikiMsg( 'ep-' . strtolower( $this->getName() ) . '-norevs' ); |
50 | 59 | |
51 | | - $c = $this->getItemClass(); // Yeah, this is needed in PHP 5.3 >_> |
52 | | - |
53 | | - $c::displayDeletionLog( |
| 60 | + $this->table->displayDeletionLog( |
54 | 61 | $this->getContext(), |
55 | 62 | 'ep-' . strtolower( $this->getName() ) . '-deleted' |
56 | 63 | ); |
Index: trunk/extensions/EducationProgram/actions/EditCourseAction.php |
— | — | @@ -13,8 +13,20 @@ |
14 | 14 | * @author Jeroen De Dauw < jeroendedauw@gmail.com > |
15 | 15 | */ |
16 | 16 | class EditCourseAction extends EPEditAction { |
17 | | - |
| 17 | + |
18 | 18 | /** |
| 19 | + * Constructor. |
| 20 | + * |
| 21 | + * @since 0.1 |
| 22 | + * |
| 23 | + * @param Page $page |
| 24 | + * @param IContextSource $context |
| 25 | + */ |
| 26 | + protected function __construct( Page $page, IContextSource $context = null ) { |
| 27 | + parent::__construct( $page, $context, EPCourses::singleton() ); |
| 28 | + } |
| 29 | + |
| 30 | + /** |
19 | 31 | * (non-PHPdoc) |
20 | 32 | * @see Action::getName() |
21 | 33 | */ |
— | — | @@ -45,10 +57,8 @@ |
46 | 58 | public function onView() { |
47 | 59 | $this->getOutput()->addModules( array( 'ep.datepicker', 'ep.combobox' ) ); |
48 | 60 | |
49 | | - $c = $this->getItemClass(); // Yeah, this is needed in PHP 5.3 >_> |
50 | | - |
51 | | - if ( !$this->isNewPost() && !$c::hasIdentifier( $this->getTitle()->getText() ) ) { |
52 | | - $c::displayDeletionLog( |
| 61 | + if ( !$this->isNewPost() && !$this->table->hasIdentifier( $this->getTitle()->getText() ) ) { |
| 62 | + $this->table->displayDeletionLog( |
53 | 63 | $this->getContext(), |
54 | 64 | 'ep-' . strtolower( $this->getName() ) . '-deleted' |
55 | 65 | ); |
— | — | @@ -105,22 +115,13 @@ |
106 | 116 | |
107 | 117 | /** |
108 | 118 | * (non-PHPdoc) |
109 | | - * @see EPEditAction::getItemClass() |
110 | | - * @return string |
111 | | - */ |
112 | | - protected function getItemClass() { |
113 | | - return 'EPCourse'; |
114 | | - } |
115 | | - |
116 | | - /** |
117 | | - * (non-PHPdoc) |
118 | 119 | * @see EPEditAction::getFormFields() |
119 | 120 | * @return array |
120 | 121 | */ |
121 | 122 | protected function getFormFields() { |
122 | 123 | $fields = parent::getFormFields(); |
123 | 124 | |
124 | | - $orgOptions = EPOrg::getOrgOptions(); |
| 125 | + $orgOptions = EPOrgs::singleton()->getOrgOptions(); |
125 | 126 | |
126 | 127 | $fields['name'] = array ( |
127 | 128 | 'type' => 'text', |
— | — | @@ -128,7 +129,7 @@ |
129 | 130 | 'required' => true, |
130 | 131 | ); |
131 | 132 | |
132 | | - $mcs = EPCourse::selectFields( 'mc', array(), array( 'DISTINCT' ) ); |
| 133 | + $mcs = $this->table->selectFields( 'mc', array(), array( 'DISTINCT' ) ); |
133 | 134 | |
134 | 135 | if ( $this->getRequest()->getCheck( 'newname' ) ) { |
135 | 136 | $newName = $this->getRequest()->getText( 'newname' ); |
— | — | @@ -138,7 +139,6 @@ |
139 | 140 | $mcs = array_merge( array( '' => '' ), $mcs ); |
140 | 141 | } |
141 | 142 | |
142 | | - |
143 | 143 | $fields['mc'] = array ( |
144 | 144 | 'class' => 'EPHTMLCombobox', |
145 | 145 | 'label-message' => 'ep-course-edit-mc', |
— | — | @@ -185,7 +185,7 @@ |
186 | 186 | 'required' => true, |
187 | 187 | ); |
188 | 188 | |
189 | | - $fieldFields = EPCourse::selectFields( 'field', array(), array( 'DISTINCT' ) ); |
| 189 | + $fieldFields = $this->table->selectFields( 'field', array(), array( 'DISTINCT' ) ); |
190 | 190 | $fieldFields = array_merge( array( '' => '' ), $fieldFields ); |
191 | 191 | $fields['field'] = array ( |
192 | 192 | 'class' => 'EPHTMLCombobox', |
— | — | @@ -194,7 +194,7 @@ |
195 | 195 | 'options' => array_combine( $fieldFields, $fieldFields ), |
196 | 196 | ); |
197 | 197 | |
198 | | - $levels = EPCourse::selectFields( 'level', array(), array( 'DISTINCT' ) ); |
| 198 | + $levels = $this->table->selectFields( 'level', array(), array( 'DISTINCT' ) ); |
199 | 199 | $levels = array_merge( array( '' => '' ), $levels ); |
200 | 200 | $fields['level'] = array ( |
201 | 201 | 'class' => 'EPHTMLCombobox', |
Index: trunk/extensions/EducationProgram/actions/OrgHistoryAction.php |
— | — | @@ -13,8 +13,19 @@ |
14 | 14 | * @author Jeroen De Dauw < jeroendedauw@gmail.com > |
15 | 15 | */ |
16 | 16 | class OrgHistoryAction extends EPHistoryAction { |
| 17 | + |
| 18 | + /** |
| 19 | + * Constructor. |
| 20 | + * |
| 21 | + * @since 0.1 |
| 22 | + * |
| 23 | + * @param Page $page |
| 24 | + * @param IContextSource $context |
| 25 | + */ |
| 26 | + protected function __construct( Page $page, IContextSource $context = null ) { |
| 27 | + parent::__construct( $page, $context, EPOrgs::singleton() ); |
| 28 | + } |
17 | 29 | |
18 | | - |
19 | 30 | public function getName() { |
20 | 31 | return 'orghistory'; |
21 | 32 | } |
— | — | @@ -28,8 +39,4 @@ |
29 | 40 | ); |
30 | 41 | } |
31 | 42 | |
32 | | - protected function getItemClass() { |
33 | | - return 'EPOrg'; |
34 | | - } |
35 | | - |
36 | 43 | } |
\ No newline at end of file |
Index: trunk/extensions/EducationProgram/actions/EPEditAction.php |
— | — | @@ -31,14 +31,25 @@ |
32 | 32 | protected $isNew = null; |
33 | 33 | |
34 | 34 | /** |
35 | | - * Returns the class name of the EPPageObject this action handles. |
| 35 | + * @since 0.1 |
| 36 | + * @var DBTable |
| 37 | + */ |
| 38 | + protected $table; |
| 39 | + |
| 40 | + /** |
| 41 | + * Constructor. |
36 | 42 | * |
37 | 43 | * @since 0.1 |
38 | 44 | * |
39 | | - * @return string |
| 45 | + * @param Page $page |
| 46 | + * @param IContextSource $context |
| 47 | + * @param DBTable $table |
40 | 48 | */ |
41 | | - protected abstract function getItemClass(); |
42 | | - |
| 49 | + protected function __construct( Page $page, IContextSource $context = null, DBTable $table ) { |
| 50 | + $this->table = $table; |
| 51 | + parent::__construct( $page, $context ); |
| 52 | + } |
| 53 | + |
43 | 54 | /** |
44 | 55 | * (non-PHPdoc) |
45 | 56 | * @see FormlessAction::onView() |
— | — | @@ -80,24 +91,23 @@ |
81 | 92 | protected function showContent() { |
82 | 93 | $out = $this->getOutput(); |
83 | 94 | |
84 | | - $c = $this->getItemClass(); // Yeah, this is needed in PHP 5.3 >_> |
85 | | - |
86 | 95 | $data = $this->getNewData(); |
87 | 96 | |
88 | | - $object = $c::selectRow( null, $data ); |
| 97 | + $object = $this->table->selectRow( null, $data ); |
89 | 98 | |
90 | 99 | if ( $object !== false && $this->getRequest()->getText( 'redlink' ) === '1' ) { |
91 | 100 | $out->redirect( $this->getTitle()->getLocalURL() ); |
92 | 101 | } |
93 | 102 | else { |
94 | 103 | if ( $object === false ) { |
| 104 | + $c = $this->table->getDataObjectClass(); |
95 | 105 | $c::displayDeletionLog( |
96 | 106 | $this->getContext(), |
97 | | - 'ep-' . strtolower( $this->getName() ) . '-deleted' |
| 107 | + 'ep-' . strtolower( $this->getName() ) . '-deleted' |
98 | 108 | ); |
99 | 109 | |
100 | 110 | $this->isNew = true; |
101 | | - $object = new $c( $data, true ); |
| 111 | + $object = $this->table->newFromArray( $data, true ); |
102 | 112 | } |
103 | 113 | elseif ( $this->isNewPost() ) { |
104 | 114 | $this->showWarning( wfMessage( 'ep-' . strtolower( $this->getName() ) . '-exists-already' ) ); |
— | — | @@ -345,14 +355,14 @@ |
346 | 356 | return Title::newFromText( $this->getRequest()->getText( 'wpreturnto' ) ); |
347 | 357 | } |
348 | 358 | elseif ( !$addedItem && $this->isNew() ) { |
349 | | - $c = $this->getItemClass(); // Yeah, this is needed in PHP 5.3 >_> |
| 359 | + $c = $this->table->getDataObjectClass(); // Yeah, this is needed in PHP 5.3 >_> |
350 | 360 | return SpecialPage::getTitleFor( $c::getListPage() ); |
351 | 361 | } |
352 | 362 | elseif ( $this->item !== false ) { |
353 | 363 | return $this->item->getTitle(); |
354 | 364 | } |
355 | 365 | else { |
356 | | - $c = $this->getItemClass(); // Yeah, this is needed in PHP 5.3 >_> |
| 366 | + $c = $this->table->getDataObjectClass(); // Yeah, this is needed in PHP 5.3 >_> |
357 | 367 | $fieldName = 'wpitem-' . $c::getIdentifierField(); |
358 | 368 | |
359 | 369 | if ( $this->getRequest()->getCheck( $fieldName ) ) { |
— | — | @@ -376,8 +386,6 @@ |
377 | 387 | $fields = array(); |
378 | 388 | $unknownValues = array(); |
379 | 389 | |
380 | | - $c = $this->getItemClass(); // Yeah, this is needed in PHP 5.3 >_> |
381 | | - |
382 | 390 | foreach ( $data as $name => $value ) { |
383 | 391 | $matches = array(); |
384 | 392 | |
— | — | @@ -386,7 +394,7 @@ |
387 | 395 | $value = null; |
388 | 396 | } |
389 | 397 | |
390 | | - if ( $c::canHaveField( $matches[1] ) ) { |
| 398 | + if ( $this->table->canHaveField( $matches[1] ) ) { |
391 | 399 | $fields[$matches[1]] = $value; |
392 | 400 | } |
393 | 401 | else { |
— | — | @@ -398,7 +406,7 @@ |
399 | 407 | $keys = array_keys( $fields ); |
400 | 408 | $fields = array_combine( $keys, array_map( array( $this, 'handleKnownField' ), $keys, $fields ) ); |
401 | 409 | |
402 | | - /* EPPageObject */ $item = new $c( $fields, is_null( $fields['id'] ) ); |
| 410 | + /* EPPageObject */ $item = $this->table->newFromArray( $fields, is_null( $fields['id'] ) ); |
403 | 411 | |
404 | 412 | foreach ( $unknownValues as $name => $value ) { |
405 | 413 | $this->handleUnknownField( $item, $name, $value ); |
Index: trunk/extensions/EducationProgram/includes/EPOrgPager.php |
— | — | @@ -62,7 +62,7 @@ |
63 | 63 | public function getFormattedValue( $name, $value ) { |
64 | 64 | switch ( $name ) { |
65 | 65 | case 'name': |
66 | | - $value = EPOrg::getLinkFor( $value ); |
| 66 | + $value = EPOrgs::getLinkFor( $value ); |
67 | 67 | break; |
68 | 68 | case 'country': |
69 | 69 | $countries = array_flip( EPUtils::getCountryOptions( $this->getLanguage()->getCode() ) ); |
Index: trunk/extensions/EducationProgram/includes/EPArticles.php |
— | — | @@ -0,0 +1,75 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * Class representing the ep_articles table. |
| 6 | + * |
| 7 | + * @since 0.1 |
| 8 | + * |
| 9 | + * @file EPArticles.php |
| 10 | + * @ingroup EducationProgram |
| 11 | + * |
| 12 | + * @licence GNU GPL v3 or later |
| 13 | + * @author Jeroen De Dauw < jeroendedauw@gmail.com > |
| 14 | + */ |
| 15 | +class EPArticles extends DBTable { |
| 16 | + |
| 17 | + /** |
| 18 | + * (non-PHPdoc) |
| 19 | + * @see DBTable::getDBTable() |
| 20 | + * @since 0.1 |
| 21 | + * @return string |
| 22 | + */ |
| 23 | + public function getDBTable() { |
| 24 | + return 'ep_articles'; |
| 25 | + } |
| 26 | + |
| 27 | + /** |
| 28 | + * (non-PHPdoc) |
| 29 | + * @see DBTable::getFieldPrefix() |
| 30 | + * @since 0.1 |
| 31 | + * @return string |
| 32 | + */ |
| 33 | + public function getFieldPrefix() { |
| 34 | + return 'article_'; |
| 35 | + } |
| 36 | + |
| 37 | + /** |
| 38 | + * (non-PHPdoc) |
| 39 | + * @see DBTable::getDataObjectClass() |
| 40 | + * @since 0.1 |
| 41 | + * @return string |
| 42 | + */ |
| 43 | + public function getDataObjectClass() { |
| 44 | + return 'EPArticle'; |
| 45 | + } |
| 46 | + |
| 47 | + /** |
| 48 | + * (non-PHPdoc) |
| 49 | + * @see DBTable::getFieldTypes() |
| 50 | + * @since 0.1 |
| 51 | + * @return array |
| 52 | + */ |
| 53 | + public function getFieldTypes() { |
| 54 | + return array( |
| 55 | + 'id' => 'id', |
| 56 | + |
| 57 | + 'course_id' => 'int', |
| 58 | + 'user_id' => 'int', |
| 59 | + 'page_id' => 'int', |
| 60 | + 'reviewers' => 'array', |
| 61 | + ); |
| 62 | + } |
| 63 | + |
| 64 | + /** |
| 65 | + * (non-PHPdoc) |
| 66 | + * @see DBTable::getDefaults() |
| 67 | + * @since 0.1 |
| 68 | + * @return array |
| 69 | + */ |
| 70 | + public function getDefaults() { |
| 71 | + return array( |
| 72 | + 'reviewers' => array(), |
| 73 | + ); |
| 74 | + } |
| 75 | + |
| 76 | +} |
Index: trunk/extensions/EducationProgram/includes/EPOrgs.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | * @licence GNU GPL v3 or later |
13 | 13 | * @author Jeroen De Dauw < jeroendedauw@gmail.com > |
14 | 14 | */ |
15 | | -class EPOrgs extends DBTable { |
| 15 | +class EPOrgs extends EPPageTable { |
16 | 16 | |
17 | 17 | /** |
18 | 18 | * (non-PHPdoc) |
Index: trunk/extensions/EducationProgram/includes/EPPageTable.php |
— | — | @@ -0,0 +1,160 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * Abstract base class DBDataObjects that have associated page views. |
| 6 | + * |
| 7 | + * @since 0.1 |
| 8 | + * |
| 9 | + * @file EPPageTable.php |
| 10 | + * @ingroup EducationProgram |
| 11 | + * |
| 12 | + * @licence GNU GPL v3 or later |
| 13 | + * @author Jeroen De Dauw < jeroendedauw@gmail.com > |
| 14 | + */ |
| 15 | +abstract class EPPageTable extends DBTable { |
| 16 | + |
| 17 | + protected static $info = array( |
| 18 | + 'EPCourses' => array( |
| 19 | + 'ns' => EP_NS_COURSE, |
| 20 | + 'actions' => array( |
| 21 | + 'view' => false, |
| 22 | + 'edit' => 'ep-course', |
| 23 | + 'history' => false, |
| 24 | + 'enroll' => 'ep-enroll', |
| 25 | + ), |
| 26 | + 'edit-right' => 'ep-course', |
| 27 | + 'identifier' => 'name', |
| 28 | + 'list' => 'Courses', |
| 29 | + 'log-type' => 'course', |
| 30 | + ), |
| 31 | + 'EPOrgs' => array( |
| 32 | + 'ns' => EP_NS_INSTITUTION, |
| 33 | + 'actions' => array( |
| 34 | + 'view' => false, |
| 35 | + 'edit' => 'ep-org', |
| 36 | + 'history' => false, |
| 37 | + ), |
| 38 | + 'edit-right' => 'ep-org', |
| 39 | + 'identifier' => 'name', |
| 40 | + 'list' => 'Institutions', |
| 41 | + 'log-type' => 'institution', |
| 42 | + ), |
| 43 | + ); |
| 44 | + |
| 45 | + public function getIdentifierField() { |
| 46 | + return self::$info[get_called_class()]['identifier']; |
| 47 | + } |
| 48 | + |
| 49 | + public function getEditRight() { |
| 50 | + return self::$info[get_called_class()]['edit-right']; |
| 51 | + } |
| 52 | + |
| 53 | + public static function getTitleFor( $identifierValue ) { |
| 54 | + return Title::newFromText( |
| 55 | + $identifierValue, |
| 56 | + self::$info[get_called_class()]['ns'] |
| 57 | + ); |
| 58 | + } |
| 59 | + |
| 60 | + public static function getLinkFor( $identifierValue, $action = 'view', $html = null, $customAttribs = array(), $query = array() ) { |
| 61 | + if ( $action !== 'view' ) { |
| 62 | + $query['action'] = $action; |
| 63 | + } |
| 64 | + |
| 65 | + return Linker::linkKnown( // Linker has no hook that allows us to figure out if the page actually exists :( |
| 66 | + self::getTitleFor( $identifierValue, $action ), |
| 67 | + is_null( $html ) ? htmlspecialchars( $identifierValue ) : $html, |
| 68 | + $customAttribs, |
| 69 | + $query |
| 70 | + ); |
| 71 | + } |
| 72 | + |
| 73 | + public function hasIdentifier( $identifier ) { |
| 74 | + return $this->has( array( $this->getIdentifierField() => $identifier ) ); |
| 75 | + } |
| 76 | + |
| 77 | + public function get( $identifier, $fields = null ) { |
| 78 | + return static::selectRow( $fields, array( $this->getIdentifierField() => $identifier ) ); |
| 79 | + } |
| 80 | + |
| 81 | + public function getListPage() { |
| 82 | + return self::$info[get_called_class()]['list']; |
| 83 | + } |
| 84 | + |
| 85 | + /** |
| 86 | + * Delete all objects matching the provided condirions. |
| 87 | + * |
| 88 | + * @since 0.1 |
| 89 | + * |
| 90 | + * @param EPRevisionAction $revAction |
| 91 | + * @param array $conditions |
| 92 | + * |
| 93 | + * @return boolean |
| 94 | + */ |
| 95 | + public function deleteAndLog( EPRevisionAction $revAction, array $conditions ) { |
| 96 | + $objects = $this->select( |
| 97 | + null, |
| 98 | + $conditions |
| 99 | + ); |
| 100 | + |
| 101 | + $success = true; |
| 102 | + |
| 103 | + if ( count( $objects ) > 0 ) { |
| 104 | + $revAction->setDelete( true ); |
| 105 | + |
| 106 | + foreach ( $objects as /* EPPageObject */ $object ) { |
| 107 | + $success = $object->revisionedRemove( $revAction ) && $success; |
| 108 | + } |
| 109 | + } |
| 110 | + |
| 111 | + return $success; |
| 112 | + } |
| 113 | + |
| 114 | + /** |
| 115 | + * (non-PHPdoc) |
| 116 | + * @see EPRevisionedObject::getLogInfo() |
| 117 | + */ |
| 118 | + protected function getLogInfoForTitle( Title $title ) { |
| 119 | + return array( |
| 120 | + 'type' => self::$info[get_called_class()]['log-type'], |
| 121 | + 'title' => $title, |
| 122 | + ); |
| 123 | + } |
| 124 | + |
| 125 | + public static function getTypeForNS( $ns ) { |
| 126 | + foreach ( self::$info as $type => $info ) { |
| 127 | + if ( $info['ns'] === $ns ) { |
| 128 | + return $type; |
| 129 | + } |
| 130 | + } |
| 131 | + |
| 132 | + throw new MWException( 'Unknown EPPageObject ns' ); |
| 133 | + } |
| 134 | + |
| 135 | + public static function getLatestRevForTitle( Title $title, $conditions = array() ) { |
| 136 | + $conds = array( |
| 137 | + 'type' => self::getTypeForNS( $title->getNamespace() ), |
| 138 | + 'object_identifier' => $title->getText(), |
| 139 | + ); |
| 140 | + |
| 141 | + return EPRevision::getLastRevision( array_merge( $conds, $conditions ) ); |
| 142 | + } |
| 143 | + |
| 144 | + public static function displayDeletionLog( IContextSource $context, $messageKey ) { |
| 145 | + $out = $context->getOutput(); |
| 146 | + |
| 147 | + LogEventsList::showLogExtract( |
| 148 | + $out, |
| 149 | + array( self::$info[get_called_class()]['log-type'] ), |
| 150 | + $context->getTitle(), |
| 151 | + '', |
| 152 | + array( |
| 153 | + 'lim' => 10, |
| 154 | + 'conds' => array( 'log_action' => 'remove' ), |
| 155 | + 'showIfEmpty' => false, |
| 156 | + 'msgKey' => array( $messageKey ) |
| 157 | + ) |
| 158 | + ); |
| 159 | + } |
| 160 | + |
| 161 | +} |
Index: trunk/extensions/EducationProgram/includes/EPPageObject.php |
— | — | @@ -13,55 +13,16 @@ |
14 | 14 | */ |
15 | 15 | abstract class EPPageObject extends EPRevisionedObject { |
16 | 16 | |
17 | | - protected static $info = array( |
18 | | - 'EPCourse' => array( |
19 | | - 'ns' => EP_NS_COURSE, |
20 | | - 'actions' => array( |
21 | | - 'view' => false, |
22 | | - 'edit' => 'ep-course', |
23 | | - 'history' => false, |
24 | | - 'enroll' => 'ep-enroll', |
25 | | - ), |
26 | | - 'edit-right' => 'ep-course', |
27 | | - 'identifier' => 'name', |
28 | | - 'list' => 'Courses', |
29 | | - 'log-type' => 'course', |
30 | | - ), |
31 | | - 'EPOrg' => array( |
32 | | - 'ns' => EP_NS_INSTITUTION, |
33 | | - 'actions' => array( |
34 | | - 'view' => false, |
35 | | - 'edit' => 'ep-org', |
36 | | - 'history' => false, |
37 | | - ), |
38 | | - 'edit-right' => 'ep-org', |
39 | | - 'identifier' => 'name', |
40 | | - 'list' => 'Institutions', |
41 | | - 'log-type' => 'institution', |
42 | | - ), |
43 | | - ); |
44 | | - |
45 | | - public static function getIdentifierField() { |
46 | | - return self::$info[get_called_class()]['identifier']; |
47 | | - } |
48 | | - |
49 | 17 | public function getIdentifier() { |
50 | | - return $this->getField( self::$info[get_called_class()]['identifier'] ); |
| 18 | + return $this->getField( $this->table->getIdentifierField() ); |
51 | 19 | } |
52 | 20 | |
53 | | - public static function getEditRight() { |
54 | | - return self::$info[get_called_class()]['edit-right']; |
55 | | - } |
56 | | - |
57 | 21 | public function getTitle() { |
58 | | - return Title::newFromText( |
59 | | - $this->getIdentifier(), |
60 | | - self::$info[get_called_class()]['ns'] |
61 | | - ); |
| 22 | + return $this->table->getTitleFor( $this->getIdentifier() ); |
62 | 23 | } |
63 | 24 | |
64 | 25 | public function getLink( $action = 'view', $html = null, $customAttribs = array(), $query = array() ) { |
65 | | - return self::getLinkFor( |
| 26 | + return $this->table->getLinkFor( |
66 | 27 | $this->getIdentifier(), |
67 | 28 | $action, |
68 | 29 | $html, |
— | — | @@ -70,112 +31,12 @@ |
71 | 32 | ); |
72 | 33 | } |
73 | 34 | |
74 | | - public static function getTitleFor( $identifierValue ) { |
75 | | - return Title::newFromText( |
76 | | - $identifierValue, |
77 | | - self::$info[get_called_class()]['ns'] |
78 | | - ); |
79 | | - } |
80 | | - |
81 | | - public static function getLinkFor( $identifierValue, $action = 'view', $html = null, $customAttribs = array(), $query = array() ) { |
82 | | - if ( $action !== 'view' ) { |
83 | | - $query['action'] = $action; |
84 | | - } |
85 | | - |
86 | | - return Linker::linkKnown( // Linker has no hook that allows us to figure out if the page actually exists :( |
87 | | - self::getTitleFor( $identifierValue, $action ), |
88 | | - is_null( $html ) ? htmlspecialchars( $identifierValue ) : $html, |
89 | | - $customAttribs, |
90 | | - $query |
91 | | - ); |
92 | | - } |
93 | | - |
94 | | - public static function hasIdentifier( $identifier ) { |
95 | | - return static::has( array( static::getIdentifierField() => $identifier ) ); |
96 | | - } |
97 | | - |
98 | | - public static function get( $identifier, $fields = null ) { |
99 | | - return static::selectRow( $fields, array( static::getIdentifierField() => $identifier ) ); |
100 | | - } |
101 | | - |
102 | | - public static function getListPage() { |
103 | | - return self::$info[get_called_class()]['list']; |
104 | | - } |
105 | | - |
106 | 35 | /** |
107 | | - * Delete all objects matching the provided condirions. |
108 | | - * |
109 | | - * @since 0.1 |
110 | | - * |
111 | | - * @param EPRevisionAction $revAction |
112 | | - * @param array $conditions |
113 | | - * |
114 | | - * @return boolean |
115 | | - */ |
116 | | - public static function deleteAndLog( EPRevisionAction $revAction, array $conditions ) { |
117 | | - $objects = static::select( |
118 | | - null, |
119 | | - $conditions |
120 | | - ); |
121 | | - |
122 | | - $success = true; |
123 | | - |
124 | | - if ( count( $objects ) > 0 ) { |
125 | | - $revAction->setDelete( true ); |
126 | | - |
127 | | - foreach ( $objects as /* EPPageObject */ $object ) { |
128 | | - $success = $object->revisionedRemove( $revAction ) && $success; |
129 | | - } |
130 | | - } |
131 | | - |
132 | | - return $success; |
133 | | - } |
134 | | - |
135 | | - /** |
136 | 36 | * (non-PHPdoc) |
137 | 37 | * @see EPRevisionedObject::getLogInfo() |
138 | 38 | */ |
139 | 39 | protected function getLogInfo( $subType ) { |
140 | | - return array( |
141 | | - 'type' => self::$info[get_called_class()]['log-type'], |
142 | | - 'title' => $this->getTitle(), |
143 | | - ); |
| 40 | + return $this->table->getLogInfoForTitle( $this->getTitle() ); |
144 | 41 | } |
145 | 42 | |
146 | | - public static function getTypeForNS( $ns ) { |
147 | | - foreach ( self::$info as $type => $info ) { |
148 | | - if ( $info['ns'] === $ns ) { |
149 | | - return $type; |
150 | | - } |
151 | | - } |
152 | | - |
153 | | - throw new MWException( 'Unknown EPPageObject ns' ); |
154 | | - } |
155 | | - |
156 | | - public static function getLatestRevForTitle( Title $title, $conditions = array() ) { |
157 | | - $conds = array( |
158 | | - 'type' => self::getTypeForNS( $title->getNamespace() ), |
159 | | - 'object_identifier' => $title->getText(), |
160 | | - ); |
161 | | - |
162 | | - return EPRevision::getLastRevision( array_merge( $conds, $conditions ) ); |
163 | | - } |
164 | | - |
165 | | - public static function displayDeletionLog( IContextSource $context, $messageKey ) { |
166 | | - $out = $context->getOutput(); |
167 | | - |
168 | | - LogEventsList::showLogExtract( |
169 | | - $out, |
170 | | - array( self::$info[get_called_class()]['log-type'] ), |
171 | | - $context->getTitle(), |
172 | | - '', |
173 | | - array( |
174 | | - 'lim' => 10, |
175 | | - 'conds' => array( 'log_action' => 'remove' ), |
176 | | - 'showIfEmpty' => false, |
177 | | - 'msgKey' => array( $messageKey ) |
178 | | - ) |
179 | | - ); |
180 | | - } |
181 | | - |
182 | 43 | } |
Index: trunk/extensions/EducationProgram/includes/EPCoursePager.php |
— | — | @@ -72,7 +72,7 @@ |
73 | 73 | public function getFormattedValue( $name, $value ) { |
74 | 74 | switch ( $name ) { |
75 | 75 | case 'name': |
76 | | - $value = EPCourse::getLinkFor( $value ); |
| 76 | + $value = EPCourses::getLinkFor( $value ); |
77 | 77 | break; |
78 | 78 | case 'org_id': |
79 | 79 | $org = EPOrgs::singleton()->selectRow( 'name', array( 'id' => $value ) ); |
Index: trunk/extensions/EducationProgram/includes/EPCourses.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | * @licence GNU GPL v3 or later |
13 | 13 | * @author Jeroen De Dauw < jeroendedauw@gmail.com > |
14 | 14 | */ |
15 | | -class EPCourses extends DBTable { |
| 15 | +class EPCourses extends EPPageTable { |
16 | 16 | |
17 | 17 | /** |
18 | 18 | * (non-PHPdoc) |
Index: trunk/extensions/EducationProgram/includes/EPArticle.php |
— | — | @@ -23,50 +23,6 @@ |
24 | 24 | protected $user = false; |
25 | 25 | |
26 | 26 | /** |
27 | | - * (non-PHPdoc) |
28 | | - * @see DBDataObject::getDBTable() |
29 | | - */ |
30 | | - public static function getDBTable() { |
31 | | - return 'ep_articles'; |
32 | | - } |
33 | | - |
34 | | - /** |
35 | | - * (non-PHPdoc) |
36 | | - * @see DBDataObject::getFieldPrefix() |
37 | | - */ |
38 | | - public static function getFieldPrefix() { |
39 | | - return 'article_'; |
40 | | - } |
41 | | - |
42 | | - /** |
43 | | - * @see parent::getFieldTypes |
44 | | - * |
45 | | - * @since 0.1 |
46 | | - * |
47 | | - * @return array |
48 | | - */ |
49 | | - protected static function getFieldTypes() { |
50 | | - return array( |
51 | | - 'id' => 'id', |
52 | | - |
53 | | - 'course_id' => 'int', |
54 | | - 'user_id' => 'int', |
55 | | - 'page_id' => 'int', |
56 | | - 'reviewers' => 'array', |
57 | | - ); |
58 | | - } |
59 | | - |
60 | | - /** |
61 | | - * (non-PHPdoc) |
62 | | - * @see DBDataObject::getDefaults() |
63 | | - */ |
64 | | - public static function getDefaults() { |
65 | | - return array( |
66 | | - 'reviewers' => array(), |
67 | | - ); |
68 | | - } |
69 | | - |
70 | | - /** |
71 | 27 | * Returns the user that authored this revision. |
72 | 28 | * |
73 | 29 | * @since 0.1 |
Index: trunk/extensions/EducationProgram/includes/EPCourse.php |
— | — | @@ -305,7 +305,7 @@ |
306 | 306 | 'form', |
307 | 307 | array( |
308 | 308 | 'method' => 'post', |
309 | | - 'action' => self::getTitleFor( 'NAME_PLACEHOLDER' )->getLocalURL( array( 'action' => 'edit' ) ), |
| 309 | + 'action' => EPCourses::singleton()->getTitleFor( 'NAME_PLACEHOLDER' )->getLocalURL( array( 'action' => 'edit' ) ), |
310 | 310 | ) |
311 | 311 | ) ); |
312 | 312 | |
— | — | @@ -705,7 +705,7 @@ |
706 | 706 | public static function hasActiveName( $courseName ) { |
707 | 707 | $now = wfGetDB( DB_SLAVE )->addQuotes( wfTimestampNow() ); |
708 | 708 | |
709 | | - return self::has( array( |
| 709 | + return EPCourses::singleton()->has( array( |
710 | 710 | 'name' => $courseName, |
711 | 711 | 'end >= ' . $now, |
712 | 712 | 'start <= ' . $now, |
Index: trunk/extensions/EducationProgram/includes/EPArticlePager.php |
— | — | @@ -23,7 +23,7 @@ |
24 | 24 | $this->mDefaultDirection = true; |
25 | 25 | |
26 | 26 | // when MW 1.19 becomes min, we want to pass an IContextSource $context here. |
27 | | - parent::__construct( $context, $conds, 'EPArticle' ); |
| 27 | + parent::__construct( $context, $conds, EPArticles::singleton() ); |
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
— | — | @@ -91,8 +91,7 @@ |
92 | 92 | } |
93 | 93 | |
94 | 94 | function getDefaultSort() { |
95 | | - $c = $this->className; // Yeah, this is needed in PHP 5.3 >_> |
96 | | - return $c::getPrefixedField( 'user_id' ); |
| 95 | + return $this->table->getPrefixedField( 'user_id' ); |
97 | 96 | } |
98 | 97 | |
99 | 98 | } |
Index: trunk/extensions/EducationProgram/EducationProgram.hooks.php |
— | — | @@ -228,8 +228,8 @@ |
229 | 229 | */ |
230 | 230 | protected static function displayTabs( SkinTemplate &$sktemplate, array &$links, Title $title ) { |
231 | 231 | $classes = array( |
232 | | - EP_NS_INSTITUTION => 'EPOrg', |
233 | | - EP_NS_COURSE => 'EPCourse', |
| 232 | + EP_NS_INSTITUTION => 'EPOrgs', |
| 233 | + EP_NS_COURSE => 'EPCourses', |
234 | 234 | ); |
235 | 235 | |
236 | 236 | $exists = null; |
— | — | @@ -240,7 +240,7 @@ |
241 | 241 | |
242 | 242 | $user = $sktemplate->getUser(); |
243 | 243 | $class = $classes[$title->getNamespace()]; |
244 | | - $exists = $class::hasIdentifier( $title->getText() ); |
| 244 | + $exists = $class::singleton()->hasIdentifier( $title->getText() ); |
245 | 245 | $type = $sktemplate->getRequest()->getText( 'action' ); |
246 | 246 | $isSpecial = $sktemplate->getTitle()->isSpecialPage(); |
247 | 247 | |
— | — | @@ -252,7 +252,7 @@ |
253 | 253 | ); |
254 | 254 | } |
255 | 255 | |
256 | | - if ( $user->isAllowed( $class::getEditRight() ) ) { |
| 256 | + if ( $user->isAllowed( $class::singleton()->getEditRight() ) ) { |
257 | 257 | $links['views']['edit'] = array( |
258 | 258 | 'class' => $type === 'edit' ? 'selected' : false, |
259 | 259 | 'text' => wfMsg( $exists ? 'ep-tab-edit' : 'ep-tab-create' ), |
— | — | @@ -307,11 +307,11 @@ |
308 | 308 | public static function onTitleIsAlwaysKnown( Title $title, &$isKnown ) { |
309 | 309 | if ( in_array( $title->getNamespace(), array( EP_NS_COURSE, EP_NS_INSTITUTION ) ) ) { |
310 | 310 | $classes = array( |
311 | | - EP_NS_COURSE => 'EPCourse', |
312 | | - EP_NS_INSTITUTION => 'EPOrg', |
| 311 | + EP_NS_COURSE => 'EPCourses', |
| 312 | + EP_NS_INSTITUTION => 'EPOrgs', |
313 | 313 | ); |
314 | 314 | |
315 | | - $isKnown = $classes[$title->getNamespace()]::hasIdentifier( $title->getText() ); |
| 315 | + $isKnown = $classes[$title->getNamespace()]::singleton()->hasIdentifier( $title->getText() ); |
316 | 316 | } |
317 | 317 | |
318 | 318 | return true; |