add a meaningful title to HTML-pages (Issue #185)
This commit is contained in:
parent
9a1e3f9152
commit
dde0a50e04
22 changed files with 334 additions and 39 deletions
|
|
@ -158,6 +158,10 @@
|
|||
$character['rank'] = $this->Achievements->getCountRank($seminary['id'], count($achievedAchievements));
|
||||
|
||||
|
||||
// Set title
|
||||
$this->addTitleLocalized('Achievements');
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('character', $character);
|
||||
|
|
|
|||
|
|
@ -86,6 +86,10 @@
|
|||
$groupsgroups = $this->Charactergroups->getGroupsroupsForSeminary($seminary['id']);
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized('Character Groups');
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('groupsgroups', $groupsgroups);
|
||||
|
|
@ -117,6 +121,11 @@
|
|||
$quests = $this->Charactergroupsquests->getQuestsForCharactergroupsgroup($groupsgroup['id']);
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitle($groupsgroup['name']);
|
||||
$this->addTitleLocalized('Character Groups');
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('groupsgroup', $groupsgroup);
|
||||
|
|
@ -178,6 +187,10 @@
|
|||
}
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized('New Character groups-group');
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('charactergroupsgroupname', $charactergroupsgroupname);
|
||||
|
|
@ -243,6 +256,10 @@
|
|||
}
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized('Edit Character groups-group');
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('charactergroupsgroupname', $charactergroupsgroupname);
|
||||
|
|
@ -287,6 +304,10 @@
|
|||
}
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized('Delete Character groups-group');
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('groupsgroup', $groupsgroup);
|
||||
|
|
@ -330,6 +351,11 @@
|
|||
$quests = $this->Charactergroupsquests->getQuestsForGroup($group['id']);
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitle($group['name']);
|
||||
$this->addTitle($groupsgroup['name']);
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('groupsgroup', $groupsgroup);
|
||||
|
|
@ -411,6 +437,11 @@
|
|||
}
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitle($group['name']);
|
||||
$this->addTitle($groupsgroup['name']);
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('groupsgroup', $groupsgroup);
|
||||
|
|
@ -478,6 +509,11 @@
|
|||
}
|
||||
|
||||
|
||||
// Set title
|
||||
$this->addTitleLocalized('New %s Character group', $groupsgroup['name']);
|
||||
$this->addTitle($groupsgroup['name']);
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('groupsgroup', $groupsgroup);
|
||||
|
|
@ -549,6 +585,11 @@
|
|||
}
|
||||
|
||||
|
||||
// Set title
|
||||
$this->addTitleLocalized('Edit %s Character group', $groupsgroup['name']);
|
||||
$this->addTitle($groupsgroup['name']);
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('groupsgroup', $groupsgroup);
|
||||
|
|
@ -599,6 +640,11 @@
|
|||
}
|
||||
|
||||
|
||||
// Set title
|
||||
$this->addTitleLocalized('Delete %s Character group', $groupsgroup['name']);
|
||||
$this->addTitle($groupsgroup['name']);
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('groupsgroup', $groupsgroup);
|
||||
|
|
|
|||
|
|
@ -94,6 +94,11 @@
|
|||
}
|
||||
|
||||
|
||||
// Set title
|
||||
$this->addTitle($quest['title']);
|
||||
$this->addTitle($groupsgroup['name']);
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('groupsgroup', $groupsgroup);
|
||||
|
|
@ -226,7 +231,10 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
// Set title
|
||||
$this->addTitle($quest['title']);
|
||||
$this->addTitle($groupsgroup['name']);
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
|
|
@ -327,6 +335,11 @@
|
|||
}
|
||||
|
||||
|
||||
// Set title
|
||||
$this->addTitleLocalized('New %s-Quest', $groupsgroup['name']);
|
||||
$this->addTitle($groupsgroup['name']);
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('groupsgroup', $groupsgroup);
|
||||
|
|
@ -436,6 +449,11 @@
|
|||
}
|
||||
|
||||
|
||||
// Set title
|
||||
$this->addTitleLocalized('Edit %s-Quest', $groupsgroup['name']);
|
||||
$this->addTitle($groupsgroup['name']);
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('groupsgroup', $groupsgroup);
|
||||
|
|
@ -492,6 +510,11 @@
|
|||
}
|
||||
|
||||
|
||||
// Set title
|
||||
$this->addTitleLocalized('Delete %s-Quest', $groupsgroup['name']);
|
||||
$this->addTitle($groupsgroup['name']);
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('groupsgroup', $groupsgroup);
|
||||
|
|
|
|||
|
|
@ -108,6 +108,10 @@
|
|||
}
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized('Characters');
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('characters', $characters);
|
||||
|
|
@ -180,6 +184,11 @@
|
|||
}
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitle($character['name']);
|
||||
$this->addTitleLocalized('Characters');
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('character', $character);
|
||||
|
|
@ -294,6 +303,10 @@
|
|||
$xplevels = $this->Characters->getXPLevelsForSeminary($seminary['id']);
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized('Create Character');
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('types', $types);
|
||||
|
|
@ -421,6 +434,10 @@
|
|||
}
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized('Manage Characters');
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('characters', $characters);
|
||||
|
|
@ -546,6 +563,11 @@
|
|||
// Get XP-levels
|
||||
$xplevels = $this->Characters->getXPLevelsForSeminary($seminary['id']);
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized('Edit Character');
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('types', $types);
|
||||
|
|
@ -595,6 +617,10 @@
|
|||
}
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized('Delete Character');
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('character', $character);
|
||||
|
|
|
|||
|
|
@ -44,6 +44,19 @@
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Postfilter that is executed after running the Controller.
|
||||
*
|
||||
* @param Request $request Current request
|
||||
* @param Response $response Current response
|
||||
*/
|
||||
public function postFilter(\nre\core\Request $request, \nre\core\Response $response)
|
||||
{
|
||||
// Get title
|
||||
$this->set('title', $this->getTitle());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Action: index.
|
||||
*
|
||||
|
|
@ -63,6 +76,36 @@
|
|||
$this->set('notifications', $this->Notification->getNotifications());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get title information from IntermediateController if possible
|
||||
* and create a title.
|
||||
*
|
||||
* @return string Title for the current page
|
||||
*/
|
||||
private function getTitle()
|
||||
{
|
||||
$title = array();
|
||||
|
||||
// Get title of IntermediateController
|
||||
$intermediateController = $this->agent->getIntermediateAgent()->controller;
|
||||
if($intermediateController instanceof \hhu\z\controllers\IntermediateController) {
|
||||
$title = $intermediateController->getTitle();
|
||||
}
|
||||
if(!is_array($title)) {
|
||||
$title = array($title);
|
||||
}
|
||||
|
||||
// Add application name
|
||||
$title[] = \nre\configs\AppConfig::$app['name'];
|
||||
|
||||
|
||||
// Return title with delimiter
|
||||
return implode(\nre\configs\AppConfig::$misc['title_delimiter'], $title);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -77,6 +77,10 @@
|
|||
}
|
||||
|
||||
|
||||
// Set title
|
||||
$this->addTitleLocalized('Library');
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('totalQuestcount', $totalQuestcount);
|
||||
|
|
@ -124,6 +128,11 @@
|
|||
}
|
||||
|
||||
|
||||
// Set title
|
||||
$this->addTitle($questtopic['title']);
|
||||
$this->addTitleLocalized('Library');
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('questtopic', $questtopic);
|
||||
|
|
|
|||
|
|
@ -185,6 +185,15 @@
|
|||
}
|
||||
|
||||
|
||||
// Set titile
|
||||
if(!is_null($questgroup['hierarchy'])) {
|
||||
$this->addTitle(sprintf('%s %d: %s', $questgroup['hierarchy']['title_singular'], $questgroup['hierarchy']['questgroup_pos'], $questgroup['title']));
|
||||
}
|
||||
else {
|
||||
$this->addTitle($questgroup['title']);
|
||||
}
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('questgroup', $questgroup);
|
||||
|
|
@ -229,6 +238,10 @@
|
|||
}
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized('Create Questgroup');
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,6 +107,10 @@
|
|||
}
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized('Quests');
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('quests', $quests);
|
||||
|
|
@ -285,6 +289,10 @@
|
|||
}
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitle($quest['title']);
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('questgroup', $questgroup);
|
||||
|
|
@ -340,6 +348,11 @@
|
|||
$solvedSubmissionCharacters = $this->Characters->getCharactersSolvedQuest($quest['id']);
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized('Submissions');
|
||||
$this->addTitle($quest['title']);
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('questgroup', $questgroup);
|
||||
|
|
@ -391,6 +404,11 @@
|
|||
$output = $this->renderTaskSubmission($questtype['classname'], $seminary, $questgroup, $quest, $character);
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized('Submission of %s', $character['name']);
|
||||
$this->addTitle($quest['title']);
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('questgroup', $questgroup);
|
||||
|
|
@ -510,6 +528,10 @@
|
|||
}
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized('Create Quest');
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('questgroups', $questgroups);
|
||||
|
|
|
|||
|
|
@ -80,6 +80,9 @@
|
|||
}
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized('Seminaries');
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminaries', $seminaries);
|
||||
}
|
||||
|
|
@ -147,6 +150,9 @@
|
|||
}
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitle($seminary['title']);
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('questgroupshierarchy', $questgroupshierarchy);
|
||||
|
|
@ -172,6 +178,10 @@
|
|||
$user = $this->Seminaries->getSeminaryById($seminaryId);
|
||||
$this->redirect($this->linker->link(array($seminary['url']), 1));
|
||||
}
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized('New seminary');
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -208,6 +218,9 @@
|
|||
}
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized('Edit seminary');
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
}
|
||||
|
|
@ -244,6 +257,9 @@
|
|||
}
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized('Delete seminary');
|
||||
|
||||
// Show confirmation
|
||||
$this->set('seminary', $seminary);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,9 @@
|
|||
$users = $this->Users->getUsers();
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized('Users');
|
||||
|
||||
// Pass data to view
|
||||
$this->set('users', $users);
|
||||
}
|
||||
|
|
@ -103,6 +106,10 @@
|
|||
}
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized($user['username']);
|
||||
$this->addTitleLocalized('Users');
|
||||
|
||||
// Pass data to view
|
||||
$this->set('user', $user);
|
||||
$this->set('characters', $characters);
|
||||
|
|
@ -144,6 +151,9 @@
|
|||
}
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized('Login');
|
||||
|
||||
// Pass data to view
|
||||
$this->set('username', $username);
|
||||
$this->set('referrer', $referrer);
|
||||
|
|
@ -213,6 +223,9 @@
|
|||
}
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized('Registration');
|
||||
|
||||
// Pass data to view
|
||||
$this->set('username', $username);
|
||||
$this->set('prename', $prename);
|
||||
|
|
@ -326,6 +339,9 @@
|
|||
}
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized('Manage users');
|
||||
|
||||
// Pass data to view
|
||||
$this->set('users', $users);
|
||||
$this->set('selectedUsers', $selectedUsers);
|
||||
|
|
@ -388,6 +404,9 @@
|
|||
}
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized('New user');
|
||||
|
||||
// Pass data to view
|
||||
$this->set('username', $username);
|
||||
$this->set('prename', $prename);
|
||||
|
|
@ -476,6 +495,9 @@
|
|||
}
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized('Edit user');
|
||||
|
||||
// Pass data to view
|
||||
$this->set('username', $username);
|
||||
$this->set('prename', $prename);
|
||||
|
|
@ -517,6 +539,9 @@
|
|||
}
|
||||
|
||||
|
||||
// Set titile
|
||||
$this->addTitleLocalized('Delete user');
|
||||
|
||||
// Show confirmation
|
||||
$this->set('user', $user);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue