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


PHP unknown_type::attribute方法代码示例

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


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

示例1: array

 /**
  * Generated all outputformats
  *
  * @param unknown_type $objectVersion
  * @return array
  */
 function getAllOutputFormatTextByContentObjectVersion($objectVersion, $forceSettingImageIncludeTo = -1)
 {
     $outputFormatTextArray = array();
     $dataMap = $objectVersion->attribute('data_map');
     $editionAttribute = $dataMap['newsletter_edition'];
     $editionAttributeContent = $editionAttribute->attribute('content');
     $listAttributeContent = $editionAttributeContent->attribute('list_attribute_content');
     $outputFormatArray = $listAttributeContent->attribute('output_format_array');
     $mainSiteAccess = $listAttributeContent->attribute('main_siteaccess');
     $skinName = $listAttributeContent->attribute('skin_name');
     $editionContentObjectId = $objectVersion->attribute('contentobject_id');
     $versionId = $objectVersion->attribute('version');
     $emailSender = $listAttributeContent->attribute('email_sender');
     $emailSenderName = $listAttributeContent->attribute('email_sender_name');
     $emailReplyTo = $listAttributeContent->attribute('email_reply_to');
     $emailReturnPath = $listAttributeContent->attribute('email_return_path');
     foreach ($outputFormatArray as $outputFormatId => $outputName) {
         $newsletterContentArray = CjwNewsletterEdition::getOutput($editionContentObjectId, $versionId, $outputFormatId, $mainSiteAccess, $skinName, $forceSettingImageIncludeTo);
         $newsletterContentArray['email_sender'] = $emailSender;
         $newsletterContentArray['email_sender_name'] = $emailSenderName;
         $newsletterContentArray['email_reply_to'] = $emailReplyTo;
         $newsletterContentArray['email_return_path'] = $emailReturnPath;
         $outputFormatTextArray[$outputName] = $newsletterContentArray;
     }
     return $outputFormatTextArray;
 }
开发者ID:hudri,项目名称:cjw_newsletter,代码行数:32,代码来源:cjwnewslettermail.php

示例2: validateObjectAttributeHTTPInput

 /**
  * Almost identical with the one in extended class, just injects
  * call for uniqness validation method
  *
  * @param unknown_type $http
  * @param unknown_type $base
  * @param unknown_type $contentObjectAttribute
  * @return unknown
  */
 function validateObjectAttributeHTTPInput($http, $base, $contentObjectAttribute)
 {
     if ($http->hasPostVariable($base . "_ezurl_url_" . $contentObjectAttribute->attribute("id")) and $http->hasPostVariable($base . "_ezurl_text_" . $contentObjectAttribute->attribute("id"))) {
         $url = $http->PostVariable($base . "_ezurl_url_" . $contentObjectAttribute->attribute("id"));
         $text = $http->PostVariable($base . "_ezurl_text_" . $contentObjectAttribute->attribute("id"));
         if ($contentObjectAttribute->validateIsRequired()) {
             if ($url == "" or $text == "") {
                 $contentObjectAttribute->setValidationError(ezpI18n::tr('kernel/classes/datatypes', 'Input required.'));
                 return eZInputValidator::STATE_INVALID;
             }
         }
         return self::validateUniqueURLHTTPInput($url, $contentObjectAttribute);
         // Remove all url-object links to this attribute.
         eZURLObjectLink::removeURLlinkList($contentObjectAttribute->attribute("id"), $contentObjectAttribute->attribute('version'));
     }
     return eZInputValidator::STATE_ACCEPTED;
 }
开发者ID:Opencontent,项目名称:ezuniquedatatypes,代码行数:26,代码来源:ezuniqueurltype.php

示例3: validateStringHTTPInput

 /**
  * This method is almost identical with the one from extended class,
  * It simply adds a call to a method dedicated to uniqueness validation
  *
  * @param unknown_type $data
  * @param unknown_type $contentObjectAttribute
  * @param unknown_type $classAttribute
  * @return unknown
  */
 function validateStringHTTPInput($data, $contentObjectAttribute, $classAttribute)
 {
     $maxLen = $classAttribute->attribute(self::MAX_LEN_FIELD);
     $textCodec = eZTextCodec::instance(false);
     if ($textCodec->strlen($data) > $maxLen && $maxLen > 0) {
         $contentObjectAttribute->setValidationError(ezpI18n::tr('kernel/classes/datatypes', 'The input text is too long. The maximum number of characters allowed is %1.'), $maxLen);
         return eZInputValidator::STATE_INVALID;
     }
     return self::validateUniqueStringHTTPInput($data, $contentObjectAttribute);
 }
开发者ID:Opencontent,项目名称:ezuniquedatatypes,代码行数:19,代码来源:ezuniquestringtype.php

示例4: fetchTagsByContentObject

 /**
  * Enter description here...
  *
  * @param unknown_type $oObject
  * @return unknown
  */
 static function fetchTagsByContentObject($oObject, $view_parameters)
 {
     // Prevent from request on a non-existent object
     if (!$oObject instanceof eZContentObject) {
         return NULL;
     }
     $oIni = eZINI::instance("metatag.ini");
     $oObjectClassIdentifier = $oObject->contentClassIdentifier();
     $oObjectDataMap = $oObject->dataMap();
     /*
      * 	Recherche des attribute mapping avec parameters
      */
     $attributesMappings = MetatagFunctionCollection::getAttributesMappingWithViewParameters($oObjectClassIdentifier, $view_parameters);
     //		$attributesMappings 	= MetatagFunctionCollection::getAttributesMapping( $oObjectClassIdentifier );
     $nameAttributes = $attributesMappings['name'];
     $descriptionAttributes = $attributesMappings['description'];
     $keywordsAttributes = $attributesMappings['keywords'];
     $metaAttributes = $attributesMappings['meta'];
     $namePattern = $attributesMappings['namePattern'];
     $descriptionPattern = $attributesMappings['descriptionPattern'];
     $keywordsPattern = $attributesMappings['keywordsPattern'];
     $sizeLimit = $attributesMappings['sizeLimit'];
     $autowash = false;
     $metatagOnlyMapping = false;
     if (isset($view_parameters['offset']) && $view_parameters['offset'] != 0) {
         $namePattern .= ', page ' . $view_parameters['offset'];
     }
     $name = NULL;
     $description = NULL;
     $keywords = NULL;
     // We check that the attribute is defined
     if (!$oIni->hasVariable('AttributesMapping', 'MetatagAttributeIdentifier')) {
         eZDebug::writeError("Configuration is incomplete, MetatagAttributeIdentifier is not defined in metatag.ini", 'MetatagFunctionCollection::fetchTagsByContentObject');
         return NULL;
     }
     // Checking preferences
     if ($oIni->hasVariable('MetatagSettings', 'Autowash') && $oIni->variable('MetatagSettings', 'Autowash') === 'enabled') {
         $autowash = true;
     }
     if ($oIni->hasVariable('AttributesMapping', "MetatagOnlyMapping") && in_array($oObjectClassIdentifier, $oIni->variable('AttributesMapping', "MetatagOnlyMapping"))) {
         $metatagOnlyMapping = true;
     }
     $metaAttribute = $oIni->variable('AttributesMapping', 'MetatagAttributeIdentifier');
     $tag = NULL;
     $tagAttributeExists = array_key_exists($metaAttribute, $oObjectDataMap) && $oObjectDataMap[$metaAttribute] instanceof eZContentObjectAttribute;
     if ($tagAttributeExists) {
         $attribute = $oObjectDataMap[$metaAttribute];
         $attributeResult = unserialize($attribute->toString());
         if ($attributeResult['name'] != '') {
             return array('result' => $attributeResult);
         } else {
             $tagAttributeExists = false;
         }
     } else {
         eZDebug::writeNotice("Tag attribute '" . $metaAttribute . "' doesn't exist in object " . $oObject->attribute('id') . ", mapping is using cascading fallback instead.", "MetatagFunctionCollection::fetchTagsByContentObject");
     }
     if ($tagAttributeExists === true && $tag->hasName() === true) {
         $name = $tag->getName();
     } elseif (!$metatagOnlyMapping) {
         // We check for a pattern defined
         if (isset($namePattern)) {
             $name = MetatagFunctionCollection::extractPattern($namePattern, $oObjectDataMap, $sizeLimit);
         } else {
             foreach ($nameAttributes as $nameAttribute) {
                 if (isset($oObjectDataMap[$nameAttribute]) && $oObjectDataMap[$nameAttribute]->hasContent()) {
                     $name = eZMetaTag::getTextValueOfAttribute($oObjectDataMap[$nameAttribute]);
                     break;
                 }
             }
         }
     }
     if ($tagAttributeExists === true && $tag->hasDescription() === true) {
         $description = $tag->getDescription();
     } elseif (!$metatagOnlyMapping) {
         if (isset($descriptionPattern)) {
             $description = MetatagFunctionCollection::extractPattern($descriptionPattern, $oObjectDataMap, $sizeLimit);
         } else {
             foreach ($descriptionAttributes as $descriptionAttribute) {
                 if (isset($oObjectDataMap[$descriptionAttribute]) && $oObjectDataMap[$descriptionAttribute]->hasContent()) {
                     $description = eZMetaTag::getTextValueOfAttribute($oObjectDataMap[$descriptionAttribute]);
                     break;
                 }
             }
         }
     }
     if ($tagAttributeExists === true && $tag->hasKeywords() === true) {
         $keywords = $tag->getKeywords();
     } elseif (!$metatagOnlyMapping) {
         if (isset($keywordsPattern)) {
             $keywords = MetatagFunctionCollection::extractPattern($keywordsPattern, $oObjectDataMap, $sizeLimit);
         } else {
             foreach ($keywordsAttributes as $keywordsAttribute) {
                 if (isset($oObjectDataMap[$keywordsAttribute]) && $oObjectDataMap[$keywordsAttribute]->hasContent()) {
                     $keywords = eZMetaTag::getTextValueOfAttribute($oObjectDataMap[$keywordsAttribute]);
//.........这里部分代码省略.........
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:101,代码来源:metatagfunctioncollection.php


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