示例#1
0
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
namespace {
    // add include path to this apps 3rdparty
    $incPath = __DIR__ . "/../3rdparty";
    set_include_path(get_include_path() . PATH_SEPARATOR . $incPath);
    // load Horde's auto loader
    require_once 'Horde/Autoloader/Default.php';
    // bypass Horde Translation system
    Horde_Translation::setHandler('Horde_Imap_Client', new OC_Translation_Handler());
}
namespace OCA\Mail {
    class App
    {
        /**
         * Extracts all matching contacts with email address and name
         *
         * @param $term
         * @return array
         */
        public static function getMatchingRecipient($term)
        {
            if (!\OCP\Contacts::isEnabled()) {
                return array();
            }
示例#2
0
<?php

use OCA\Mail\HordeTranslationHandler;
if (@(include_once __DIR__ . '/../vendor/autoload.php') === false) {
    throw new Exception('Cannot include autoload. Did you run install dependencies using composer?');
}
// bypass Horde Translation system
Horde_Translation::setHandler('Horde_Imap_Client', new HordeTranslationHandler());
Horde_Translation::setHandler('Horde_Mime', new HordeTranslationHandler());
Horde_Translation::setHandler('Horde_Smtp', new HordeTranslationHandler());
$l = \OC::$server->getL10N('mail');
$g = \OC::$server->getURLGenerator();
\OC::$server->getNavigationManager()->add(['id' => 'mail', 'order' => 1, 'href' => $g->linkToRoute('mail.page.index'), 'icon' => $g->imagePath('mail', 'mail.svg'), 'name' => $l->t('Mail')]);