if ($size == 'tiny') {
$parameters['tiny'] = 1;
}
+ else if ($size == 'thumbnail') {
+ $parameters['thumbnail'] = 1;
+ }
return LinkHandler::getInstance()->getLink('Attachment', $parameters);
}
use wcf\system\event\EventHandler;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\exception\UserInputException;
-use wcf\system\request\LinkHandler;
use wcf\system\upload\DefaultUploadFileSaveStrategy;
use wcf\system\upload\DefaultUploadFileValidationStrategy;
use wcf\system\upload\UploadFile;
'formattedFilesize' => FileUtil::formatFilesize($attachment->filesize),
'isImage' => $attachment->isImage,
'attachmentID' => $attachment->attachmentID,
- 'tinyURL' => $attachment->tinyThumbnailType ? LinkHandler::getInstance()->getLink('Attachment', ['object' => $attachment], 'tiny=1') : '',
- 'thumbnailURL' => $attachment->thumbnailType ? LinkHandler::getInstance()->getLink('Attachment', ['object' => $attachment], 'thumbnail=1') : '',
- 'url' => LinkHandler::getInstance()->getLink('Attachment', ['object' => $attachment]),
+ 'tinyURL' => $attachment->tinyThumbnailType ? $attachment->getThumbnailLink('tiny') : '',
+ 'thumbnailURL' => $attachment->thumbnailType ? $attachment->getThumbnailLink('thumbnail') : '',
+ 'url' => $attachment->getLink(),
'height' => $attachment->height,
'width' => $attachment->width,
'iconName' => $attachment->getIconName()
$username = $this->user->userID ? $this->user->username : WCF::getLanguage()->get('wcf.moderation.assignedUser.nobody');
$link = '';
if ($this->user->userID) {
- $link = LinkHandler::getInstance()->getLink('User', ['object' => $this->user]);
+ $link = $this->user->getLink();
}
$newStatus = '';
<?php
namespace wcf\data\package;
+use wcf\acp\page\PackagePage;
use wcf\data\DatabaseObject;
+use wcf\data\ILinkableObject;
use wcf\system\package\PackageInstallationDispatcher;
+use wcf\system\request\IRouteController;
+use wcf\system\request\LinkHandler;
use wcf\system\WCF;
use wcf\util\FileUtil;
* @property-read string $author author of the package
* @property-read string $authorURL external url to the website of the package author
*/
-class Package extends DatabaseObject {
+class Package extends DatabaseObject implements ILinkableObject, IRouteController {
/**
* recursive list of packages that were given as required packages during installation
* @var Package[]
*/
protected static $requirements = null;
+ /**
+ * @inheritDoc
+ */
+ public function getLink() {
+ return LinkHandler::getInstance()->getControllerLink(PackagePage::class, [
+ 'object' => $this,
+ ]);
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function getTitle() {
+ return $this->getName();
+ }
+
/**
* Returns true if this package is required by other packages.
*
use wcf\system\comment\manager\ICommentManager;
use wcf\system\comment\CommentHandler;
use wcf\system\reaction\ReactionHandler;
-use wcf\system\request\LinkHandler;
use wcf\system\MetaTagHandler;
use wcf\system\WCF;
use wcf\util\StringUtil;
// add meta/og tags
MetaTagHandler::getInstance()->addTag('og:title', 'og:title', $this->articleContent->getTitle() . ' - ' . WCF::getLanguage()->get(PAGE_TITLE), true);
- MetaTagHandler::getInstance()->addTag('og:url', 'og:url', LinkHandler::getInstance()->getLink('Article', ['object' => $this->articleContent]), true);
+ MetaTagHandler::getInstance()->addTag('og:url', 'og:url', $this->articleContent->getLink(), true);
MetaTagHandler::getInstance()->addTag('og:type', 'og:type', 'article', true);
MetaTagHandler::getInstance()->addTag('og:description', 'og:description', ($this->articleContent->teaser ?: StringUtil::decodeHTML(StringUtil::stripHTML($this->articleContent->getFormattedTeaser()))), true);
if (isset($_REQUEST['editOnInit'])) $this->editOnInit = true;
- $this->canonicalURL = LinkHandler::getInstance()->getLink('User', ['object' => $this->user]);
+ $this->canonicalURL = $this->user->getLink();
}
/**
$class = 'messageFloatObject'.ucfirst($alignment);
}
- $source = StringUtil::encodeHTML(LinkHandler::getInstance()->getLink('Attachment', ['object' => $attachment]));
+ $source = StringUtil::encodeHTML($attachment->getLink());
$title = StringUtil::encodeHTML($attachment->filename);
if ($parser instanceof HtmlBBCodeParser && $parser->getIsGoogleAmp()) {
}
else {
// file
- return StringUtil::getAnchorTag(LinkHandler::getInstance()->getLink('Attachment', [
- 'object' => $attachment
- ]), $attachment->filename);
+ return StringUtil::getAnchorTag($attachment->getLink(), $attachment->filename);
}
}
namespace wcf\system\search\acp;
use wcf\data\package\Package;
use wcf\system\database\util\PreparedStatementConditionBuilder;
-use wcf\system\request\LinkHandler;
use wcf\system\WCF;
/**
/** @var Package $package */
while ($package = $statement->fetchObject(Package::class)) {
- $results[] = new ACPSearchResult($package->getName(), LinkHandler::getInstance()->getLink('Package', [
- 'id' => $package->packageID,
- 'title' => $package->getName()
- ]));
+ $results[] = new ACPSearchResult($package->getName(), $package->getLink());
}
return $results;
* @inheritDoc
*/
public function getLink() {
- return LinkHandler::getInstance()->getLink('User', ['object' => $this->author]);
+ return $this->author->getLink();
}
/**
use wcf\data\user\UserProfile;
use wcf\system\cache\runtime\UserProfileRuntimeCache;
use wcf\system\comment\CommentHandler;
-use wcf\system\request\LinkHandler;
use wcf\system\user\notification\object\LikeUserNotificationObject;
use wcf\system\WCF;
$owner = UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID']);
}
- return LinkHandler::getInstance()->getLink('User', ['object' => $owner], '#wall/comment' . $this->getCommentID());
+ return $owner->getLink() . '#wall/comment' . $this->getCommentID();
}
/**
use wcf\data\user\UserProfile;
use wcf\system\cache\runtime\UserProfileRuntimeCache;
use wcf\system\comment\CommentHandler;
-use wcf\system\request\LinkHandler;
use wcf\system\user\notification\object\LikeUserNotificationObject;
use wcf\system\WCF;
$owner = UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID']);
}
- return LinkHandler::getInstance()->getLink(
- 'User',
- ['object' => $owner],
- '#wall/comment' . $this->additionalData['commentID'] . '/response' . $this->getResponseID()
- );
+ return $owner->getLink() . '#wall/comment' . $this->additionalData['commentID'] . '/response' . $this->getResponseID();
}
/**
use wcf\system\cache\runtime\UserProfileRuntimeCache;
use wcf\system\comment\CommentHandler;
use wcf\system\email\Email;
-use wcf\system\request\LinkHandler;
use wcf\system\user\notification\object\CommentResponseUserNotificationObject;
/**
* @inheritDoc
*/
public function getLink() {
- return LinkHandler::getInstance()->getLink(
- 'User',
- ['object' => UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID'])],
- '#wall/comment' . $this->getUserNotificationObject()->commentID
- );
+ return UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID'])->getLink() .
+ '#wall/comment' . $this->getUserNotificationObject()->commentID;
}
/**
use wcf\data\user\UserProfile;
use wcf\system\cache\runtime\UserProfileRuntimeCache;
use wcf\system\comment\CommentHandler;
-use wcf\system\request\LinkHandler;
use wcf\system\user\notification\object\CommentUserNotificationObject;
/**
* @inheritDoc
*/
public function getLink() {
- return LinkHandler::getInstance()->getLink(
- 'User',
- ['object' => UserProfileRuntimeCache::getInstance()->getObject($this->getUserNotificationObject()->objectID)],
- '#wall/comment' . $this->getUserNotificationObject()->commentID
- );
+ return UserProfileRuntimeCache::getInstance()->getObject($this->getUserNotificationObject()->objectID)->getLink() .
+ '#wall/comment' . $this->getUserNotificationObject()->commentID;
}
/**
* @inheritDoc
*/
public function getLink() {
- return LinkHandler::getInstance()->getLink('User', ['object' => $this->author]);
+ return $this->author->getLink();
}
/**