本文整理汇总了PHP中QApplication::LocalizeDateTime方法的典型用法代码示例。如果您正苦于以下问题:PHP QApplication::LocalizeDateTime方法的具体用法?PHP QApplication::LocalizeDateTime怎么用?PHP QApplication::LocalizeDateTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QApplication
的用法示例。
在下文中一共展示了QApplication::LocalizeDateTime方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SelectTopic
public function SelectTopic(Topic $objTopic)
{
$this->objTopic = $objTopic;
if ($this->objTopic) {
// View Buttons
$this->btnRespond1->Visible = true;
$this->btnRespond2->Visible = true;
$this->btnMarkAsViewed1->Visible = true;
$this->btnMarkAsViewed2->Visible = true;
$this->btnNotify1->Visible = true;
$this->btnNotify2->Visible = true;
$objFirstMessage = Message::QuerySingle(QQ::Equal(QQN::Message()->TopicId, $this->objTopic->Id), QQ::OrderBy(QQN::Message()->Id));
if ($objFirstMessage) {
$dttLocalize = QApplication::LocalizeDateTime($objFirstMessage->PostDate);
$this->strPostStartedLinkText = strtolower($dttLocalize->__toString('DDDD, MMMM D, YYYY, h:mm z ')) . strtolower(QApplication::DisplayTimezoneLink($dttLocalize, false));
} else {
$this->strPostStartedLinkText = 'none';
}
$this->UpdateNotifyButtons();
$this->UpdateMarkAsViewedButtons();
} else {
// Hide Buttons
$this->btnRespond1->Visible = false;
$this->btnRespond2->Visible = false;
$this->btnMarkAsViewed1->Visible = false;
$this->btnMarkAsViewed2->Visible = false;
$this->btnNotify1->Visible = false;
$this->btnNotify2->Visible = false;
}
}
示例2: printf
<?php
$dttLocalize = QApplication::LocalizeDateTime($_ITEM->PostDate);
?>
<div class="messageBar <?php
if ($_CONTROL->CurrentItemIndex % 2) {
print 'messageBarAlternate';
}
?>
">
<a name="<?php
_p($_ITEM->ReplyNumber);
?>
"></a>
<div class="name">
<?php
if ($_CONTROL->ParentControl->IsMessageEditable($_ITEM)) {
printf('<span class="replyNumber">#%s (<a href="#" title="Edit This Post" %s>Edit</a>) | </span>', $_ITEM->ReplyNumber, $_CONTROL->ParentControl->pxyEditMessage->RenderAsEvents($_ITEM->Id, false));
} else {
printf('<span class="replyNumber">#%s | </span>', $_ITEM->ReplyNumber);
}
?>
<?php
_p($_ITEM->Person ? $_ITEM->Person->DisplayForForums : '‹‹ Qcodo System Message ››', false);
?>
</div>
<div class="date">
<?php
if ($_CONTROL->ParentControl->pxyDeleteMessage) {
?>
<a style="margin-right: 25px;" href="#" <?php
示例3: Form_Create
protected function Form_Create()
{
$this->strSanitizedPath = WikiItem::SanitizeForPath(QApplication::$PathInfo, $this->intWikiItemTypeId);
$this->objWikiItem = WikiItem::LoadByPathWikiItemTypeId($this->strSanitizedPath, $this->intWikiItemTypeId);
$this->strPageTitle .= sprintf(' %s - ', WikiItemType::$NameArray[$this->intWikiItemTypeId]);
// If Doesn't Exist, Show the 404 page
if (!$this->objWikiItem) {
parent::Form_Create();
$this->strHtmlIncludeFilePath = dirname(__FILE__) . '/index_404.tpl.php';
$this->strPageTitle .= QApplication::$PathInfo;
return;
}
// cleanup any dangling versions (if applicable)
if (!$this->objWikiItem->CurrentWikiVersion) {
if ($this->objWikiItem->CleanupOrphans()) {
parent::Form_Create();
$this->strHtmlIncludeFilePath = dirname(__FILE__) . '/index_404.tpl.php';
$this->strPageTitle .= QApplication::$PathInfo;
return;
}
}
// Get the Wiki Version object based on the $_GET variables, or use CurrentWikiVersion if none passed in
$arrGetKeys = array_keys($_GET);
if (count($arrGetKeys) == 1) {
$this->objWikiVersion = WikiVersion::LoadByWikiItemIdVersionNumber($this->objWikiItem->Id, $arrGetKeys[0]);
}
if (!$this->objWikiVersion) {
$this->objWikiVersion = $this->objWikiItem->CurrentWikiVersion;
}
// Setup NavBar and SubNav stuff (if applicable) and setup PageTitle
if (!is_null($this->objWikiItem->OverrideNavbarIndex)) {
$this->intNavBarIndex = $this->objWikiItem->OverrideNavbarIndex;
$this->intSubNavIndex = $this->objWikiItem->OverrideSubnavIndex;
$this->strPageTitle = $this->objWikiVersion->Name;
} else {
$this->strPageTitle .= $this->objWikiVersion->Name;
}
// Create Controls for Page
parent::Form_Create();
if ($this->objWikiItem->IsEditableForPerson(QApplication::$Person)) {
$this->btnSetAsCurrentVersion = new QLinkButton($this);
$this->btnSetAsCurrentVersion->Text = 'Set as Current';
$this->btnSetAsCurrentVersion->AddAction(new QClickEvent(), new QAjaxAction('btnSetAsCurrentVersion_Click'));
$this->btnSetAsCurrentVersion->AddAction(new QClickEvent(), new QTerminateAction());
}
// Setup the Main Content Area
$this->pnlContent = new QPanel($this);
$this->pnlContent->CssClass = 'wiki';
$this->pnlContentHeadline = new QPanel($this->pnlContent);
$this->pnlContentHeadline->Template = 'pnlContentHeadline.tpl.php';
$this->btnEdit = new RoundedLinkButton($this->pnlContentHeadline);
$this->btnEdit->AddAction(new QClickEvent(), new QAjaxAction('btnEdit_Click'));
$this->btnEdit->AddAction(new QClickEvent(), new QTerminateAction());
$this->btnEdit->AddCssClass('roundedLinkGray');
$this->btnToggleVersions = new RoundedLinkButton($this->pnlContentHeadline);
$this->btnToggleVersions->AddAction(new QClickEvent(), new QAjaxAction('btnToggleVersions_Click'));
$this->btnToggleVersions->AddAction(new QClickEvent(), new QTerminateAction());
$this->btnToggleMessages = new RoundedLinkButton($this->pnlContentHeadline);
$this->btnToggleMessages->AddAction(new QClickEvent(), new QAjaxAction('btnToggleMessages_Click'));
$this->btnToggleMessages->AddAction(new QClickEvent(), new QTerminateAction());
if ($this->objWikiItem->IsAdminableForPerson(QApplication::$Person)) {
$this->btnAdmin = new RoundedLinkButton($this->pnlContentHeadline);
$this->btnAdmin->AddAction(new QClickEvent(), new QAjaxAction('btnAdmin_Click'));
$this->btnAdmin->AddAction(new QClickEvent(), new QTerminateAction());
$this->btnAdmin->AddCssClass('roundedLinkGray');
$this->btnAdmin->Text = 'Admin This Wiki';
}
$this->pnlVersions = new WikiVersionsPanel($this->objWikiItem, $this, 'wikiVersionsPanel');
if (count($arrGetKeys) && is_numeric($arrGetKeys[0])) {
$this->pnlVersions_Show();
} else {
$this->pnlVersions_Hide();
}
// Set the template path baed on the wiki item type
$this->SetTemplatePath();
// Setup DateTime of Post
$dttLocalize = QApplication::LocalizeDateTime($this->objWikiVersion->PostDate);
$this->strPostStartedLinkText = strtolower($dttLocalize->__toString('DDDD, MMMM D, YYYY, h:mm z ')) . strtolower(QApplication::DisplayTimezoneLink($dttLocalize, false));
// Setup messages panel
$this->pnlMessages = new MessagesPanel($this);
$this->pnlMessages->SelectTopic($this->objWikiItem->TopicLink->GetTopic());
$this->pnlMessages->lblTopicInfo_SetTemplate(__INCLUDES__ . '/messages/lblTopicInfoForWiki.tpl.php');
$this->pnlMessages->btnRespond1->Text = 'Post Comment';
$this->pnlMessages->btnRespond2->Text = 'Post Comment';
$this->pnlMessages->strAdditionalCssClass = 'topicForWiki';
if (array_key_exists('lastpage', $_GET)) {
$this->pnlMessages->SetPageNumber(QPaginatedControl::LastPage);
$this->pnlMessages_Show();
} else {
if (QApplication::IsWikiViewComments()) {
$this->pnlMessages_Show();
} else {
$this->pnlMessages_Hide();
}
}
}