本文整理汇总了PHP中wcf\system\WCF::getLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP WCF::getLanguage方法的具体用法?PHP WCF::getLanguage怎么用?PHP WCF::getLanguage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wcf\system\WCF
的用法示例。
在下文中一共展示了WCF::getLanguage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDeleteNote
/**
* Returns delete note if applicable.
*
* @return string
*/
public function getDeleteNote()
{
if ($this->logEntry === null) {
return '';
}
return WCF::getLanguage()->getDynamicVariable('filebase.entry.file.deleted', array('file' => $this));
}
示例2: save
/**
* @see \wcf\form\IForm::save()
*/
public function save()
{
AbstractForm::save();
// set cookies
if ($this->useCookies == 1) {
UserAuthenticationFactory::getInstance()->getUserAuthentication()->storeAccessData($this->user, $this->username, $this->password);
}
$oldSessionID = WCF::getSession()->sessionID;
// change user
WCF::getSession()->changeUser($this->user);
// get redirect url
$this->checkURL();
$this->saved();
if (isset($_REQUEST['s']) && $_REQUEST['s'] == $oldSessionID && $oldSessionID != WCF::getSession()->sessionID) {
// force instant redirect to avoid issues with non-cookie login and the already defined SID_ARG_* constants
if (preg_match('~[?&]s=[a-f0-9]{40}~i', $this->url)) {
$this->url = preg_replace('~([?&])s=[a-f0-9]{40}~i', '$1s=' . WCF::getSession()->sessionID, $this->url);
} else {
$this->url .= mb_strpos($this->url, '?') === false ? '?' : '&';
$this->url .= 's=' . WCF::getSession()->sessionID;
}
HeaderUtil::redirect($this->url);
exit;
}
// redirect to url
WCF::getTPL()->assign('__hideUserMenu', true);
HeaderUtil::delayedRedirect($this->url, WCF::getLanguage()->get('wcf.user.login.redirect'));
exit;
}
示例3: getData
/**
* @see \wcf\system\option\IOptionType::getData()
*/
public function getData(Option $option, $newValue)
{
$number = str_replace(WCF::getLanguage()->get('wcf.global.thousandsSeparator'), '', $newValue);
$number = str_replace(WCF::getLanguage()->get('wcf.global.decimalPoint'), '.', $number);
if (!preg_match('~^(?:\\d*)\\.?\\d+~', $number, $matches)) {
return 0;
}
$number = $matches[0];
if (preg_match('/[kmgt]i?b$/i', $newValue, $multiplier)) {
switch (mb_strtolower($multiplier[0])) {
case 'tb':
$number *= 1000;
case 'gb':
$number *= 1000;
case 'mb':
$number *= 1000;
case 'kb':
$number *= 1000;
break;
case 'tib':
$number *= 1024;
case 'gib':
$number *= 1024;
case 'mib':
$number *= 1024;
case 'kib':
$number *= 1024;
break;
}
}
return $number;
}
示例4: prepare
/**
* @see \wcf\system\user\activity\event\IUserActivityEvent::prepare()
*/
public function prepare(array $events)
{
$commentIDs = array();
foreach ($events as $event) {
$commentIDs[] = $event->objectID;
}
$commentList = new CommentList();
$commentList->getConditionBuilder()->add('comment.commentID IN (?)', array($objectIDs));
$commentList->readObjects();
$comments = $commentList->getObjects();
foreach ($events as $event) {
if (isset($comments[$event->objectID])) {
$comment = $comments[$event->objectID];
$page = PageCache::getInstance()->getPage($comment->objectID);
if ($page !== null) {
if (!$page->canRead()) {
continue;
}
$event->setIsAccessible();
$text = WCF::getLanguage()->getDynamicVariable('wcf.user.profile.recentActivity.pageComment', array('page' => $page));
$event->setTitle($text);
$event->setDescription($comment->getFormattedMessage());
continue;
}
}
$event->setIsOrphaned();
}
}
示例5: getData
/**
* @see \wcf\system\option\IOptionType::getData()
*/
public function getData(Option $option, $newValue)
{
$newValue = str_replace(' ', '', $newValue);
$newValue = str_replace(WCF::getLanguage()->get('wcf.global.thousandsSeparator'), '', $newValue);
$newValue = str_replace(WCF::getLanguage()->get('wcf.global.decimalPoint'), '.', $newValue);
return floatval($newValue);
}
示例6: prepare
/**
* @see \wcf\system\user\activity\event\IUserActivityEvent::prepare()
*/
public function prepare(array $events)
{
$responseIDs = array();
foreach ($events as $event) {
$responseIDs[] = $event->objectID;
}
$responseList = new CommentResponseList();
$responseList->getConditionBuilder()->add("comment_response.responseID IN (?)", array($responseIDs));
$responseList->readObjects();
$responses = $responseList->getObjects();
$commentIDs = $comments = array();
foreach ($responses as $response) {
$commentIDs[] = $response->commentID;
}
if (!empty($commentIDs)) {
$commentList = new CommentList();
$commentList->getConditionBuilder()->add("comment.commentID IN (?)", array($commentIDs));
$commentList->readObjects();
$comments = $commentList->getObjects();
}
// fetch news entries
$entryIDs = $entry = array();
foreach ($comments as $comment) {
$entryIDs[] = $comment->objectID;
}
if (!empty($entryIDs)) {
$entryList = new ViewableEntryList();
$entryList->getConditionBuilder()->add("news_entry.entryID IN (?)", array($entryIDs));
$entryList->readObjects();
$entry = $entryList->getObjects();
}
$userIDs = $user = array();
foreach ($comments as $comment) {
$userIDs[] = $comment->userID;
}
if (!empty($userIDs)) {
$userList = new UserList();
$userList->getConditionBuilder()->add("user_table.userID IN (?)", array($userIDs));
$userList->readObjects();
$users = $userList->getObjects();
}
foreach ($events as $event) {
if (isset($responses[$event->objectID])) {
$response = $responses[$event->objectID];
$comment = $comments[$response->commentID];
if (isset($entry[$comment->objectID]) && isset($users[$comment->userID])) {
$newsEntry = $entry[$comment->objectID];
if (!$newsEntry->canRead()) {
continue;
}
$event->setIsAccessible();
$text = WCF::getLanguage()->getDynamicVariable('cms.recentActivity.newsCommentResponse', array('commentAuthor' => $users[$comment->userID], 'entry' => $newsEntry));
$event->setTitle($text);
$event->setDescription($response->getExcerpt());
continue;
}
}
$event->setIsOrphaned();
}
}
开发者ID:Griborim,项目名称:de.incendium.cms.news,代码行数:63,代码来源:NewsEntryCommentResponseUserActivityEvent.class.php
示例7: readData
/**
* @see \wcf\page\IPage::readData()
*/
public function readData()
{
parent::readData();
// add breadcrumbs
WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('cms.header.menu.news'), LinkHandler::getInstance()->getLink('NewsOverview', array('application' => 'cms'))));
WCF::getBreadcrumbs()->add($this->entry->getDecoratedObject()->getBreadcrumb());
}
示例8: search
/**
* @see \wcf\system\search\acp\IACPSearchResultProvider::search()
*/
public function search($query)
{
if (!WCF::getSession()->getPermission('admin.system.package.canUpdatePackage') && !WCF::getSession()->getPermission('admin.system.package.canUninstallPackage')) {
return array();
}
$results = array();
// search by language item
$conditions = new PreparedStatementConditionBuilder();
$conditions->add("languageID = ?", array(WCF::getLanguage()->languageID));
$conditions->add("languageItem LIKE ?", array('wcf.acp.package.packageName.package%'));
$conditions->add("languageItemValue LIKE ?", array('%' . $query . '%'));
$sql = "SELECT\t\tlanguageItem\n\t\t\tFROM\t\twcf" . WCF_N . "_language_item\n\t\t\t" . $conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
$packageIDs = array();
while ($row = $statement->fetchArray()) {
$packageIDs[] = str_replace('wcf.acp.package.packageName.package', '', $row['languageItem']);
}
$conditions = new PreparedStatementConditionBuilder(false);
if (!empty($packageIDs)) {
$conditions->add("packageID IN (?)", array($packageIDs));
}
$sql = "SELECT\t*\n\t\t\tFROM\twcf" . WCF_N . "_package\n\t\t\tWHERE\tpackageName LIKE ?\n\t\t\t\tOR package LIKE ?\n\t\t\t\t" . (count($conditions->getParameters()) ? "OR " . $conditions : "");
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(array_merge(array($query . '%', $query . '%'), $conditions->getParameters()));
while ($package = $statement->fetchObject('wcf\\data\\package\\Package')) {
$results[] = new ACPSearchResult($package->getName(), LinkHandler::getInstance()->getLink('Package', array('id' => $package->packageID, 'title' => $package->getName())));
}
return $results;
}
示例9: prepare
public function prepare(array $events)
{
$objectIDs = array();
foreach ($events as $event) {
$objectIDs[] = $event->objectID;
}
// comments
$commentList = new CommentList();
$commentList->getConditionBuilder()->add("comment.commentID IN (?)", array($objectIDs));
$commentList->readObjects();
$comments = $commentList->getObjects();
// get news
$newsIDs = array();
foreach ($comments as $comment) {
$newsIDs[] = $comment->objectID;
}
$list = new NewsList();
$list->getConditionBuilder()->add("news.newsID IN (?)", array($newsIDs));
$list->readObjects();
$newss = $list->getObjects();
foreach ($events as $event) {
if (isset($comments[$event->objectID])) {
$comment = $comments[$event->objectID];
if (isset($newss[$comment->objectID])) {
$news = $newss[$comment->objectID];
$text = WCF::getLanguage()->getDynamicVariable('wcf.user.profile.recentActivity.newsComment', array('news' => $news));
$event->setTitle($text);
$event->setDescription($comment->getFormattedMessage());
$event->setIsAccessible();
}
} else {
$event->setIsOrphaned();
}
}
}
示例10: prepare
/**
* @see \wcf\system\like\IViewableLikeProvider::prepare()
*/
public function prepare(array $likes)
{
$entryIDs = array();
foreach ($likes as $like) {
$entryIDs[] = $like->objectID;
}
// fetch entries
$entryList = new EntryList();
$entryList->setObjectIDs($entryIDs);
$entryList->readObjects();
$entries = $entryList->getObjects();
// set message
foreach ($likes as $like) {
if (isset($entries[$like->objectID])) {
$entry = $entries[$like->objectID];
// check permissions
if (!$entry->canRead()) {
continue;
}
$like->setIsAccessible();
// short output
$text = WCF::getLanguage()->getDynamicVariable('wcf.like.title.de.incendium.cms.like.likeableNews', array('entry' => $entry, 'like' => $like));
$like->setTitle($text);
// output
$like->setDescription($entry->getExcerpt());
}
}
}
示例11: init
/**
* @see \wcf\system\SingletonFactory::init()
*/
protected function init()
{
// set default tags
$this->addTag('description', 'description', WCF::getLanguage()->get(META_DESCRIPTION));
$this->addTag('keywords', 'keywords', WCF::getLanguage()->get(META_KEYWORDS));
$this->addTag('og:site_name', 'og:site_name', WCF::getLanguage()->get(PAGE_TITLE), true);
}
示例12: getParsedTag
/**
* @see \wcf\system\bbcode\IBBCode::getParsedTag()
*/
public function getParsedTag(array $openingTag, $content, array $closingTag, BBCodeParser $parser)
{
if ($parser->getOutputType() == 'text/html') {
$quoteLink = !empty($openingTag['attributes'][1]) ? $openingTag['attributes'][1] : '';
$externalQuoteLink = !empty($openingTag['attributes'][1]) ? !ApplicationHandler::getInstance()->isInternalURL($openingTag['attributes'][1]) : false;
if (!$externalQuoteLink) {
$quoteLink = preg_replace('~^https?://~', RouteHandler::getProtocol(), $quoteLink);
}
$quoteAuthor = !empty($openingTag['attributes'][0]) ? $openingTag['attributes'][0] : '';
$quoteAuthorObject = null;
if ($quoteAuthor && !$externalQuoteLink) {
$quoteAuthorLC = mb_strtolower(StringUtil::decodeHTML($quoteAuthor));
foreach (MessageEmbeddedObjectManager::getInstance()->getObjects('com.woltlab.wcf.quote') as $user) {
if (mb_strtolower($user->username) == $quoteAuthorLC) {
$quoteAuthorObject = $user;
break;
}
}
}
WCF::getTPL()->assign(array('content' => $content, 'quoteLink' => $quoteLink, 'quoteAuthor' => $quoteAuthor, 'quoteAuthorObject' => $quoteAuthorObject, 'isExternalQuoteLink' => $externalQuoteLink));
return WCF::getTPL()->fetch('quoteBBCodeTag');
} else {
if ($parser->getOutputType() == 'text/simplified-html') {
return WCF::getLanguage()->getDynamicVariable('wcf.bbcode.quote.text', array('content' => $content, 'cite' => !empty($openingTag['attributes'][0]) ? $openingTag['attributes'][0] : '')) . "\n";
}
}
}
示例13: getLabel
/**
* Returns the label of the input element.
*
* @param string $identifier
* @return string
*/
protected function getLabel($identifier)
{
if (isset($this->labels[$identifier])) {
return '<label for="' . $identifier . '">' . WCF::getLanguage()->get($this->labels[$identifier]) . '</label>';
}
return '';
}
示例14: readData
public function readData()
{
parent::readData();
WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('cms.page.news'), LinkHandler::getInstance()->getLink('NewsCategoryList', array('application' => 'cms'))));
$excludedCategoryIDs = array_diff(NewsCategory::getAccessibleCategoryIDs(), NewsCategory::getAccessibleCategoryIDs(array('canAddNews')));
$categoryTree = new NewsCategoryNodeTree('de.codequake.cms.category.news', 0, false, $excludedCategoryIDs);
$this->categoryList = $categoryTree->getIterator();
$this->categoryList->setMaxDepth(0);
if (empty($_POST)) {
$dateTime = DateUtil::getDateTimeByTimestamp(TIME_NOW);
$dateTime->setTimezone(WCF::getUser()->getTimeZone());
$this->time = $dateTime->format('c');
} else {
$dateTime = DateUtil::getDateTimeByTimestamp(@strtotime($this->time));
$dateTime->setTimezone(WCF::getUser()->getTimeZone());
$this->time = $dateTime->format('c');
}
// default values
if (empty($_POST)) {
$this->username = WCF::getSession()->getVar('username');
// multilingualism
if (!empty($this->availableContentLanguages)) {
if ($this->languageID) {
$language = LanguageFactory::getInstance()->getUserLanguage();
$this->languageID = $language->languageID;
}
if (!isset($this->availableContentLanguages[$this->languageID])) {
$languageIDs = array_keys($this->availableContentLanguages);
$this->languageID = array_shift($languageIDs);
}
}
}
}
示例15: prepare
/**
* @see \wcf\system\user\activity\event\IUserActivityEvent::prepare()
*/
public function prepare(array $events)
{
$objectIDs = array();
foreach ($events as $event) {
$objectIDs[] = $event->objectID;
}
// fetch entrys
$entryList = new EntryList();
$entryList->setObjectIDs($objectIDs);
$entryList->readObjects();
$entries = $entryList->getObjects();
// set message
foreach ($events as $event) {
if (isset($entries[$event->objectID])) {
if (!$entries[$event->objectID]->canRead()) {
continue;
}
$event->setIsAccessible();
// title
$text = WCF::getLanguage()->getDynamicVariable('filebase.recentActivity.entry', array('entry' => $entries[$event->objectID]));
$event->setTitle($text);
// description
$event->setDescription($entries[$event->objectID]->getExcerpt());
} else {
$event->setIsOrphaned();
}
}
}