Tuesday 29 March 2005 3:04:38 am
Ok, have a look at the new param in webdav.ini (diff output) :
+# List of classes that should be seen as a folder.
+# by default, if a class contains an image attribute it is seen as an image
+# if a container class doesn't contains an image attribute it is also seen as an image
+FolderClasses[]=folder
+FolderClasses[]=article
+#FolderClasses[]=your_custom_class
and modify kernel/classes/webdav/ezwebdavcontentserver.php
/*!
+ Check if the object has to be seen as a folder
+ */
+ function objectAsFolder ( &$object, &$class )
+ {
+ $webdavINI =& eZINI::instance( WEBDAV_INI_FILE );
+ $classIdentifier = $class->attribute( 'identifier' );
+ if ( $webdavINI->hasGroup( 'GeneralSettings' ) && $webdavINI->hasVariable( 'GeneralSettings', 'FolderClasses' ) )
+ {
+ $folderClasses = $webdavINI->variable( 'GeneralSettings', 'FolderClasses' );
+ foreach ( $folderClasses as $folderClass)
+ {
+ if ($folderClass == $classIdentifier)
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /*!
Gathers information about a given node (specified as parameter).
*/
function fetchNodeInfo( &$node )
@@ -1429,7 +1451,9 @@
include_once( 'kernel/classes/ezcontentupload.php' );
$upload = new eZContentUpload();
$info = $upload->objectFileInfo( $object );
- if ( $info )
+ $class =& $object->contentClass();
+
+ if (!$this->objectAsFolder ( $object,$class ) && $info )
{
$filePath = $info['filepath'];
$entry["mimetype"] = false;
@@ -1470,7 +1494,6 @@
{
// Here we only show items as folders if they have
// is_container set to true, otherwise it's an unknown binary file
- $class =& $object->contentClass();
if ( !$class->attribute( 'is_container' ) )
{
$entry['mimetype'] = 'application/octet-stream';
http://www.sydesy.com
|