* Return a DOM representation of the content object attribute
     *
     * @param eZPackage $package
     * @param eZContentObjectAttribute $objectAttribute
     * @return DOMElement
     */
    function serializeContentObjectAttribute($package, $objectAttribute)
    {
        $node = $this->createContentObjectAttributeDOMNode($objectAttribute);
        $dom = new DOMDocument('1.0', 'utf-8');
        $success = $dom->loadXML($objectAttribute->attribute('data_text'));
        $importedRoot = $node->ownerDocument->importNode($dom->documentElement, true);
        $node->appendChild($importedRoot);
        return $node;
    }
    /**
     * Unserailize contentobject attribute
     *
     * @param eZPackage $package
     * @param eZContentObjectAttribute $objectAttribute
     * @param DOMElement $attributeNode
     */
    function unserializeContentObjectAttribute($package, $objectAttribute, $attributeNode)
    {
        $rootNode = $attributeNode->childNodes->item(0);
        $xmlString = $rootNode ? $rootNode->ownerDocument->saveXML($rootNode) : '';
        $objectAttribute->setAttribute('data_text', $xmlString);
    }
}
eZDataType::register(eZPageType::DATA_TYPE_STRING, "ezpagetype");
            $content->setAttribute('alternative_text', substr($string, $delimiterPos + 1));
        }
        $content->store($objectAttribute);
        return true;
    }
    function supportsBatchInitializeObjectAttribute()
    {
        return true;
    }
    /**
     * Iterates over images referenced in data_text, and adds eZImageFile references
     * @param eZContentObjectAttribute $objectAttribute
     */
    function postStore($objectAttribute)
    {
        $objectAttributeId = $objectAttribute->attribute("id");
        if (($doc = simplexml_load_string($objectAttribute->attribute("data_text"))) === false) {
            return;
        }
        // Creates ezimagefile entries
        foreach ($doc->xpath("//*/@url") as $url) {
            $url = (string) $url;
            if ($url === "") {
                continue;
            }
            eZImageFile::appendFilepath($objectAttributeId, $url, true);
        }
    }
}
eZDataType::register(eZImageType::DATA_TYPE_STRING, "eZImageType");
            } else {
                if (strlen($maxValue) > 0) {
                    $minMaxState = self::HAS_MAX_VALUE;
                } else {
                    $minMaxState = self::NO_MIN_MAX_VALUE;
                }
            }
        }
        $classAttribute->setAttribute(self::DEFAULT_FIELD, $defaultValue);
        $classAttribute->setAttribute(self::MIN_FIELD, $minValue);
        $classAttribute->setAttribute(self::MAX_FIELD, $maxValue);
        $classAttribute->setAttribute(self::INPUT_STATE_FIELD, $minMaxState);
    }
    function supportsBatchInitializeObjectAttribute()
    {
        return true;
    }
    function batchInitializeObjectAttributeData($classAttribute)
    {
        $default = $classAttribute->attribute('data_float3');
        if ($default !== 0) {
            return array('data_float' => $default);
        }
        return array();
    }
    /// \privatesection
    /// The float value validator
    public $FloatValidator;
}
eZDataType::register(eZFloatType::DATA_TYPE_STRING, "eZFloatType");
示例#4
0
        return $contentObjectAttribute->attribute("data_int");
    }
    function hasObjectAttributeContent($contentObjectAttribute)
    {
        return true;
    }
    function serializeContentClassAttribute($classAttribute, $attributeNode, $attributeParametersNode)
    {
        $defaultValue = $classAttribute->attribute('data_int3');
        $dom = $attributeParametersNode->ownerDocument;
        $defaultValueNode = $dom->createElement('default-value');
        $defaultValueNode->setAttribute('is-set', $defaultValue ? 'true' : 'false');
        $attributeParametersNode->appendChild($defaultValueNode);
    }
    function unserializeContentClassAttribute($classAttribute, $attributeNode, $attributeParametersNode)
    {
        $defaultValue = strtolower($attributeParametersNode->getElementsByTagName('default-value')->item(0)->getAttribute('is-set')) == 'true';
        $classAttribute->setAttribute('data_int3', $defaultValue);
    }
    function supportsBatchInitializeObjectAttribute()
    {
        return true;
    }
    function batchInitializeObjectAttributeData($classAttribute)
    {
        $default = $classAttribute->attribute("data_int3");
        return array('data_int' => $default, 'sort_key_int' => $default);
    }
}
eZDataType::register(eZBooleanType::DATA_TYPE_STRING, "eZBooleanType");
    {
        return false;
    }
    function sortKey($contentObjectAttribute)
    {
        return strtolower($contentObjectAttribute->attribute('data_text'));
    }
    function sortKeyType()
    {
        return 'string';
    }
    function serializeContentClassAttribute($classAttribute, $attributeNode, $attributeParametersNode)
    {
        $type = $classAttribute->attribute(self::TYPE_FIELD);
        $dom = $attributeParametersNode->ownerDocument;
        $typeNode = $dom->createElement('type');
        $typeNode->appendChild($dom->createTextNode($type));
        $attributeParametersNode->appendChild($typeNode);
    }
    function unserializeContentClassAttribute($classAttribute, $attributeNode, $attributeParametersNode)
    {
        $type = $attributeParametersNode->getElementsByTagName('type')->item(0)->textContent;
        $classAttribute->setAttribute(self::TYPE_FIELD, $type);
    }
    function diff($old, $new, $options = false)
    {
        return null;
    }
}
eZDataType::register(eZPackageType::DATA_TYPE_STRING, 'eZPackageType');
示例#6
0
                if ( $imploded == '' )
                    $imploded = $countryName;
                else
                    $imploded .= ',' . $countryName;
            }
            $content['value'] = $imploded;
        }
        return $trans->transformByGroup( $content['value'], 'lowercase' );
    }

    function sortKeyType()
    {
        return 'string';
    }

    function diff( $old, $new, $options = false )
    {
        return null;
    }

    function supportsBatchInitializeObjectAttribute()
    {
        return true;
    }
}

eZDataType::register( eZCountryType::DATA_TYPE_STRING, 'ezcountrytype' );

?>
                $contentObjectAttribute->setAttribute('data_int', $category->attribute('id'));
                return true;
            }
        }
        return false;
    }
    /*!
       Returns the integer value.
      */
    function title($contentObjectAttribute, $name = null)
    {
        $categoryID = $contentObjectAttribute->attribute("data_int");
        $category = $categoryID > 0 ? eZProductCategory::fetch($categoryID) : false;
        return is_object($category) ? $category->attribute('name') : '';
    }
    function diff($old, $new, $options = null)
    {
        return null;
    }
    function supportsBatchInitializeObjectAttribute()
    {
        return true;
    }
    function batchInitializeObjectAttributeData($classAttribute)
    {
        $default = 0;
        return array('data_int' => $default, 'sort_key_int' => $default);
    }
}
eZDataType::register(eZProductCategoryType::DATA_TYPE_STRING, "eZProductCategoryType");
示例#8
0
    function metaData($contentObjectAttribute)
    {
        return $contentObjectAttribute->attribute("data_text");
    }
    /*!
       Returns the text.
      */
    function title($contentObjectAttribute, $name = null)
    {
    }
    /*!
       \reimp
      */
    function serializeContentClassAttribute($classAttribute, $attributeNode, $attributeParametersNode)
    {
        $value = $classAttribute->attribute(self::CONTENT_CLASS_VALUE);
        $dom = $attributeParametersNode->ownerDocument;
        $defaultValueNode = $dom->createElement('value', $value);
        $attributeParametersNode->appendChild($defaultValueNode);
    }
    /*!
       \reimp
      */
    function unserializeContentClassAttribute($classAttribute, $attrjeppibuteNode, $attributeParametersNode)
    {
        $value = $attributeParametersNode->getElementsByTagName('value')->item(0)->textContent;
        $classAttribute->setAttribute(self::CONTENT_CLASS_VALUE, $value);
    }
}
eZDataType::register(eZSurveyType::DATA_TYPE_STRING, "eZSurveyType");
        $identifierNode = $dom->createElement('identifier');
        $identifierNode->appendChild($dom->createTextNode($identifier));
        $attributeParametersNode->appendChild($identifierNode);
    }
    function unserializeContentClassAttribute($classAttribute, $attributeNode, $attributeParametersNode)
    {
        $digits = $attributeParametersNode->getElementsByTagName('digits')->item(0)->textContent;
        $preText = $attributeParametersNode->getElementsByTagName('pre-text')->item(0)->textContent;
        $postText = $attributeParametersNode->getElementsByTagName('post-text')->item(0)->textContent;
        $startValue = $attributeParametersNode->getElementsByTagName('start-value')->item(0)->textContent;
        $identifier = $attributeParametersNode->getElementsByTagName('identifier')->item(0)->textContent;
        if ($digits !== false) {
            $classAttribute->setAttribute(self::DIGITS_FIELD, $digits);
        }
        if ($preText !== false) {
            $classAttribute->setAttribute(self::PRETEXT_FIELD, $preText);
        }
        if ($postText !== false) {
            $classAttribute->setAttribute(self::POSTTEXT_FIELD, $postText);
        }
        if ($startValue !== false) {
            $classAttribute->setAttribute(self::START_VALUE_FIELD, $startValue);
        }
        if ($identifier !== false) {
            $classAttribute->setAttribute(self::IDENTIFIER_FIELD, $identifier);
        }
    }
    public $IntegerValidator;
}
eZDataType::register(eZIdentifierType::DATA_TYPE_STRING, "ezidentifiertype");
示例#10
0
        $classAttribute->setContent($matrixDefinition);
    }
    function serializeContentObjectAttribute($package, $objectAttribute)
    {
        $node = $this->createContentObjectAttributeDOMNode($objectAttribute);
        $dom = new DOMDocument('1.0', 'utf-8');
        $success = $dom->loadXML($objectAttribute->attribute('data_text'));
        $importedRoot = $node->ownerDocument->importNode($dom->documentElement, true);
        $node->appendChild($importedRoot);
        return $node;
    }
    function unserializeContentObjectAttribute($package, $objectAttribute, $attributeNode)
    {
        $rootNode = $attributeNode->getElementsByTagName('ezmatrix')->item(0);
        $xmlString = $rootNode ? $rootNode->ownerDocument->saveXML($rootNode) : '';
        $objectAttribute->setAttribute('data_text', $xmlString);
    }
    function supportsBatchInitializeObjectAttribute()
    {
        return true;
    }
    function batchInitializeObjectAttributeData($classAttribute)
    {
        $numRows = $classAttribute->attribute('data_int1');
        $matrix = new eZMatrix('', $numRows, $classAttribute->attribute('content'));
        $db = eZDB::instance();
        return array('data_text' => "'" . $db->escapeString($matrix->xmlString()) . "'");
    }
}
eZDataType::register(eZMatrixType::DATA_TYPE_STRING, 'ezmatrixtype');
示例#11
0
        $makeEmptyArray = $objectAttribute->attribute('data_int');
        $value = $objectAttribute->attribute('data_text');
        $dom = $node->ownerDocument;
        $makeEmptyArrayNode = $dom->createElement('make_empty_array');
        $makeEmptyArrayNode->appendChild($dom->createTextNode($makeEmptyArray));
        $node->appendChild($makeEmptyArrayNode);
        $valueNode = $dom->createElement('value');
        $valueNode->appendChild($dom->createTextNode($value));
        $node->appendChild($valueNode);
        return $node;
    }
    function unserializeContentObjectAttribute($package, $objectAttribute, $attributeNode)
    {
        $makeEmptyArray = $attributeNode->getElementsByTagName('make_empty_array')->item(0)->textContent;
        $value = $attributeNode->getElementsByTagName('value')->item(0)->textContent;
        if ($makeEmptyArray === false) {
            $makeEmptyArray = 0;
        }
        if ($value === false) {
            $value = '';
        }
        $objectAttribute->setAttribute('data_int', $makeEmptyArray);
        $objectAttribute->setAttribute('data_text', $value);
    }
    function diff($old, $new, $options = false)
    {
        return null;
    }
}
eZDataType::register(eZIniSettingType::DATA_TYPE_STRING, 'eZIniSettingType');
示例#12
0
            foreach ($res as $record) {
                $unusedUrlIDs[] = $record['id'];
            }
            $unusedUrlIDString = implode(', ', $unusedUrlIDs);
            $db->query("DELETE FROM ezurl WHERE id IN ({$unusedUrlIDString})");
        }
    }
    function diff($old, $new, $options = false)
    {
        $diff = new eZDiff();
        $diff->setDiffEngineType($diff->engineType('xml'));
        $diff->initDiffEngine();
        $diffObject = $diff->diff($old, $new);
        return $diffObject;
    }
    function supportsBatchInitializeObjectAttribute()
    {
        return true;
    }
    function batchInitializeObjectAttributeData($classAttribute)
    {
        $parser = new eZXMLInputParser();
        $doc = $parser->createRootNode();
        $xmlText = eZXMLTextType::domString($doc);
        $db = eZDB::instance();
        $xmlText = "'" . $db->escapeString($xmlText) . "'";
        return array('data_text' => $xmlText);
    }
}
eZDataType::register(eZXMLTextType::DATA_TYPE_STRING, "eZXMLTextType");
            }
        }
        return $name;
    }
    function isIndexable()
    {
        return true;
    }
    function serializeContentObjectAttribute($package, $objectAttribute)
    {
        $node = $this->createContentObjectAttributeDOMNode($objectAttribute);
        $dom = new DOMDocument('1.0', 'utf-8');
        $success = $dom->loadXML($objectAttribute->attribute('data_text'));
        $nodeDOM = $node->ownerDocument;
        $importedElement = $nodeDOM->importNode($dom->documentElement, true);
        $node->appendChild($importedElement);
        return $node;
    }
    function unserializeContentObjectAttribute($package, $objectAttribute, $attributeNode)
    {
        $rootNode = $attributeNode->getElementsByTagName('ezauthor')->item(0);
        $xmlString = $rootNode->ownerDocument->saveXML($rootNode);
        $objectAttribute->setAttribute('data_text', $xmlString);
    }
    function supportsBatchInitializeObjectAttribute()
    {
        return true;
    }
}
eZDataType::register(eZAuthorType::DATA_TYPE_STRING, "eZAuthorType");
    }
    /*!
       Returns the text.
      */
    function title($contentObjectAttribute, $name = null)
    {
        return $contentObjectAttribute->attribute("data_text");
    }
    function hasObjectAttributeContent($contentObjectAttribute)
    {
        return trim($contentObjectAttribute->attribute("data_text")) != '';
    }
    function isInformationCollector()
    {
        return true;
    }
    function sortKey($contentObjectAttribute)
    {
        return strtolower($contentObjectAttribute->attribute('data_text'));
    }
    function sortKeyType()
    {
        return 'string';
    }
    function supportsBatchInitializeObjectAttribute()
    {
        return true;
    }
}
eZDataType::register(eZEmailType::DATA_TYPE_STRING, "eZEmailType");
            $subscriptionDataArr['list_array'] = $http->postVariable('Subscription_ListArray');
        }
        foreach ($subscriptionDataArr['id_array'] as $listId) {
            if ($http->hasPostVariable("Subscription_OutputFormatArray_{$listId}")) {
                $subscriptionDataArr['list_output_format_array'][$listId] = $http->postVariable("Subscription_OutputFormatArray_{$listId}");
            } else {
                $defaultOutputFormatId = 0;
                $subscriptionDataArr['list_output_format_array'][$listId] = array($defaultOutputFormatId);
            }
        }
        if ($isNewObjectDraft === true) {
            $existingNewsletterUser = false;
        } elseif ($subscriptionDataArr['ez_user_id'] > 0) {
            $existingNewsletterUser = CjwNewsletterUser::fetchByEzUserId($subscriptionDataArr['ez_user_id']);
            if (is_object($existingNewsletterUser) === false) {
                if ($subscriptionDataArr['email'] != '') {
                    $existingNewsletterUser = CjwNewsletterUser::fetchByEmail($subscriptionDataArr['email']);
                }
            }
        } elseif ($subscriptionDataArr['email'] != '') {
            $existingNewsletterUser = CjwNewsletterUser::fetchByEmail($subscriptionDataArr['email']);
        } else {
            $existingNewsletterUser = false;
        }
        $returnArray = array('is_new_object_draft' => $isNewObjectDraft, 'subscription_data_array' => $subscriptionDataArr, 'existing_newsletter_user' => $existingNewsletterUser);
        // var_dump( $returnArray );
        return $returnArray;
    }
}
eZDataType::register(CjwNewsletterSubscriptionType::DATA_TYPE_STRING, 'CjwNewsletterSubscriptionType');
示例#16
0
            $userNode->setAttribute('password_hash', $user->attribute('password_hash'));
            $userNode->setAttribute('password_hash_type', eZUser::passwordHashTypeName($user->attribute('password_hash_type')));
            $userNode->setAttribute('is_enabled', (int) $user->isEnabled());
            $node->appendChild($userNode);
        }
        return $node;
    }
    /*!
       \param package
       \param contentobject attribute object
       \param ezdomnode object
      */
    function unserializeContentObjectAttribute($package, $objectAttribute, $attributeNode)
    {
        $userNode = $attributeNode->getElementsByTagName('account')->item(0);
        if (is_object($userNode)) {
            $userID = $objectAttribute->attribute('contentobject_id');
            $user = eZUser::fetch($userID);
            if (!is_object($user)) {
                $user = eZUser::create($userID);
            }
            $user->setAttribute('login', $userNode->getAttribute('login'));
            $user->setAttribute('email', $userNode->getAttribute('email'));
            $user->setAttribute('password_hash', $userNode->getAttribute('password_hash'));
            $user->setAttribute('password_hash_type', eZUser::passwordHashTypeID($userNode->getAttribute('password_hash_type')));
            $user->store();
        }
    }
}
eZDataType::register(eZUserType::DATA_TYPE_STRING, "eZUserType");
示例#17
0
    {
        return true;
    }
    function fromString($contentObjectAttribute, $string)
    {
        return $contentObjectAttribute->setAttribute('data_text', $string);
    }
    function title($contentObjectAttribute, $name = null)
    {
        $content = $contentObjectAttribute->content();
        // Exit if the input is empty
        if ($content == '') {
            return $content;
        } else {
            return $this->stripTags($contentObjectAttribute, $content);
        }
    }
    function metaData($contentObjectAttribute)
    {
        return $contentObjectAttribute->attribute('data_text');
    }
    /*!
    	 \return string representation of an contentobjectattribute data for simplified export
    	 */
    function toString($contentObjectAttribute)
    {
        return $contentObjectAttribute->attribute('data_text');
    }
}
eZDataType::register(BbanType::DATATYPE_STRING, "BbanType");
        switch( $defaultType )
        {
            case self::DEFAULT_CURRENT_DATE:
            {
                $default = time();
            } break;

            case self::DEFAULT_ADJUSTMENT:
            {
                $adjustments = $this->classAttributeContent( $classAttribute );
                $value = new eZDateTime();
                $secondAdjustment = $classAttribute->attribute( self::USE_SECONDS_FIELD ) == 1 ? $adjustments['second'] : 0;
                $value->adjustDateTime( $adjustments['hour'], $adjustments['minute'], $secondAdjustment, $adjustments['month'], $adjustments['day'], $adjustments['year'] );

                $default = $value->timeStamp();
            } break;

            default:
            {
                $default = 0;
            }
        }

        return array( 'data_int' => $default, 'sort_key_int' => $default );
    }
}

eZDataType::register( eZDateTimeType::DATA_TYPE_STRING, "eZDateTimeType" );

?>
     *
     * @param mixed $contentObjectAttribute Class eZContentObjectAttribute.
     *
     * @return string
     */
    public function sortKey($contentObjectAttribute)
    {
        return $contentObjectAttribute->attribute('data_text');
    }
    /**
     * Returns the type of the sortKey.
     *
     * @return string
     */
    public function sortKeyType()
    {
        return 'string';
    }
    public function serializeContentClassAttribute($classAttribute, $attributeNode, $attributeParametersNode)
    {
        $withSubDomainValue = $classAttribute->attribute(self::SUBDOMAIN_FIELD);
        $attributeParametersNode->appendChild(eZDOMDocument::createElementTextNode('with-subdomain-value', $withSubDomainValue));
    }
    public function unserializeContentClassAttribute($classAttribute, $attributeNode, $attributeParametersNode)
    {
        $withSubDomainValue = $attributeParametersNode->elementTextContentByName('with-subdomain-value');
        $classAttribute->setAttribute(self::SUBDOMAIN_FIELD, $withSubDomainValue);
    }
}
eZDataType::register(ymcDatatypeDomain::DATATYPE_STRING, "ymcDatatypeDomain");
示例#20
0
    function removeRelatedObjectItem($contentObjectAttribute, $objectID)
    {
        $xmlText = $contentObjectAttribute->attribute('data_text');
        if (trim($xmlText) == '') {
            return;
        }
        $doc = $this->parseXML($xmlText);
        $return = false;
        $root = $doc->documentElement;
        $relationList = $root->getElementsByTagName('relation-list')->item(0);
        if ($relationList) {
            $relationItems = $relationList->getElementsByTagName('relation-item');
            if (!empty($relationItems)) {
                foreach ($relationItems as $relationItem) {
                    if ($relationItem->getAttribute('contentobject-id') == $objectID) {
                        $relationList->removeChild($relationItem);
                        $return = true;
                    }
                }
            }
        }
        $this->storeObjectDOMDocument($doc, $contentObjectAttribute);
        return $return;
    }
    function supportsBatchInitializeObjectAttribute()
    {
        return true;
    }
}
eZDataType::register(eZObjectRelationListType::DATA_TYPE_STRING, "eZObjectRelationListType");
示例#21
0
        $localeString = $attributeNode->getElementsByTagName('locale-string')->item(0)->textContent;
        $validationResult = $this->validateObjectAttribute($objectAttribute, $idString, $keywordString, $parentString, $localeString);
        if ($validationResult == eZInputValidator::STATE_ACCEPTED) {
            $eZTags = eZTags::createFromStrings($objectAttribute, $idString, $keywordString, $parentString, $localeString);
            $objectAttribute->setContent($eZTags);
        }
    }
    /**
     * Returns if the content supports batch initialization
     *
     * @return bool
     */
    public function supportsBatchInitializeObjectAttribute()
    {
        return true;
    }
    /**
     * Sets grouped_input to true for edit view of the datatype
     *
     * @param eZContentObjectAttribute $objectAttribute
     * @param array|bool $mergeInfo
     *
     * @return array
     */
    public function objectDisplayInformation($objectAttribute, $mergeInfo = false)
    {
        return eZDataType::objectDisplayInformation($objectAttribute, array('edit' => array('grouped_input' => true)));
    }
}
eZDataType::register(eZTagsType::DATA_TYPE_STRING, 'eZTagsType');
示例#22
0
     * @param eZContentObjectAttribute
     * @see eZDataType::toString()
     * @return string
     */
    public function toString($objectAttribute)
    {
        return (string) $objectAttribute->attribute('data_int');
    }
    /**
     * Returns the sort type. Can be 'string', 'int' ('float' is not supported) or false if sorting is not supported
     *
     * @see eZDataType::sortKeyType()
     */
    public function sortKeyType()
    {
        return 'int';
    }
    /**
     * Returns the sort key, for sorting at the attribute level
     *
     * @param eZContentObjectAttribute $contentObjectAttribute
     * @return string
     * @see eZDataType::sortKey()
     */
    public function sortKey($contentObjectAttribute)
    {
        return $contentObjectAttribute->attribute('data_int');
    }
}
eZDataType::register(DisqusCommentsType::DATA_TYPE_STRING, 'DisqusCommentsType');
示例#23
0
    function serializeContentClassAttribute($classAttribute, $attributeNode, $attributeParametersNode)
    {
        $defaultValue = $classAttribute->attribute('data_text1');
        $dom = $attributeParametersNode->ownerDocument;
        $defaultValueNode = $dom->createElement('default-value');
        $defaultValueNode->appendChild($dom->createTextNode($defaultValue));
        $attributeParametersNode->appendChild($defaultValueNode);
    }
    function unserializeContentClassAttribute($classAttribute, $attributeNode, $attributeParametersNode)
    {
        $defaultValue = $attributeParametersNode->getElementsByTagName('default-value')->item(0)->textContent;
        $classAttribute->setAttribute('data_text1', $defaultValue);
    }
    function serializeContentObjectAttribute($package, $objectAttribute)
    {
        $node = $this->createContentObjectAttributeDOMNode($objectAttribute);
        $dom = new DOMDocument('1.0', 'utf-8');
        $success = $dom->loadXML($objectAttribute->attribute('data_text'));
        $importedRoot = $node->ownerDocument->importNode($dom->documentElement, true);
        $node->appendChild($importedRoot);
        return $node;
    }
    function unserializeContentObjectAttribute($package, $objectAttribute, $attributeNode)
    {
        $rootNode = $attributeNode->getElementsByTagName('ezmultioption')->item(0);
        $xmlString = $rootNode ? $rootNode->ownerDocument->saveXML($rootNode) : '';
        $objectAttribute->setAttribute('data_text', $xmlString);
    }
}
eZDataType::register(eZMultiOptionType::DATA_TYPE_STRING, "eZMultiOptionType");
示例#24
0
                break;
            case 'current-date':
                $classAttribute->setAttribute(self::BIRTHDAY_DEFAULT, self::BIRTHDAY_DEFAULT_CURRENT_DATE);
                break;
        }
    }
    /*!
       \return the collect information action if enabled
      */
    function contentActionList($classAttribute)
    {
        if ($classAttribute->attribute('is_information_collector') == true) {
            return array(array('name' => 'Send', 'action' => 'ActionCollectInformation'));
        } else {
            return array();
        }
    }
    function isIndexable()
    {
        return true;
    }
    /*!
       \reimp
      */
    function isInformationCollector()
    {
        return true;
    }
}
eZDataType::register(eZBirthdayType::DATA_TYPE_STRING, "ezbirthdaytype");
            $node->appendChild( $address );
        }

        return $node;
    }

    /**
     * @see eZDataType::unserializeContentObjectAttribute
     */
    function unserializeContentObjectAttribute( $package, $contentObjectAttribute, $attributeNode )
    {
        $contentObjectAttribute->setAttribute( 'data_int', $attributeNode->getAttribute( 'ezgl_has_content' ) );

    	if ( $attributeNode->getAttribute( 'ezgl_has_content' ) != 0 )
        {
            $location = new eZGmapLocation( array(
                            'contentobject_attribute_id' => $contentObjectAttribute->attribute('id'),
                            'contentobject_version' => $contentObjectAttribute->attribute('version'),
                            'latitude' => $attributeNode->getElementsByTagName( 'latitude' )->item( 0 )->textContent,
                            'longitude' => $attributeNode->getElementsByTagName( 'longitude' )->item( 0 )->textContent,
                            'address' => $attributeNode->getElementsByTagName( 'address' )->item( 0 )->textContent
                         ));
            $contentObjectAttribute->setContent( $location );
        }
    }
}

eZDataType::register( eZGmapLocationType::DATA_TYPE_STRING, 'eZGmapLocationType' );

?>
     * Returns the meta data used for storing search indeces.
     * @param eZContentObjectAttribute
     * @return string
     */
    public function metaData($contentObjectAttribute)
    {
        return $contentObjectAttribute->attribute('data_text');
    }
    /**
     * Initializes the object attribute from a string representation
     * @param eZContentObjectAttribute
     * @param string
     * @see eZDataType::fromString()
     */
    public function fromString($objectAttribute, $string)
    {
        $objectAttribute->setAttribute('data_text', $string);
    }
    /**
     * Returns the string representation of the object attribute
     * @param eZContentObjectAttribute
     * @see eZDataType::toString()
     * @return string
     */
    public function toString($objectAttribute)
    {
        return $objectAttribute->attribute('data_text');
    }
}
eZDataType::register(acColorPickerType::DATA_TYPE_STRING, 'acColorPickerType');
        $options = $domRoot->getElementsByTagName('options')->item(0);
        $dom = $attributeParametersNode->ownerDocument;
        $importedOptionsNode = $dom->importNode($options, true);
        $attributeParametersNode->appendChild($importedOptionsNode);
        $isMultiSelectNode = $dom->createElement('is-multiselect');
        $isMultiSelectNode->appendChild($dom->createTextNode($isMultipleSelection));
        $attributeParametersNode->appendChild($isMultiSelectNode);
    }
    function unserializeContentClassAttribute($classAttribute, $attributeNode, $attributeParametersNode)
    {
        $options = $attributeParametersNode->getElementsByTagName('options')->item(0);
        $doc = new DOMDocument('1.0', 'utf-8');
        $root = $doc->createElement('ezselection');
        $doc->appendChild($root);
        $importedOptions = $doc->importNode($options, true);
        $root->appendChild($importedOptions);
        $xml = $doc->saveXML();
        $classAttribute->setAttribute('data_text5', $xml);
        if ($attributeParametersNode->getElementsByTagName('is-multiselect')->item(0)->textContent == 0) {
            $classAttribute->setAttribute('data_int1', 0);
        } else {
            $classAttribute->setAttribute('data_int1', 1);
        }
    }
    function supportsBatchInitializeObjectAttribute()
    {
        return true;
    }
}
eZDataType::register(eZSelectionType::DATA_TYPE_STRING, "eZSelectionType");
示例#28
0
            $elementListNode->appendChild($elementNode);
        }
    }
    function unserializeContentClassAttribute($classAttribute, $attributeNode, $attributeParametersNode)
    {
        $isOption = strtolower($attributeParametersNode->getAttribute('is-option')) == 'true';
        $isMultiple = strtolower($attributeParametersNode->getAttribute('is-multiple')) == 'true';
        $classAttribute->setAttribute(self::IS_OPTION_FIELD, $isOption);
        $classAttribute->setAttribute(self::IS_MULTIPLE_FIELD, $isMultiple);
        $enum = new eZEnum($classAttribute->attribute('id'), $classAttribute->attribute('version'));
        $elementListNode = $attributeParametersNode->getElementsByTagName('elements')->item(0);
        if ($elementListNode) {
            $elementList = $elementListNode->getElementsByTagName('element');
            foreach ($elementList as $element) {
                $elementID = $element->getAttribute('id');
                $elementName = $element->getAttribute('name');
                $elementValue = $element->getAttribute('value');
                $value = eZEnumValue::create($classAttribute->attribute('id'), $classAttribute->attribute('version'), $elementName);
                $value->setAttribute('enumvalue', $elementValue);
                $value->store();
                $enum->addEnumerationValue($value);
            }
        }
    }
    function diff($old, $new, $options = false)
    {
        return null;
    }
}
eZDataType::register(eZEnumType::DATA_TYPE_STRING, 'eZEnumType');
示例#29
0
        $sql['from'] = "ezmultipricedata {$multipriceTableAlias}";
        $and = '';
        if (isset($params['contentobject_attr_id'])) {
            $sql['where'] = "\n                     {$multipriceTableAlias}.contentobject_attr_id = {$params['contentobject_attr_id']}";
            $and = ' AND';
        }
        if (isset($params['contentobject_attr_version'])) {
            $sql['where'] .= "\n                    {$and} {$multipriceTableAlias}.contentobject_attr_version = {$params['contentobject_attr_version']}";
            $and = ' AND';
        }
        if (!isset($params['currency_code'])) {
            $params['currency_code'] = eZShopFunctions::preferredCurrencyCode();
        }
        if ($params['currency_code'] !== false) {
            $sql['where'] .= "\n                    {$and} {$multipriceTableAlias}.currency_code = '{$params['currency_code']}'";
            $and = ' AND';
        }
        $sql['sorting_field'] = "{$multipriceTableAlias}.value";
        return $sql;
    }
    function diff($old, $new, $options = false)
    {
        return null;
    }
    function supportsBatchInitializeObjectAttribute()
    {
        return true;
    }
}
eZDataType::register(eZMultiPriceType::DATA_TYPE_STRING, "eZMultiPriceType");
            return true;
        }
        if (!is_numeric($string)) {
            return false;
        }
        $contentObjectAttribute->setAttribute('data_int', $string);
        return true;
    }
    function serializeContentObjectAttribute($package, $objectAttribute)
    {
        $node = $this->createContentObjectAttributeDOMNode($objectAttribute);
        $dom = $node->ownerDocument;
        $value = $objectAttribute->attribute('data_int');
        $valueNode = $dom->createElement('value');
        $valueNode->appendChild($dom->createTextNode($value));
        $node->appendChild($valueNode);
        return $node;
    }
    function unserializeContentObjectAttribute($package, $objectAttribute, $attributeNode)
    {
        $valueNode = $attributeNode->getElementsByTagName('value')->item(0);
        $value = $valueNode ? $valueNode->textContent : 0;
        $objectAttribute->setAttribute('data_int', $value);
    }
    function diff($old, $new, $options = false)
    {
        return null;
    }
}
eZDataType::register(eZSubtreeSubscriptionType::DATA_TYPE_STRING, "eZSubtreeSubscriptionType");