merge branch ?charactergroupsqueststations?
This commit is contained in:
parent
538e1aa8b0
commit
ba97244b15
13 changed files with 700 additions and 59 deletions
|
@ -104,6 +104,10 @@
|
|||
'charactergroupsquest' => array(
|
||||
'width' => 80,
|
||||
'height' => 80
|
||||
),
|
||||
'charactergroupsqueststation' => array(
|
||||
'width' => 100,
|
||||
'height' => 100
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -160,6 +164,38 @@
|
|||
'mimetype' => 'image/png',
|
||||
'size' => 10485760
|
||||
)
|
||||
),
|
||||
'stationimages' => array(
|
||||
array(
|
||||
'mimetype' => 'image/jpeg',
|
||||
'size' => 1048576
|
||||
),
|
||||
array(
|
||||
'mimetype' => 'image/png',
|
||||
'size' => 2097152
|
||||
)
|
||||
),
|
||||
'stationavs' => array(
|
||||
array(
|
||||
'mimetype' => 'audio/mpeg',
|
||||
'size' => 2097152
|
||||
),
|
||||
array(
|
||||
'mimetype' => 'audio/ogg',
|
||||
'size' => 2097152
|
||||
),
|
||||
array(
|
||||
'mimetype' => 'audio/opus',
|
||||
'size' => 2097152
|
||||
),
|
||||
array(
|
||||
'mimetype' => 'video/mp4',
|
||||
'size' => 2097152
|
||||
),
|
||||
array(
|
||||
'mimetype' => 'video/webm',
|
||||
'size' => 2097152
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
|
|
|
@ -89,12 +89,20 @@
|
|||
|
||||
// Get Stations
|
||||
$stations = null;
|
||||
if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) {
|
||||
$stations = $this->Charactergroupsqueststations->getStationsForQuest($quest['id']);
|
||||
}
|
||||
elseif(!is_null($charactergroup)) {
|
||||
$stations = $this->Charactergroupsqueststations->getStationsForQuestAndGroup($quest['id'], $charactergroup['id']);
|
||||
foreach($stations as &$station) {
|
||||
$stations = $this->Charactergroupsqueststations->getStationsForQuest($quest['id']);
|
||||
foreach($stations as &$station)
|
||||
{
|
||||
// Icon
|
||||
if(!is_null($station['stationpicture_id'])) {
|
||||
$station['picture'] = $this->Media->getSeminaryMediaById($station['stationpicture_id']);
|
||||
}
|
||||
|
||||
// Entered state
|
||||
if(!is_null($charactergroup)) {
|
||||
$station['entered'] = $this->Charactergroupsqueststations->hasCharactergroupEnteredStation(
|
||||
$station['id'],
|
||||
$charactergroup['id']
|
||||
);
|
||||
$station['solved'] = $this->Charactergroupsqueststations->hasCharactergroupSolvedStation(
|
||||
$station['id'],
|
||||
$charactergroup['id']
|
||||
|
|
|
@ -39,7 +39,11 @@
|
|||
*/
|
||||
public $permissions = array(
|
||||
'index' => array('admin', 'moderator', 'user'),
|
||||
'station' => array('admin', 'moderator', 'user')
|
||||
'station' => array('admin', 'moderator', 'user'),
|
||||
'create' => array('admin', 'moderator', 'user'),
|
||||
'edit' => array('admin', 'moderator', 'user'),
|
||||
'edittask' => array('admin', 'moderator', 'user'),
|
||||
'delete' => array('admin', 'moderator', 'user')
|
||||
);
|
||||
/**
|
||||
* User seminary permissions
|
||||
|
@ -48,7 +52,11 @@
|
|||
*/
|
||||
public $seminaryPermissions = array(
|
||||
'index' => array('admin', 'moderator', 'user'),
|
||||
'station' => array('admin', 'moderator', 'user')
|
||||
'station' => array('admin', 'moderator', 'user'),
|
||||
'create' => array('admin', 'moderator'),
|
||||
'edit' => array('admin', 'moderator'),
|
||||
'edittask' => array('admin', 'moderator'),
|
||||
'delete' => array('admin', 'moderator')
|
||||
);
|
||||
|
||||
|
||||
|
@ -124,8 +132,19 @@
|
|||
|
||||
// Get Station
|
||||
$station = $this->Charactergroupsqueststations->getStationByUrl($quest['id'], $stationUrl);
|
||||
if(!is_null($station['stationpicture_id'])) {
|
||||
$station['picture'] = $this->Media->getSeminaryMediaById($station['stationpicture_id']);
|
||||
|
||||
// Get media
|
||||
if(!is_null($station['rightimage_id'])) {
|
||||
$station['rightimage'] = $this->Media->getSeminaryMediaById($station['rightimage_id']);
|
||||
}
|
||||
if(!is_null($station['rightav_id'])) {
|
||||
$station['rightav'] = $this->Media->getSeminaryMediaById($station['rightav_id']);
|
||||
}
|
||||
if(!is_null($station['wrongimage_id'])) {
|
||||
$station['wrongimage'] = $this->Media->getSeminaryMediaById($station['wrongimage_id']);
|
||||
}
|
||||
if(!is_null($station['wrongav_id'])) {
|
||||
$station['wrongav'] = $this->Media->getSeminaryMediaById($station['wrongav_id']);
|
||||
}
|
||||
|
||||
// Get Character group
|
||||
|
@ -228,7 +247,9 @@
|
|||
}
|
||||
|
||||
// Get allowed mimetypes
|
||||
$mimetypes = \nre\configs\AppConfig::$mimetypes['icons'];
|
||||
$iconMimetypes = \nre\configs\AppConfig::$mimetypes['icons'];
|
||||
$imageMimetypes = \nre\configs\AppConfig::$mimetypes['stationimages'];
|
||||
$avMimetypes = \nre\configs\AppConfig::$mimetypes['stationavs'];
|
||||
|
||||
// Values
|
||||
$title = '';
|
||||
|
@ -238,6 +259,12 @@
|
|||
$latitude = null;
|
||||
$rightText = '';
|
||||
$wrongText = '';
|
||||
$textMedia = array(
|
||||
'rightimage' => null,
|
||||
'rightav' => null,
|
||||
'wrongimage' => null,
|
||||
'wrongav' => null
|
||||
);
|
||||
$fields = array('title');
|
||||
$validation = array();
|
||||
|
||||
|
@ -284,7 +311,7 @@
|
|||
// Check mimetype
|
||||
$mediaMimetype = null;
|
||||
$icon['mimetype'] = \hhu\z\Utils::getMimetype($icon['tmp_name'], $icon['type']);
|
||||
foreach($mimetypes as &$mimetype) {
|
||||
foreach($iconMimetypes as &$mimetype) {
|
||||
if($mimetype['mimetype'] == $icon['mimetype']) {
|
||||
$mediaMimetype = $mimetype;
|
||||
break;
|
||||
|
@ -298,6 +325,51 @@
|
|||
}
|
||||
}
|
||||
|
||||
// Validate media
|
||||
if(!empty($_FILES))
|
||||
{
|
||||
foreach(array_keys($textMedia) as $mediumKey)
|
||||
{
|
||||
if(array_key_exists($mediumKey, $_FILES) && $_FILES[$mediumKey]['error'] != UPLOAD_ERR_NO_FILE)
|
||||
{
|
||||
$mediumValidation = true;
|
||||
$medium = $_FILES[$mediumKey];
|
||||
|
||||
// Check error
|
||||
if($medium['error'] !== UPLOAD_ERR_OK) {
|
||||
$mediumValidation = $this->Validation->addValidationResults($mediumValidation, 'error', $medium['error']);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check mimetype
|
||||
$mediaMimetype = null;
|
||||
$medium['mimetype'] = \hhu\z\Utils::getMimetype($medium['tmp_name'], $medium['type']);
|
||||
$mediaMimetypes = (strpos($mediumKey, 'image') !== false) ? $imageMimetypes : $avMimetypes;
|
||||
foreach($mediaMimetypes as &$mimetype) {
|
||||
if($mimetype['mimetype'] == $medium['mimetype']) {
|
||||
$mediaMimetype = $mimetype;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(is_null($mediaMimetype)) {
|
||||
$mediumValidation = $this->Validation->addValidationResults($mediumValidation, 'mimetype', $medium['mimetype']);
|
||||
}
|
||||
elseif($medium['size'] > $mediaMimetype['size']) {
|
||||
$mediumValidation = $this->Validation->addValidationResults($mediumValidation, 'size', $mediaMimetype['size']);
|
||||
}
|
||||
|
||||
if($validation == true) {
|
||||
$textMedia[$mediumKey] = $medium;
|
||||
}
|
||||
}
|
||||
|
||||
if($mediumValidation !== true) {
|
||||
$validation = $this->Validation->addValidationResults($validation, $mediumKey, $mediumValidation);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create new Station
|
||||
if($validation === true)
|
||||
{
|
||||
|
@ -330,6 +402,50 @@
|
|||
}
|
||||
}
|
||||
|
||||
// Upload media
|
||||
$textMediaIds = array();
|
||||
foreach($textMedia as $mediumKey => $medium)
|
||||
{
|
||||
if(!is_null($medium))
|
||||
{
|
||||
$mediaId = $this->Media->createStationMedia(
|
||||
$this->Auth->getUserId(),
|
||||
$seminary['id'],
|
||||
sprintf('station-%d-%s', $station['id'], $mediumKey),
|
||||
$medium['name'],
|
||||
$medium['type'],
|
||||
$medium['tmp_name']
|
||||
);
|
||||
$textMediaIds[$mediumKey] = $mediaId;
|
||||
}
|
||||
}
|
||||
|
||||
// Set media
|
||||
if(array_key_exists('rightimage', $textMediaIds)) {
|
||||
$this->Charactergroupsqueststations->setRightImageForStation(
|
||||
$station['id'],
|
||||
$textMediaIds['rightimage']
|
||||
);
|
||||
}
|
||||
if(array_key_exists('rightav', $textMediaIds)) {
|
||||
$this->Charactergroupsqueststations->setRightAvForStation(
|
||||
$station['id'],
|
||||
$textMediaIds['rightav']
|
||||
);
|
||||
}
|
||||
if(array_key_exists('wrongimage', $textMediaIds)) {
|
||||
$this->Charactergroupsqueststations->setWrongImageForStation(
|
||||
$station['id'],
|
||||
$textMediaIds['wrongimage']
|
||||
);
|
||||
}
|
||||
if(array_key_exists('wrongav', $textMediaIds)) {
|
||||
$this->Charactergroupsqueststations->setWrongAvForStation(
|
||||
$station['id'],
|
||||
$textMediaIds['wrongav']
|
||||
);
|
||||
}
|
||||
|
||||
// Redirect to Station page
|
||||
$this->redirect(
|
||||
$this->linker->link(
|
||||
|
@ -364,7 +480,9 @@
|
|||
$this->set('latitude', $latitude);
|
||||
$this->set('righttext', $rightText);
|
||||
$this->set('wrongtext', $wrongText);
|
||||
$this->set('mimetypes', $mimetypes);
|
||||
$this->set('iconMimetypes', $iconMimetypes);
|
||||
$this->set('imageMimetypes', $imageMimetypes);
|
||||
$this->set('avMimetypes', $avMimetypes);
|
||||
$this->set('stationtypes', $stationtypes);
|
||||
$this->set('validation', $validation);
|
||||
}
|
||||
|
@ -395,6 +513,20 @@
|
|||
// Get Station
|
||||
$station = $this->Charactergroupsqueststations->getStationByUrl($quest['id'], $stationUrl);
|
||||
|
||||
// Get media
|
||||
if(!is_null($station['rightimage_id'])) {
|
||||
$station['rightimage'] = $this->Media->getSeminaryMediaById($station['rightimage_id']);
|
||||
}
|
||||
if(!is_null($station['rightav_id'])) {
|
||||
$station['rightav'] = $this->Media->getSeminaryMediaById($station['rightav_id']);
|
||||
}
|
||||
if(!is_null($station['wrongimage_id'])) {
|
||||
$station['wrongimage'] = $this->Media->getSeminaryMediaById($station['wrongimage_id']);
|
||||
}
|
||||
if(!is_null($station['wrongav_id'])) {
|
||||
$station['wrongav'] = $this->Media->getSeminaryMediaById($station['wrongav_id']);
|
||||
}
|
||||
|
||||
// Get Quest types
|
||||
$stationtypes = $this->Stationtypes->getStationtypes();
|
||||
foreach($stationtypes as &$stationtype) {
|
||||
|
@ -402,7 +534,9 @@
|
|||
}
|
||||
|
||||
// Get allowed mimetypes
|
||||
$mimetypes = \nre\configs\AppConfig::$mimetypes['icons'];
|
||||
$iconMimetypes = \nre\configs\AppConfig::$mimetypes['icons'];
|
||||
$imageMimetypes = \nre\configs\AppConfig::$mimetypes['stationimages'];
|
||||
$avMimetypes = \nre\configs\AppConfig::$mimetypes['stationavs'];
|
||||
|
||||
// Values
|
||||
$title = $station['title'];
|
||||
|
@ -412,6 +546,12 @@
|
|||
$latitude = $station['latitude'];
|
||||
$rightText = $station['righttext'];
|
||||
$wrongText = $station['wrongtext'];
|
||||
$textMedia = array(
|
||||
'rightimage' => null,
|
||||
'rightav' => null,
|
||||
'wrongimage' => null,
|
||||
'wrongav' => null
|
||||
);
|
||||
$fields = array('title');
|
||||
$validation = array();
|
||||
|
||||
|
@ -458,7 +598,7 @@
|
|||
// Check mimetype
|
||||
$mediaMimetype = null;
|
||||
$icon['mimetype'] = \hhu\z\Utils::getMimetype($icon['tmp_name'], $icon['type']);
|
||||
foreach($mimetypes as &$mimetype) {
|
||||
foreach($iconMimetypes as &$mimetype) {
|
||||
if($mimetype['mimetype'] == $icon['mimetype']) {
|
||||
$mediaMimetype = $mimetype;
|
||||
break;
|
||||
|
@ -472,6 +612,51 @@
|
|||
}
|
||||
}
|
||||
|
||||
// Validate media
|
||||
if(!empty($_FILES))
|
||||
{
|
||||
foreach(array_keys($textMedia) as $mediumKey)
|
||||
{
|
||||
if(array_key_exists($mediumKey, $_FILES) && $_FILES[$mediumKey]['error'] != UPLOAD_ERR_NO_FILE)
|
||||
{
|
||||
$mediumValidation = true;
|
||||
$medium = $_FILES[$mediumKey];
|
||||
|
||||
// Check error
|
||||
if($medium['error'] !== UPLOAD_ERR_OK) {
|
||||
$mediumValidation = $this->Validation->addValidationResults($mediumValidation, 'error', $medium['error']);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check mimetype
|
||||
$mediaMimetype = null;
|
||||
$medium['mimetype'] = \hhu\z\Utils::getMimetype($medium['tmp_name'], $medium['type']);
|
||||
$mediaMimetypes = (strpos($mediumKey, 'image') !== false) ? $imageMimetypes : $avMimetypes;
|
||||
foreach($mediaMimetypes as &$mimetype) {
|
||||
if($mimetype['mimetype'] == $medium['mimetype']) {
|
||||
$mediaMimetype = $mimetype;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(is_null($mediaMimetype)) {
|
||||
$mediumValidation = $this->Validation->addValidationResults($mediumValidation, 'mimetype', $medium['mimetype']);
|
||||
}
|
||||
elseif($medium['size'] > $mediaMimetype['size']) {
|
||||
$mediumValidation = $this->Validation->addValidationResults($mediumValidation, 'size', $mediaMimetype['size']);
|
||||
}
|
||||
|
||||
if($validation == true) {
|
||||
$textMedia[$mediumKey] = $medium;
|
||||
}
|
||||
}
|
||||
|
||||
if($mediumValidation !== true) {
|
||||
$validation = $this->Validation->addValidationResults($validation, $mediumKey, $mediumValidation);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Edit Station
|
||||
if($validation === true)
|
||||
{
|
||||
|
@ -504,6 +689,50 @@
|
|||
}
|
||||
}
|
||||
|
||||
// Upload media
|
||||
$textMediaIds = array();
|
||||
foreach($textMedia as $mediumKey => $medium)
|
||||
{
|
||||
if(!is_null($medium))
|
||||
{
|
||||
$mediaId = $this->Media->createStationMedia(
|
||||
$this->Auth->getUserId(),
|
||||
$seminary['id'],
|
||||
sprintf('station-%d-%s', $station['id'], $mediumKey),
|
||||
$medium['name'],
|
||||
$medium['type'],
|
||||
$medium['tmp_name']
|
||||
);
|
||||
$textMediaIds[$mediumKey] = $mediaId;
|
||||
}
|
||||
}
|
||||
|
||||
// Set media
|
||||
if(array_key_exists('rightimage', $textMediaIds)) {
|
||||
$this->Charactergroupsqueststations->setRightImageForStation(
|
||||
$station['id'],
|
||||
$textMediaIds['rightimage']
|
||||
);
|
||||
}
|
||||
if(array_key_exists('rightav', $textMediaIds)) {
|
||||
$this->Charactergroupsqueststations->setRightAvForStation(
|
||||
$station['id'],
|
||||
$textMediaIds['rightav']
|
||||
);
|
||||
}
|
||||
if(array_key_exists('wrongimage', $textMediaIds)) {
|
||||
$this->Charactergroupsqueststations->setWrongImageForStation(
|
||||
$station['id'],
|
||||
$textMediaIds['wrongimage']
|
||||
);
|
||||
}
|
||||
if(array_key_exists('wrongav', $textMediaIds)) {
|
||||
$this->Charactergroupsqueststations->setWrongAvForStation(
|
||||
$station['id'],
|
||||
$textMediaIds['wrongav']
|
||||
);
|
||||
}
|
||||
|
||||
// Redirect
|
||||
if(!is_null($this->request->getPostParam('edit-task'))) {
|
||||
// To task editing
|
||||
|
@ -550,6 +779,7 @@
|
|||
$this->set('seminary', $seminary);
|
||||
$this->set('groupsgroup', $groupsgroup);
|
||||
$this->set('quest', $quest);
|
||||
$this->set('station', $station);
|
||||
$this->set('title', $title);
|
||||
$this->set('prolog', $prolog);
|
||||
$this->set('task', $task);
|
||||
|
@ -557,14 +787,16 @@
|
|||
$this->set('latitude', $latitude);
|
||||
$this->set('righttext', $rightText);
|
||||
$this->set('wrongtext', $wrongText);
|
||||
$this->set('mimetypes', $mimetypes);
|
||||
$this->set('iconMimetypes', $iconMimetypes);
|
||||
$this->set('imageMimetypes', $imageMimetypes);
|
||||
$this->set('avMimetypes', $avMimetypes);
|
||||
$this->set('stationtypes', $stationtypes);
|
||||
$this->set('validation', $validation);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* TODO Action: edittask.
|
||||
* Action: edittask.
|
||||
*
|
||||
* Edit the task of a Character groups Quest Station.
|
||||
*
|
||||
|
|
|
@ -25,14 +25,15 @@
|
|||
* @var array
|
||||
*/
|
||||
public $permissions = array(
|
||||
'index' => array('admin', 'moderator', 'user', 'guest'),
|
||||
'seminarymoodpic' => array('admin', 'moderator', 'user'),
|
||||
'seminarymap' => array('admin', 'moderator', 'user'),
|
||||
'seminary' => array('admin', 'moderator', 'user'),
|
||||
'avatar' => array('admin', 'moderator', 'user'),
|
||||
'achievement' => array('admin', 'moderator', 'user'),
|
||||
'charactergroup' => array('admin', 'moderator', 'user'),
|
||||
'charactergroupsquest' => array('admin', 'moderator', 'user')
|
||||
'index' => array('admin', 'moderator', 'user', 'guest'),
|
||||
'seminarymoodpic' => array('admin', 'moderator', 'user'),
|
||||
'seminarymap' => array('admin', 'moderator', 'user'),
|
||||
'seminary' => array('admin', 'moderator', 'user'),
|
||||
'avatar' => array('admin', 'moderator', 'user'),
|
||||
'achievement' => array('admin', 'moderator', 'user'),
|
||||
'charactergroup' => array('admin', 'moderator', 'user'),
|
||||
'charactergroupsquest' => array('admin', 'moderator', 'user'),
|
||||
'charactergroupsqueststation' => array('admin', 'moderator', 'user')
|
||||
);
|
||||
/**
|
||||
* User seminary permissions
|
||||
|
@ -40,17 +41,18 @@
|
|||
* @var array
|
||||
*/
|
||||
public $seminaryPermissions = array(
|
||||
'seminary' => array('admin', 'moderator', 'user', 'guest'),
|
||||
'achievement' => array('admin', 'moderator', 'user', 'guest'),
|
||||
'charactergroup' => array('admin', 'moderator', 'user', 'guest'),
|
||||
'charactergroupsquest' => array('admin', 'moderator', 'user', 'guest')
|
||||
'seminary' => array('admin', 'moderator', 'user', 'guest'),
|
||||
'achievement' => array('admin', 'moderator', 'user', 'guest'),
|
||||
'charactergroup' => array('admin', 'moderator', 'user', 'guest'),
|
||||
'charactergroupsquest' => array('admin', 'moderator', 'user', 'guest'),
|
||||
'charactergroupsqueststation' => array('admin', 'moderator', 'user', 'guest')
|
||||
);
|
||||
/**
|
||||
* Required models
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $models = array('seminaries', 'achievements', 'media', 'avatars', 'charactergroups', 'charactergroupsquests', 'map');
|
||||
public $models = array('seminaries', 'achievements', 'media', 'avatars', 'charactergroups', 'charactergroupsquests', 'charactergroupsqueststations', 'map');
|
||||
|
||||
|
||||
|
||||
|
@ -403,6 +405,47 @@
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Action: charactergroupsqueststation
|
||||
*
|
||||
* Display the icon for a Character groups Quest Station.
|
||||
*
|
||||
* @throws \nre\exceptions\IdNotFoundException
|
||||
* @param string $seminaryUrl URL-Title of a Seminary
|
||||
* @param string $groupsgroupUrl URL-Title of a Character groups-group
|
||||
* @param string $questUrl URL-Title of a Character groups Quest
|
||||
* @param string $stationUrl URL-title of Station
|
||||
*/
|
||||
public function charactergroupsqueststation($seminaryUrl, $groupsgroupUrl, $questUrl, $stationUrl)
|
||||
{
|
||||
// Get seminary
|
||||
$seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl);
|
||||
|
||||
// Get Character groups-group
|
||||
$groupsgroup = $this->Charactergroups->getGroupsgroupByUrl($seminary['id'], $groupsgroupUrl);
|
||||
|
||||
// Get Character groups Quests
|
||||
$quest = $this->Charactergroupsquests->getQuestByUrl($groupsgroup['id'], $questUrl);
|
||||
|
||||
// Get Station
|
||||
$station = $this->Charactergroupsqueststations->getStationByUrl($quest['id'], $stationUrl);
|
||||
|
||||
// Get media
|
||||
$media = $this->Media->getSeminaryMediaById($station['stationpicture_id']);
|
||||
|
||||
// Get file
|
||||
$file = $this->getMediaFile($media, 'charactergroupsqueststation');
|
||||
if(is_null($file)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Pass data to view
|
||||
$this->set('media', $media);
|
||||
$this->set('file', $file);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -495,6 +538,14 @@
|
|||
\nre\configs\AppConfig::$media[$action]['height']
|
||||
);
|
||||
break;
|
||||
case 'charactergroupsqueststation':
|
||||
$file = self::resizeImage(
|
||||
$media['filename'],
|
||||
$format,
|
||||
\nre\configs\AppConfig::$media[$action]['width'],
|
||||
\nre\configs\AppConfig::$media[$action]['height']
|
||||
);
|
||||
break;
|
||||
default:
|
||||
throw new ParamsNotValidException($action);
|
||||
break;
|
||||
|
|
|
@ -590,15 +590,27 @@ CREATE TABLE `charactergroupsqueststations` (
|
|||
`longitude` decimal(10,6) DEFAULT NULL,
|
||||
`righttext` text COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
`wrongtext` text COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
`rightimage_id` int(11) DEFAULT NULL,
|
||||
`rightav_id` int(11) DEFAULT NULL,
|
||||
`wrongimage_id` int(11) DEFAULT NULL,
|
||||
`wrongav_id` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `charactergroupsquest_id_2` (`charactergroupsquest_id`,`url`),
|
||||
UNIQUE KEY `charactergroupsquest_id_3` (`charactergroupsquest_id`,`pos`),
|
||||
KEY `charactergroupsquest_id` (`charactergroupsquest_id`),
|
||||
KEY `charactergroupsqueststationtype_id` (`stationtype_id`),
|
||||
KEY `stationpicture_id` (`stationpicture_id`) USING BTREE,
|
||||
KEY `rightimage_id` (`rightimage_id`),
|
||||
KEY `rightav_id` (`rightav_id`),
|
||||
KEY `wrongimage_id` (`wrongimage_id`),
|
||||
KEY `wrongav_id` (`wrongav_id`),
|
||||
CONSTRAINT `charactergroupsqueststations_ibfk_1` FOREIGN KEY (`charactergroupsquest_id`) REFERENCES `charactergroupsquests` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `charactergroupsqueststations_ibfk_2` FOREIGN KEY (`stationpicture_id`) REFERENCES `seminarymedia` (`id`) ON DELETE SET NULL ON UPDATE SET NULL,
|
||||
CONSTRAINT `charactergroupsqueststations_ibfk_3` FOREIGN KEY (`stationtype_id`) REFERENCES `stationtypes` (`id`)
|
||||
CONSTRAINT `charactergroupsqueststations_ibfk_3` FOREIGN KEY (`stationtype_id`) REFERENCES `stationtypes` (`id`),
|
||||
CONSTRAINT `charactergroupsqueststations_ibfk_4` FOREIGN KEY (`rightimage_id`) REFERENCES `seminarymedia` (`id`) ON DELETE SET NULL ON UPDATE SET NULL,
|
||||
CONSTRAINT `charactergroupsqueststations_ibfk_5` FOREIGN KEY (`rightav_id`) REFERENCES `seminarymedia` (`id`) ON DELETE SET NULL ON UPDATE SET NULL,
|
||||
CONSTRAINT `charactergroupsqueststations_ibfk_6` FOREIGN KEY (`wrongimage_id`) REFERENCES `seminarymedia` (`id`) ON DELETE SET NULL ON UPDATE SET NULL,
|
||||
CONSTRAINT `charactergroupsqueststations_ibfk_7` FOREIGN KEY (`wrongav_id`) REFERENCES `seminarymedia` (`id`) ON DELETE SET NULL ON UPDATE SET NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
public function getStationById($stationId)
|
||||
{
|
||||
$data = $this->db->query(
|
||||
'SELECT id, charactergroupsquest_id, stationtype_id, title, url, stationpicture_id, prolog, task, latitude, longitude, righttext, wrongtext '.
|
||||
'SELECT id, charactergroupsquest_id, stationtype_id, title, url, stationpicture_id, prolog, task, latitude, longitude, righttext, wrongtext, rightimage_id, rightav_id, wrongimage_id, wrongav_id '.
|
||||
'FROM charactergroupsqueststations '.
|
||||
'WHERE id = ?',
|
||||
'i',
|
||||
|
@ -88,7 +88,7 @@
|
|||
public function getStationByUrl($groupsquestId, $stationUrl)
|
||||
{
|
||||
$data = $this->db->query(
|
||||
'SELECT id, charactergroupsquest_id, stationtype_id, title, url, stationpicture_id, prolog, task, latitude, longitude, righttext, wrongtext '.
|
||||
'SELECT id, charactergroupsquest_id, stationtype_id, title, url, stationpicture_id, prolog, task, latitude, longitude, righttext, wrongtext, rightimage_id, rightav_id, wrongimage_id, wrongav_id '.
|
||||
'FROM charactergroupsqueststations '.
|
||||
'WHERE charactergroupsquest_id = ? AND url = ?',
|
||||
'is',
|
||||
|
@ -184,6 +184,33 @@
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if a Character group has entered a Station.
|
||||
*
|
||||
* @param int $stationId ID of Station to check
|
||||
* @param int $groupId ID of Character group to check
|
||||
* @return bool Whether the group has tried the station or not
|
||||
*/
|
||||
public function hasCharactergroupEnteredStation($stationId, $groupId)
|
||||
{
|
||||
$data = $this->db->query(
|
||||
'SELECT created '.
|
||||
'FROM charactergroupsqueststations_charactergroups '.
|
||||
'WHERE charactergroupsqueststation_id = ? AND charactergroup_id = ? AND status >= ?',
|
||||
'iii',
|
||||
$stationId,
|
||||
$groupId,
|
||||
self::STATUS_ENTERED
|
||||
);
|
||||
if(!empty($data)) {
|
||||
return $data[0]['created'];
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if a Character group has tried to solve a Station.
|
||||
*
|
||||
|
@ -269,7 +296,7 @@
|
|||
* @param int $stationId ID of Station to upload media for
|
||||
* @param int $mediaId ID of Station media
|
||||
*/
|
||||
public function setPictureForStation($station, $mediaId)
|
||||
public function setPictureForStation($stationId, $mediaId)
|
||||
{
|
||||
$this->db->query(
|
||||
'UPDATE charactergroupsqueststations '.
|
||||
|
@ -277,11 +304,59 @@
|
|||
'WHERE id = ?',
|
||||
'ii',
|
||||
$mediaId,
|
||||
$station
|
||||
$stationId
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the image for the right-text.
|
||||
*
|
||||
* @param int $stationId ID of Station to set image for
|
||||
* @param int $mediaId ID of Seminary media to set
|
||||
*/
|
||||
public function setRightImageForStation($stationId, $mediaId)
|
||||
{
|
||||
$this->setMediaForStation($stationId, $mediaId, 'rightimage_id');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the audio/video for the right-text.
|
||||
*
|
||||
* @param int $stationId ID of Station to set audio/video for
|
||||
* @param int $mediaId ID of Seminary media to set
|
||||
*/
|
||||
public function setRightAVForStation($stationId, $mediaId)
|
||||
{
|
||||
$this->setMediaForStation($stationId, $mediaId, 'rightav_id');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the image for the wrong-text.
|
||||
*
|
||||
* @param int $stationId ID of Station to set image for
|
||||
* @param int $mediaId ID of Seminary media to set
|
||||
*/
|
||||
public function setWrongImageForStation($stationId, $mediaId)
|
||||
{
|
||||
$this->setMediaForStation($stationId, $mediaId, 'wrongimage_id');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the audio/video for the wrong-text.
|
||||
*
|
||||
* @param int $stationId ID of Station to set audio/video for
|
||||
* @param int $mediaId ID of Seminary media to set
|
||||
*/
|
||||
public function setWrongAvForStation($stationId, $mediaId)
|
||||
{
|
||||
$this->setMediaForStation($stationId, $mediaId, 'wrongav_id');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create a new Character groups Quest Station.
|
||||
*
|
||||
|
@ -410,6 +485,29 @@
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add a medium for a Character groups Quest Station.
|
||||
*
|
||||
* @param int $stationId ID of Station to upload media for
|
||||
* @param int $mediaId ID of Seminary media
|
||||
* @param string $field Field name to set media to
|
||||
*/
|
||||
private function setMediaForStation($stationId, $mediaId, $field)
|
||||
{
|
||||
$this->db->query(
|
||||
sprintf(
|
||||
'UPDATE charactergroupsqueststations '.
|
||||
'SET %s = ? '.
|
||||
'WHERE id = ?',
|
||||
$field
|
||||
),
|
||||
'ii',
|
||||
$mediaId,
|
||||
$stationId
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -557,6 +557,46 @@
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create a new Character groups Quest Station media by creating a new
|
||||
* Seminarymedia .
|
||||
*
|
||||
* @param int $userId ID of user that does the upload
|
||||
* @param int $seminaryId ID of Seminary
|
||||
* @param string $filename Filename of uploading media
|
||||
* @param string $description Description for media
|
||||
* @param string $mimetype Mimetype of media
|
||||
* @param string $tmpFilename Name of temporary uploaded file
|
||||
* @return mixed ID of media record or false if upload failed
|
||||
*/
|
||||
public function createStationMedia($userId, $seminaryId, $filename, $description, $mimetype, $tmpFilename)
|
||||
{
|
||||
$mediaId = false;
|
||||
$this->db->setAutocommit(false);
|
||||
|
||||
try {
|
||||
// Create Seminary media record
|
||||
$mediaId = $this->createSeminaryMedia($userId, $seminaryId, $filename, $description, $mimetype);
|
||||
|
||||
// Create filename
|
||||
$filename = ROOT.DS.\nre\configs\AppConfig::$dirs['seminarymedia'].DS.$mediaId;
|
||||
if(!move_uploaded_file($tmpFilename, $filename))
|
||||
{
|
||||
$this->db->rollback();
|
||||
$mediaId = false;
|
||||
}
|
||||
}
|
||||
catch(\nre\exceptions\DatamodelException $e) {
|
||||
$this->db->rollback();
|
||||
$this->db->setAutocommit(true);
|
||||
}
|
||||
|
||||
|
||||
$this->db->setAutocommit(true);
|
||||
return $mediaId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create a new Achievement media by creating a new Seminarymedia and
|
||||
* adding it to the list of media for Achievements.
|
||||
|
|
1
views/binary/media/charactergroupsqueststation.tpl
Normal file
1
views/binary/media/charactergroupsqueststation.tpl
Normal file
|
@ -0,0 +1 @@
|
|||
<?=$file?>
|
|
@ -78,27 +78,42 @@
|
|||
</ul>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
<?php if(!empty($stations)) : ?>
|
||||
<ol class="grpqlist">
|
||||
<?php foreach($stations as &$station) : ?>
|
||||
<li>
|
||||
<?php if(array_key_exists('created', $station)) : ?>
|
||||
<span class="date">
|
||||
<?=$dateFormatter->format(new \DateTime($station['created']))?>
|
||||
<?=$timeFormatter->format(new \DateTime($station['created']))?>
|
||||
</span>
|
||||
<?php endif ?>
|
||||
<span class="group">
|
||||
<?php if(!array_key_exists('entered', $station) || $station['entered']) : ?>
|
||||
<a href="<?=$linker->link(array('charactergroupsqueststations','station',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']))?>"><?=$station['title']?></a>
|
||||
<?php else : ?>
|
||||
<?=_('Station not yet discovered')?>
|
||||
<?php endif ?>
|
||||
</span>
|
||||
<?php if(array_key_exists('solved', $station) && $station['solved']) : ?>
|
||||
<span class="xp">
|
||||
<i class="fa fa-check-circle fa-fw"></i>
|
||||
</span>
|
||||
<?php if(!array_key_exists('created', $station) || $station['solved'] !== false) : ?>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
<?php else : ?>
|
||||
<p><?=sprintf(_('Your %s-group has not discovered any station yet'), $groupsgroup['name'])?>.</p>
|
||||
<?php endif ?>
|
||||
|
||||
<ol class="grpqslist">
|
||||
<?php foreach($stations as &$station) : ?>
|
||||
<li>
|
||||
<?php if(!array_key_exists('entered', $station) || $station['entered']) : ?>
|
||||
<a href="<?=$linker->link(array('charactergroupsqueststations','station',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']))?>">
|
||||
<?php if(!is_null($station['stationpicture_id'])) : ?>
|
||||
<img title="<?=$station['title']?>" src="<?=$linker->link(array('media','charactergroupsqueststation',$seminary['url'],$groupsgroup['url'],$quest['url'],$station['url']))?>" />
|
||||
<?php else : ?>
|
||||
<i class="fa fa-globe"></i>
|
||||
<?php endif ?>
|
||||
</a>
|
||||
<?php else : ?>
|
||||
<i class="fa fa-question-circle"></i>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
|
|
|
@ -39,6 +39,20 @@
|
|||
default: echo _('Title invalid');
|
||||
}
|
||||
break;
|
||||
case 'rightimage':
|
||||
case 'rightav':
|
||||
case 'wrongimage':
|
||||
case 'wrongav':
|
||||
switch($setting) {
|
||||
case 'error': printf(_('Error during file upload: %s'), $value);
|
||||
break;
|
||||
case 'mimetype': printf(_('File has wrong type “%s”'), $value);
|
||||
break;
|
||||
case 'size': echo _('File exceeds size maximum');
|
||||
break;
|
||||
default: echo _('File invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
|
@ -53,7 +67,7 @@
|
|||
<input type="file" name="icon" />
|
||||
<p><?=_('Allowed file types')?>:</p>
|
||||
<ul>
|
||||
<?php foreach($mimetypes as &$mimetype) : ?>
|
||||
<?php foreach($iconMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
|
@ -65,6 +79,9 @@
|
|||
<input id="latitude" name="latitude" type="hidden" value="<?=$latitude?>" />
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Basic data')?></legend>
|
||||
<label for="title"><?=_('Title')?>:</label>
|
||||
<input type="text" id="title" name="title" placeholder="<?=_('Title')?>" title="<?=_('Title')?>" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=($validation !== true && array_key_exists('title', $validation)) ? 'class="invalid"' : null?> />
|
||||
<label for="stationtype"><?=('Stationtype')?>:</label>
|
||||
<select id="stationtype" name="stationtype">
|
||||
<?php foreach($stationtypes as &$stationtype) : ?>
|
||||
|
@ -80,16 +97,42 @@
|
|||
</option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label for="title"><?=_('Title')?>:</label>
|
||||
<input type="text" id="title" name="title" placeholder="<?=_('Title')?>" title="<?=_('Title')?>" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=($validation !== true && array_key_exists('title', $validation)) ? 'class="invalid"' : null?> />
|
||||
<label for="prolog"><?=_('Prolog')?>:</label><br />
|
||||
<textarea id="prolog" name="prolog" placeholder="<?=_('Prolog')?>" style="width:100%; height:10em;"><?=$prolog?></textarea><br />
|
||||
<label for="task"><?=_('Task')?>:</label><br />
|
||||
<textarea id="task" name="task" placeholder="<?=_('Task')?>" style="width:100%; height:10em;"><?=$task?></textarea><br />
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Correctly solved')?></legend>
|
||||
<input type="file" name="rightimage" />
|
||||
<ul>
|
||||
<?php foreach($imageMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<input type="file" name="rightav" />
|
||||
<ul>
|
||||
<?php foreach($avMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<label for="rightText"><?=('Right text')?>:</label><br />
|
||||
<textarea id="rightText" name="rightText" placeholder="<?=_('Right text')?>" style="width:100%; height:10em;"><?=$righttext?></textarea><br />
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Incorreclty solved')?></legend>
|
||||
<input type="file" name="wrongimage" />
|
||||
<ul>
|
||||
<?php foreach($imageMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<input type="file" name="wrongav" />
|
||||
<ul>
|
||||
<?php foreach($avMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<label for="wrongText"><?=_('Wrong text')?>:</label><br />
|
||||
<textarea id="wrongText" name="wrongText" placeholder="<?=_('Wrong text')?>" style="width:100%; height:10em;"><?=$wrongtext?></textarea><br />
|
||||
</fieldset>
|
||||
|
|
|
@ -39,6 +39,20 @@
|
|||
default: echo _('Title invalid');
|
||||
}
|
||||
break;
|
||||
case 'rightimage':
|
||||
case 'rightav':
|
||||
case 'wrongimage':
|
||||
case 'wrongav':
|
||||
switch($setting) {
|
||||
case 'error': printf(_('Error during file upload: %s'), $value);
|
||||
break;
|
||||
case 'mimetype': printf(_('File has wrong type “%s”'), $value);
|
||||
break;
|
||||
case 'size': echo _('File exceeds size maximum');
|
||||
break;
|
||||
default: echo _('File invalid');
|
||||
}
|
||||
break;
|
||||
} ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
|
@ -53,7 +67,7 @@
|
|||
<input type="file" name="icon" />
|
||||
<p><?=_('Allowed file types')?>:</p>
|
||||
<ul>
|
||||
<?php foreach($mimetypes as &$mimetype) : ?>
|
||||
<?php foreach($iconMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
|
@ -65,6 +79,9 @@
|
|||
<input id="latitude" name="latitude" type="hidden" value="<?=$latitude?>" />
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Basic data')?></legend>
|
||||
<label for="title"><?=_('Title')?>:</label>
|
||||
<input type="text" id="title" name="title" placeholder="<?=_('Title')?>" title="<?=_('Title')?>" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=($validation !== true && array_key_exists('title', $validation)) ? 'class="invalid"' : null?> />
|
||||
<label for="stationtype"><?=('Stationtype')?>:</label>
|
||||
<select id="stationtype" name="stationtype">
|
||||
<?php foreach($stationtypes as &$stationtype) : ?>
|
||||
|
@ -80,16 +97,75 @@
|
|||
</option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label for="title"><?=_('Title')?>:</label>
|
||||
<input type="text" id="title" name="title" placeholder="<?=_('Title')?>" title="<?=_('Title')?>" maxlength="<?=$validationSettings['title']['maxlength']?>" value="<?=$title?>" <?=($validation !== true && array_key_exists('title', $validation)) ? 'class="invalid"' : null?> />
|
||||
<label for="prolog"><?=_('Prolog')?>:</label><br />
|
||||
<textarea id="prolog" name="prolog" placeholder="<?=_('Prolog')?>" style="width:100%; height:10em;"><?=$prolog?></textarea><br />
|
||||
<label for="task"><?=_('Task')?>:</label><br />
|
||||
<textarea id="task" name="task" placeholder="<?=_('Task')?>" style="width:100%; height:10em;"><?=$task?></textarea><br />
|
||||
<fieldset>
|
||||
<legend><?=_('Correctly solved')?></legend>
|
||||
<?php if(array_key_exists('rightimage', $station)) : ?>
|
||||
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightimage']['url']))?>">
|
||||
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightimage']['url'],'charactergroupsqueststation'))?>" />
|
||||
</a>
|
||||
<?php else : ?>
|
||||
<i class="placeholder fa fa-picture-o fa-4x"></i><br />
|
||||
<?php endif ?>
|
||||
<br />
|
||||
<input type="file" name="rightimage" />
|
||||
<ul>
|
||||
<?php foreach($imageMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php if(array_key_exists('rightav', $station)) : ?>
|
||||
<?php if(strpos($station['rightav']['mimetype'], 'audio') !== false) : ?>
|
||||
<audio controls="controls" autoplay="false" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightav']['url'],'charactergroupsqueststation'))?>"></audio>
|
||||
<?php else : ?>
|
||||
<video controls="controls" autoplay="false" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightav']['url'],'charactergroupsqueststation'))?>"></video>
|
||||
<?php endif ?>
|
||||
<?php else : ?>
|
||||
<i class="placeholder fa fa-film fa-4x"></i><br />
|
||||
<?php endif ?>
|
||||
<input type="file" name="rightav" />
|
||||
<ul>
|
||||
<?php foreach($avMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<label for="rightText"><?=('Right text')?>:</label><br />
|
||||
<textarea id="rightText" name="rightText" placeholder="<?=_('Right text')?>" style="width:100%; height:10em;"><?=$righttext?></textarea><br />
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Incorreclty solved')?></legend>
|
||||
<?php if(array_key_exists('wrongimage', $station)) : ?>
|
||||
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongimage']['url']))?>">
|
||||
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongimage']['url'],'charactergroupsqueststation'))?>" />
|
||||
</a>
|
||||
<?php else : ?>
|
||||
<i class="placeholder fa fa-picture-o fa-4x"></i><br />
|
||||
<?php endif ?>
|
||||
<br />
|
||||
<input type="file" name="wrongimage" />
|
||||
<ul>
|
||||
<?php foreach($imageMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php if(array_key_exists('wrongav', $station)) : ?>
|
||||
<?php if(strpos($station['wrongav']['mimetype'], 'audio') !== false) : ?>
|
||||
<audio controls="controls" autoplay="false" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongav']['url'],'charactergroupsqueststation'))?>"></audio>
|
||||
<?php else : ?>
|
||||
<video controls="controls" autoplay="false" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongav']['url'],'charactergroupsqueststation'))?>"></video>
|
||||
<?php endif ?>
|
||||
<?php else : ?>
|
||||
<i class="placeholder fa fa-film fa-4x"></i><br />
|
||||
<?php endif ?>
|
||||
<input type="file" name="wrongav" />
|
||||
<ul>
|
||||
<?php foreach($avMimetypes as &$mimetype) : ?>
|
||||
<li><?=sprintf(_('%s-files'), strtoupper(explode('/',$mimetype['mimetype'])[1]))?> <?php if($mimetype['size'] > 0) : ?>(<?=_('max.')?> <?=round($mimetype['size']/(1024*1024),2)?> MiB)<?php endif ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<label for="wrongText"><?=_('Wrong text')?>:</label><br />
|
||||
<textarea id="wrongText" name="wrongText" placeholder="<?=_('Wrong text')?>" style="width:100%; height:10em;"><?=$wrongtext?></textarea><br />
|
||||
</fieldset>
|
||||
|
|
|
@ -13,9 +13,7 @@
|
|||
</nav>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if(array_key_exists('picture', $station)) : ?>
|
||||
<h1><?=$station['title']?></h1>
|
||||
<?php endif ?>
|
||||
<ul class="gdata cf">
|
||||
<?php if(!empty($station['longitude']) && !empty($station['latitude'])) : ?>
|
||||
<li>
|
||||
|
@ -29,6 +27,10 @@
|
|||
</a>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<?php if($solved !== false) : ?>
|
||||
<li>
|
||||
<i class="fa fa-check-circle fa-fw"></i>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
|
||||
<?php if(!empty($station['longitude']) && !empty($station['latitude'])) : ?>
|
||||
|
@ -94,8 +96,8 @@
|
|||
<span class="group"><a href="<?=$linker->link(array('charactergroups','group',$seminary['url'],$groupsgroup['url'],$group['url']))?>"><?=$group['name']?></a></span>
|
||||
<?php if($group['solved'] !== false) : ?>
|
||||
<span class="xp">
|
||||
<i class="fa fa-check-square-o fa-fw"></i>
|
||||
<?=_(sprintf('solved at %s', $timeFormatter->format(new \DateTime($group['solved']))))?>
|
||||
<i class="fa fa-check-circle fa-fw"></i>
|
||||
</span>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
|
@ -120,10 +122,34 @@
|
|||
|
||||
<?php if($solved): ?>
|
||||
<div class="text">
|
||||
<?php if(array_key_exists('rightimage', $station)) : ?>
|
||||
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightimage']['url']))?>">
|
||||
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightimage']['url'],'charactergroupsqueststation'))?>" />
|
||||
</a><br />
|
||||
<?php endif ?>
|
||||
<?php if(array_key_exists('rightav', $station)) : ?>
|
||||
<?php if(strpos($station['rightav']['mimetype'], 'audio') !== false) : ?>
|
||||
<audio controls="controls" autoplay="autoplay" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightav']['url'],'charactergroupsqueststation'))?>"></audio>
|
||||
<?php else : ?>
|
||||
<video controls="controls" autoplay="autoplay" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['rightav']['url'],'charactergroupsqueststation'))?>"></video>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
<?=$t->t($station['righttext'])?>
|
||||
</div>
|
||||
<?php elseif($tried) : ?>
|
||||
<div class="text">
|
||||
<?php if(array_key_exists('wrongimage', $station)) : ?>
|
||||
<a href="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongimage']['url']))?>">
|
||||
<img src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongimage']['url'],'charactergroupsqueststation'))?>" />
|
||||
</a><br />
|
||||
<?php endif ?>
|
||||
<?php if(array_key_exists('wrongav', $station)) : ?>
|
||||
<?php if(strpos($station['wrongav']['mimetype'], 'audio') !== false) : ?>
|
||||
<audio controls="controls" autoplay="autoplay" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongav']['url'],'charactergroupsqueststation'))?>"></audio>
|
||||
<?php else : ?>
|
||||
<video controls="controls" autoplay="autoplay" preload="metadata" src="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongav']['url'],'charactergroupsqueststation'))?>" poster="<?=$linker->link(array('media','seminary',$seminary['url'],$station['wrongimage']['url']))?>"></video>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
<?=$t->t($station['wrongtext'])?>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
|
|
|
@ -298,6 +298,9 @@ input[type="submit"][disabled]{text-shadow:1px 2px #d48c4e;background:#f9ac69;bo
|
|||
.grpqlist .date{padding:0 15px 0 0;display:block}
|
||||
.grpqlist .xp{display:block}
|
||||
.gqgllry li{display:inline-block}
|
||||
.grpqslist li{display:inline-block;width:100px;height:100px}
|
||||
.grpqslist li a{color:#5e5c58}
|
||||
.grpqslist li i{font-size:100px;padding:0}
|
||||
|
||||
|
||||
/** Achievements **/
|
||||
|
|
Loading…
Add table
Reference in a new issue