• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP eZDataType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: solrMetaDataExists

 private function solrMetaDataExists( $contentObjectID=0, $attributeIdentifier='', $subattr='' )
 {
     try
     {
         $contentObject = eZContentObject::fetch( $contentObjectID );
         $dataMap = $contentObject->dataMap();
         if ( array_key_exists( $attributeIdentifier, $dataMap ) )
         {
             $contentObjectAttribute = $dataMap[$attributeIdentifier];
             $eZType = eZDataType::create( solrMetaDataType::DATA_TYPE_STRING );
             $value = $eZType->getValue( $contentObjectAttribute->ID, $subattr );
             return ( ! empty( $value ) );
         }
         else
         {
             eZDebug::writeError( 'Object '.$contentObjectID.' has no attribute '.$attributeIdentifier, 'solrMetaDataExists Error' );
         }
         return false;
     }
     catch ( Exception $e )
     {
         eZDebug::writeError( $e, 'solrMetaDataExists Exception' );
         return false;
     }
 }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:25,代码来源:kdatatypes_operators.php


示例2: getData

    /**
     * @see ezfSolrDocumentFieldBase::getData()
     */
    public function getData()
    {
        $returnArray = parent::getData();

        $contentClassAttributeIdentifier = $this->ContentObjectAttribute->ContentClassAttributeIdentifier;

        $eZType = eZDataType::create( $this->ContentObjectAttribute->DataTypeString );
        $attributeContent = $eZType->getValues( $this->ContentObjectAttribute->ID );

        foreach( $attributeContent as $key => $value )
        {
            if ( $value > 0 )
            {
                $suffix = self::getPostFix( $contentClassAttributeIdentifier );
                $attribute =  'attr_'.$contentClassAttributeIdentifier.'_'.$key.$suffix;
                $returnArray[$attribute] = $value;
            }
        }
		
        return $returnArray;
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:24,代码来源:ezfsolrdocumentfieldsolrmetadata.php


示例3: unserializeContentClassAttribute

        $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");
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:30,代码来源:ezselectiontype.php


示例4: substr

            $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");
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:30,代码来源:ezimagetype.php


示例5: serializeContentClassAttribute

    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");
开发者ID:CG77,项目名称:ezpublish-legacy,代码行数:30,代码来源:ezmultioptiontype.php


示例6: objectDisplayInformation

 /**
  * 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)));
 }
开发者ID:oki34,项目名称:eztags,代码行数:12,代码来源:eztagstype.php


示例7: __construct

 /**
  * Constructor
  */
 public function __construct()
 {
     parent::eZDataType(self::DATA_TYPE_STRING, 'AC Color picker');
 }
开发者ID:informaticatrentina,项目名称:accolorpicker,代码行数:7,代码来源:accolorpickertype.php


示例8: contentActionList

                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");
开发者ID:netgen,项目名称:birthday,代码行数:30,代码来源:ezbirthdaytype.php


示例9: __construct

 public function __construct()
 {
     parent::eZDataType(self::DATA_TYPE_STRING, ezpi18n::tr('ezdisqus/datatype', 'Disqus comments'));
 }
开发者ID:tompsonx,项目名称:ezdisqus,代码行数:4,代码来源:disquscommentstype.php


示例10: customObjectAttributeHTTPAction

 function customObjectAttributeHTTPAction($http, $action, $contentObjectAttribute, $parameters)
 {
     $contentobjectID = false;
     if (eZDataType::fetchActionValue($action, 'new_class', $classID) or $action == 'new_class') {
         if ($action == 'new_class') {
             $base = $parameters['base_name'];
             $classVariableName = $base . '_new_class';
             if ($http->hasPostVariable($classVariableName)) {
                 $classVariable = $http->postVariable($classVariableName);
                 $classID = $classVariable[$contentObjectAttribute->attribute('id')];
                 $class = eZContentClass::fetch($classID);
             } else {
                 return false;
             }
         } else {
             $class = eZContentClass::fetch($classID);
         }
         if ($class) {
             $classAttribute = $contentObjectAttribute->attribute('contentclass_attribute');
             $class_content = $classAttribute->content();
             $content = $contentObjectAttribute->content();
             $priority = 0;
             for ($i = 0; $i < count($content['relation_list']); ++$i) {
                 if ($content['relation_list'][$i]['priority'] > $priority) {
                     $priority = $content['relation_list'][$i]['priority'];
                 }
             }
             $base = $parameters['base_name'];
             $nodePlacement = false;
             $nodePlacementName = $base . '_object_initial_node_placement';
             if ($http->hasPostVariable($nodePlacementName)) {
                 $nodePlacementMap = $http->postVariable($nodePlacementName);
                 if (isset($nodePlacementMap[$contentObjectAttribute->attribute('id')])) {
                     $nodePlacement = $nodePlacementMap[$contentObjectAttribute->attribute('id')];
                 }
             }
             $relationItem = $this->createInstance($class, $priority + 1, $contentObjectAttribute, $nodePlacement);
             if ($class_content['default_placement']) {
                 $relationItem['parent_node_id'] = $class_content['default_placement']['node_id'];
             }
             $content['relation_list'][] = $relationItem;
             $hasAttributeInput = false;
             $attributeInputVariable = $base . '_has_attribute_input';
             if ($http->hasPostVariable($attributeInputVariable)) {
                 $attributeInputMap = $http->postVariable($attributeInputVariable);
                 if (isset($attributeInputMap[$contentObjectAttribute->attribute('id')])) {
                     $hasAttributeInput = $attributeInputMap[$contentObjectAttribute->attribute('id')];
                 }
             }
             if ($hasAttributeInput) {
                 $object = $relationItem['object'];
                 $attributes = $object->contentObjectAttributes();
                 foreach ($attributes as $attribute) {
                     $attributeBase = $base . '_ezorl_init_class_' . $object->attribute('contentclass_id') . '_attr_' . $attribute->attribute('contentclassattribute_id');
                     $oldAttributeID = $attribute->attribute('id');
                     $attribute->setAttribute('id', false);
                     if ($attribute->fetchInput($http, $attributeBase)) {
                         $attribute->setAttribute('id', $oldAttributeID);
                         $attribute->store();
                     }
                 }
             }
             $contentObjectAttribute->setContent($content);
             $contentObjectAttribute->store();
         } else {
             eZDebug::writeError("Unknown class ID {$classID}, cannot instantiate object", __METHOD__);
         }
     } else {
         if (eZDataType::fetchActionValue($action, 'edit_objects', $contentobjectID) or $action == 'edit_objects' or $action == 'remove_objects') {
             $base = $parameters['base_name'];
             $selectionBase = $base . '_selection';
             $selections = array();
             $http = eZHTTPTool::instance();
             if ($http->hasPostVariable($selectionBase)) {
                 $selectionMap = $http->postVariable($selectionBase);
                 $selections = $selectionMap[$contentObjectAttribute->attribute('id')];
             }
             if ($contentobjectID !== false) {
                 $selections[] = $contentobjectID;
             }
             if ($action == 'edit_objects' or eZDataType::fetchActionValue($action, 'edit_objects', $contentobjectID)) {
                 $content = $contentObjectAttribute->content();
                 foreach ($content['relation_list'] as $key => $relationItem) {
                     if (!$relationItem['is_modified'] and in_array($relationItem['contentobject_id'], $selections)) {
                         $object = eZContentObject::fetch($relationItem['contentobject_id']);
                         if ($object->attribute('can_edit')) {
                             $content['relation_list'][$key]['is_modified'] = true;
                             $translationSourceBase = $base . '_translation_source_' . $contentObjectAttribute->attribute('id') . '_' . $relationItem['contentobject_id'];
                             $languageFrom = false;
                             if ($http->hasPostVariable($translationSourceBase) && $http->postVariable($translationSourceBase) !== '') {
                                 $languageFrom = $http->postVariable($translationSourceBase);
                             }
                             $version = $object->createNewVersionIn($contentObjectAttribute->attribute('language_code'), $languageFrom);
                             $content['relation_list'][$key]['contentobject_version'] = $version->attribute('version');
                         }
                     }
                 }
                 $contentObjectAttribute->setContent($content);
                 $contentObjectAttribute->store();
             } else {
//.........这里部分代码省略.........
开发者ID:nfrp,项目名称:ezpublish,代码行数:101,代码来源:ezobjectrelationlisttype.php


示例11: createSortingSQLStrings

 /**
  * Creates an array with sorting SQL strings to be appended to a query
  *
  * @param array|bool $sortList
  * @param string $treeTableName
  * @param bool $allowCustomColumns
  * @return array
  */
 static function createSortingSQLStrings($sortList, $treeTableName = 'ezcontentobject_tree', $allowCustomColumns = false)
 {
     $sortingInfo = array('sortCount' => 0, 'sortingFields' => " path_string ASC", 'attributeJoinCount' => 0, 'attributeFromSQL' => "", 'attributeTargetSQL' => "", 'attributeWhereSQL' => "");
     if ($sortList and is_array($sortList) and count($sortList) > 0) {
         if (count($sortList) > 1 and !is_array($sortList[0])) {
             $sortList = array($sortList);
         }
         $sortingFields = '';
         $sortCount = 0;
         $attributeJoinCount = 0;
         $stateJoinCount = 0;
         $attributeFromSQL = "";
         $attributeWhereSQL = "";
         $datatypeSortingTargetSQL = "";
         foreach ($sortList as $sortBy) {
             if (is_array($sortBy) and count($sortBy) > 0) {
                 if ($sortCount > 0) {
                     $sortingFields .= ', ';
                 }
                 $sortField = $sortBy[0];
                 switch ($sortField) {
                     case 'path':
                         $sortingFields .= 'path_string';
                         break;
                     case 'path_string':
                         $sortingFields .= 'path_identification_string';
                         break;
                     case 'published':
                         $sortingFields .= 'ezcontentobject.published';
                         break;
                     case 'modified':
                         $sortingFields .= 'ezcontentobject.modified';
                         break;
                     case 'modified_subnode':
                         $sortingFields .= 'modified_subnode';
                         break;
                     case 'section':
                         $sortingFields .= 'ezcontentobject.section_id';
                         break;
                     case 'node_id':
                         $sortingFields .= $treeTableName . '.node_id';
                         break;
                     case 'contentobject_id':
                         $sortingFields .= 'ezcontentobject.id';
                         break;
                     case 'depth':
                         $sortingFields .= 'depth';
                         break;
                     case 'class_identifier':
                         $sortingFields .= 'ezcontentclass.identifier';
                         break;
                     case 'class_name':
                         $classNameFilter = eZContentClassName::sqlFilter();
                         $sortingFields .= 'contentclass_name';
                         $datatypeSortingTargetSQL .= ", {$classNameFilter['nameField']} AS contentclass_name";
                         $attributeFromSQL .= " INNER JOIN {$classNameFilter['from']} ON ({$classNameFilter['where']})";
                         break;
                     case 'priority':
                         $sortingFields .= $treeTableName . '.priority';
                         break;
                     case 'name':
                         $sortingFields .= 'ezcontentobject_name.name';
                         break;
                     case 'attribute':
                         $classAttributeID = $sortBy[2];
                         if (!is_numeric($classAttributeID)) {
                             $classAttributeID = eZContentObjectTreeNode::classAttributeIDByIdentifier($classAttributeID);
                         }
                         $contentAttributeTableAlias = "a{$attributeJoinCount}";
                         $datatypeFromSQL = "ezcontentobject_attribute {$contentAttributeTableAlias}";
                         $datatypeWhereSQL = "\n                                   {$contentAttributeTableAlias}.contentobject_id = ezcontentobject.id AND\n                                   {$contentAttributeTableAlias}.contentclassattribute_id = {$classAttributeID} AND\n                                   {$contentAttributeTableAlias}.version = ezcontentobject.current_version AND";
                         $datatypeWhereSQL .= eZContentLanguage::sqlFilter($contentAttributeTableAlias, 'ezcontentobject');
                         $dataType = eZDataType::create(eZContentObjectTreeNode::dataTypeByClassAttributeID($classAttributeID));
                         if (is_object($dataType) && $dataType->customSorting()) {
                             $params = array();
                             $params['contentobject_attr_id'] = "{$contentAttributeTableAlias}.id";
                             $params['contentobject_attr_version'] = "{$contentAttributeTableAlias}.version";
                             $params['table_alias_suffix'] = "{$attributeJoinCount}";
                             $sql = $dataType->customSortingSQL($params);
                             $datatypeFromSQL .= " INNER JOIN {$sql['from']} ON ({$sql['where']})";
                             $datatypeSortingFieldSQL = $sql['sorting_field'];
                             $datatypeSortingTargetSQL .= ', ' . $sql['sorting_field'];
                         } else {
                             // Look up datatype for standard sorting
                             $sortKeyType = eZContentObjectTreeNode::sortKeyByClassAttributeID($classAttributeID);
                             switch ($sortKeyType) {
                                 case 'string':
                                     $sortKey = 'sort_key_string';
                                     break;
                                 case 'int':
                                 default:
                                     $sortKey = 'sort_key_int';
//.........这里部分代码省略.........
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:101,代码来源:ezcontentobjecttreenode.php


示例12: title

                $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");
开发者ID:runelangseid,项目名称:ezpublish,代码行数:30,代码来源:ezproductcategorytype.php


示例13: initializePackage


//.........这里部分代码省略.........
             if ($result) {
                 $schemaArray = array_merge($schemaArray, $dataArray);
                 $schemaArray['type'] = strtolower($db->databaseName());
                 $schemaArray['instance'] = $db;
                 $result = true;
                 $dbSchema = eZDbSchema::instance($schemaArray);
                 if (!$dbSchema) {
                     $resultArray['errors'][] = array('code' => 'EZSW-003', 'text' => "Failed loading " . $db->databaseName() . " schema handler");
                     $result = false;
                 }
                 if ($result) {
                     $result = true;
                     // This will insert the schema, then the data and
                     // run any sequence value correction SQL if required
                     $params = array('schema' => true, 'data' => true);
                     if ($db->databaseName() == 'mysql') {
                         $engines = $db->arrayQuery('SHOW ENGINES');
                         foreach ($engines as $engine) {
                             if ($engine['Engine'] == 'InnoDB' && in_array($engine['Support'], array('YES', 'DEFAULT'))) {
                                 $params['table_type'] = 'innodb';
                                 break;
                             }
                         }
                     }
                     if (!$dbSchema->insertSchema($params)) {
                         $resultArray['errors'][] = array('code' => 'EZSW-004', 'text' => "Failed inserting data to " . $db->databaseName() . "\n" . $db->errorMessage());
                         $result = false;
                     }
                 }
             }
         }
         if ($result) {
             // Inserting data from the dba-data files of the datatypes
             eZDataType::loadAndRegisterAllTypes();
             $registeredDataTypes = eZDataType::registeredDataTypes();
             foreach ($registeredDataTypes as $dataType) {
                 if (!$dataType->importDBDataFromDBAFile()) {
                     $resultArray['errors'][] = array('code' => 'EZSW-002', 'text' => "Failed importing datatype related data into database: \n" . 'datatype - ' . $dataType->DataTypeString . ", \n" . 'dba-data file - ' . $dataType->getDBAFilePath());
                 }
             }
         }
     }
     if (!$result) {
         return false;
     }
     // Database initialization done
     // Prepare languages
     $primaryLanguageLocaleCode = $primaryLanguage->localeCode();
     $primaryLanguageName = $primaryLanguage->languageName();
     $prioritizedLanguages = array_merge(array($primaryLanguageLocaleCode), $extraLanguageCodes);
     $installParameters = array('path' => '.');
     $installParameters['ini'] = array();
     $siteINIChanges = array();
     $url = $siteType['url'];
     if (preg_match("#^[a-zA-Z0-9]+://(.*)\$#", $url, $matches)) {
         $url = $matches[1];
     }
     $siteINIChanges['SiteAccessSettings'] = array('RelatedSiteAccessList' => $accessMap['accesses']);
     $siteINIChanges['ContentSettings'] = array('TranslationList' => implode(';', $extraLanguageCodes));
     $siteINIChanges['SiteSettings'] = array('SiteName' => $siteType['title'], 'SiteURL' => $url);
     $siteINIChanges['DatabaseSettings'] = array('DatabaseImplementation' => $dbDriver, 'Server' => $dbServer, 'Port' => $dbPort, 'Database' => $dbName, 'User' => $dbUser, 'Password' => $dbPwd, 'Charset' => false);
     $siteINIChanges['FileSettings'] = array('VarDir' => 'var/' . $siteType['identifier']);
     if (trim($dbSocket) != '') {
         $siteINIChanges['DatabaseSettings']['Socket'] = $dbSocket;
     } else {
         $siteINIChanges['DatabaseSettings']['Socket'] = 'disabled';
开发者ID:patrickallaert,项目名称:ezpublish-legacy-php7,代码行数:67,代码来源:ezstep_create_sites.php


示例14: objectDisplayInformation

 function objectDisplayInformation($objectAttribute, $mergeInfo = false)
 {
     $classAttribute = $objectAttribute->contentClassAttribute();
     $isOption = $classAttribute->attribute('data_int2');
     $editGrouped = $isOption == false;
     $info = array('edit' => array('grouped_input' => $editGrouped), 'collection' => array('grouped_input' => $editGrouped));
     return eZDataType::objectDisplayInformation($objectAttribute, $info);
 }
开发者ID:legende91,项目名称:ez,代码行数:8,代码来源:ezenumtype.php


示例15: hasObjectAttributeContent

        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");
开发者ID:runelangseid,项目名称:ezpublish,代码行数:30,代码来源:ezbooleantype.php


示例16: array

    function &generateOverrideSettingsArray( $siteAccessArray, $minimalTemplateSet )
    {
        $datatypeHash = array();
        $simpleMatchList = array();
        $regexpMatchList = array();
        foreach ( $siteAccessArray as $siteAccess )
        {
            $overrideINI = eZINI::instance( 'override.ini', 'settings', null, null, true );
            $overrideINI->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess' );
            $overrideINI->loadCache();

            $matchBlock = false;
            $blockMatchArray = array();

            foreach( array_keys( $this->NodeObjectArray ) as $nodeID )
            {
                // Extract some information that will be used
                unset( $contentNode, $contentObject, $contentClass );
                $contentNode = $this->NodeObjectArray[$nodeID];
                $contentObject = $contentNode->attribute( 'object' );
                $contentClass = $contentObject->attribute( 'content_class' );
                $attributeList = $contentClass->fetchAttributes( false, false, false );
                $datatypeList = array();
                foreach ( $attributeList as $attribute )
                {
                    $datatypeList[] = $attribute['data_type_string'];
                    if ( !isset( $datatypeHash[$attribute['data_type_string']] ) )
                    {
                        $datatype = eZDataType::create( $attribute['data_type_string'] );
                        $datatypeHash[$attribute['data_type_string']] = $datatype;
                        if ( !method_exists( $datatype, 'templateList' ) )
                            continue;
                        $templateList = $datatype->templateList();
                        if ( $templateList === false )
                            continue;
                        foreach ( $templateList as $templateMatch )
                        {
                            if ( is_string( $templateMatch ) )
                            {
                                $simpleMatchList[] = $templateMatch;
                            }
                            else if ( is_array( $templateMatch ) )
                            {
                                if ( $templateMatch[0] == 'regexp' )
                                {
                                    $regexpMatchList[] = $templateMatch[1];
                                }
                            }
                        }
                    }
                }
                $datatypeText = implode( '|', array_unique( $datatypeList ) );

                foreach( array_keys( $overrideINI->groups() ) as $blockName )
                {
                    if ( isset( $blockMatchArray[$blockName] ) )
                    {
                        continue;
                    }

                    $blockData = $overrideINI->group( $blockName );
                    $sourceName = $blockData['Source'];
                    $matchSettings = false;
                    if ( isset( $blockData['Match'] ) )
                        $matchSettings = $blockData['Match'];

                    $matchValue = array();
                    $validMatch = true;
                    $hasMatchType = false;
                    if ( $matchSettings )
                    {
                        foreach( array_keys( $matchSettings ) as $matchType )
                        {
                            switch( $matchType )
                            {
                                case 'object':
                                {
                                    $hasMatchType = true;
                                    if ( $contentNode->attribute( 'contentobject_id' ) != $matchSettings[$matchType] )
                                    {
                                        $validMatch = false;
                                    }
                                    else
                                    {
                                        $matchValue[$this->OverrideObjectRemoteID] = $contentObject->attribute( 'remote_id' );
                                    }
                                } break;

                                case 'node':
                                {
                                    $hasMatchType = true;
                                    if ( $nodeID != $matchSettings[$matchType] )
                                    {
                                        $validMatch = false;
                                    }
                                    else
                                    {
                                        $matchValue[$this->OverrideNodeRemoteID] = $contentNode->attribute( 'remote_id' );
                                    }
                                } break;
//.........这里部分代码省略.........
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:101,代码来源:ezcontentobjectpackagehandler.php


示例17: foreach

            $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');
开发者ID:heliopsis,项目名称:cjw_newsletter,代码行数:30,代码来源:cjwnewslettersubscriptiontype.php


示例18: isUserObject

 static function isUserObject($contentObject)
 {
     if (!$contentObject) {
         return false;
     }
     eZDataType::loadAndRegisterType('ezuser');
     $contentClass = $contentObject->attribute('content_class');
     $classAttributeList = $contentClass->fetchAttributes();
     foreach ($classAttributeList as $classAttribute) {
         if ($classAttribute->attribute('data_type_string') == eZUserType::DATA_TYPE_STRING) {
             return true;
         }
     }
     return false;
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:15,代码来源:ezuser.php


示例19: fromString

    {
        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");
开发者ID:npanau,项目名称:rgIsoCodes,代码行数:30,代码来源:bbantype.php


示例20: array

    return $Module->handleError(eZError::KERNEL_NOT_AVAILABLE, 'kernel');
}
if (!$LanguageCode) {
    $LanguageCode = $class->attribute('top_priority_language_locale');
}
if ($http->hasPostVariable('AddGroupButton') && $http->hasPostVariable('ContentClass_group')) {
    eZClassFunctions::addGroup($ClassID, $ClassVersion, $http->postVariable('ContentClass_group'));
}
if ($http->hasPostVariable('RemoveGroupButton') && $http->hasPostVariable('group_id_checked')) {
    if (!eZClassFunctions::removeGroup($ClassID, $ClassVersion, $http->postVariable('group_id_checked'))) {
        $validation['groups'][] = array('text' => ezpI18n::tr('kernel/class', 'You have to have at least one group that the class belongs to!'));
        $validation['processed'] = true;
    }
}
$attributes = $class->fetchAttributes();
$datatypes = eZDataType::registeredDataTypes();
$mainGroupID = false;
$mainGroupName = false;
$groupList = $class->fetchGroupList();
if (count($groupList) > 0) {
    $mainGroupID = $groupList[0]->attribute('group_id');
    $mainGroupName = $groupList[0]->attribute('group_name');
}
$Module->setTitle("Edit class " . $class->attribute("name"));
$tpl = eZTemplate::factory();
$res = eZTemplateDesignResource::instance();
$res->setKeys(array(array('class', $class->attribute("id")), array('class_identifier', $class->attribute('identifier'))));
$tpl->setVariable('module', $Module);
$tpl->setVariable('language_code', $LanguageCode);
$tpl->setVariable('class', $class);
$tpl->setVariable('attributes', $attributes);
开发者ID:runelangseid,项目名称:ezpublish,代码行数:31,代码来源:view.php



注:本文中的eZDataType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP eZDateTime类代码示例发布时间:2022-05-23
下一篇:
PHP eZDB类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap