當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TranslationPeer類代碼示例

本文整理匯總了PHP中TranslationPeer的典型用法代碼示例。如果您正苦於以下問題:PHP TranslationPeer類的具體用法?PHP TranslationPeer怎麽用?PHP TranslationPeer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了TranslationPeer類的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));
 }
開發者ID:rapila,項目名稱:cms-base,代碼行數:31,代碼來源:Page.php

示例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;
 }
開發者ID:rapila,項目名稱:cms-base,代碼行數:28,代碼來源:DocumentInputWidgetModule.php

示例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;
 }
開發者ID:rapila,項目名稱:plugin-newsletter,代碼行數:30,代碼來源:SubscriberGroupListWidgetModule.php

示例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();
 }
開發者ID:rapila,項目名稱:cms-base,代碼行數:7,代碼來源:TagsAdminModule.php

示例5: 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();
 }
開發者ID:rapila,項目名稱:cms-base,代碼行數:7,代碼來源:TagListWidgetDelegate.php

示例6: 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;
 }
開發者ID:rapila,項目名稱:cms-base,代碼行數:29,代碼來源:UserPeer.php

示例7: 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;
 }
開發者ID:rapila,項目名稱:cms-base,代碼行數:27,代碼來源:TagListWidgetModule.php

示例8: 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;
 }
開發者ID:rapila,項目名稱:cms-base,代碼行數:28,代碼來源:DocumentCategoryListWidgetModule.php

示例9: getCustomListElements

 public function getCustomListElements()
 {
     if (GroupPeer::doCount(new Criteria()) > 0) {
         return array(array('group_id' => CriteriaListWidgetDelegate::SELECT_ALL, 'name' => TranslationPeer::getString('wns.roles.select_all_title'), 'magic_column' => 'all'), array('group_id' => CriteriaListWidgetDelegate::SELECT_WITHOUT, 'name' => TranslationPeer::getString('wns.roles.select_without_group_title'), 'magic_column' => 'without'));
     }
     return array();
 }
開發者ID:rapila,項目名稱:cms-base,代碼行數:7,代碼來源:RolesAdminModule.php

示例10: 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();
 }
開發者ID:rapila,項目名稱:cms-base,代碼行數:7,代碼來源:DocumentsAdminModule.php

示例11: 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();
 }
開發者ID:rapila,項目名稱:plugin-documentation,代碼行數:7,代碼來源:DocumentationPartsAdminModule.php

示例12: 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;
 }
開發者ID:rapila,項目名稱:cms-base,代碼行數:26,代碼來源:DocumentTypeListWidgetModule.php

示例13: 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')));
     }
 }
開發者ID:rapila,項目名稱:cms-base,代碼行數:28,代碼來源:TestReferencesFileModule.php

示例14: 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();
 }
開發者ID:rapila,項目名稱:cms-base,代碼行數:7,代碼來源:StringWidgetModule.php

示例15: 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;
 }
開發者ID:rapila,項目名稱:cms-base,代碼行數:27,代碼來源:AdminModule.php


注:本文中的TranslationPeer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。