Tuesday 04 September 2007 4:24:33 am
I woold like to create a new datatype whit 4 attribute
.text_field
.text_block
.image .checkbox I all ready read this tutoriel http://ez.no/ezpublish/documentation/development/extensions/datatypes/new_datatype and this what i did : <?php
// Include the super class file
include_once( "kernel/classes/ezdatatype.php" );
// Include the file which will be used to validate email
/*include_once( "lib/ezutils/classes/ezmail.php" );*/
/* text */ define( "EZ_DATATYPESTRING_TEXT", "ezad_text" );
class eZAdType extends eZDataType {
/*!
Construction of the class, note that the second parameter in eZDataType is the actual name showed in the datatype dropdown list.
*/ function eZAdType()
{
$this->eZDataType( EZ_DATATYPESTRING_EZAD, "ezad" );
}
function validateObjectAttributeHTTPInput( &$http, $base,
&$contentObjectAttribute )
{
}
function fetchObjectAttributeHTTPInput( &$http, $base, &$contentObjectAttribute )
{
if ( $http->hasPostVariable( $base . "_data_text_" .
$contentObjectAttribute->attribute( "id" ) ) )
{
$data =& $http->postVariable( $base . "_data_text_" .
$contentObjectAttribute->attribute( "id" )
);
$contentObjectAttribute->setAttribute( "data_text", $data );
}
return false; } /*!
Store the content. Since the content has been stored in function
fetchObjectAttributeHTTPInput(), this function is with empty code. */
function storeObjectAttribute( &$contentObjectattribute )
{
}
/*!
Returns the content.
*/
function &objectAttributeContent( &$contentObjectAttribute )
{
return $contentObjectAttribute->attribute( "data_text" );
}
/*!
Returns the meta data used for storing search indices. */
function metaData( $contentObjectAttribute )
{
return $contentObjectAttribute->attribute( "data_text" ); }
/*! Returns the text.
*/ function title( &$contentObjectAttribute )
{
return $contentObjectAttribute->attribute( "data_text" ); }
}
eZDataType::register( EZ_DATATYPESTRING_AD, "ezadtype" ); ?> can u tell me what i have to do next ?
|