Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mms] Contacts popup now does address search dynamically, without the…
… need to reload the page.
- Loading branch information
Showing
8 changed files
with
189 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
/** | ||
* Copyright 2014 Horde LLC (http://www.horde.org/) | ||
* | ||
* See the enclosed file COPYING for license information (GPL). If you | ||
* did not receive this file, see http://www.horde.org/licenses/gpl. | ||
* | ||
* @category Horde | ||
* @copyright 2014 Horde LLC | ||
* @license http://www.horde.org/licenses/gpl GPL | ||
* @package IMP | ||
*/ | ||
|
||
/** | ||
* Defines AJAX actions used in the contacts popup. | ||
* | ||
* @author Michael Slusarz <slusarz@horde.org> | ||
* @category Horde | ||
* @copyright 2014 Horde LLC | ||
* @license http://www.horde.org/licenses/gpl GPL | ||
* @package IMP | ||
*/ | ||
class IMP_Ajax_Application_Handler_Contacts | ||
extends Horde_Core_Ajax_Application_Handler | ||
{ | ||
/** | ||
* AJAX action: Return address list for the contacts popup. | ||
* | ||
* Variables used: | ||
* - search: (string) Search string. | ||
* - source: (string) Source identifier. | ||
* | ||
* @return object An object with a single property: 'results'. | ||
* 'results' is an array of e-mail addresses. | ||
*/ | ||
public function contactsSearch() | ||
{ | ||
global $injector; | ||
|
||
$contacts = $injector->getInstance('IMP_Contacts'); | ||
|
||
$out = new stdClass; | ||
$out->results = array_map( | ||
'strval', | ||
iterator_to_array($contacts->searchEmail($this->vars->get('search', ''), array( | ||
'sources' => array($this->vars->source) | ||
))) | ||
); | ||
|
||
return $out; | ||
} | ||
|
||
} |
Oops, something went wrong.