/**
*/
protected function _initPages()
{
global $injector;
$this->view->list = array();
if ($GLOBALS['browse_source_count']) {
foreach (Turba::getAddressBooks() as $key => $val) {
if (!empty($val['browse'])) {
try {
$driver = $injector->getInstance('Turba_Factory_Driver')->create($key);
} catch (Turba_Exception $e) {
continue;
}
try {
$contacts = $driver->search(array(), null, 'AND', array('__key', 'name'));
$contacts->reset();
} catch (Turba_Exception $e) {
continue;
}
$url = new Horde_Core_Smartmobile_Url();
$url->add('source', $key);
$url->setAnchor('entry');
$tmp = array();
while ($contact = $contacts->next()) {
$name = Turba::formatName($contact);
$tmp[] = array('group' => $contact->isGroup(), 'name' => strlen($name) ? $name : '[' . _("No Name") . ']', 'url' => strval($url->add('key', $contact->getValue('__key'))));
}
$this->view->list[$val['title']] = $tmp;
}
}
}
}