From efd4f990fa7c2a9fb398bf3e40bc1f5a54074804 Mon Sep 17 00:00:00 2001 From: coderkun Date: Sun, 9 Feb 2014 13:37:40 +0100 Subject: [PATCH] implement basic Questgroups and Quests structure --- .../QuestgroupshierarchypathAgent.inc | 35 +++++ agents/intermediate/QuestgroupsAgent.inc | 36 +++++ agents/intermediate/QuestsAgent.inc | 36 +++++ configs/AppConfig.inc | 11 +- controllers/QuestgroupsController.inc | 95 ++++++++++++ .../QuestgroupshierarchypathController.inc | 76 ++++++++++ controllers/QuestsController.inc | 78 ++++++++++ controllers/SeminariesController.inc | 9 +- locale/de_DE/LC_MESSAGES/The Legend of Z.mo | Bin 1805 -> 1888 bytes locale/de_DE/LC_MESSAGES/The Legend of Z.po | 14 +- models/QuestgroupsModel.inc | 143 ++++++++++++++++++ models/QuestgroupshierarchyModel.inc | 103 +++++++++++++ models/QuestsModel.inc | 85 +++++++++++ models/SeminariesModel.inc | 6 +- views/html/questgroups/questgroup.tpl | 29 ++++ views/html/questgroupshierarchypath/index.tpl | 8 + views/html/quests/index.tpl | 0 views/html/quests/quest.tpl | 7 + views/html/seminaries/seminary.tpl | 11 ++ 19 files changed, 774 insertions(+), 8 deletions(-) create mode 100644 agents/bottomlevel/QuestgroupshierarchypathAgent.inc create mode 100644 agents/intermediate/QuestgroupsAgent.inc create mode 100644 agents/intermediate/QuestsAgent.inc create mode 100644 controllers/QuestgroupsController.inc create mode 100644 controllers/QuestgroupshierarchypathController.inc create mode 100644 controllers/QuestsController.inc create mode 100644 models/QuestgroupsModel.inc create mode 100644 models/QuestgroupshierarchyModel.inc create mode 100644 models/QuestsModel.inc create mode 100644 views/html/questgroups/questgroup.tpl create mode 100644 views/html/questgroupshierarchypath/index.tpl create mode 100644 views/html/quests/index.tpl create mode 100644 views/html/quests/quest.tpl diff --git a/agents/bottomlevel/QuestgroupshierarchypathAgent.inc b/agents/bottomlevel/QuestgroupshierarchypathAgent.inc new file mode 100644 index 00000000..a2cb8086 --- /dev/null +++ b/agents/bottomlevel/QuestgroupshierarchypathAgent.inc @@ -0,0 +1,35 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\bottomlevel; + + + /** + * Agent to display the Questgroups hierarchy path. + * + * @author Oliver Hanraths + */ + class QuestgroupshierarchypathAgent extends \nre\agents\BottomlevelAgent + { + + + + + /** + * Action: index. + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + } + + } + +?> diff --git a/agents/intermediate/QuestgroupsAgent.inc b/agents/intermediate/QuestgroupsAgent.inc new file mode 100644 index 00000000..52ecd4e1 --- /dev/null +++ b/agents/intermediate/QuestgroupsAgent.inc @@ -0,0 +1,36 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\intermediate; + + + /** + * Agent to display Questgroups. + * + * @author Oliver Hanraths + */ + class QuestgroupsAgent extends \nre\agents\IntermediateAgent + { + + + + + /** + * Action: questgroup. + */ + public function questgroup(\nre\core\Request $request, \nre\core\Response $response) + { + $this->addSubAgent('Questgroupshierarchypath', 'index', $request->getParam(3), $request->getParam(4)); + } + + } + +?> diff --git a/agents/intermediate/QuestsAgent.inc b/agents/intermediate/QuestsAgent.inc new file mode 100644 index 00000000..e58e5092 --- /dev/null +++ b/agents/intermediate/QuestsAgent.inc @@ -0,0 +1,36 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\intermediate; + + + /** + * Agent to display Quests. + * + * @author Oliver Hanraths + */ + class QuestsAgent extends \nre\agents\IntermediateAgent + { + + + + + /** + * Action: quest. + */ + public function quest(\nre\core\Request $request, \nre\core\Response $response) + { + $this->addSubAgent('Questgroupshierarchypath', 'index', $request->getParam(3), $request->getParam(4), true); + } + + } + +?> diff --git a/configs/AppConfig.inc b/configs/AppConfig.inc index aeafd57e..82134781 100644 --- a/configs/AppConfig.inc +++ b/configs/AppConfig.inc @@ -70,11 +70,17 @@ * @var array */ public static $routes = array( - array('css/?(.*)', 'css/$1?layout=stylesheet', false), + array('css/?(.*)', 'css/$1?layout=stylesheet', true), array('users/([^/]+)/(edit|delete)', 'users/$2/$1', true), array('users/(?!(index|login|logout|create|edit|delete))', 'users/user/$1', true), array('seminaries/([^/]+)/(edit|delete)', 'seminaries/$2/$1', true), - array('seminaries/(?!(index|create|edit|delete))', 'seminaries/seminary/$1', true) + array('seminaries/(?!(index|create|edit|delete))', 'seminaries/seminary/$1', true), + /*// z/ ⇒ z/seminaries/seminary/ + array('^([^/]+)/*$', 'seminaries/seminary/$1', true), + // z// ⇒ z/questgroups/questgroup// + array('^([^/]+)/([^/]+)/?$', 'questgropus/questgroup/$1/$2', true), + // z/// ⇒ z/quests/quest/// + array('^([^/]+)/([^/]+)/([^/]+)/?$', 'quests/quest/$1/$2/3', true)*/ ); @@ -88,6 +94,7 @@ array('users/user/(.*)', 'users/$1', true), array('users/([^/]+)/(.*)', 'users/$2/$1', true), array('seminaries/seminary/(.*)', 'seminaries/$1', false) + //array('seminaries/seminary/(.*)', '$1', false) ); diff --git a/controllers/QuestgroupsController.inc b/controllers/QuestgroupsController.inc new file mode 100644 index 00000000..2ab68d9e --- /dev/null +++ b/controllers/QuestgroupsController.inc @@ -0,0 +1,95 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the QuestgroupsAgent to display Questgroups. + * + * @author Oliver Hanraths + */ + class QuestgroupsController extends \hhu\z\controllers\SeminaryRoleController + { + /** + * Required models + * + * @var array + */ + public $models = array('seminaries', 'questgroupshierarchy', 'questgroups', 'quests'); + /** + * User permissions + * + * @var array + */ + public $permissions = array( + 'questgroup' => array('admin', 'moderator', 'user') + ); + /** + * User seminary permissions + * + * @var array + */ + public $seminaryPermissions = array( + 'questgroup' => array('admin', 'moderator', 'user') + ); + + + + + /** + * Action: questgroup. + * + * Display a Questgroup and its data. + * + * @throws IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $questgroupUrl URL-Title of a Questgroup + */ + public function questgroup($seminaryUrl, $questgroupUrl) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questgroup + $questgroup = $this->Questgroups->getQuestgroupByUrl($seminary['id'], $questgroupUrl); + + // Get Questgrouphierarchy + $questgroupshierarchy = $this->Questgroupshierarchy->getHierarchyById($questgroup['questgroupshierarchy_id']); + + // Get child Questgroupshierarchy + $childQuestgroupshierarchy = $this->Questgroupshierarchy->getChildQuestgroupshierarchy($questgroupshierarchy['id']); + foreach($childQuestgroupshierarchy as &$hierarchy) { + $hierarchy['questgroups'] = $this->Questgroups->getQuestgroupsForHierarchy($hierarchy['id'], $questgroup['id']); + } + + // Get texts + $questgroupTexts = $this->Questgroups->getQuestgroupTexts($questgroup['id']); + + // Get Quests + $quests = null; + if(count($childQuestgroupshierarchy) == 0) { + $quests = $this->Quests->getQuestsForQuestgroup($questgroup['id']); + } + + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('questgroup', $questgroup); + $this->set('questgroupshierarchy', $questgroupshierarchy); + $this->set('childquestgroupshierarchy', $childQuestgroupshierarchy); + $this->set('texts', $questgroupTexts); + $this->set('quests', $quests); + } + + } + +?> diff --git a/controllers/QuestgroupshierarchypathController.inc b/controllers/QuestgroupshierarchypathController.inc new file mode 100644 index 00000000..e746d198 --- /dev/null +++ b/controllers/QuestgroupshierarchypathController.inc @@ -0,0 +1,76 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of QuestgroupshierarchypathAgent to display the + * Questgroups hierarchy path. + * + * @author Oliver Hanraths + */ + class QuestgroupshierarchypathController extends \hhu\z\Controller + { + /** + * Required models + * + * @var array + */ + public $models = array('seminaries', 'questgroups', 'questgroupshierarchy'); + + + + + /** + * Action: index. + * + * Calculate and show the hierarchy path of a Questgroup. + * + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $questgroupUrl URL-Title of a Questgroup + * @param boolean $showGroup Show the current group itself + */ + public function index($seminaryUrl, $questgroupUrl, $showGroup=false) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questgroup + $questgroup = $this->Questgroups->getQuestgroupByUrl($seminary['id'], $questgroupUrl); + + // Get parent Questgrouphierarchy + $parentQuestgroupshierarchy = array(); + $currentQuestgroup = $questgroup; + if($showGroup) { + $currentQuestgroup['hierarchy'] = $this->Questgroupshierarchy->getHierarchyById($currentQuestgroup['questgroupshierarchy_id']); + array_unshift($parentQuestgroupshierarchy, $currentQuestgroup); + } + while(!is_null($currentQuestgroup['parent_questgroup_id'])) + { + // Get Questgroup + $currentQuestgroup = $this->Questgroups->GetQuestgroupById($currentQuestgroup['parent_questgroup_id']); + + // Get Questgroupshierarchy + $currentQuestgroup['hierarchy'] = $this->Questgroupshierarchy->getHierarchyById($currentQuestgroup['questgroupshierarchy_id']); + + array_unshift($parentQuestgroupshierarchy, $currentQuestgroup); + } + + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('parentquestgroupshierarchy', $parentQuestgroupshierarchy); + } + + } + +?> diff --git a/controllers/QuestsController.inc b/controllers/QuestsController.inc new file mode 100644 index 00000000..f8b41332 --- /dev/null +++ b/controllers/QuestsController.inc @@ -0,0 +1,78 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of the QuestsAgent to display Quests. + * + * @author Oliver Hanraths + */ + class QuestsController extends \hhu\z\controllers\SeminaryRoleController + { + /** + * Required models + * + * @var array + */ + public $models = array('seminaries', 'questgroups', 'quests'); + /** + * User permissions + * + * @var array + */ + public $permissions = array( + 'quest' => array('admin', 'moderator', 'user') + ); + /** + * User seminary permissions + * + * @var array + */ + public $seminaryPermissions = array( + 'quest' => array('admin', 'moderator', 'user') + ); + + + + + /** + * Action: quest. + * + * Show a quest and its task. + * + * @throws IdNotFoundException + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $questgroupUrl URL-Title of a Questgroup + * @param string $questUrl URL-Title of a Quest + */ + public function quest($seminaryUrl, $questgroupUrl, $questUrl) + { + // Get seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questgroup + $questgroup = $this->Questgroups->getQuestgroupByUrl($seminary['id'], $questgroupUrl); + + // Get Quest + $quest = $this->Quests->getQuestByUrl($seminary['id'], $questgroup['id'], $questUrl); + + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('questgroup', $questgroup); + $this->set('quest', $quest); + } + + } + +?> diff --git a/controllers/SeminariesController.inc b/controllers/SeminariesController.inc index 1df4d5a4..94303d88 100644 --- a/controllers/SeminariesController.inc +++ b/controllers/SeminariesController.inc @@ -24,7 +24,7 @@ * * @var array */ - public $models = array('seminaries', 'users'); + public $models = array('seminaries', 'users', 'questgroupshierarchy', 'questgroups'); /** * User permissions * @@ -90,9 +90,16 @@ // Created user $seminary['creator'] = $this->Users->getUserById($seminary['created_user_id']); + // Questgrouphierarchy and Questgroups + $questgroupshierarchy = $this->Questgroupshierarchy->getHierarchyForSeminary($seminary['id']); + foreach($questgroupshierarchy as &$hierarchy) { + $hierarchy['questgroups'] = $this->Questgroups->getQuestgroupsForHierarchy($hierarchy['id']); + } + // Pass data to view $this->set('seminary', $seminary); + $this->set('questgroupshierarchy', $questgroupshierarchy); } diff --git a/locale/de_DE/LC_MESSAGES/The Legend of Z.mo b/locale/de_DE/LC_MESSAGES/The Legend of Z.mo index 621bc112b8c5dacdd562cb787b33290e193e8a09..ab0f294c9cf370b826dbce9096447d57728a950e 100644 GIT binary patch delta 748 zcmYk)PbfrD6vy$yycuIK{*3?svXLzOnaN_XuwccCB1_VgB5K%KOetlf=w+v@St+rQ zg^d&&*(ssy#6q#5=-@4h?to_o)G8}Y|@?!Lm?Hlm5vNb~Z{+VKSyoB3uj z+``Y6HXA zh2z+bYi|4)HSg5*&yj`g%6Ws@_^s=|qBiu79{DZoneB4g7%I^|Su61fYw;3wvL`IZ zH&g{eWYNM2RKhkcTDTKckpbkdHiGCiF^Km zs?-GfRFn^c_oeboaI-Q++*Yzszg?*F8*o$-G!FZ;p8xe>Qv(VcvXZ!S9Sb`~an@ BLZJWv delta 664 zcmYk(J4*vW6o%oGWD`w{QDZdT5F70z7f6%Z%FchFAc#L8g$M>j8^J=BpkN^if`VWX zg4k#yUcf?Z#UR>#nccH<&ORm96Xkl+s~BUD7$QE2QQ|hhg)tp8 z>&6-Ez>;$n+n86d9d|K`#~8*_?8I}7L6A0@B()z?gmpAhn2lBHYF4_-sQ2}vGU>bGcG1Pq-%wYkGyx->B#vZCw2dD>XsFt2Nud#>u zz1x399rWGphg!_^)zXB9J}FJL0YV4Spy)<1DonX%3F{|Pgu0*(kgw4yy}UWd-Ke_P zEvOP5Qk5p%S`!tagQ+_j{&w)tpA3D+a^v~JNIqLE + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\models; + + + /** + * Model to interact with Questgroups-table. + * + * @author Oliver Hanraths + */ + class QuestgroupsModel extends \hhu\z\Model + { + + + + + /** + * Construct a new QuestgroupsModel. + */ + public function __construct() + { + parent::__construct(); + } + + + + + /** + * Get all Questgroups for a Questgroup hierarchy. + * + * @param int $hierarchyId ID of the Questgroup hierarchy to get Questgroups for + * @param int $parentQuestgroupId ID of the parent Questgroup hierarchy + * @return array Questgroups for the given hierarchy + */ + public function getQuestgroupsForHierarchy($hierarchyId, $parentQuestgroupId=null) + { + if(is_null($parentQuestgroupId)) + { + return $this->db->query( + 'SELECT id, questgroupshierarchy_id, pos, title, url '. + 'FROM questgroups '. + 'WHERE questgroups.questgroupshierarchy_id = ? AND parent_questgroup_id IS NULL '. + 'ORDER BY questgroups.pos ASC', + 'i', + $hierarchyId + ); + } + else + { + return $this->db->query( + 'SELECT id, questgroupshierarchy_id, pos, title, url '. + 'FROM questgroups '. + 'WHERE questgroups.questgroupshierarchy_id = ? AND parent_questgroup_id = ? '. + 'ORDER BY questgroups.pos ASC', + 'ii', + $hierarchyId, $parentQuestgroupId + ); + } + } + + + /** + * Get a Questgroup by its ID. + * + * @throws IdNotFoundException + * @param int $questgroupId ID of a Questgroup + * @return array Questgroup data + */ + public function getQuestgroupById($questgroupId) + { + $data = $this->db->query( + 'SELECT id, questgroupshierarchy_id, parent_questgroup_id, pos, title, url '. + 'FROM questgroups '. + 'WHERE questgroups.id = ?', + 'i', + $questgroupId + ); + if(empty($data)) { + throw new \nre\exceptions\IdNotFoundException($questgroupId); + } + + + return $data[0]; + } + + + /** + * Get a Questgroup by its URL. + * + * @throws IdNotFoundException + * @param int $seminaryId ID of the corresponding seminary + * @param string $questgroupURL URL-title of a Questgroup + * @return array Questgroup data + */ + public function getQuestgroupByUrl($seminaryId, $questgroupUrl) + { + $data = $this->db->query( + 'SELECT questgroups.id, questgroups.questgroupshierarchy_id, questgroups.parent_questgroup_id, questgroups.pos, questgroups.title, questgroups.url '. + 'FROM questgroups '. + 'LEFT JOIN questgroupshierarchy ON questgroupshierarchy.id = questgroups.questgroupshierarchy_id '. + 'WHERE questgroupshierarchy.seminary_id = ? AND questgroups.url = ?', + 'is', + $seminaryId, $questgroupUrl + ); + if(empty($data)) { + throw new \nre\exceptions\IdNotFoundException($questgroupUrl); + } + + + return $data[0]; + } + + + /** + * Get texts of a Questgroup. + * + * @param int $questgroupId ID of a Questgroup + * @return array Texts of this Questgroup + */ + public function getQuestgroupTexts($questgroupId) + { + return $this->db->query( + 'SELECT id, pos, text '. + 'FROM questgrouptexts '. + 'WHERE questgroup_id = ? '. + 'ORDER BY pos ASC', + 'i', + $questgroupId + ); + } + + } + +?> diff --git a/models/QuestgroupshierarchyModel.inc b/models/QuestgroupshierarchyModel.inc new file mode 100644 index 00000000..df676ea4 --- /dev/null +++ b/models/QuestgroupshierarchyModel.inc @@ -0,0 +1,103 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\models; + + + /** + * Model to interact with Questgroupshierarchy-table. + * + * @author Oliver Hanraths + */ + class QuestgroupshierarchyModel extends \hhu\z\Model + { + + + + + /** + * Construct a new QuestgroupshierarchyModel. + */ + public function __construct() + { + parent::__construct(); + } + + + + + /** + * Get a Questgroup hierarchy by its ID. + * + * throws IdNotFoundException + * @param int $questgroupshierarchyId ID of a Questgroup hierarchy + * @return array Questgroup hierarchy + */ + public function getHierarchyById($questgroupshierarchyId) + { + $data = $this->db->query( + 'SELECT id, seminary_id, parent_questgroupshierarchy_id, pos, title_singular, title_plural, url '. + 'FROM questgroupshierarchy '. + 'WHERE questgroupshierarchy.id = ?', + 'i', + $questgroupshierarchyId + ); + if(empty($data)) { + throw new \nre\exceptions\IdNotFoundException($questgroupshierarchyId); + } + + + return $data[0]; + } + + + /** + * Get the toplevel hierarchy entries of a Seminary. + * + * @param int $seminaryId ID of the seminary to get hierarchy for + * @return array Toplevel hierarchy + */ + public function getHierarchyForSeminary($seminaryId) + { + return $this->db->query( + 'SELECT id, seminary_id, parent_questgroupshierarchy_id, pos, title_singular, title_plural, url '. + 'FROM questgroupshierarchy '. + 'WHERE '. + 'questgroupshierarchy.seminary_id = ? AND '. + 'questgroupshierarchy.parent_questgroupshierarchy_id IS NULL '. + 'ORDER BY questgroupshierarchy.pos ASC', + 'i', + $seminaryId + ); + } + + + /** + * Get the child hierarchy entries of a Questgroup hierarchy. + * + * @param int $questgroupshierarchyId ID of a Questgroup hierarchy + * @return array Child Questgroup hierarchy entries + */ + public function getChildQuestgroupshierarchy($questgroupshierarchyId) + { + return $this->db->query( + 'SELECT id, seminary_id, parent_questgroupshierarchy_id, pos, title_singular, title_plural, url '. + 'FROM questgroupshierarchy '. + 'WHERE questgroupshierarchy.parent_questgroupshierarchy_id = ? '. + 'ORDER BY questgroupshierarchy.pos ASC', + 'i', + $questgroupshierarchyId + ); + } + + } + +?> diff --git a/models/QuestsModel.inc b/models/QuestsModel.inc new file mode 100644 index 00000000..c4770488 --- /dev/null +++ b/models/QuestsModel.inc @@ -0,0 +1,85 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\models; + + + /** + * Model to interact with Quests-table. + * + * @author Oliver Hanraths + */ + class QuestsModel extends \hhu\z\Model + { + + + + + /** + * Construct a new QuestsModel. + */ + public function __construct() + { + parent::__construct(); + } + + + + + /** + * Get all Quests for the given Questgroup. + * + * @param int $questgroupId ID of a Questgroup + * @return array Quests of the given Questgroup + */ + public function getQuestsForQuestgroup($questgroupId) + { + return $this->db->query( + 'SELECT id, questtype_id, title, url, xps, text '. + 'FROM quests '. + 'WHERE questgroup_id = ?', + 'i', + $questgroupId + ); + } + + + /** + * Get a Quest and its data by its URL. + * + * @throws IdNotFoundException + * @param int $seminaryId ID of the corresponding Seminary + * @param int $questgroupId ID of the corresponding Questgroup + * @param string $questURL URL-title of a Quest + * @return array Quest data + */ + public function getQuestByUrl($seminaryId, $questgroupId, $questUrl) + { + $data = $this->db->query( + 'SELECT quests.id, quests.questtype_id, quests.title, quests.url, quests.xps, quests.text '. + 'FROM quests '. + 'LEFT JOIN questgroups ON questgroups.id = quests.questgroup_id '. + 'LEFT JOIN questgroupshierarchy ON questgroupshierarchy.id = questgroups.questgroupshierarchy_id '. + 'WHERE questgroupshierarchy.seminary_id = ? AND questgroups.id = ? AND quests.url = ?', + 'iis', + $seminaryId, $questgroupId, $questUrl + ); + if(empty($data)) { + throw new \nre\exceptions\IdNotFoundException($questUrl); + } + + + return $data[0]; + } + + } + +?> diff --git a/models/SeminariesModel.inc b/models/SeminariesModel.inc index 03ccc2f0..15963271 100644 --- a/models/SeminariesModel.inc +++ b/models/SeminariesModel.inc @@ -43,7 +43,7 @@ { // Get seminaries return $this->db->query( - 'SELECT id, created, created_user_id, title, url '. + 'SELECT id, created, created_user_id, title, url, description '. 'FROM seminaries '. 'ORDER BY created DESC' ); @@ -60,7 +60,7 @@ public function getSeminaryById($seminaryId) { $seminary = $this->db->query( - 'SELECT id, created, created_user_id, title, url '. + 'SELECT id, created, created_user_id, title, url, description '. 'FROM seminaries '. 'WHERE id = ?', 'i', @@ -85,7 +85,7 @@ public function getSeminaryByUrl($seminaryUrl) { $seminary = $this->db->query( - 'SELECT id, created, created_user_id, title, url '. + 'SELECT id, created, created_user_id, title, url, description '. 'FROM seminaries '. 'WHERE url = ?', 's', diff --git a/views/html/questgroups/questgroup.tpl b/views/html/questgroups/questgroup.tpl new file mode 100644 index 00000000..3cca41f4 --- /dev/null +++ b/views/html/questgroups/questgroup.tpl @@ -0,0 +1,29 @@ +

+

+ + + +

:

+ +

+ + + + 0) : ?> +

+
    + +
  • :
  • + +
+ + + + +

Quests

+
    + +
  • + +
+ diff --git a/views/html/questgroupshierarchypath/index.tpl b/views/html/questgroupshierarchypath/index.tpl new file mode 100644 index 00000000..2c583bb6 --- /dev/null +++ b/views/html/questgroupshierarchypath/index.tpl @@ -0,0 +1,8 @@ + 0) : ?> +Pfad: + + diff --git a/views/html/quests/index.tpl b/views/html/quests/index.tpl new file mode 100644 index 00000000..e69de29b diff --git a/views/html/quests/quest.tpl b/views/html/quests/quest.tpl new file mode 100644 index 00000000..1dc1fc0d --- /dev/null +++ b/views/html/quests/quest.tpl @@ -0,0 +1,7 @@ +

+

+ + + +

+

diff --git a/views/html/seminaries/seminary.tpl b/views/html/seminaries/seminary.tpl index d033df1c..2f63cdfa 100644 --- a/views/html/seminaries/seminary.tpl +++ b/views/html/seminaries/seminary.tpl @@ -7,3 +7,14 @@

format(new \DateTime($seminary['created'])))?>

+

Beschreibung

+

+ + +

+
    + +
  • :
  • + +
+