Copyright 2003-2016 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.
저자: Marko Djukic (marko@oblo.com)
예제 #1
0
파일: Hylax.php 프로젝트: horde/horde
 function getPDF($fax_id)
 {
     $data = $GLOBALS['hylax_storage']->getFaxData($fax_id);
     /* Get the pdf. */
     require_once HYLAX_BASE . '/lib/Image.php';
     $image = new Hylax_Image();
     $image->loadData($data);
     $image->getPDF();
 }
예제 #2
0
 function createFax($info, $fix_owner = false)
 {
     /* In case this is just a fax creation without yet a number assigned
      * create an empty number. */
     if (!isset($info['fax_number'])) {
         $info['fax_number'] = '';
     }
     /* Set the folder. */
     $info['fax_folder'] = $info['fax_type'] ? 'outbox' : 'inbox';
     /* Set timestamp. */
     if (empty($info['fax_created'])) {
         $info['fax_created'] = time();
     }
     $data = $this->getFaxData($info['fax_id']);
     if (is_a($data, 'PEAR_Error')) {
         Horde::log('Could not get fax data: ' . $data->getMessage(), 'ERR');
         return $data;
     }
     /* Create a fax image object. */
     require_once HYLAX_BASE . '/lib/Image.php';
     $image = new Hylax_Image();
     $image->loadData($data);
     if (empty($info['fax_pages'])) {
         $info['fax_pages'] = $image->getNumPages();
     }
     /* Save to backend. */
     $result = $this->_createFax($info);
     if (is_a($result, 'PEAR_Error')) {
         return $result;
     }
     global $conf;
     foreach ($conf['fax']['notify'] as $rec) {
         mail($rec, _("New fax from: ") . $info['fax_number'], '', 'From: ' . $conf['fax']['notifyfrom']);
     }
     return true;
 }
예제 #3
0
파일: Image.php 프로젝트: horde/horde
 /**
  * Attempts to return a reference to a concrete Hylax_Image instance based
  * on $driver.
  *
  * It will only create a new instance if no Hylax_Image instance with the
  * same parameters currently exists.
  *
  * This should be used if multiple image sources are required.
  *
  * This method must be invoked as: $var = &Hylax_Image::singleton()
  *
  * @param string $driver  The type of concrete Hylax_Image subclass to
  *                        return.
  * @param array $params   A hash containing any additional configuration or
  *                        connection parameters a subclass might need.
  *
  * @return mixed  The created concrete Hylax_Image instance, or false on
  *                error.
  */
 function &singleton($driver, $params = array())
 {
     static $instances;
     if (!isset($instances)) {
         $instances = array();
     }
     $signature = serialize(array($driver, $params));
     if (!isset($instances[$signature])) {
         $instances[$signature] =& Hylax_Image::factory($driver, $params);
     }
     return $instances[$signature];
 }