CC-2166: Packaging Improvements. Moved the Zend app into airtime_mvc. It is now installed to /var/www/airtime. Storage is now set to /srv/airtime/stor. Utils are now installed to /usr/lib/airtime/utils/. Added install/airtime-dircheck.php as a simple test to see if everything is install/uninstalled correctly.

This commit is contained in:
Paul Baranowski 2011-04-14 18:55:04 -04:00
parent 514777e8d2
commit b11cbd8159
4546 changed files with 138 additions and 51 deletions

View file

@ -0,0 +1,116 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: GoTo.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Internally used classes */
require_once 'Zend/Pdf/Destination.php';
require_once 'Zend/Pdf/Element/Dictionary.php';
require_once 'Zend/Pdf/Element/Name.php';
/** Zend_Pdf_Action */
require_once 'Zend/Pdf/Action.php';
/**
* PDF 'Go to' action
*
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Action_GoTo extends Zend_Pdf_Action
{
/**
* GoTo Action destination
*
* @var Zend_Pdf_Destination
*/
protected $_destination;
/**
* Object constructor
*
* @param Zend_Pdf_Element_Dictionary $dictionary
* @param SplObjectStorage $processedActions list of already processed action dictionaries, used to avoid cyclic references
*/
public function __construct(Zend_Pdf_Element $dictionary, SplObjectStorage $processedActions)
{
parent::__construct($dictionary, $processedActions);
$this->_destination = Zend_Pdf_Destination::load($dictionary->D);
}
/**
* Create new Zend_Pdf_Action_GoTo object using specified destination
*
* @param Zend_Pdf_Destination|string $destination
* @return Zend_Pdf_Action_GoTo
*/
public static function create($destination)
{
if (is_string($destination)) {
require_once 'Zend/Pdf/Destination/Named.php';
$destination = Zend_Pdf_Destination_Named::create($destination);
}
if (!$destination instanceof Zend_Pdf_Destination) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('$destination parameter must be a Zend_Pdf_Destination object or string.');
}
$dictionary = new Zend_Pdf_Element_Dictionary();
$dictionary->Type = new Zend_Pdf_Element_Name('Action');
$dictionary->S = new Zend_Pdf_Element_Name('GoTo');
$dictionary->Next = null;
$dictionary->D = $destination->getResource();
return new Zend_Pdf_Action_GoTo($dictionary, new SplObjectStorage());
}
/**
* Set goto action destination
*
* @param Zend_Pdf_Destination|string $destination
* @return Zend_Pdf_Action_GoTo
*/
public function setDestination(Zend_Pdf_Destination $destination)
{
$this->_destination = $destination;
$this->_actionDictionary->touch();
$this->_actionDictionary->D = $destination->getResource();
return $this;
}
/**
* Get goto action destination
*
* @return Zend_Pdf_Destination
*/
public function getDestination()
{
return $this->_destination;
}
}

View file

@ -0,0 +1,39 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: GoTo3DView.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Zend_Pdf_Action */
require_once 'Zend/Pdf/Action.php';
/**
* PDF 'Set the current view of a 3D annotation' action
* PDF 1.6+ feature
*
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Action_GoTo3DView extends Zend_Pdf_Action
{
}

View file

@ -0,0 +1,38 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: GoToE.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Zend_Pdf_Action */
require_once 'Zend/Pdf/Action.php';
/**
* PDF 'Go to a destination in an embedded file' action
*
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Action_GoToE extends Zend_Pdf_Action
{
}

View file

@ -0,0 +1,38 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: GoToR.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Zend_Pdf_Action */
require_once 'Zend/Pdf/Action.php';
/**
* PDF 'Go to a destination in another document' action
*
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Action_GoToR extends Zend_Pdf_Action
{
}

View file

@ -0,0 +1,39 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Hide.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Zend_Pdf_Action */
require_once 'Zend/Pdf/Action.php';
/**
* PDF 'Set an annotations Hidden flag' action
* PDF 1.2+ feature
*
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Action_Hide extends Zend_Pdf_Action
{
}

View file

@ -0,0 +1,39 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ImportData.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Zend_Pdf_Action */
require_once 'Zend/Pdf/Action.php';
/**
* PDF 'Import field values from a file' action
* PDF 1.2+ feature
*
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Action_ImportData extends Zend_Pdf_Action
{
}

View file

@ -0,0 +1,39 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: JavaScript.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Zend_Pdf_Action */
require_once 'Zend/Pdf/Action.php';
/**
* PDF 'Execute a JavaScript script' action
* PDF 1.3+ feature
*
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Action_JavaScript extends Zend_Pdf_Action
{
}

View file

@ -0,0 +1,38 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Launch.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Zend_Pdf_Action */
require_once 'Zend/Pdf/Action.php';
/**
* PDF 'Launch an application, usually to open a file' action
*
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Action_Launch extends Zend_Pdf_Action
{
}

View file

@ -0,0 +1,38 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Movie.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Zend_Pdf_Action */
require_once 'Zend/Pdf/Action.php';
/**
* PDF 'Play a movie' action
* PDF 1.2+ feature
*
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Action_Movie extends Zend_Pdf_Action
{
}

View file

@ -0,0 +1,39 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Named.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Zend_Pdf_Action */
require_once 'Zend/Pdf/Action.php';
/**
* PDF 'Execute an action predefined by the viewer application' action
* PDF 1.2+ feature
*
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Action_Named extends Zend_Pdf_Action
{
}

View file

@ -0,0 +1,39 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Rendition.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Zend_Pdf_Action */
require_once 'Zend/Pdf/Action.php';
/**
* PDF 'Controls the playing of multimedia content' action
* PDF 1.5+ feature
*
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Action_Rendition extends Zend_Pdf_Action
{
}

View file

@ -0,0 +1,39 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ResetForm.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Zend_Pdf_Action */
require_once 'Zend/Pdf/Action.php';
/**
* PDF 'Set fields to their default values' action
* PDF 1.2+ feature
*
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Action_ResetForm extends Zend_Pdf_Action
{
}

View file

@ -0,0 +1,39 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: SetOCGState.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Zend_Pdf_Action */
require_once 'Zend/Pdf/Action.php';
/**
* PDF 'Set the states of optional content groups' action
* PDF 1.5+ feature
*
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Action_SetOCGState extends Zend_Pdf_Action
{
}

View file

@ -0,0 +1,39 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Sound.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Zend_Pdf_Action */
require_once 'Zend/Pdf/Action.php';
/**
* PDF 'Play a sound' action representation class
* PDF 1.2+ feature
*
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Action_Sound extends Zend_Pdf_Action
{
}

View file

@ -0,0 +1,39 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: SubmitForm.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Zend_Pdf_Action */
require_once 'Zend/Pdf/Action.php';
/**
* PDF 'Send data to a uniform resource locator' action
* PDF 1.2+ feature
*
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Action_SubmitForm extends Zend_Pdf_Action
{
}

View file

@ -0,0 +1,38 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Thread.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Zend_Pdf_Action */
require_once 'Zend/Pdf/Action.php';
/**
* PDF 'Begin reading an article thread' action
*
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Action_Thread extends Zend_Pdf_Action
{
}

View file

@ -0,0 +1,39 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Trans.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Zend_Pdf_Action */
require_once 'Zend/Pdf/Action.php';
/**
* PDF 'Updates the display of a document, using a transition dictionary' action
* PDF 1.5+ feature
*
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Action_Trans extends Zend_Pdf_Action
{
}

View file

@ -0,0 +1,167 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: URI.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Internally used classes */
require_once 'Zend/Pdf/Element/Dictionary.php';
require_once 'Zend/Pdf/Element/Name.php';
require_once 'Zend/Pdf/Element/String.php';
require_once 'Zend/Pdf/Element/Boolean.php';
/** Zend_Pdf_Action */
require_once 'Zend/Pdf/Action.php';
/**
* PDF 'Resolve a uniform resource identifier' action
*
* A URI action causes a URI to be resolved.
*
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Action_URI extends Zend_Pdf_Action
{
/**
* Object constructor
*
* @param Zend_Pdf_Element_Dictionary $dictionary
* @param SplObjectStorage $processedActions list of already processed action dictionaries, used to avoid cyclic references
* @throws Zend_Pdf_Exception
*/
public function __construct(Zend_Pdf_Element $dictionary, SplObjectStorage $processedActions)
{
parent::__construct($dictionary, $processedActions);
if ($dictionary->URI === null) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('URI action dictionary entry is required');
}
}
/**
* Validate URI
*
* @param string $uri
* @return true
* @throws Zend_Pdf_Exception
*/
protected static function _validateUri($uri)
{
$scheme = parse_url((string)$uri, PHP_URL_SCHEME);
if ($scheme === false || $scheme === null) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Invalid URI');
}
}
/**
* Create new Zend_Pdf_Action_URI object using specified uri
*
* @param string $uri The URI to resolve, encoded in 7-bit ASCII
* @param boolean $isMap A flag specifying whether to track the mouse position when the URI is resolved
* @return Zend_Pdf_Action_URI
*/
public static function create($uri, $isMap = false)
{
self::_validateUri($uri);
$dictionary = new Zend_Pdf_Element_Dictionary();
$dictionary->Type = new Zend_Pdf_Element_Name('Action');
$dictionary->S = new Zend_Pdf_Element_Name('URI');
$dictionary->Next = null;
$dictionary->URI = new Zend_Pdf_Element_String($uri);
if ($isMap) {
$dictionary->IsMap = new Zend_Pdf_Element_Boolean(true);
}
return new Zend_Pdf_Action_URI($dictionary, new SplObjectStorage());
}
/**
* Set URI to resolve
*
* @param string $uri The uri to resolve, encoded in 7-bit ASCII.
* @return Zend_Pdf_Action_URI
*/
public function setUri($uri)
{
$this->_validateUri($uri);
$this->_actionDictionary->touch();
$this->_actionDictionary->URI = new Zend_Pdf_Element_String($uri);
return $this;
}
/**
* Get URI to resolve
*
* @return string
*/
public function getUri()
{
return $this->_actionDictionary->URI->value;
}
/**
* Set IsMap property
*
* If the IsMap flag is true and the user has triggered the URI action by clicking
* an annotation, the coordinates of the mouse position at the time the action is
* performed should be transformed from device space to user space and then offset
* relative to the upper-left corner of the annotation rectangle.
*
* @param boolean $isMap A flag specifying whether to track the mouse position when the URI is resolved
* @return Zend_Pdf_Action_URI
*/
public function setIsMap($isMap)
{
$this->_actionDictionary->touch();
if ($isMap) {
$this->_actionDictionary->IsMap = new Zend_Pdf_Element_Boolean(true);
} else {
$this->_actionDictionary->IsMap = null;
}
return $this;
}
/**
* Get IsMap property
*
* If the IsMap flag is true and the user has triggered the URI action by clicking
* an annotation, the coordinates of the mouse position at the time the action is
* performed should be transformed from device space to user space and then offset
* relative to the upper-left corner of the annotation rectangle.
*
* @return boolean
*/
public function getIsMap()
{
return $this->_actionDictionary->IsMap !== null &&
$this->_actionDictionary->IsMap->value;
}
}

View file

@ -0,0 +1,38 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Unknown.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Zend_Pdf_Action */
require_once 'Zend/Pdf/Action.php';
/**
* Unrecognized PDF action
*
* @package Zend_Pdf
* @subpackage Actions
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Action_Unknown extends Zend_Pdf_Action
{
}