Xavier Dutoit
|
Thursday 16 August 2007 8:00:53 am
Some of your code is quite.... ;)
$node = $obj;
That's what I generate for one single node
{"ID":"1054","Name":"a second point we offer is to \r\ngo to the line again","CurrentLanguage":"eng-GB","ClassName":false,"ClassIdentifier":false,"DataMap":{"1":{"eng-GB":{"text":{"HTTPValue":null,"Content":null,"DisplayInfo":null,"IsValid":null,"ContentClassAttributeID":"235","ValidationError":null,"ValidationLog":null,"ContentClassAttributeIdentifier":"text","ContentClassAttributeCanTranslate":null,"ContentClassAttributeName":null,"ContentClassAttributeIsInformationCollector":null,"ContentClassAttributeIsRequired":null,"PersistentDataDirty":false,"InputParameters":false,"HasValidationError":false,"DataTypeCustom":null,"ID":"5684","ContentObjectID":"1054","Version":"1","LanguageCode":"eng-GB","AttributeOriginalID":"0","SortKeyInt":"0","SortKeyString":"","DataTypeString":"eztext","DataText":"a second point we offer is to \r\ngo to the line again","DataInt":null,"DataFloat":"0"},"alert":{"HTTPValue":null,"Content":null,"DisplayInfo":null,"IsValid":null,"ContentClassAttributeID":"236","ValidationError":null,"ValidationLog":null,"ContentClassAttributeIdentifier":"alert","ContentClassAttributeCanTranslate":null,"ContentClassAttributeName":null,"ContentClassAttributeIsInformationCollector":null,"ContentClassAttributeIsRequired":null,"PersistentDataDirty":false,"InputParameters":false,"HasValidationError":false,"DataTypeCustom":null,"ID":"5685","ContentObjectID":"1054","Version":"1","LanguageCode":"eng-GB","AttributeOriginalID":"0","SortKeyInt":"0","SortKeyString":"","DataTypeString":"ezboolean","DataText":"","DataInt":"0","DataFloat":"0"},"ref":{"HTTPValue":null,"Content":null,"DisplayInfo":null,"IsValid":null,"ContentClassAttributeID":"237","ValidationError":null,"ValidationLog":null,"ContentClassAttributeIdentifier":"ref","ContentClassAttributeCanTranslate":null,"ContentClassAttributeName":null,"ContentClassAttributeIsInformationCollector":null,"ContentClassAttributeIsRequired":null,"PersistentDataDirty":false,"InputParameters":false,"HasValidationError":false,"DataTypeCustom":null,"ID":"5687","ContentObjectID":"1054","Version":"1","LanguageCode":"eng-GB","AttributeOriginalID":"0","SortKeyInt":"0","SortKeyString":"","DataTypeString":"ezstring","DataText":"","DataInt":null,"DataFloat":"0"}}}},"ContentActionList":false,"ContentObjectAttributes":{"1":{"eng-GB":[{"HTTPValue":null,"Content":null,"DisplayInfo":null,"IsValid":null,"ContentClassAttributeID":"235","ValidationError":null,"ValidationLog":null,"ContentClassAttributeIdentifier":"text","ContentClassAttributeCanTranslate":null,"ContentClassAttributeName":null,"ContentClassAttributeIsInformationCollector":null,"ContentClassAttributeIsRequired":null,"PersistentDataDirty":false,"InputParameters":false,"HasValidationError":false,"DataTypeCustom":null,"ID":"5684","ContentObjectID":"1054","Version":"1","LanguageCode":"eng-GB","AttributeOriginalID":"0","SortKeyInt":"0","SortKeyString":"","DataTypeString":"eztext","DataText":"a second point we offer is to \r\ngo to the line again","DataInt":null,"DataFloat":"0"},{"HTTPValue":null,"Content":null,"DisplayInfo":null,"IsValid":null,"ContentClassAttributeID":"236","ValidationError":null,"ValidationLog":null,"ContentClassAttributeIdentifier":"alert","ContentClassAttributeCanTranslate":null,"ContentClassAttributeName":null,"ContentClassAttributeIsInformationCollector":null,"ContentClassAttributeIsRequired":null,"PersistentDataDirty":false,"InputParameters":false,"HasValidationError":false,"DataTypeCustom":null,"ID":"5685","ContentObjectID":"1054","Version":"1","LanguageCode":"eng-GB","AttributeOriginalID":"0","SortKeyInt":"0","SortKeyString":"","DataTypeString":"ezboolean","DataText":"","DataInt":"0","DataFloat":"0"},{"HTTPValue":null,"Content":null,"DisplayInfo":null,"IsValid":null,"ContentClassAttributeID":"237","ValidationError":null,"ValidationLog":null,"ContentClassAttributeIdentifier":"ref","ContentClassAttributeCanTranslate":null,"ContentClassAttributeName":null,"ContentClassAttributeIsInformationCollector":null,"ContentClassAttributeIsRequired":null,"PersistentDataDirty":false,"InputParameters":false,"HasValidationError":false,"DataTypeCustom":null,"ID":"5687","ContentObjectID":"1054","Version":"1","LanguageCode":"eng-GB","AttributeOriginalID":"0","SortKeyInt":"0","SortKeyString":"","DataTypeString":"ezstring","DataText":"","DataInt":null,"DataFloat":"0"}]}},"MainNodeID":false,"PersistentDataDirty":false,"SectionID":"1","OwnerID":"14","ClassID":"26","IsPublished":"0","Published":"1186757618","Modified":"1186757618","CurrentVersion":"1","Status":"1","RemoteID":"e6c62a157cd6c52e37916147b5fa647e","ContentObjectAttributeArray":{"1":{"eng-GB":[{"HTTPValue":null,"Content":null,"DisplayInfo":null,"IsValid":null,"ContentClassAttributeID":"235","ValidationError":null,"ValidationLog":null,"ContentClassAttributeIdentifier":"text","ContentClassAttributeCanTranslate":null,"ContentClassAttributeName":null,"ContentClassAttributeIsInformationCollector":null,"ContentClassAttributeIsRequired":null,"PersistentDataDirty":false,"InputParameters":false,"HasValidationError":false,"DataTypeCustom":null,"ID":"5684","ContentObjectID":"1054","Version":"1","LanguageCode":"eng-GB","AttributeOriginalID":"0","SortKeyInt":"0","SortKeyString":"","DataTypeString":"eztext","DataText":"a second point we offer is to \r\ngo to the line again","DataInt":null,"DataFloat":"0"},{"HTTPValue":null,"Content":null,"DisplayInfo":null,"IsValid":null,"ContentClassAttributeID":"236","ValidationError":null,"ValidationLog":null,"ContentClassAttributeIdentifier":"alert","ContentClassAttributeCanTranslate":null,"ContentClassAttributeName":null,"ContentClassAttributeIsInformationCollector":null,"ContentClassAttributeIsRequired":null,"PersistentDataDirty":false,"InputParameters":false,"HasValidationError":false,"DataTypeCustom":null,"ID":"5685","ContentObjectID":"1054","Version":"1","LanguageCode":"eng-GB","AttributeOriginalID":"0","SortKeyInt":"0","SortKeyString":"","DataTypeString":"ezboolean","DataText":"","DataInt":"0","DataFloat":"0"},{"HTTPValue":null,"Content":null,"DisplayInfo":null,"IsValid":null,"ContentClassAttributeID":"237","ValidationError":null,"ValidationLog":null,"ContentClassAttributeIdentifier":"ref","ContentClassAttributeCanTranslate":null,"ContentClassAttributeName":null,"ContentClassAttributeIsInformationCollector":null,"ContentClassAttributeIsRequired":null,"PersistentDataDirty":false,"InputParameters":false,"HasValidationError":false,"DataTypeCustom":null,"ID":"5687","ContentObjectID":"1054","Version":"1","LanguageCode":"eng-GB","AttributeOriginalID":"0","SortKeyInt":"0","SortKeyString":"","DataTypeString":"ezstring","DataText":"","DataInt":null,"DataFloat":"0"}]}}}
(basically, hardcode mapping between the ez object and json. Are you aware of an easy php trick to clean a wee bit ? (eg. get rid of all the HTTPValue,DisplayInfo... ?) Last, but not the least, an easy method to populate the Content ?
Any suggestion more than welcome. X+
http://www.sydesy.com
|