Skip to content

Commit

Permalink
Rename contentNotVisible to shared_contentNotVisible
Browse files Browse the repository at this point in the history
Load in ACP also the Application into the TemplateEngine
  • Loading branch information
Cyperghost committed Jan 30, 2024
1 parent bd06d46 commit fa0a7f6
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
6 changes: 4 additions & 2 deletions wcfsetup/install/files/lib/system/WCF.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,10 @@ protected function loadApplication(Application $application, bool $isDependentAp
throw new SystemException('Unable to load configuration for ' . $package->package);
}

// register template path if not within ACP
if (!\class_exists('wcf\system\WCFACP', false)) {
if (\class_exists('wcf\system\WCFACP', false)) {
// In acp we need to load the application and path into TemplateEngine
TemplateEngine::getInstance()->addApplication($abbreviation, $packageDir . 'templates/');
} else {
// add template path and abbreviation
static::getTPL()->addApplication($abbreviation, $packageDir . 'templates/');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function getParsedTag(array $openingTag, $content, array $closingTag, BBC

$attachment = $this->getAttachment($attachmentID);
if ($attachment === null) {
return WCF::getTPL()->fetch('contentNotVisible');
return WCF::getTPL()->fetch('shared_contentNotVisible');
}

$outputType = $parser->getOutputType();
Expand Down Expand Up @@ -55,7 +55,7 @@ public function getParsedTag(array $openingTag, $content, array $closingTag, BBC
} elseif (\substr($attachment->fileType, 0, 6) === 'audio/' && $outputType == 'text/html') {
return $this->showAudioPlayer($attachment);
} elseif (!$attachment->canDownload()) {
return WCF::getTPL()->fetch('contentNotVisible', 'wcf', [
return WCF::getTPL()->fetch('shared_contentNotVisible', 'wcf', [
'message' => WCF::getLanguage()->getDynamicVariable('wcf.message.content.no.permission.title')
], true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ public function getParsedTag(array $openingTag, $content, array $closingTag, BBC

$article = $this->getArticle($articleID);
if ($article === null) {
return WCF::getTPL()->fetch('contentNotVisible');
return WCF::getTPL()->fetch('shared_contentNotVisible');
}

if (!$article->canRead()) {
return WCF::getTPL()->fetch('contentNotVisible', 'wcf', [
return WCF::getTPL()->fetch('shared_contentNotVisible', 'wcf', [
'message' => WCF::getLanguage()->getDynamicVariable('wcf.message.content.no.permission.title')
], true);
} elseif ($parser->getOutputType() == 'text/html') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function getParsedTag(array $openingTag, $content, array $closingTag, BBC
/** @var ViewableMedia $media */
$media = MessageEmbeddedObjectManager::getInstance()->getObject('com.woltlab.wcf.media', $mediaID);
if ($media === null) {
return WCF::getTPL()->fetch('contentNotVisible');
return WCF::getTPL()->fetch('shared_contentNotVisible');
}

if ($media->isAccessible()) {
Expand Down Expand Up @@ -95,7 +95,7 @@ public function getParsedTag(array $openingTag, $content, array $closingTag, BBC

return StringUtil::encodeHTML($this->getLink($media));
} else {
return WCF::getTPL()->fetch('contentNotVisible', 'wcf', [
return WCF::getTPL()->fetch('shared_contentNotVisible', 'wcf', [
'message' => WCF::getLanguage()->getDynamicVariable('wcf.message.content.no.permission.title')
], true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ public function getParsedTag(array $openingTag, $content, array $closingTag, BBC
return StringUtil::getAnchorTag($page->getLink(), $title ?: $page->getTitle());
}

return WCF::getTPL()->fetch('contentNotVisible');
return WCF::getTPL()->fetch('shared_contentNotVisible');
}
}

0 comments on commit fa0a7f6

Please sign in to comment.