Index: trunk/extensions/EducationProgram/actions/EPViewAction.php |
— | — | @@ -48,7 +48,7 @@ |
49 | 49 | $currentObject = $this->table->get( $name, 'id' ); |
50 | 50 | |
51 | 51 | if ( $currentObject !== false ) { |
52 | | - $rev = EPRevision::selectRow( null, array( |
| 52 | + $rev = EPRevisions::singleton()->selectRow( null, array( |
53 | 53 | 'id' => $this->getRequest()->getInt( 'revid' ), |
54 | 54 | 'object_id' => $currentObject->getField( 'id' ) |
55 | 55 | ) ); |
Index: trunk/extensions/EducationProgram/includes/EPOrgs.php |
— | — | @@ -13,6 +13,19 @@ |
14 | 14 | */ |
15 | 15 | class EPOrgs extends EPPageTable { |
16 | 16 | |
| 17 | + protected static $info = array( |
| 18 | + 'ns' => EP_NS_INSTITUTION, |
| 19 | + 'actions' => array( |
| 20 | + 'view' => false, |
| 21 | + 'edit' => 'ep-org', |
| 22 | + 'history' => false, |
| 23 | + ), |
| 24 | + 'edit-right' => 'ep-org', |
| 25 | + 'identifier' => 'name', |
| 26 | + 'list' => 'Institutions', |
| 27 | + 'log-type' => 'institution', |
| 28 | + ); |
| 29 | + |
17 | 30 | /** |
18 | 31 | * (non-PHPdoc) |
19 | 32 | * @see DBTable::getDBTable() |
Index: trunk/extensions/EducationProgram/includes/EPPageTable.php |
— | — | @@ -13,47 +13,18 @@ |
14 | 14 | */ |
15 | 15 | abstract class EPPageTable extends DBTable { |
16 | 16 | |
17 | | - // TODO |
18 | | - protected static $info = array( |
19 | | - 'EPCourses' => array( |
20 | | - 'ns' => EP_NS_COURSE, |
21 | | - 'actions' => array( |
22 | | - 'view' => false, |
23 | | - 'edit' => 'ep-course', |
24 | | - 'history' => false, |
25 | | - 'enroll' => 'ep-enroll', |
26 | | - ), |
27 | | - 'edit-right' => 'ep-course', |
28 | | - 'identifier' => 'name', |
29 | | - 'list' => 'Courses', |
30 | | - 'log-type' => 'course', |
31 | | - ), |
32 | | - 'EPOrgs' => array( |
33 | | - 'ns' => EP_NS_INSTITUTION, |
34 | | - 'actions' => array( |
35 | | - 'view' => false, |
36 | | - 'edit' => 'ep-org', |
37 | | - 'history' => false, |
38 | | - ), |
39 | | - 'edit-right' => 'ep-org', |
40 | | - 'identifier' => 'name', |
41 | | - 'list' => 'Institutions', |
42 | | - 'log-type' => 'institution', |
43 | | - ), |
44 | | - ); |
45 | | - |
46 | 17 | public function getIdentifierField() { |
47 | | - return self::$info[get_called_class()]['identifier']; |
| 18 | + return static::$info['identifier']; |
48 | 19 | } |
49 | 20 | |
50 | 21 | public function getEditRight() { |
51 | | - return self::$info[get_called_class()]['edit-right']; |
| 22 | + return static::$info['edit-right']; |
52 | 23 | } |
53 | 24 | |
54 | 25 | public static function getTitleFor( $identifierValue ) { |
55 | 26 | return Title::newFromText( |
56 | 27 | $identifierValue, |
57 | | - self::$info[get_called_class()]['ns'] |
| 28 | + static::$info['ns'] |
58 | 29 | ); |
59 | 30 | } |
60 | 31 | |
— | — | @@ -79,7 +50,7 @@ |
80 | 51 | } |
81 | 52 | |
82 | 53 | public function getListPage() { |
83 | | - return self::$info[get_called_class()]['list']; |
| 54 | + return static::$info['list']; |
84 | 55 | } |
85 | 56 | |
86 | 57 | /** |
— | — | @@ -117,13 +88,13 @@ |
118 | 89 | */ |
119 | 90 | public function getLogInfoForTitle( Title $title ) { |
120 | 91 | return array( |
121 | | - 'type' => self::$info[get_called_class()]['log-type'], |
| 92 | + 'type' => static::$info['log-type'], |
122 | 93 | 'title' => $title, |
123 | 94 | ); |
124 | 95 | } |
125 | 96 | |
126 | 97 | public static function getTypeForNS( $ns ) { |
127 | | - foreach ( self::$info as $type => $info ) { |
| 98 | + foreach ( static::$info as $type => $info ) { |
128 | 99 | if ( $info['ns'] === $ns ) { |
129 | 100 | return $type; |
130 | 101 | } |
— | — | @@ -146,7 +117,7 @@ |
147 | 118 | |
148 | 119 | LogEventsList::showLogExtract( |
149 | 120 | $out, |
150 | | - array( self::$info[get_called_class()]['log-type'] ), |
| 121 | + array( static::$info['log-type'] ), |
151 | 122 | $context->getTitle(), |
152 | 123 | '', |
153 | 124 | array( |
Index: trunk/extensions/EducationProgram/includes/EPCourses.php |
— | — | @@ -13,6 +13,20 @@ |
14 | 14 | */ |
15 | 15 | class EPCourses extends EPPageTable { |
16 | 16 | |
| 17 | + protected static $info = array( |
| 18 | + 'ns' => EP_NS_COURSE, |
| 19 | + 'actions' => array( |
| 20 | + 'view' => false, |
| 21 | + 'edit' => 'ep-course', |
| 22 | + 'history' => false, |
| 23 | + 'enroll' => 'ep-enroll', |
| 24 | + ), |
| 25 | + 'edit-right' => 'ep-course', |
| 26 | + 'identifier' => 'name', |
| 27 | + 'list' => 'Courses', |
| 28 | + 'log-type' => 'course', |
| 29 | + ); |
| 30 | + |
17 | 31 | /** |
18 | 32 | * (non-PHPdoc) |
19 | 33 | * @see DBTable::getDBTable() |