Index: trunk/extensions/EducationProgram/specials/SpecialAmbassadorProfile.php |
— | — | @@ -70,9 +70,9 @@ |
71 | 71 | 'default' => $ambassador->getField( 'bio' ), |
72 | 72 | ); |
73 | 73 | |
74 | | - $lang = $this->getLanguage(); |
75 | | - |
76 | | - $prefix = $this->getMsgPrefix(); |
| 74 | +// $lang = $this->getLanguage(); |
| 75 | +// |
| 76 | +// $prefix = $this->getMsgPrefix(); |
77 | 77 | $fields['photo'] = array( |
78 | 78 | 'type' => 'text', |
79 | 79 | 'label-message' => $this->getMsgPrefix() . 'profile-photo', |
Index: trunk/extensions/EducationProgram/includes/EPCAPager.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 EPCAPager extends EPPager { |
| 15 | +class EPCAPager extends EPOAPager { |
16 | 16 | /** |
17 | 17 | * Constructor. |
18 | 18 | * |
— | — | @@ -25,18 +25,6 @@ |
26 | 26 | |
27 | 27 | /** |
28 | 28 | * (non-PHPdoc) |
29 | | - * @see EPPager::getFields() |
30 | | - */ |
31 | | - public function getFields() { |
32 | | - return array( |
33 | | - 'photo', |
34 | | - 'user_id', |
35 | | - 'bio', |
36 | | - ); |
37 | | - } |
38 | | - |
39 | | - /** |
40 | | - * (non-PHPdoc) |
41 | 29 | * @see TablePager::getRowClass() |
42 | 30 | */ |
43 | 31 | function getRowClass( $row ) { |
— | — | @@ -51,91 +39,4 @@ |
52 | 40 | return 'TablePager ep-cas'; |
53 | 41 | } |
54 | 42 | |
55 | | - /** |
56 | | - * (non-PHPdoc) |
57 | | - * @see EPPager::getFormattedValue() |
58 | | - */ |
59 | | - protected function getFormattedValue( $name, $value ) { |
60 | | - switch ( $name ) { |
61 | | - case 'photo': |
62 | | - $title = Title::newFromText( $value, NS_FILE ); |
63 | | - $value = ''; |
64 | | - |
65 | | - if ( is_object( $title ) ) { |
66 | | - $api = new ApiMain( new FauxRequest( array( |
67 | | - 'action' => 'query', |
68 | | - 'format' => 'json', |
69 | | - 'prop' => 'imageinfo', |
70 | | - 'iiprop' => 'url', |
71 | | - 'titles' => $title->getFullText(), |
72 | | - 'iiurlwidth' => 200 |
73 | | - ), true ), true ); |
74 | | - |
75 | | - $api->execute(); |
76 | | - $result = $api->getResultData(); |
77 | | - |
78 | | - if ( array_key_exists( 'query', $result ) && array_key_exists( 'pages', $result['query'] ) ) { |
79 | | - foreach ( $result['query']['pages'] as $page ) { |
80 | | - foreach ( $page['imageinfo'] as $imageInfo ) { |
81 | | - $value = Html::element( |
82 | | - 'img', |
83 | | - array( |
84 | | - 'src' => $imageInfo['thumburl'], |
85 | | - 'width' => '200px', |
86 | | - ) |
87 | | - ); |
88 | | - break; |
89 | | - } |
90 | | - } |
91 | | - } |
92 | | - } |
93 | | - break; |
94 | | - case 'user_id': |
95 | | - $ca = $this->currentObject; |
96 | | - $value = Linker::userLink( $value, $ca->getName() ) . Linker::userToolLinks( $value, $ca->getName() ); |
97 | | - break; |
98 | | - case 'bio': |
99 | | - $value = $this->getOutput()->parseInline( $value ); |
100 | | - break; |
101 | | - case '_courses': |
102 | | - $oa = $this->currentObject; |
103 | | - $value = $this->getLanguage()->listToText( array_map( |
104 | | - function( EPCourse $course ) { |
105 | | - return $course->getLink(); |
106 | | - }, |
107 | | - $oa->getCoursesWithState( 'current', 'name' ) |
108 | | - ) ); |
109 | | - break; |
110 | | - } |
111 | | - |
112 | | - return $value; |
113 | | - } |
114 | | - |
115 | | - /** |
116 | | - * (non-PHPdoc) |
117 | | - * @see EPPager::getSortableFields() |
118 | | - */ |
119 | | - protected function getSortableFields() { |
120 | | - return array( |
121 | | - ); |
122 | | - } |
123 | | - |
124 | | - /** |
125 | | - * (non-PHPdoc) |
126 | | - * @see EPPager::hasActionsColumn() |
127 | | - */ |
128 | | - protected function hasActionsColumn() { |
129 | | - return false; |
130 | | - } |
131 | | - |
132 | | - /** |
133 | | - * (non-PHPdoc) |
134 | | - * @see EPPager::getFieldNames() |
135 | | - */ |
136 | | - public function getFieldNames() { |
137 | | - $fields = parent::getFieldNames(); |
138 | | - $fields['_courses'] = 'courses'; |
139 | | - return $fields; |
140 | | - } |
141 | | - |
142 | 43 | } |
Index: trunk/extensions/EducationProgram/includes/EPOAPager.php |
— | — | @@ -12,6 +12,7 @@ |
13 | 13 | * @author Jeroen De Dauw < jeroendedauw@gmail.com > |
14 | 14 | */ |
15 | 15 | class EPOAPager extends EPPager { |
| 16 | + |
16 | 17 | /** |
17 | 18 | * Constructor. |
18 | 19 | * |
— | — | @@ -51,6 +52,16 @@ |
52 | 53 | return 'TablePager ep-oas'; |
53 | 54 | } |
54 | 55 | |
| 56 | + function getCellAttrs( $field, $value ) { |
| 57 | + $attr = parent::getCellAttrs( $field, $value ); |
| 58 | + |
| 59 | + if ( in_array( $field, array( 'user_id', '_courses' ) ) ) { |
| 60 | + $attr['style'] = 'min-width: 200px'; |
| 61 | + } |
| 62 | + |
| 63 | + return $attr; |
| 64 | + } |
| 65 | + |
55 | 66 | /** |
56 | 67 | * (non-PHPdoc) |
57 | 68 | * @see EPPager::getFormattedValue() |