Skip to content

Commit

Permalink
WCAG (2.4.2): Add proper page titles. (#1673) (#1674)
Browse files Browse the repository at this point in the history
  • Loading branch information
melaniekung authored Oct 3, 2023
1 parent 48e1fa3 commit 60c961c
Show file tree
Hide file tree
Showing 21 changed files with 74 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/qubit/modules/clipboard/actions/loadAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class ClipboardLoadAction extends DefaultEditAction

public function execute($request)
{
$title = $this->context->i18n->__('Load clipboard');
$this->response->setTitle("{$title} - {$this->response->getTitle()}");

parent::execute($request);

if (!$request->isMethod('post')) {
Expand Down
7 changes: 7 additions & 0 deletions apps/qubit/modules/default/actions/browseAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ class DefaultBrowseAction extends sfAction
{
public function execute($request)
{
$mod = $this->context->getModuleName();
if ('informationobject' == $mod) {
$mod = 'information object';
}
$title = $this->context->i18n->__(ucfirst($mod));
$this->response->setTitle("{$title} browse - {$this->response->getTitle()}");

// Force subclassing
if ('default' == $this->context->getModuleName() && 'browse' == $this->context->getActionName()) {
$this->forward404();
Expand Down
3 changes: 3 additions & 0 deletions apps/qubit/modules/function/actions/browseAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class FunctionBrowseAction extends sfAction
{
public function execute($request)
{
$title = $this->context->i18n->__('Function');
$this->response->setTitle("{$title} browse - {$this->response->getTitle()}");

if (!isset($request->limit)) {
$request->limit = sfConfig::get('app_hits_per_page');
}
Expand Down
3 changes: 3 additions & 0 deletions apps/qubit/modules/menu/actions/listAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class MenuListAction extends sfAction
{
public function execute($request)
{
$title = $this->context->i18n->__('Site menu list');
$this->response->setTitle("{$title} - {$this->response->getTitle()}");

// Re-order menus if "move" parameter passed
if (isset($request->move) && $menu = QubitMenu::getById($request->move)) {
if (isset($request->before)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ public function execute($request)
switch ($this->type) {
case 'csv':
$this->title = $this->context->i18n->__('Import CSV');
$this->response->setTitle("{$this->title} - {$this->response->getTitle()}");

break;

case 'xml':
$this->title = $this->context->i18n->__('Import XML');
$this->response->setTitle("{$this->title} - {$this->response->getTitle()}");

break;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function execute($request)
}
} else {
$this->title = $this->context->i18n->__('Validate CSV');
$this->response->setTitle("{$this->title} - {$this->response->getTitle()}");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class PhysicalObjectBrowseAction extends sfAction
{
public function execute($request)
{
$title = $this->context->i18n->__('Physical storage');
$this->response->setTitle("{$title} - {$this->response->getTitle()}");

if (!isset($request->limit)) {
$request->limit = sfConfig::get('app_hits_per_page');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class RightsHolderBrowseAction extends sfAction
{
public function execute($request)
{
$title = $this->context->i18n->__('Rights holders');
$this->response->setTitle("{$title} - {$this->response->getTitle()}");

if (!isset($request->limit)) {
$request->limit = sfConfig::get('app_hits_per_page');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class SearchDescriptionUpdatesAction extends sfAction

public function execute($request)
{
$title = $this->context->i18n->__('Newest additions');
$this->response->setTitle("{$title} - {$this->response->getTitle()}");

// Store user and user URL for convenience
if (!empty($userUrl = $request->getGetParameter('user'))) {
$params = $this->context->routing->parse($userUrl);
Expand Down
3 changes: 3 additions & 0 deletions apps/qubit/modules/settings/actions/menuComponent.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class SettingsMenuComponent extends sfComponent
{
public function execute($request)
{
$title = $this->context->i18n->__(ucfirst(implode(' ', array_map('strtolower', preg_split('/(?=[A-Z])/', $this->context->getActionName())))));
$this->response->setTitle("{$title} setting - {$this->response->getTitle()}");

$i18n = $this->context->i18n;
$this->nodes = [
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class SettingsVisibleElementsAction extends sfAction
{
public function execute($request)
{
$title = $this->context->i18n->__('Visible elements');
$this->response->setTitle("{$title} - {$this->response->getTitle()}");

$this->form = new sfForm();

foreach (QubitSetting::getByScope('element_visibility') as $item) {
Expand Down
3 changes: 3 additions & 0 deletions apps/qubit/modules/staticpage/actions/listAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class StaticPageListAction extends sfAction
{
public function execute($request)
{
$title = $this->context->i18n->__('Static pages');
$this->response->setTitle("{$title} - {$this->response->getTitle()}");

if (!isset($request->limit)) {
$request->limit = sfConfig::get('app_hits_per_page');
}
Expand Down
13 changes: 13 additions & 0 deletions apps/qubit/modules/taxonomy/actions/indexAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,19 @@ public function execute($request)
$this->icon = 'map-marker-alt';
}

$title = $this->context->i18n->__('Places');
$this->response->setTitle("{$title} - {$this->response->getTitle()}");

break;

case QubitTaxonomy::SUBJECT_ID:
$this->icon = 'subjects';
$this->addIoCountColumn = true;
$this->addActorCountColumn = true;

$title = $this->context->i18n->__('Subjects');
$this->response->setTitle("{$title} - {$this->response->getTitle()}");

if (sfConfig::get('app_b5_theme', false)) {
$this->icon = 'tag';
}
Expand All @@ -153,7 +159,14 @@ public function execute($request)
$this->addIoCountColumn = true;
$this->addActorCountColumn = true;

$title = $this->context->i18n->__('Genres');
$this->response->setTitle("{$title} - {$this->response->getTitle()}");

break;

default:
$title = $this->context->i18n->__(ucwords(str_replace('-', ' ', $this->request->slug)));
$this->response->setTitle("{$title} - {$this->response->getTitle()}");
}

$culture = $this->context->user->getCulture();
Expand Down
3 changes: 3 additions & 0 deletions apps/qubit/modules/taxonomy/actions/listAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class TaxonomyListAction extends sfAction
{
public function execute($request)
{
$title = $this->context->i18n->__(ucfirst($this->context->getModuleName()));
$this->response->setTitle("{$title} - {$this->response->getTitle()}");

if (!isset($request->limit)) {
$request->limit = sfConfig::get('app_hits_per_page');
}
Expand Down
3 changes: 3 additions & 0 deletions apps/qubit/modules/user/actions/listAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class UserListAction extends sfAction
{
public function execute($request)
{
$title = $this->context->i18n->__('List users');
$this->response->setTitle("{$title} - {$this->response->getTitle()}");

if (!isset($request->limit)) {
$request->limit = sfConfig::get('app_hits_per_page');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class aclGroupListAction extends sfAction
{
public function execute($request)
{
$title = $this->context->i18n->__('List groups');
$this->response->setTitle("{$title} - {$this->response->getTitle()}");

if (!isset($request->limit)) {
$request->limit = sfConfig::get('app_hits_per_page');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class AccessionBrowseAction extends sfAction
{
public function execute($request)
{
$title = $this->context->i18n->__(ucfirst($this->context->getModuleName()));
$this->response->setTitle("{$title} - {$this->response->getTitle()}");

if (!isset($request->limit)) {
$request->limit = sfConfig::get('app_hits_per_page');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class DonorBrowseAction extends sfAction
{
public function execute($request)
{
$title = $this->context->i18n->__(ucfirst($this->context->getModuleName()));
$this->response->setTitle("{$title} - {$this->response->getTitle()}");

if (!isset($request->limit)) {
$request->limit = sfConfig::get('app_hits_per_page');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class sfPluginAdminPluginPluginsAction extends sfAction
{
public function execute($request)
{
$title = $this->context->i18n->__('List plugins');
$this->response->setTitle("{$title} - {$this->response->getTitle()}");

$this->form = new sfForm();
$this->defaultTemplate = sfConfig::get('app_default_template_informationobject');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class sfPluginAdminPluginThemesAction extends sfAction
{
public function execute($request)
{
$title = $this->context->i18n->__('List themes');
$this->response->setTitle("{$title} - {$this->response->getTitle()}");

$this->form = new sfForm();

if (!$this->context->user->isAdministrator()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class sfSkosPluginImportAction extends DefaultEditAction

public function execute($request)
{
$title = $this->context->i18n->__('SKOS import');
$this->response->setTitle("{$title} - {$this->response->getTitle()}");

parent::execute($request);

if ($request->isMethod('post')) {
Expand Down

0 comments on commit 60c961c

Please sign in to comment.