• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP tc函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中tc函数的典型用法代码示例。如果您正苦于以下问题:PHP tc函数的具体用法?PHP tc怎么用?PHP tc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: installOrUpgrade

 private function installOrUpgrade($pkg, $fromVersion)
 {
     $at = AttributeType::getByHandle('handle_https');
     if (!is_object($at)) {
         $at = AttributeType::add('handle_https', tc('AttributeTypeName', 'HTTPS handling'), $pkg);
     }
     $akc = AttributeKeyCategory::getByHandle('collection');
     if (is_object($akc)) {
         if (!$akc->hasAttributeKeyTypeAssociated($at)) {
             $akc->associateAttributeKeyType($at);
         }
     }
     if (empty($fromVersion)) {
         $ak = CollectionAttributeKey::getByHandle('handle_https');
         if (!is_object($ak)) {
             $hhh = Loader::helper('https_handling', 'handle_https');
             /* @var $hhh HttpsHandlingHelper */
             $httpDomain = defined('BASE_URL') ? BASE_URL : Config::get('BASE_URL');
             if (!$httpDomain) {
                 $httpDomain = 'http://' . $hhh->getRequestDomain();
             }
             $httpsDomain = defined('BASE_URL_SSL') ? BASE_URL_SSL : Config::get('BASE_URL_SSL');
             if (!$httpsDomain) {
                 $httpsDomain = 'https://' . $hhh->getRequestDomain();
             }
             $ak = CollectionAttributeKey::add($at, array('akHandle' => 'handle_https', 'akName' => tc('AttributeKeyName', 'Page HTTP/HTTPS'), 'akIsSearchable' => 1, 'akIsSearchableIndexed' => 1, 'akIsAutoCreated' => 1, 'akIsEditable' => 1, 'akIsInternal' => 0, 'akEnabled' => 0, 'akDefaultRequirement' => HttpsHandlingHelper::SSLHANDLING_DOESNOT_MATTER, 'akCustomDomains' => 0, 'akHTTPDomain' => $httpDomain, 'akHTTPSDomain' => $httpsDomain), $pkg);
         }
     }
 }
开发者ID:mlocati,项目名称:concrete5-handle_https,代码行数:29,代码来源:controller.php


示例2: filterByKeywords

 public function filterByKeywords($kw)
 {
     static $reverseLookup = array();
     $db = Loader::db();
     $locale = Localization::activeLocale();
     if (!array_key_exists($locale, $reverseLookup)) {
         $reverseLookup[$locale] = false;
         if (Localization::activeLocale() != 'en_US' || ENABLE_TRANSLATE_LOCALE_EN_US) {
             $limit = defined('GROUPNAME_REVERSELOOKUP_LIMIT') ? GROUPNAME_REVERSELOOKUP_LIMIT : 100;
             $count = $db->GetOne('select count(*) from Groups');
             if ($count > 0 && $count <= $limit) {
                 $reverseLookup[$locale] = array();
                 $rs = $db->Query('select gID, gName, gDescription from Groups');
                 while ($row = $rs->FetchRow()) {
                     $reverseLookup[$locale][$row['gID']] = array('name' => tc('GroupName', $row['gName']), 'description' => tc('GroupDescription', $row['gDescription']));
                 }
                 $rs->Close();
             }
         }
     }
     if ($reverseLookup[$locale]) {
         $foundIDs = array();
         foreach ($reverseLookup[$locale] as $gID => $gTranslated) {
             if (stripos($gTranslated['name'], $kw) !== false || stripos($gTranslated['description'], $kw) !== false) {
                 $foundIDs[] = $gID;
             }
         }
         if (count($foundIDs)) {
             $this->filter(false, '(Groups.gID in (' . implode(', ', $foundIDs) . '))');
             return;
         }
     }
     $this->filter(false, "(Groups.gName like " . $db->qstr('%' . $kw . '%') . " or Groups.gDescription like " . $db->qstr('%' . $kw . '%') . ")");
 }
开发者ID:Zyqsempai,项目名称:amanet,代码行数:34,代码来源:group.php


示例3: actionAdmin

 public function actionAdmin()
 {
     $this->getMaxSorter();
     $this->getMinSorter();
     Yii::app()->user->setFlash('warning', Yii::t('module_lang', 'moduleAdminHelp', array('{link}' => CHtml::link(tc('Currency'), array('/currency/backend/main/admin')))));
     parent::actionAdmin();
 }
开发者ID:barricade86,项目名称:raui,代码行数:7,代码来源:MainController.php


示例4: getServiceLink

 public function getServiceLink(Page $c = null)
 {
     if (!is_object($c)) {
         $c = \Page::getCurrentPage();
     }
     if (is_object($c) && !$c->isError()) {
         $url = urlencode($c->getCollectionLink(true));
         switch ($this->getHandle()) {
             case 'facebook':
                 return "https://www.facebook.com/sharer/sharer.php?u={$url}";
             case 'twitter':
                 return "https://www.twitter.com/intent/tweet?url={$url}";
             case 'linkedin':
                 $title = urlencode($c->getCollectionName());
                 return "https://www.linkedin.com/shareArticle?mini-true&url={$url}&title={$title}";
             case 'pinterest':
                 return "https://www.pinterest.com/pin/create/button?url={$url}";
             case 'google_plus':
                 return "https://plus.google.com/share?url={$url}";
             case 'reddit':
                 return "https://www.reddit.com/submit?url={$url}";
             case 'print':
                 return "javascript:window.print();";
             case 'email':
                 $body = rawurlencode(t("Check out this article on %s:\n\n%s\n%s", tc('SiteName', Config::get('concrete.site')), $c->getCollectionName(), urldecode($url)));
                 $subject = rawurlencode(t('Thought you\'d enjoy this article.'));
                 return "mailto:?body={$body}&subject={$subject}";
         }
     }
 }
开发者ID:kreativmind,项目名称:concrete5-5.7.0,代码行数:30,代码来源:Service.php


示例5: jsonOk

 public static function jsonOk($msg = 'Success', $params = array())
 {
     $msg = $msg == 'Success' ? tc('Success') : $msg;
     $params = CMap::mergeArray(array('status' => self::STATUS_OK, 'msg' => $msg), $params);
     echo CJSON::encode($params);
     Yii::app()->end();
 }
开发者ID:alexjkitty,项目名称:estate,代码行数:7,代码来源:HAjax.php


示例6: actionUpdate

 public function actionUpdate($id)
 {
     $model = $this->loadModel($id);
     $model->scenario = 'update';
     $this->performAjaxValidation($model);
     if (isset($_POST[$this->modelName])) {
         $model->attributes = $_POST[$this->modelName];
         if (isset($_POST[$this->modelName]['password']) && $_POST[$this->modelName]['password']) {
             if (demo()) {
                 Yii::app()->user->setFlash('error', tc('Sorry, this action is not allowed on the demo server.'));
                 unset($model->password, $model->salt);
                 $this->redirect(array('update', 'id' => $model->id));
             } else {
                 $model->scenario = 'changePass';
             }
         } else {
             unset($model->password, $model->salt);
         }
         if ($model->validate()) {
             if ($model->scenario == 'changePass') {
                 $model->setPassword();
             }
             if ($model->save(false)) {
                 $this->redirect(array('view', 'id' => $model->id));
             }
         }
     }
     $this->render('update', array('model' => $model));
 }
开发者ID:alexjkitty,项目名称:estate,代码行数:29,代码来源:MainController.php


示例7: actionIndex

 public function actionIndex()
 {
     $model = $this->loadModel(Yii::app()->user->id);
     if (isset($_POST[$this->modelName])) {
         $model->scenario = 'changeAdminPass';
         $model->old_password = $_POST[$this->modelName]['old_password'];
         if ($model->validatePassword($model->old_password)) {
             if (demo()) {
                 Yii::app()->user->setFlash('error', tc('Sorry, this action is not allowed on the demo server.'));
                 $this->redirect(array('index'));
             }
             $model->attributes = $_POST[$this->modelName];
             if ($model->validate()) {
                 $model->setPassword();
                 $model->save(false);
                 Yii::app()->user->setFlash('success', Yii::t('module_usercpanel', 'Your password successfully changed.'));
                 $this->redirect(array('index'));
             }
         } else {
             Yii::app()->user->setFlash('error', Yii::t('module_adminpass', 'Wrong admin password! Try again.'));
             $this->redirect(array('index'));
         }
     }
     $this->render('index', array('model' => $model));
 }
开发者ID:barricade86,项目名称:raui,代码行数:25,代码来源:MainController.php


示例8: actionUpdate

 public function actionUpdate($id)
 {
     $model = $this->loadModel($id);
     if (isset($_POST["{$this->modelName}"])) {
         $model->attributes = $_POST["{$this->modelName}"];
         $newImage = isset($_FILES['Themes']) && $_FILES['Themes']['name']['upload_img'];
         if ($newImage) {
             // delete old image
             $model->delImage();
             $model->scenario = 'upload';
         }
         if ($model->validate()) {
             if ($newImage) {
                 $model->upload = CUploadedFile::getInstance($model, 'upload_img');
                 $model->bg_image = md5(uniqid()) . '.' . $model->upload->extensionName;
             }
             if ($model->save()) {
                 if ($newImage) {
                     $model->upload->saveAs(Yii::getPathOfAlias($model->path) . '/' . $model->bg_image);
                     Yii::app()->user->setFlash('success', tt('Image successfully added', 'themes'));
                 } else {
                     Yii::app()->user->setFlash('success', tc('Success'));
                 }
                 $this->refresh();
             }
         }
     }
     $this->render('update', array('model' => $model));
 }
开发者ID:barricade86,项目名称:raui,代码行数:29,代码来源:MainController.php


示例9: setUp

 public function setUp()
 {
     parent::setUp();
     $g1 = Group::add(tc("GroupName", "Guest"), tc("GroupDescription", "The guest group represents unregistered visitors to your site."), false, false, GUEST_GROUP_ID);
     $g2 = Group::add(tc("GroupName", "Registered Users"), tc("GroupDescription", "The registered users group represents all user accounts."), false, false, REGISTERED_GROUP_ID);
     $g3 = Group::add(tc("GroupName", "Administrators"), "", false, false, ADMIN_GROUP_ID);
 }
开发者ID:meixelsberger,项目名称:concrete5-5.7.0,代码行数:7,代码来源:GroupTest.php


示例10: label

		public function label($customText = false) {
			if ($customText == false) {
				$text = tc('AttributeKeyName', $this->attributeKey->getAttributeKeyName());
			} else {
				$text = $customText;
			}
			print Loader::helper('form')->label($this->field('value'), $text);
		}
开发者ID:ronlobo,项目名称:concrete5,代码行数:8,代码来源:controller.php


示例11: registerClientScriptJQuerySimpleCaptchaImage

 public function registerClientScriptJQuerySimpleCaptchaImage()
 {
     Yii::app()->clientScript->registerCssFile(Yii::app()->getBaseUrl(true) . '/common/js/antispam/jquerySimpleCCaptcha/jquery.simpleCaptcha.css');
     Yii::app()->clientScript->registerScriptFile(Yii::app()->getBaseUrl(true) . '/common/js/antispam/jquerySimpleCCaptcha/jquery.simpleCaptcha.js');
     $cs = Yii::app()->clientScript;
     $id = $this->imageOptions['id'];
     $js = "";
     $js .= "\n\$(document).ready(function() {\n\t\t\tvar parentBlockTmp = \$('#" . $this->imageOptions['id'] . "').parent();\n\t\t\t//var verifyCodeInput = \$(parentBlockTmp).find('input[type=text]');\n\t\t\tvar verifyCodeInput = \$(parentBlockTmp).find('input[id\$=\"_verifyCode\"]');\n\n\t\t\tif (verifyCodeInput && typeof verifyCodeInput !== 'undefined') {\n\t\t\t\tverifyCodeInput.hide();\n\t\t\t}\n\n\t\t\t\$('#" . $this->imageOptions['id'] . "')\n\t\t\t\t.simpleCaptcha({\n\t\t\t\t\tnumImages: 4,\n\t\t\t\t\tintroText: '" . tc('jquerySimpleCaptchaIntroText') . "',\n\t\t\t\t\tallowRefresh : false,\n\t\t\t\t\tscriptPath: '" . $this->getController()->createUrl('/antispam/jquerysimpleccaptcha/renderimages') . "',\n\t\t\t\t\tlanguage : '" . Yii::app()->language . "',\n\t\t\t\t\tverifyCodeInput : verifyCodeInput\n\t\t\t\t});\n\n\t\t});\n";
     $cs->registerScript('Yii.CCaptcha#' . $id, $js);
 }
开发者ID:barricade86,项目名称:raui,代码行数:10,代码来源:CustomCCaptcha.php


示例12: __construct

 public function __construct()
 {
     parent::__construct();
     $otypes = AttributeType::getList('file');
     $types = array();
     foreach ($otypes as $at) {
         $types[$at->getAttributeTypeID()] = tc('AttributeTypeName', $at->getAttributeTypeName());
     }
     $this->set('types', $types);
 }
开发者ID:ronlobo,项目名称:concrete5,代码行数:10,代码来源:attributes.php


示例13: getAccessEntityTypeDisplayName

 /** Returns the display name for this access entity type (localized and escaped accordingly to $format)
  * @param string $format = 'html'
  *    Escape the result in html format (if $format is 'html').
  *    If $format is 'text' or any other value, the display name won't be escaped.
  * @return string
  */
 public function getAccessEntityTypeDisplayName($format = 'html')
 {
     $value = tc('PermissionAccessEntityTypeName', $this->getAccessEntityTypeName());
     switch ($format) {
         case 'html':
             return h($value);
         case 'text':
         default:
             return $value;
     }
 }
开发者ID:ngreimel,项目名称:kovent,代码行数:17,代码来源:Type.php


示例14: getSelectAttributeOptionDisplayValue

 /** Returns the display name for this select option value (localized and escaped accordingly to $format)
  * @param string $format = 'html'
  *	Escape the result in html format (if $format is 'html').
  *	If $format is 'text' or any other value, the display name won't be escaped.
  * @return string
  */
 public function getSelectAttributeOptionDisplayValue($format = 'html')
 {
     $value = tc('SelectAttributeValue', $this->getSelectAttributeOptionValue(false));
     switch ($format) {
         case 'html':
             return h($value);
         case 'text':
         default:
             return $value;
     }
 }
开发者ID:ngreimel,项目名称:kovent,代码行数:17,代码来源:option.php


示例15: getTreeDisplayName

 /** Returns the display name for this tree (localized and escaped accordingly to $format)
  * @param  string $format = 'html' Escape the result in html format (if $format is 'html'). If $format is 'text' or any other value, the display name won't be escaped.
  * @return string
  */
 public function getTreeDisplayName($format = 'html')
 {
     $value = tc('TreeName', $this->topicTreeName);
     switch ($format) {
         case 'html':
             return h($value);
         case 'text':
         default:
             return $value;
     }
 }
开发者ID:meixelsberger,项目名称:concrete5-5.7.0,代码行数:15,代码来源:Topic.php


示例16: getBlockTypeSetDisplayName

 /** Returns the display name for this instance (localized and escaped accordingly to $format)
  * @param string $format = 'html' Escape the result in html format (if $format is 'html'). If $format is 'text' or any other value, the display name won't be escaped.
  * @return string
  */
 public function getBlockTypeSetDisplayName($format = 'html')
 {
     $value = tc('BlockTypeSetName', $this->btsName);
     switch ($format) {
         case 'html':
             return h($value);
         case 'text':
         default:
             return $value;
     }
 }
开发者ID:meixelsberger,项目名称:concrete5-5.7.0,代码行数:15,代码来源:Set.php


示例17: getTreeDisplayName

 /** Returns the display name for this tree (localized and escaped accordingly to $format)
  * @param  string $format = 'html' Escape the result in html format (if $format is 'html'). If $format is 'text' or any other value, the display name won't be escaped.
  *
  * @return string
  */
 public function getTreeDisplayName($format = 'html')
 {
     $value = tc('TreeName', 'File Manager');
     switch ($format) {
         case 'html':
             return h($value);
         case 'text':
         default:
             return $value;
     }
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:16,代码来源:FileManager.php


示例18: getTemplateFileDisplayName

 /** Returns the display name for this template file (localized and escaped accordingly to $format)
  * @param string $format = 'html' Escape the result in html format (if $format is 'html'). If $format is 'text' or any other value, the display name won't be escaped.
  * @return string
  */
 public function getTemplateFileDisplayName($format = 'html')
 {
     $displayName = tc('TemplateFileName', $this->name);
     switch ($format) {
         case 'html':
             return h($displayName);
         case 'text':
         default:
             return $displayName;
     }
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:15,代码来源:TemplateFile.php


示例19: getPermissionKeyDisplayDescription

 /** Returns the display description for this permission key (localized and escaped accordingly to $format)
  * @param string $format = 'html'
  *	Escape the result in html format (if $format is 'html').
  *	If $format is 'text' or any other value, the display description won't be escaped.
  * @return string
  */
 public function getPermissionKeyDisplayDescription($format = 'html')
 {
     $value = tc('PermissionKeyDescription', $this->getPermissionKeyDescription());
     switch ($format) {
         case 'html':
             return h($value);
         case 'text':
         default:
             return $value;
     }
 }
开发者ID:Zyqsempai,项目名称:amanet,代码行数:17,代码来源:key.php


示例20: getWorkflowDisplayName

 /**
  * Returns the display name for this workflow (localized and escaped accordingly to $format)
  * @param string $format = 'html'
  *    Escape the result in html format (if $format is 'html').
  *    If $format is 'text' or any other value, the display name won't be escaped.
  * @return string
  */
 public function getWorkflowDisplayName($format = 'html')
 {
     $value = tc('WorkflowName', $this->getWorkflowName());
     switch ($format) {
         case 'html':
             return h($value);
         case 'text':
         default:
             return $value;
     }
 }
开发者ID:WillemAnchor,项目名称:concrete5,代码行数:18,代码来源:Workflow.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP tc__f函数代码示例发布时间:2022-05-23
下一篇:
PHP tbl函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap