public function getFolderList()
{
$this->_logger->debug('Horde::getFolderList()');
+ /* Make sure we have the APIs needed for each folder class */
+ $supported = $this->_connector->horde_listApis();
$folders = array();
- $folders[] = $this->StatFolder(self::APPOINTMENTS_FOLDER);
- $folders[] = $this->StatFolder(self::CONTACTS_FOLDER);
- $folders[] = $this->StatFolder(self::TASKS_FOLDER);
+
+ if (array_search('calendar', $supported)){
+ $folders[] = $this->StatFolder(self::APPOINTMENTS_FOLDER);
+ }
+
+ if (array_search('contacts', $supported)){
+ $folders[] = $this->StatFolder(self::CONTACTS_FOLDER);
+ }
+
+ if (array_search('tasks', $supported)){
+ $folders[] = $this->StatFolder(self::TASKS_FOLDER);
+ }
return $folders;
}
return $result;
}
+ public function tasks_listTasks()
+ {
+ return $this->_registry->tasks->listTasks();
+ }
+
+ public function horde_listApis()
+ {
+ return $this->_registry->horde->listAPIs();
+ }
+
+ public function horde_getPref($app, $pref)
+ {
+ return $this->_registry->horde->getPref($app, $pref);
+ }
+
}
\ No newline at end of file
{
$registry = $this->getMockSkipConstructor('Horde_Registry');
$state = $this->getMockSkipConstructor('Horde_ActiveSync_State_File');
- $connector = new Horde_ActiveSync_MockConnector(array('fixture' => array()));
+ $connector = new Horde_ActiveSync_MockConnector(array('fixture' => array('horde_listApis' => array('horde', 'contacts', 'calendar', 'tasks'))));
$driver = new Horde_ActiveSync_Driver_Horde(array('connector' => $connector,
'state_basic' => $state));
$results = $driver->getFolderList();