<?php

/**
 * Atmail Delegates Root Collection
 *
 * This node is responsible for populating the '/calendar-delegation' url. 
 * 
 * @package Atmail
 * @subpackage Dav 
 * @copyright Copyright (C) 2011 Atmail. All rights reserved.
 * @author Evert Pot (http://www.rooftopsolutions.nl/) 
 */
class Atmail_Dav_FSExt_Root extends Atmail_Dav_FSExt_Directory {

	public $_basePath;
	
	public function getName()
	{
		return "webfiles";	
	}
	
	public function getQuotaInfo() {
		$this->updatePath();
		$quotaA = $this->getFolderSize($this->path);
		$quotaB = Atmail_Quota::getTotalQuota(array(Atmail_Quota::ACCOUNT => $this->_authPlugin->getCurrentUser(), Atmail_Quota::TYPE => Atmail_Quota::TYPE_DB))*1024*1024;
		if($quotaB == 0)
		{
			// unlimited
			return array(0,0);
		}
		return array(
            $quotaB-$quotaA,
            $quotaB
            );
	}
	
}

?>
