| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | <?php | 
					
						
							| 
									
										
										
										
											2015-05-08 00:09:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | /** | 
					
						
							| 
									
										
										
										
											2015-05-08 00:09:27 +00:00
										 |  |  |  * PHPExcel_Cell_Hyperlink | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2015-05-02 22:50:37 +00:00
										 |  |  |  * Copyright (c) 2006 - 2015 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 | 
					
						
							| 
									
										
										
										
											2015-05-02 22:50:37 +00:00
										 |  |  |  * @copyright  Copyright (c) 2006 - 2015 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##
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | class PHPExcel_Cell_Hyperlink | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-28 21:30:58 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * URL to link the cell to | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @var string | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-08 00:09:27 +00:00
										 |  |  |     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 | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-08 00:09:27 +00:00
										 |  |  |     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
 | 
					
						
							| 
									
										
										
										
											2015-05-08 00:09:27 +00:00
										 |  |  |         $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 | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-08 00:09:27 +00:00
										 |  |  |     public function getUrl() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         return $this->url; | 
					
						
							| 
									
										
										
										
											2012-11-28 21:30:58 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											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 | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-08 00:09:27 +00:00
										 |  |  |     public function setUrl($value = '') | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $this->url = $value; | 
					
						
							| 
									
										
										
										
											2012-11-28 21:30:58 +00:00
										 |  |  |         return $this; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-11-28 21:30:58 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * Get tooltip | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return string | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-08 00:09:27 +00:00
										 |  |  |     public function getTooltip() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         return $this->tooltip; | 
					
						
							| 
									
										
										
										
											2012-11-28 21:30:58 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											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 | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-08 00:09:27 +00:00
										 |  |  |     public function setTooltip($value = '') | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $this->tooltip = $value; | 
					
						
							| 
									
										
										
										
											2012-11-28 21:30:58 +00:00
										 |  |  |         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 | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-08 00:09:27 +00:00
										 |  |  |     public function isInternal() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         return strpos($this->url, 'sheet://') !== false; | 
					
						
							| 
									
										
										
										
											2012-11-28 21:30:58 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-03-03 21:08:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-11-28 21:30:58 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * Get hash code | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return string    Hash code | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-08 00:09:27 +00:00
										 |  |  |     public function getHashCode() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2012-11-28 21:30:58 +00:00
										 |  |  |         return md5( | 
					
						
							| 
									
										
										
										
											2015-05-08 00:09:27 +00:00
										 |  |  |             $this->url . | 
					
						
							|  |  |  |             $this->tooltip . | 
					
						
							|  |  |  |             __CLASS__ | 
					
						
							| 
									
										
										
										
											2012-11-28 21:30:58 +00:00
										 |  |  |         ); | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  |     } | 
					
						
							|  |  |  | } |