From: Michael M Slusarz Date: Sat, 25 Jul 2009 04:48:45 +0000 (-0600) Subject: getInstance() -> factory() X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=ae800629866d9e11ba3fd6447ccd098047e50f9b;p=horde.git getInstance() -> factory() --- diff --git a/imp/compose.php b/imp/compose.php index 6bb8fbd17..15ea8e67a 100644 --- a/imp/compose.php +++ b/imp/compose.php @@ -616,7 +616,7 @@ if ($has_js) { $imp_ui->attachAutoCompleter($auto_complete); if (!empty($conf['spell']['driver'])) { try { - Horde_SpellChecker::getInstance($conf['spell']['driver'], array()); + Horde_SpellChecker::factory($conf['spell']['driver'], array()); $spellcheck = true; $imp_ui->attachSpellChecker('imp', true); } catch (Exception $e) { diff --git a/imp/lib/Fetchmail/imap.php b/imp/lib/Fetchmail/imap.php index 424415832..70abefdd9 100644 --- a/imp/lib/Fetchmail/imap.php +++ b/imp/lib/Fetchmail/imap.php @@ -124,7 +124,7 @@ class IMP_Fetchmail_imap extends IMP_Fetchmail ); try { - $this->_ob = Horde_Imap_Client::getInstance(($protocols[$this->_params['protocol']]['string'] == 'imap') ? 'Socket' : 'Socket_Pop3', $imap_config); + $this->_ob = Horde_Imap_Client::factory(($protocols[$this->_params['protocol']]['string'] == 'imap') ? 'Socket' : 'Socket_Pop3', $imap_config); } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Exception(_("Cannot connect to the remote mail server: ") . $e->getMessage()); } diff --git a/imp/lib/Imap.php b/imp/lib/Imap.php index 0d0b982ca..f04c251b7 100644 --- a/imp/lib/Imap.php +++ b/imp/lib/Imap.php @@ -196,7 +196,7 @@ class IMP_Imap } try { - $ob = Horde_Imap_Client::getInstance(($protocol == 'imap') ? 'Socket' : 'Socket_Pop3', $imap_config); + $ob = Horde_Imap_Client::factory(($protocol == 'imap') ? 'Socket' : 'Socket_Pop3', $imap_config); } catch (Horde_Imap_Client_Exception $e) { return false; } diff --git a/imp/lib/Quota.php b/imp/lib/Quota.php index 20f43e5cd..f5aeb5bdb 100644 --- a/imp/lib/Quota.php +++ b/imp/lib/Quota.php @@ -49,7 +49,7 @@ class IMP_Quota $sig = hash('md5', serialize(array($driver, $params))); if (!isset(self::$_instances[$sig])) { - self::$_instances[$sig] = self::getInstance($driver, $params); + self::$_instances[$sig] = self::factory($driver, $params); } return self::$_instances[$sig]; @@ -65,7 +65,7 @@ class IMP_Quota * @return IMP_Quota The concrete instance. * @throws Horde_Exception */ - static public function getInstance($driver, $params = array()) + static public function factory($driver, $params = array()) { $driver = basename($driver); $class = 'IMP_Quota_' . ucfirst($driver); diff --git a/imp/lib/UI/Compose.php b/imp/lib/UI/Compose.php index f7810a8d1..e5bdf3aab 100644 --- a/imp/lib/UI/Compose.php +++ b/imp/lib/UI/Compose.php @@ -97,7 +97,7 @@ class IMP_UI_Compose { /* Attach autocompleters to the compose form elements. */ foreach ($fields as $val) { - $imple = Horde_Ajax_Imple::getInstance(array('imp', 'ContactAutoCompleter'), array('triggerId' => $val)); + $imple = Horde_Ajax_Imple::factory(array('imp', 'ContactAutoCompleter'), array('triggerId' => $val)); $imple->attach(); } } @@ -122,7 +122,7 @@ class IMP_UI_Compose ) ); - $imple = Horde_Ajax_Imple::getInstance('SpellChecker', $args); + $imple = Horde_Ajax_Imple::factory('SpellChecker', $args); $imple->attach(); } diff --git a/imp/test.php b/imp/test.php index eee06f564..4b04f1c66 100644 --- a/imp/test.php +++ b/imp/test.php @@ -26,7 +26,7 @@ function _doConnectionTest() $driver = ($_POST['server_type'] == 'imap') ? 'Socket' : 'Socket_Pop3'; try { - $imap_client = Horde_Imap_Client::getInstance($driver, $imap_config); + $imap_client = Horde_Imap_Client::factory($driver, $imap_config); } catch (Horde_Imap_Client_Exception $e) { return _errorMsg($e); } diff --git a/kronolith/attendees.php b/kronolith/attendees.php index 67ca17f0d..b4cc64af1 100644 --- a/kronolith/attendees.php +++ b/kronolith/attendees.php @@ -248,7 +248,7 @@ $date = new Horde_Date($date); $vfb_html = $attendee_view->render($date); // Add the ContactAutoCompleter -$cac = Horde_Ajax_Imple::getInstance(array('kronolith', 'ContactAutoCompleter'), array('triggerId' => 'newAttendees')); +$cac = Horde_Ajax_Imple::factory(array('kronolith', 'ContactAutoCompleter'), array('triggerId' => 'newAttendees')); $cac->attach(); $title = _("Edit attendees"); diff --git a/kronolith/calendars/edit.php b/kronolith/calendars/edit.php index 191b45562..1cad577b9 100644 --- a/kronolith/calendars/edit.php +++ b/kronolith/calendars/edit.php @@ -58,5 +58,5 @@ require KRONOLITH_TEMPLATES . '/common-header.inc'; require KRONOLITH_TEMPLATES . '/menu.inc'; echo $form->renderActive($form->getRenderer(), $vars, 'edit.php', 'post'); require $registry->get('templates', 'horde') . '/common-footer.inc'; -$ac = Horde_Ajax_Imple::getInstance(array('kronolith', 'TagAutoCompleter'), array('triggerId' => 'tags', 'id')); +$ac = Horde_Ajax_Imple::factory(array('kronolith', 'TagAutoCompleter'), array('triggerId' => 'tags', 'id')); $ac->attach(); diff --git a/kronolith/index.php b/kronolith/index.php index e5d4e21b5..2ca8c5f78 100644 --- a/kronolith/index.php +++ b/kronolith/index.php @@ -65,6 +65,6 @@ require KRONOLITH_TEMPLATES . '/index/index.inc'; Kronolith::includeScriptFiles(); Horde::outputInlineScript(); $notification->notify(array('listeners' => array('javascript'))); -$tac = Horde_Ajax_Imple::getInstance(array('kronolith', 'TagAutoCompleter'), array('triggerId' => 'kronolithEventTags', 'pretty' => true)); +$tac = Horde_Ajax_Imple::factory(array('kronolith', 'TagAutoCompleter'), array('triggerId' => 'kronolithEventTags', 'pretty' => true)); $tac->attach(); echo "\n"; diff --git a/kronolith/templates/edit/edit.inc b/kronolith/templates/edit/edit.inc index d4c0392df..9aea18105 100644 --- a/kronolith/templates/edit/edit.inc +++ b/kronolith/templates/edit/edit.inc @@ -379,7 +379,7 @@ endif;
- 'tags', 'id' => $event->getUID())); + 'tags', 'id' => $event->getUID())); $tac->attach(); ?> diff --git a/kronolith/templates/panel.inc b/kronolith/templates/panel.inc index 58e40d5d9..bd746a90f 100644 --- a/kronolith/templates/panel.inc +++ b/kronolith/templates/panel.inc @@ -66,12 +66,12 @@ if ($cal->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) { . Horde::img('delete-small.png', _("Remove Tag"), '', $registry->getImageDir('horde')) . ''; } -$ta = Horde_Ajax_Imple::getInstance(array('kronolith', 'TagActions'), - array('triggerId' => 'remove' . md5($id . $tag_id), - 'action' => 'delete', - 'resource' => $id, - 'type' => 'calendar', - 'tagId' => $tag_id)); +$ta = Horde_Ajax_Imple::factory(array('kronolith', 'TagActions'), + array('triggerId' => 'remove' . md5($id . $tag_id), + 'action' => 'delete', + 'resource' => $id, + 'type' => 'calendar', + 'tagId' => $tag_id)); $ta->attach(); ?> @@ -82,9 +82,9 @@ $ta->attach();
'newtags-input_' . $id, 'id' => $id)); + $tac = Horde_Ajax_Imple::factory(array('kronolith', 'TagAutoCompleter'), array('triggerId' => 'newtags-input_' . $id, 'id' => $id)); $tac->attach(); - $ta = Horde_Ajax_Imple::getInstance(array('kronolith', 'TagActions'), + $ta = Horde_Ajax_Imple::factory(array('kronolith', 'TagActions'), array('triggerId' => 'newtags-button', 'resource' => $id, 'type' => 'calendar',