Index: trunk/extensions/EducationProgram/includes/EPRevisionPager.php |
— | — | @@ -42,66 +42,6 @@ |
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
46 | | - * Get the OutputPage being used for this instance. |
47 | | - * IndexPager extends ContextSource as of 1.19. |
48 | | - * |
49 | | - * @since 0.1 |
50 | | - * |
51 | | - * @return OutputPage |
52 | | - */ |
53 | | - public function getOutput() { |
54 | | - return $this->context->getOutput(); |
55 | | - } |
56 | | - |
57 | | - /** |
58 | | - * Get the Language being used for this instance. |
59 | | - * IndexPager extends ContextSource as of 1.19. |
60 | | - * |
61 | | - * @since 0.1 |
62 | | - * |
63 | | - * @return Language |
64 | | - */ |
65 | | - public function getLanguage() { |
66 | | - return $this->context->getLanguage(); |
67 | | - } |
68 | | - |
69 | | - /** |
70 | | - * Get the User being used for this instance. |
71 | | - * IndexPager extends ContextSource as of 1.19. |
72 | | - * |
73 | | - * @since 0.1 |
74 | | - * |
75 | | - * @return User |
76 | | - */ |
77 | | - public function getUser() { |
78 | | - return $this->context->getUser(); |
79 | | - } |
80 | | - |
81 | | - /** |
82 | | - * Get the WebRequest being used for this instance. |
83 | | - * IndexPager extends ContextSource as of 1.19. |
84 | | - * |
85 | | - * @since 0.1 |
86 | | - * |
87 | | - * @return WebRequest |
88 | | - */ |
89 | | - public function getRequest() { |
90 | | - return $this->context->getRequest(); |
91 | | - } |
92 | | - |
93 | | - /** |
94 | | - * Get the Title being used for this instance. |
95 | | - * IndexPager extends ContextSource as of 1.19. |
96 | | - * |
97 | | - * @since 0.1 |
98 | | - * |
99 | | - * @return Title |
100 | | - */ |
101 | | - public function getTitle() { |
102 | | - return $this->context->getTitle(); |
103 | | - } |
104 | | - |
105 | | - /** |
106 | 46 | * @see parent::getStartBody |
107 | 47 | * @since 0.1 |
108 | 48 | */ |
— | — | @@ -119,7 +59,7 @@ |
120 | 60 | * @return String |
121 | 61 | */ |
122 | 62 | function formatRow( $row ) { |
123 | | - $revision = EPRevision::newFromDBResult( $row ); |
| 63 | + $revision = EPRevisions::singleton()->newFromDBResult( $row ); |
124 | 64 | $object = $revision->getObject(); |
125 | 65 | |
126 | 66 | $html = ''; |
— | — | @@ -179,9 +119,9 @@ |
180 | 120 | */ |
181 | 121 | function getQueryInfo() { |
182 | 122 | return array( |
183 | | - 'tables' => EPRevision::getDBTable(), |
184 | | - 'fields' => EPRevision::getPrefixedFields( EPRevision::getFieldNames() ), |
185 | | - 'conds' => EPRevision::getPrefixedValues( $this->conds ) |
| 123 | + 'tables' => EPRevisions::singleton()->getDBTable(), |
| 124 | + 'fields' => EPRevisions::singleton()->getPrefixedFields( EPRevisions::singleton()->getFieldNames() ), |
| 125 | + 'conds' => EPRevisions::singleton()->getPrefixedValues( $this->conds ) |
186 | 126 | ); |
187 | 127 | } |
188 | 128 | |
— | — | @@ -198,8 +138,7 @@ |
199 | 139 | * @return string|Array |
200 | 140 | */ |
201 | 141 | function getIndexField() { |
202 | | - return EPRevision::getPrefixedField( 'id' ); |
| 142 | + return EPRevisions::singleton()->getPrefixedField( 'id' ); |
203 | 143 | } |
204 | 144 | |
205 | | - |
206 | 145 | } |
Index: trunk/extensions/EducationProgram/includes/EPOrg.php |
— | — | @@ -129,7 +129,7 @@ |
130 | 130 | 'form', |
131 | 131 | array( |
132 | 132 | 'method' => 'post', |
133 | | - 'action' => self::getTitleFor( 'NAME_PLACEHOLDER' )->getLocalURL( array( 'action' => 'edit' ) ), |
| 133 | + 'action' => EPOrgs::singleton()->getTitleFor( 'NAME_PLACEHOLDER' )->getLocalURL( array( 'action' => 'edit' ) ), |
134 | 134 | ) |
135 | 135 | ) ); |
136 | 136 | |
Index: trunk/extensions/EducationProgram/includes/EPRevision.php |
— | — | @@ -21,7 +21,6 @@ |
22 | 22 | */ |
23 | 23 | protected $user = false; |
24 | 24 | |
25 | | - |
26 | 25 | /** |
27 | 26 | * @see parent::__construct |
28 | 27 | * |
— | — | @@ -75,8 +74,8 @@ |
76 | 75 | * @return EPRevisionedObject |
77 | 76 | */ |
78 | 77 | public function getObject() { |
79 | | - $class = $this->getField( 'type' ); |
80 | | - return $class::newFromArray( $this->getField( 'data' ), true ); |
| 78 | + $class = $this->getField( 'type' ) . 's'; // TODO: refactor made this suck a lot |
| 79 | + return $class::singleton()->newFromArray( $this->getField( 'data' ), true ); |
81 | 80 | } |
82 | 81 | |
83 | 82 | /** |