getInstance() -> factory()
authorMichael M Slusarz <slusarz@curecanti.org>
Sat, 25 Jul 2009 04:48:45 +0000 (22:48 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Sat, 25 Jul 2009 16:47:21 +0000 (10:47 -0600)
imp/compose.php
imp/lib/Fetchmail/imap.php
imp/lib/Imap.php
imp/lib/Quota.php
imp/lib/UI/Compose.php
imp/test.php
kronolith/attendees.php
kronolith/calendars/edit.php
kronolith/index.php
kronolith/templates/edit/edit.inc
kronolith/templates/panel.inc

index 6bb8fbd..15ea8e6 100644 (file)
@@ -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) {
index 4244158..70abefd 100644 (file)
@@ -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());
         }
index 0d0b982..f04c251 100644 (file)
@@ -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;
         }
index 20f43e5..f5aeb5b 100644 (file)
@@ -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);
index f7810a8..e5bdf3a 100644 (file)
@@ -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();
     }
 
index eee06f5..4b04f1c 100644 (file)
@@ -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);
     }
index 67ca17f..b4cc64a 100644 (file)
@@ -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");
index 191b455..1cad577 100644 (file)
@@ -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();
index e5d4e21..2ca8c5f 100644 (file)
@@ -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 "</body>\n</html>";
index d4c0392..9aea181 100644 (file)
@@ -379,7 +379,7 @@ endif;
    <input type="text" name="tags" id="tags" value="<?php echo (!empty($tags) ? htmlspecialchars($tags) : '')?>" size="40" />
    <div id="tags_results" name="tags_results" class="autocomplete"></div>
    <span id="tags_loading_img" style="display:none;"><?php echo Horde::img('loading.gif', _("Loading...")) ?></span>
-   <?php $tac = Horde_Ajax_Imple::getInstance(array('kronolith', 'TagAutoCompleter'), array('triggerId' => 'tags', 'id' => $event->getUID()));
+   <?php $tac = Horde_Ajax_Imple::factory(array('kronolith', 'TagAutoCompleter'), array('triggerId' => 'tags', 'id' => $event->getUID()));
          $tac->attach();
    ?>
  </td>
index 58e40d5..bd746a9 100644 (file)
@@ -66,12 +66,12 @@ if ($cal->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
         . Horde::img('delete-small.png', _("Remove Tag"), '', $registry->getImageDir('horde'))
         . '</a>';
 }
-$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();
 ?>
         </li>
@@ -82,9 +82,9 @@ $ta->attach();
       <div id="newtags-input_<?php echo $id?>_results" class="autocomplete"></div>
       <span id="newtags-input_<?php echo $id?>_loading_img" style="display:none;"><?php echo Horde::img('loading.gif', _("Loading...")) ?></span>
      <?php
-      $tac = Horde_Ajax_Imple::getInstance(array('kronolith', 'TagAutoCompleter'), array('triggerId' => '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',