2010-08-26 19:14:53 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* PHPExcel
|
|
|
|
*
|
2013-05-14 11:20:28 +00:00
|
|
|
* Copyright (c) 2006 - 2013 PHPExcel
|
2010-08-26 19:14:53 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2012-03-03 21:08:29 +00:00
|
|
|
*
|
2010-08-26 19:14:53 +00:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2012-03-03 21:08:29 +00:00
|
|
|
*
|
2010-08-26 19:14:53 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*
|
|
|
|
* @category PHPExcel
|
|
|
|
* @package PHPExcel_Cell
|
2013-05-14 11:20:28 +00:00
|
|
|
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
|
2012-11-28 21:30:58 +00:00
|
|
|
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
2010-08-26 19:14:53 +00:00
|
|
|
* @version ##VERSION##, ##DATE##
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* PHPExcel_Cell_Hyperlink
|
|
|
|
*
|
|
|
|
* @category PHPExcel
|
|
|
|
* @package PHPExcel_Cell
|
2013-05-14 11:20:28 +00:00
|
|
|
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
|
2010-08-26 19:14:53 +00:00
|
|
|
*/
|
|
|
|
class PHPExcel_Cell_Hyperlink
|
|
|
|
{
|
2012-11-28 21:30:58 +00:00
|
|
|
/**
|
|
|
|
* URL to link the cell to
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $_url;
|
2012-03-03 21:08:29 +00:00
|
|
|
|
2012-11-28 21:30:58 +00:00
|
|
|
/**
|
|
|
|
* Tooltip to display on the hyperlink
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $_tooltip;
|
2012-03-03 21:08:29 +00:00
|
|
|
|
2010-08-26 19:14:53 +00:00
|
|
|
/**
|
|
|
|
* Create a new PHPExcel_Cell_Hyperlink
|
|
|
|
*
|
2012-11-28 21:30:58 +00:00
|
|
|
* @param string $pUrl Url to link the cell to
|
|
|
|
* @param string $pTooltip Tooltip to display on the hyperlink
|
2010-08-26 19:14:53 +00:00
|
|
|
*/
|
|
|
|
public function __construct($pUrl = '', $pTooltip = '')
|
|
|
|
{
|
2012-11-28 21:30:58 +00:00
|
|
|
// Initialise member variables
|
|
|
|
$this->_url = $pUrl;
|
|
|
|
$this->_tooltip = $pTooltip;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
2012-03-03 21:08:29 +00:00
|
|
|
|
2012-11-28 21:30:58 +00:00
|
|
|
/**
|
|
|
|
* Get URL
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getUrl() {
|
|
|
|
return $this->_url;
|
|
|
|
}
|
2010-08-26 19:14:53 +00:00
|
|
|
|
2012-11-28 21:30:58 +00:00
|
|
|
/**
|
|
|
|
* Set URL
|
|
|
|
*
|
|
|
|
* @param string $value
|
|
|
|
* @return PHPExcel_Cell_Hyperlink
|
|
|
|
*/
|
|
|
|
public function setUrl($value = '') {
|
|
|
|
$this->_url = $value;
|
|
|
|
return $this;
|
|
|
|
}
|
2012-03-03 21:08:29 +00:00
|
|
|
|
2012-11-28 21:30:58 +00:00
|
|
|
/**
|
|
|
|
* Get tooltip
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getTooltip() {
|
|
|
|
return $this->_tooltip;
|
|
|
|
}
|
2010-08-26 19:14:53 +00:00
|
|
|
|
2012-11-28 21:30:58 +00:00
|
|
|
/**
|
|
|
|
* Set tooltip
|
|
|
|
*
|
|
|
|
* @param string $value
|
|
|
|
* @return PHPExcel_Cell_Hyperlink
|
|
|
|
*/
|
|
|
|
public function setTooltip($value = '') {
|
|
|
|
$this->_tooltip = $value;
|
|
|
|
return $this;
|
|
|
|
}
|
2012-03-03 21:08:29 +00:00
|
|
|
|
2012-11-28 21:30:58 +00:00
|
|
|
/**
|
|
|
|
* Is this hyperlink internal? (to another worksheet)
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
|
|
|
public function isInternal() {
|
|
|
|
return strpos($this->_url, 'sheet://') !== false;
|
|
|
|
}
|
2012-03-03 21:08:29 +00:00
|
|
|
|
2012-11-28 21:30:58 +00:00
|
|
|
/**
|
|
|
|
* Get hash code
|
|
|
|
*
|
|
|
|
* @return string Hash code
|
|
|
|
*/
|
|
|
|
public function getHashCode() {
|
|
|
|
return md5(
|
|
|
|
$this->_url
|
|
|
|
. $this->_tooltip
|
|
|
|
. __CLASS__
|
|
|
|
);
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
}
|