File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ $(function(){
5959 var navigationLink = this . $navigation . find ( 'a[data-navigation=' + filter + ']' ) ;
6060 navigationLink . parent ( ) . addClass ( 'active' ) . attr ( 'aria-current' , 'page' ) ;
6161 window . document . title = navigationLink . text ( ) . trim ( ) + ' - ' + this . defaultPageTitle ;
62-
62+ OCP . Accessibility . setPageHeading ( navigationLink . text ( ) . trim ( ) ) ;
6363 OCA . Activity . InfinitScrolling . prefill ( ) ;
6464 }
6565 } ;
Original file line number Diff line number Diff line change 2727use OCP \AppFramework \Controller ;
2828use OCP \AppFramework \Http \TemplateResponse ;
2929use OCP \IConfig ;
30+ use OCP \IL10N ;
3031use OCP \IRequest ;
3132use Symfony \Component \EventDispatcher \EventDispatcherInterface ;
3233use Symfony \Component \EventDispatcher \GenericEvent ;
@@ -38,6 +39,9 @@ class ActivitiesController extends Controller {
3839 /** @var Data */
3940 protected $ data ;
4041
42+ /** @var IL10N */
43+ private $ l10n ;
44+
4145 /** @var Navigation */
4246 protected $ navigation ;
4347
@@ -51,18 +55,21 @@ class ActivitiesController extends Controller {
5155 * @param Data $data
5256 * @param Navigation $navigation
5357 * @param EventDispatcherInterface $eventDispatcher
58+ * @param IL10N $l10n
5459 */
5560 public function __construct ($ appName ,
5661 IRequest $ request ,
5762 IConfig $ config ,
5863 Data $ data ,
5964 Navigation $ navigation ,
60- EventDispatcherInterface $ eventDispatcher ) {
65+ EventDispatcherInterface $ eventDispatcher ,
66+ IL10N $ l10n ) {
6167 parent ::__construct ($ appName , $ request );
6268 $ this ->data = $ data ;
6369 $ this ->config = $ config ;
6470 $ this ->navigation = $ navigation ;
6571 $ this ->eventDispatcher = $ eventDispatcher ;
72+ $ this ->l10n = $ l10n ;
6673 }
6774
6875 /**
@@ -82,6 +89,7 @@ public function showList($filter = 'all') {
8289 'appNavigation ' => $ this ->navigation ->getTemplate ($ filter ),
8390 'avatars ' => $ this ->config ->getSystemValue ('enable_avatars ' , true ) ? 'yes ' : 'no ' ,
8491 'filter ' => $ filter ,
92+ 'pageTitle ' => $ this ->l10n ->t ('Activity ' )
8593 ]);
8694 }
8795}
Original file line number Diff line number Diff line change 2424
2525use OCA \Activity \Controller \ActivitiesController ;
2626use OCA \Activity \Tests \TestCase ;
27+ use OCP \IL10N ;
2728use OCP \ILogger ;
2829use OCP \Template ;
2930use PHPUnit \Framework \MockObject \MockObject ;
@@ -51,6 +52,8 @@ class ActivitiesControllerTest extends TestCase {
5152 protected $ eventDispatcher ;
5253 /** @var Navigation|MockObject */
5354 protected $ navigation ;
55+ /** @var IL10N */
56+ protected $ l10n ;
5457
5558 /** @var ActivitiesController */
5659 protected $ controller ;
@@ -63,6 +66,7 @@ protected function setUp(): void {
6366 $ this ->navigation = $ this ->createMock (Navigation::class);
6467 $ this ->eventDispatcher = $ this ->createMock (EventDispatcherInterface::class);
6568 $ this ->request = $ this ->createMock (IRequest::class);
69+ $ this ->l10n = $ this ->createMock (IL10N ::class);
6670
6771 $ this ->controller = $ this ->getController ();
6872 }
@@ -75,7 +79,8 @@ protected function getController(array $methods = []): ActivitiesController {
7579 $ this ->config ,
7680 $ this ->data ,
7781 $ this ->navigation ,
78- $ this ->eventDispatcher
82+ $ this ->eventDispatcher ,
83+ $ this ->l10n ,
7984 );
8085 }
8186
@@ -87,6 +92,7 @@ protected function getController(array $methods = []): ActivitiesController {
8792 $ this ->data ,
8893 $ this ->navigation ,
8994 $ this ->eventDispatcher ,
95+ $ this ->l10n ,
9096 ])
9197 ->onlyMethods ($ methods )
9298 ->getMock ();
You can’t perform that action at this time.
0 commit comments