本文整理汇总了PHP中TranslationPeer::getString方法的典型用法代码示例。如果您正苦于以下问题:PHP TranslationPeer::getString方法的具体用法?PHP TranslationPeer::getString怎么用?PHP TranslationPeer::getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TranslationPeer
的用法示例。
在下文中一共展示了TranslationPeer::getString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getConsolidatedKeywords
public function getConsolidatedKeywords($sLanguageId = null, $bReturnArray = false)
{
if ($sLanguageId == null) {
$sLanguageId = Session::language();
}
$aKeywords = array();
$aKeywords[] = TranslationPeer::getString('meta.keywords', null, '');
$aTags = TagPeer::tagInstancesForObject($this);
foreach ($aTags as $iKey => $oTag) {
$aTags[$iKey] = $oTag->getTag()->getName();
}
$aKeywords[] = $aTags;
$aKeywords[] = Settings::getSetting('frontend', 'keywords', '');
$aKeywords[] = $this->getActivePageString()->getMetaKeywords();
$aResult = array();
foreach ($aKeywords as $iKey => $mKeywords) {
if (!is_array($mKeywords)) {
$mKeywords = explode(',', $mKeywords);
}
foreach ($mKeywords as $sKeyword) {
$sKeyword = trim($sKeyword);
if (!isset($aResult[$sKeyword]) && $sKeyword !== '') {
$aResult[$sKeyword] = true;
}
}
}
if ($bReturnArray) {
return array_keys($aResult);
}
return implode(', ', array_keys($aResult));
}
示例2: allDocumentsByCategories
public function allDocumentsByCategories()
{
$aResult = array();
// find files in media dirs - large files that cannot be uploaded with http
$aCustomFiles = array();
$aMediaDirs = ResourceFinder::create()->addExpression('web', '/^(media|flash)$/')->addRecursion()->noCache()->returnObjects()->find();
foreach ($aMediaDirs as $oFileResource) {
if ($oFileResource->isFile()) {
$aCustomFiles[$oFileResource->getRelativePath()] = $oFileResource->getInstancePrefix() . $oFileResource->getRelativePath();
}
}
if (count($aCustomFiles) > 0) {
$sCustomFiles = TranslationPeer::getString('wns.documents.custom_files');
$aResult[$sCustomFiles] = array_flip($aCustomFiles);
}
// find files in database ordered by category
foreach (DocumentCategoryQuery::create()->filterByIsExternallyManaged(false)->orderByName()->find() as $oCategory) {
$aDocuments = DocumentQuery::create()->useDocumentCategoryQuery()->filterByIsExternallyManaged(false)->endUse()->orderByDocumentCategoryId()->orderByName()->select(array('Id', 'Name'))->find();
foreach ($aDocuments as $aDocument) {
$aResult[$oCategory->getName()][$aDocument['Id']] = $aDocument['Name'];
}
}
$sWithoutCategory = TranslationPeer::getString('wns.documents.select_without_title');
foreach (self::getDocumentsWithoutCategoryId() as $iId => $sName) {
$aResult[$sWithoutCategory][$iId] = $sName;
}
return $aResult;
}
示例3: getMetadataForColumn
public function getMetadataForColumn($sColumnIdentifier)
{
$aResult = array('is_sortable' => true);
switch ($sColumnIdentifier) {
case 'id':
$aResult['display_type'] = ListWidgetModule::DISPLAY_TYPE_DATA;
break;
case 'name':
$aResult['heading'] = TranslationPeer::getString('wns.subscriber_group.name');
break;
case 'display_name':
$aResult['heading'] = TranslationPeer::getString('wns.subscriber_group.display_name');
break;
case 'is_temporary':
$aResult['heading'] = TranslationPeer::getString('wns.subscriber_group.is_temporary');
$aResult['is_sortable'] = false;
break;
case 'link_to_subscriber_data':
$aResult['heading'] = TranslationPeer::getString('wns.subscribers');
$aResult['display_type'] = ListWidgetModule::DISPLAY_TYPE_URL;
break;
case 'delete':
$aResult['heading'] = ' ';
$aResult['display_type'] = ListWidgetModule::DISPLAY_TYPE_ICON;
$aResult['field_name'] = 'trash';
$aResult['is_sortable'] = false;
break;
}
return $aResult;
}
示例4: getCustomListElements
public static function getCustomListElements()
{
if (TagInstancePeer::doCount(TagInstancePeer::getTaggedModelsCriteria())) {
return array(array('tag_model_name' => CriteriaListWidgetDelegate::SELECT_ALL, 'title' => TranslationPeer::getString('wns.documents.select_all_title'), 'magic_column' => 'all'));
}
return array();
}
示例5: getUserOptions
/**
* @deprecated use query methods
*/
public static function getUserOptions()
{
$aUserOptions = array();
foreach (self::$USER_OPTIONS as $iKey => $iValue) {
switch ($iKey) {
case '2':
$sCheckMethod = 'hasBackendAdministrators';
break;
case '3':
$sCheckMethod = 'hasBackendUsersWithRights';
break;
case '4':
$sCheckMethod = 'hasBackendUsersOther';
break;
case '5':
$sCheckMethod = 'hasFrontendUsers';
break;
default:
$sCheckMethod = 'hasBackendUsers';
}
if (self::$sCheckMethod()) {
$aUserOptions[$iKey] = TranslationPeer::getString('user.' . $iValue);
}
}
return $aUserOptions;
}
示例6: getMetadataForColumn
public function getMetadataForColumn($sColumnIdentifier)
{
$aResult = array('is_sortable' => false);
switch ($sColumnIdentifier) {
case 'id':
$aResult['heading'] = false;
$aResult['display_type'] = ListWidgetModule::DISPLAY_TYPE_DATA;
break;
case 'name':
$aResult['heading'] = TranslationPeer::getString('wns.tag.name');
$aResult['is_sortable'] = true;
break;
case 'tag_instance_count':
$aResult['heading'] = TranslationPeer::getString('wns.tag.instance_count');
$aResult['display_type'] = ListWidgetModule::DISPLAY_TYPE_NUMERIC;
break;
case 'language_ids_of_strings':
$aResult['heading'] = TranslationPeer::getString('wns.tag.available_strings');
break;
case 'delete':
$aResult['heading'] = ' ';
$aResult['display_type'] = ListWidgetModule::DISPLAY_TYPE_ICON;
$aResult['field_name'] = 'trash';
break;
}
return $aResult;
}
示例7: getReferences
public static function getReferences($aReferences)
{
if (count($aReferences) === null) {
return null;
}
$aResult = array();
foreach ($aReferences as $oReference) {
if ($oReference->getFromModelName() === 'LanguageObject') {
$oReferencedFromObject = $oReference->getFrom();
if ($oReferencedFromObject) {
$oContentObject = $oReferencedFromObject->getContentObject();
$aResult[$oReferencedFromObject->getId()]['title'] = TranslationPeer::getString('reference.used_in_page');
$aResult[$oReferencedFromObject->getId()]['page_name'] = $oContentObject->getPage()->getName();
$aResult[$oReferencedFromObject->getId()]['container_name'] = $oContentObject->getContainerName();
$aResult[$oReferencedFromObject->getId()]['edit_link'] = TagWriter::quickTag('a', array('href' => LinkUtil::link(array('content', $oContentObject->getPageId(), 'edit', $oContentObject->getId()), 'AdminManager')), 'edit')->render();
} else {
// delete reference if getFrom() === null
$oReference->delete();
}
} else {
$aResult[$oReference->getFromId()]['title'] = TranslationPeer::getString('reference.used_in_object');
$aResult[$oReference->getFromId()]['object_class'] = $oReference->getFromModelName();
$aResult[$oReference->getFromId()]['object_id'] = $oReference->getFromId();
}
}
return $aResult;
}
示例8: getCustomListElements
public function getCustomListElements()
{
if ($this->getCriteria()->count() > 0) {
return array(array('document_category_id' => CriteriaListWidgetDelegate::SELECT_ALL, 'name_with_externally_managed_state' => TranslationPeer::getString('wns.documents.select_all_title'), 'magic_column' => 'all'), array('document_category_id' => CriteriaListWidgetDelegate::SELECT_WITHOUT, 'name_with_externally_managed_state' => TranslationPeer::getString('wns.documents.select_without_title'), 'magic_column' => 'without'));
}
return array();
}
示例9: renderFile
public function renderFile()
{
$bCleanup = Manager::usePath() === self::DO_CLEANUP;
$aReferences = ReferenceQuery::create()->find();
self::checkReferences($aReferences, $bCleanup);
if (count(self::$REFERENCES_WITHOUT_FROM) === 0 && count(self::$REFERENCES_WITHOUT_TO) === 0) {
if (!$bCleanup) {
print TranslationPeer::getString('test_references.references_are_ok', null, null, array('count' => count($aReferences)));
} else {
print TranslationPeer::getString('test_references.wrong_references_removed');
print TagWriter::quickTag('p', array(), TagWriter::quickTag('a', array('href' => LinkUtil::link(array('test_references'), 'FileManager')), TranslationPeer::getString('test_references.test_again')));
}
} else {
if (count(self::$REFERENCES_WITHOUT_FROM) > 0) {
print TagWriter::quickTag('p', array(), count(self::$REFERENCES_WITHOUT_FROM) . TranslationPeer::getString('test_references.loose_from_references_found'));
foreach (self::$REFERENCES_WITHOUT_FROM as $oReference) {
print TagWriter::quickTag('p', array(), $oReference->getFromModelName() . '/' . $oReference->getFromId());
}
}
if (count(self::$REFERENCES_WITHOUT_TO) > 0) {
print TagWriter::quickTag('p', array(), count(self::$REFERENCES_WITHOUT_TO) . TranslationPeer::getString('test_references.loose_to_references_found'));
foreach (self::$REFERENCES_WITHOUT_TO as $oReference) {
print TagWriter::quickTag('p', array(), $oReference->getToModelName() . '/' . $oReference->getToId());
}
}
print TagWriter::quickTag('p', array(), TagWriter::quickTag('a', array('href' => LinkUtil::link(array('test_references', self::DO_CLEANUP), 'FileManager')), TranslationPeer::getString('test_references.remove_loose_ends')));
}
}
示例10: getCustomListElements
public function getCustomListElements()
{
if (DocumentationQuery::create()->count() > 0) {
return array(array('documentation_id' => CriteriaListWidgetDelegate::SELECT_ALL, 'full_name' => TranslationPeer::getString('wns.sidebar.select_all'), 'magic_column' => 'all'));
}
return array();
}
示例11: getMetadataForColumn
public function getMetadataForColumn($sColumnIdentifier)
{
$aResult = array('is_sortable' => true);
switch ($sColumnIdentifier) {
case 'id':
$aResult['heading'] = false;
$aResult['field_name'] = 'string_key';
$aResult['display_type'] = ListWidgetModule::DISPLAY_TYPE_DATA;
break;
case 'string_key':
$aResult['heading'] = TranslationPeer::getString('wns.string.string_key');
break;
case 'text_truncated_current':
$aResult['heading'] = TranslationPeer::getString('wns.string.string_text.heading', null, 'Text', array('language_id' => AdminManager::getContentLanguage()));
break;
case 'languages_available':
$aResult['heading'] = TranslationPeer::getString('wns.languages_filled');
$aResult['is_sortable'] = false;
break;
case 'delete':
$aResult['heading'] = ' ';
$aResult['display_type'] = ListWidgetModule::DISPLAY_TYPE_ICON;
$aResult['field_name'] = 'trash';
$aResult['is_sortable'] = false;
break;
}
return $aResult;
}
示例12: getCustomListElements
public function getCustomListElements()
{
if ($this->oTagList->getIncludeAllAndWithout() && TagQuery::create()->filterByTagged($this->oTagList->getTaggedModelName())->count() > 0) {
return array(array('name' => CriteriaListWidgetDelegate::SELECT_ALL, 'display_name' => TranslationPeer::getString('wns.tags.select_all_title'), 'magic_column' => 'all'), array('name' => CriteriaListWidgetDelegate::SELECT_WITHOUT, 'display_name' => TranslationPeer::getString('wns.tags.select_without_title'), 'magic_column' => 'without'));
}
return array();
}
示例13: getMetadataForColumn
public function getMetadataForColumn($sColumnIdentifier)
{
$aResult = array('is_sortable' => true);
switch ($sColumnIdentifier) {
case 'extension':
$aResult['heading'] = TranslationPeer::getString('wns.extension');
break;
case 'document_kind':
$aResult['heading'] = TranslationPeer::getString('wns.document_kind');
break;
case 'mimetype':
$aResult['heading'] = TranslationPeer::getString('wns.mimetype');
break;
case 'document_count':
$aResult['heading'] = TranslationPeer::getString('wns.documents_count');
$aResult['is_sortable'] = false;
break;
case 'delete':
$aResult['heading'] = ' ';
$aResult['display_type'] = ListWidgetModule::DISPLAY_TYPE_ICON;
$aResult['field_name'] = 'trash';
$aResult['is_sortable'] = false;
break;
}
return $aResult;
}
示例14: getMetadataForColumn
public function getMetadataForColumn($sColumnIdentifier)
{
$aResult = array();
switch ($sColumnIdentifier) {
case 'name':
$aResult['heading'] = TranslationPeer::getString('wns.name');
$aResult['is_sortable'] = true;
break;
case 'settings':
$aResult['heading'] = TranslationPeer::getString('wns.document_category.settings');
break;
case 'link_to_document_data':
$aResult['heading'] = TranslationPeer::getString('wns.documents_count');
$aResult['display_type'] = ListWidgetModule::DISPLAY_TYPE_URL;
break;
case 'is_externally_managed':
$aResult['heading'] = TranslationPeer::getString('wns.internally_managed_only');
$aResult['heading_filter'] = array('externally_managed_input', $this->oExternallyManagedInputFilter->getSessionKey());
$aResult['is_sortable'] = false;
break;
case 'delete':
$aResult['heading'] = ' ';
$aResult['display_type'] = ListWidgetModule::DISPLAY_TYPE_ICON;
$aResult['field_name'] = 'trash';
break;
}
return $aResult;
}
示例15: getStringAsHTML
public function getStringAsHTML($sKey, $aParams = array(), $sLanguageId = null, $sDefaultValue = null)
{
$mResult = TranslationPeer::getString($sKey, $sLanguageId, $sDefaultValue, $aParams, true);
$oTemplate = new Template(TemplateIdentifier::constructIdentifier('result'), null, true);
$oTemplate->replaceIdentifier('result', $mResult);
return $oTemplate->render();
}