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


PHP eZContentClassAttribute::setAttribute方法代碼示例

本文整理匯總了PHP中eZContentClassAttribute::setAttribute方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZContentClassAttribute::setAttribute方法的具體用法?PHP eZContentClassAttribute::setAttribute怎麽用?PHP eZContentClassAttribute::setAttribute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在eZContentClassAttribute的用法示例。


在下文中一共展示了eZContentClassAttribute::setAttribute方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: fetchClassAttributeHTTPInput

 /**
  * Handles the input specific for one attribute from the class edit interface.
  *
  * @param eZHTTPTool $http
  * @param string $base Seems to be always 'ContentClassAttribute'.
  * @param eZContentClassAttribute $classAttribute
  * @return void
  */
 public function fetchClassAttributeHTTPInput($http, $base, $classAttribute)
 {
     // Comments default activation
     $activationFieldName = $base . self::COMMENTS_ENABLED_VARIABLE . $classAttribute->attribute('id');
     if ($http->hasPostVariable($activationFieldName)) {
         $classAttribute->setAttribute(self::CLASSATTRIBUTE_COMMENTS_ACTIVATED_DEFAULT_FIELD, 1);
     }
 }
開發者ID:tompsonx,項目名稱:ezdisqus,代碼行數:16,代碼來源:disquscommentstype.php

示例2: unserializeContentClassAttribute

 /**
  * Extracts values from the attribute parameters and sets it in the class attribute.
  *
  * @param eZContentClassAttribute $classAttribute
  * @param DOMElement $attributeNode
  * @param DOMElement $attributeParametersNode
  */
 public function unserializeContentClassAttribute($classAttribute, $attributeNode, $attributeParametersNode)
 {
     /** @var $domNodes DOMNodeList */
     $subTreeLimit = 0;
     $domNodes = $attributeParametersNode->getElementsByTagName('subtree-limit');
     if ($domNodes->length > 0) {
         $subTreeLimit = (int) $domNodes->item(0)->textContent;
     }
     $maxTags = 0;
     $domNodes = $attributeParametersNode->getElementsByTagName('max-tags');
     if ($domNodes->length > 0) {
         $maxTags = (int) $domNodes->item(0)->textContent;
     }
     $showDropDown = 0;
     $domNodes = $attributeParametersNode->getElementsByTagName('dropdown');
     if ($domNodes->length > 0 && $domNodes->item(0)->textContent === 'true') {
         $showDropDown = 1;
     }
     $hideRootTag = 0;
     $domNodes = $attributeParametersNode->getElementsByTagName('hide-root-tag');
     if ($domNodes->length > 0 && $domNodes->item(0)->textContent === 'true') {
         $hideRootTag = 1;
     }
     $classAttribute->setAttribute(self::SUBTREE_LIMIT_FIELD, $subTreeLimit);
     $classAttribute->setAttribute(self::MAX_TAGS_FIELD, $maxTags);
     $classAttribute->setAttribute(self::SHOW_DROPDOWN_FIELD, $showDropDown);
     $classAttribute->setAttribute(self::HIDE_ROOT_TAG_FIELD, $hideRootTag);
 }
開發者ID:oki34,項目名稱:eztags,代碼行數:35,代碼來源:eztagstype.php

示例3: fetchClassAttributeHTTPInput

 /**
  * Fetches all variables inputed on content class level
  * return true if fetching of class attributes are successfull, false if not
  *
  * @param eZHTTPTool $http
  * @param string $base
  * @param eZContentClassAttribute $classAttribute
  * @return bool
  */
 function fetchClassAttributeHTTPInput($http, $base, $classAttribute)
 {
     if ($http->hasPostVariable($base . '_ezpage_default_layout_' . $classAttribute->attribute('id'))) {
         $defaultLayout = $http->postVariable($base . '_ezpage_default_layout_' . $classAttribute->attribute('id'));
         $classAttribute->setAttribute('data_text1', $defaultLayout);
     }
     return true;
 }
開發者ID:BGCX067,項目名稱:ezpublish-thetechtalent-svn-to-git,代碼行數:17,代碼來源:ezpagetype.php

示例4: fetchClassAttributeHTTPInput

 /**
  * Fetches all variables inputed on content class level
  * return true if fetching of class attributes are successfull, false if not
  *
  * @param eZHTTPTool $http
  * @param string $base
  * @param eZContentClassAttribute $classAttribute
  * @return bool
  */
 function fetchClassAttributeHTTPInput( $http, $base, $classAttribute )
 {
     if ( $http->hasPostVariable( $base . '_ezpage_default_layout_' . $classAttribute->attribute( 'id' ) ) )
     {
         $defaultLayout = $http->postVariable( $base . '_ezpage_default_layout_' . $classAttribute->attribute( 'id' ) );
         $classAttribute->setAttribute( self::DEFAULT_ZONE_LAYOUT_FIELD, $defaultLayout );
     }
     return true;
 }
開發者ID:ezsystemstraining,項目名稱:ez54training,代碼行數:18,代碼來源:ezpagetype.php

示例5: storeClassAttribute

 /**
  * Stores the datatype data to the database which is related to the
  * class attribute. The $version parameter determines which version
  * is currently being stored, 0 is the real version while 1 is the
  * temporary version.
  *
  * @param eZContentClassAttribute $classAttribute
  * @param int $version
  */
 public function storeClassAttribute($classAttribute, $version)
 {
     $content = $classAttribute->content();
     // Make sure this can never slip into the database
     unset($content['db_options']);
     $xmlString = $this->classContentToXml($content);
     $classAttribute->setAttribute(self::CLASS_STORAGE_XML, $xmlString);
 }
開發者ID:netgen,項目名稱:enhancedselection2,代碼行數:17,代碼來源:sckenhancedselectiontype.php

示例6: preStoreClassAttribute

 /**
  * Just before store the content , we convert
  *
  * @param eZContentClassAttribute $classAttribute
  * @param mixed                   $version
  */
 function preStoreClassAttribute($classAttribute, $version)
 {
     $classAttribute->setAttribute('data_text5', json_encode($classAttribute->attribute('content')));
     $version;
     // Just for phpcs
 }
開發者ID:rihards,項目名稱:NovaeZSEOBundle,代碼行數:12,代碼來源:novaseometastype.php

示例7: setClassAttributeAttributes

 /**
  * Writes the class options in the class attribute's data fields.
  * 
  * @param eZContentClassAttribute $classAttribute Used as in/out parameter.
  *
  * @return void
  */
 public function setClassAttributeAttributes(eZContentClassAttribute $classAttribute)
 {
     $classAttribute->setAttribute(ymcDatatypeEnhancedSelectionType::FIELD_IS_NODE_PLACEMENT, (int) $this->isNodePlacement);
     $classAttribute->setAttribute(ymcDatatypeEnhancedSelectionType::FIELD_IS_MULTIPLE, (int) $this->isMultipleSelection);
     $classAttribute->setAttribute(ymcDatatypeEnhancedSelectionType::FIELD_DONT_ALLOW_REMOVAL, (int) $this->isRemovalForbidden);
     $classAttribute->setAttribute(ymcDatatypeEnhancedSelectionType::FIELD_DELIMITER, $this->delimiter);
     $classAttribute->setAttribute(ymcDatatypeEnhancedSelectionType::FIELD_OPTIONS, self::optionArrayToXml($this->options));
 }
開發者ID:kmajkowski,項目名稱:ymc-ezp-datatypes,代碼行數:15,代碼來源:class_content.php


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