当前位置: 首页>>代码示例>>PHP>>正文


PHP OC_L10N::l方法代码示例

本文整理汇总了PHP中OC_L10N::l方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_L10N::l方法的具体用法?PHP OC_L10N::l怎么用?PHP OC_L10N::l使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OC_L10N的用法示例。


在下文中一共展示了OC_L10N::l方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createMailBody

 /**
  * create mail body for plain text and html mail
  *
  * @param string $filename the shared file
  * @param string $link link to the shared file
  * @param int $expiration expiration date (timestamp)
  * @return array an array of the html mail body and the plain text mail body
  */
 private function createMailBody($filename, $link, $expiration)
 {
     $formatedDate = $expiration ? $this->l->l('date', $expiration) : null;
     $html = new \OC_Template("core", "mail", "");
     $html->assign('link', $link);
     $html->assign('user_displayname', $this->senderDisplayName);
     $html->assign('filename', $filename);
     $html->assign('expiration', $formatedDate);
     $htmlMail = $html->fetchPage();
     $alttext = new \OC_Template("core", "altmail", "");
     $alttext->assign('link', $link);
     $alttext->assign('user_displayname', $this->senderDisplayName);
     $alttext->assign('filename', $filename);
     $alttext->assign('expiration', $formatedDate);
     $alttextMail = $alttext->fetchPage();
     return array($htmlMail, $alttextMail);
 }
开发者ID:kebenxiaoming,项目名称:owncloudRedis,代码行数:25,代码来源:mailnotifications.php

示例2: testFirstWeekDay

 /**
  * @dataProvider firstDayDataProvider
  * @param $expected
  * @param $lang
  */
 public function testFirstWeekDay($expected, $lang)
 {
     $l = new OC_L10N('test');
     $l->forceLanguage($lang);
     $this->assertSame($expected, $l->l('firstday', 'firstday'));
 }
开发者ID:heldernl,项目名称:owncloud8-extended,代码行数:11,代码来源:l10n.php

示例3: basename

<?php

OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();
$l = new OC_L10N('core');
if (!isset($_FILES['rootcert_import'])) {
    OCP\JSON::error(array('error' => 'No certificate uploaded'));
    exit;
}
$data = file_get_contents($_FILES['rootcert_import']['tmp_name']);
$filename = basename($_FILES['rootcert_import']['name']);
$certificateManager = \OC::$server->getCertificateManager();
try {
    $cert = $certificateManager->addCertificate($data, $filename);
    OCP\JSON::success(array('name' => $cert->getName(), 'commonName' => $cert->getCommonName(), 'organization' => $cert->getOrganization(), 'validFrom' => $cert->getIssueDate()->getTimestamp(), 'validTill' => $cert->getExpireDate()->getTimestamp(), 'validFromString' => $l->l('date', $cert->getIssueDate()), 'validTillString' => $l->l('date', $cert->getExpireDate()), 'issuer' => $cert->getIssuerName(), 'issuerOrganization' => $cert->getIssuerOrganization()));
} catch (\Exception $e) {
    OCP\JSON::error(array('error' => 'Couldn\'t import SSL root certificate, allowed formats: PEM and DER'));
}
开发者ID:samj1912,项目名称:repo,代码行数:18,代码来源:addRootCertificate.php

示例4: generateRelativeDatetime

 /**
  * Creates a relative datetime string (with today, yesterday) or the normal date
  *
  * @param \OC_L10N $l
  * @param $timestamp
  * @return string
  */
 protected function generateRelativeDatetime(\OC_L10N $l, $timestamp)
 {
     $dateOfTimestamp = $l->l('date', $timestamp);
     $dateOfToday = $l->l('date', time());
     $dateOfYesterday = $l->l('date', time() - 3600 * 24);
     if ($dateOfTimestamp === $dateOfToday) {
         return (string) $l->t('Today %s', $l->l('time', $timestamp));
     }
     if ($dateOfTimestamp === $dateOfYesterday) {
         return (string) $l->t('Yesterday %s', $l->l('time', $timestamp));
     }
     return (string) $l->l('datetime', $timestamp);
 }
开发者ID:WYSAC,项目名称:oregon-owncloud,代码行数:20,代码来源:mailqueuehandler.php

示例5: testNumericToDateTime

 public function testNumericToDateTime()
 {
     $l = new OC_L10N('test');
     $this->assertSame('February 13, 2009 23:31', $l->l('datetime', 1234567890));
 }
开发者ID:olucao,项目名称:owncloud-core,代码行数:5,代码来源:l10n.php


注:本文中的OC_L10N::l方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。