@@ -98,188 +98,188 @@ discard block |
||
| 98 | 98 | */ |
| 99 | 99 | private $_alignment; |
| 100 | 100 | |
| 101 | - /** |
|
| 102 | - * Create a new PHPExcel_Comment |
|
| 103 | - * |
|
| 104 | - * @throws Exception |
|
| 105 | - */ |
|
| 106 | - public function __construct() |
|
| 107 | - { |
|
| 108 | - // Initialise variables |
|
| 109 | - $this->_author = 'Author'; |
|
| 110 | - $this->_text = new PHPExcel_RichText(); |
|
| 111 | - $this->_fillColor = new PHPExcel_Style_Color('FFFFFFE1'); |
|
| 101 | + /** |
|
| 102 | + * Create a new PHPExcel_Comment |
|
| 103 | + * |
|
| 104 | + * @throws Exception |
|
| 105 | + */ |
|
| 106 | + public function __construct() |
|
| 107 | + { |
|
| 108 | + // Initialise variables |
|
| 109 | + $this->_author = 'Author'; |
|
| 110 | + $this->_text = new PHPExcel_RichText(); |
|
| 111 | + $this->_fillColor = new PHPExcel_Style_Color('FFFFFFE1'); |
|
| 112 | 112 | $this->_alignment = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL; |
| 113 | - } |
|
| 113 | + } |
|
| 114 | 114 | |
| 115 | - /** |
|
| 116 | - * Get Author |
|
| 117 | - * |
|
| 118 | - * @return string |
|
| 119 | - */ |
|
| 120 | - public function getAuthor() { |
|
| 121 | - return $this->_author; |
|
| 122 | - } |
|
| 115 | + /** |
|
| 116 | + * Get Author |
|
| 117 | + * |
|
| 118 | + * @return string |
|
| 119 | + */ |
|
| 120 | + public function getAuthor() { |
|
| 121 | + return $this->_author; |
|
| 122 | + } |
|
| 123 | 123 | |
| 124 | - /** |
|
| 125 | - * Set Author |
|
| 126 | - * |
|
| 127 | - * @param string $pValue |
|
| 128 | - * @return PHPExcel_Comment |
|
| 129 | - */ |
|
| 124 | + /** |
|
| 125 | + * Set Author |
|
| 126 | + * |
|
| 127 | + * @param string $pValue |
|
| 128 | + * @return PHPExcel_Comment |
|
| 129 | + */ |
|
| 130 | 130 | public function setAuthor($pValue = '') { |
| 131 | 131 | $this->_author = $pValue; |
| 132 | 132 | return $this; |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - /** |
|
| 136 | - * Get Rich text comment |
|
| 137 | - * |
|
| 138 | - * @return PHPExcel_RichText |
|
| 139 | - */ |
|
| 140 | - public function getText() { |
|
| 141 | - return $this->_text; |
|
| 142 | - } |
|
| 135 | + /** |
|
| 136 | + * Get Rich text comment |
|
| 137 | + * |
|
| 138 | + * @return PHPExcel_RichText |
|
| 139 | + */ |
|
| 140 | + public function getText() { |
|
| 141 | + return $this->_text; |
|
| 142 | + } |
|
| 143 | 143 | |
| 144 | - /** |
|
| 145 | - * Set Rich text comment |
|
| 146 | - * |
|
| 147 | - * @param PHPExcel_RichText $pValue |
|
| 148 | - * @return PHPExcel_Comment |
|
| 149 | - */ |
|
| 150 | - public function setText(PHPExcel_RichText $pValue) { |
|
| 151 | - $this->_text = $pValue; |
|
| 152 | - return $this; |
|
| 153 | - } |
|
| 144 | + /** |
|
| 145 | + * Set Rich text comment |
|
| 146 | + * |
|
| 147 | + * @param PHPExcel_RichText $pValue |
|
| 148 | + * @return PHPExcel_Comment |
|
| 149 | + */ |
|
| 150 | + public function setText(PHPExcel_RichText $pValue) { |
|
| 151 | + $this->_text = $pValue; |
|
| 152 | + return $this; |
|
| 153 | + } |
|
| 154 | 154 | |
| 155 | - /** |
|
| 156 | - * Get comment width (CSS style, i.e. XXpx or YYpt) |
|
| 157 | - * |
|
| 158 | - * @return string |
|
| 159 | - */ |
|
| 160 | - public function getWidth() { |
|
| 161 | - return $this->_width; |
|
| 162 | - } |
|
| 155 | + /** |
|
| 156 | + * Get comment width (CSS style, i.e. XXpx or YYpt) |
|
| 157 | + * |
|
| 158 | + * @return string |
|
| 159 | + */ |
|
| 160 | + public function getWidth() { |
|
| 161 | + return $this->_width; |
|
| 162 | + } |
|
| 163 | 163 | |
| 164 | - /** |
|
| 165 | - * Set comment width (CSS style, i.e. XXpx or YYpt) |
|
| 166 | - * |
|
| 167 | - * @param string $value |
|
| 168 | - * @return PHPExcel_Comment |
|
| 169 | - */ |
|
| 170 | - public function setWidth($value = '96pt') { |
|
| 171 | - $this->_width = $value; |
|
| 172 | - return $this; |
|
| 173 | - } |
|
| 164 | + /** |
|
| 165 | + * Set comment width (CSS style, i.e. XXpx or YYpt) |
|
| 166 | + * |
|
| 167 | + * @param string $value |
|
| 168 | + * @return PHPExcel_Comment |
|
| 169 | + */ |
|
| 170 | + public function setWidth($value = '96pt') { |
|
| 171 | + $this->_width = $value; |
|
| 172 | + return $this; |
|
| 173 | + } |
|
| 174 | 174 | |
| 175 | - /** |
|
| 176 | - * Get comment height (CSS style, i.e. XXpx or YYpt) |
|
| 177 | - * |
|
| 178 | - * @return string |
|
| 179 | - */ |
|
| 180 | - public function getHeight() { |
|
| 181 | - return $this->_height; |
|
| 182 | - } |
|
| 175 | + /** |
|
| 176 | + * Get comment height (CSS style, i.e. XXpx or YYpt) |
|
| 177 | + * |
|
| 178 | + * @return string |
|
| 179 | + */ |
|
| 180 | + public function getHeight() { |
|
| 181 | + return $this->_height; |
|
| 182 | + } |
|
| 183 | 183 | |
| 184 | - /** |
|
| 185 | - * Set comment height (CSS style, i.e. XXpx or YYpt) |
|
| 186 | - * |
|
| 187 | - * @param string $value |
|
| 188 | - * @return PHPExcel_Comment |
|
| 189 | - */ |
|
| 190 | - public function setHeight($value = '55.5pt') { |
|
| 191 | - $this->_height = $value; |
|
| 192 | - return $this; |
|
| 193 | - } |
|
| 184 | + /** |
|
| 185 | + * Set comment height (CSS style, i.e. XXpx or YYpt) |
|
| 186 | + * |
|
| 187 | + * @param string $value |
|
| 188 | + * @return PHPExcel_Comment |
|
| 189 | + */ |
|
| 190 | + public function setHeight($value = '55.5pt') { |
|
| 191 | + $this->_height = $value; |
|
| 192 | + return $this; |
|
| 193 | + } |
|
| 194 | 194 | |
| 195 | - /** |
|
| 196 | - * Get left margin (CSS style, i.e. XXpx or YYpt) |
|
| 197 | - * |
|
| 198 | - * @return string |
|
| 199 | - */ |
|
| 200 | - public function getMarginLeft() { |
|
| 201 | - return $this->_marginLeft; |
|
| 202 | - } |
|
| 195 | + /** |
|
| 196 | + * Get left margin (CSS style, i.e. XXpx or YYpt) |
|
| 197 | + * |
|
| 198 | + * @return string |
|
| 199 | + */ |
|
| 200 | + public function getMarginLeft() { |
|
| 201 | + return $this->_marginLeft; |
|
| 202 | + } |
|
| 203 | 203 | |
| 204 | - /** |
|
| 205 | - * Set left margin (CSS style, i.e. XXpx or YYpt) |
|
| 206 | - * |
|
| 207 | - * @param string $value |
|
| 208 | - * @return PHPExcel_Comment |
|
| 209 | - */ |
|
| 210 | - public function setMarginLeft($value = '59.25pt') { |
|
| 211 | - $this->_marginLeft = $value; |
|
| 212 | - return $this; |
|
| 213 | - } |
|
| 204 | + /** |
|
| 205 | + * Set left margin (CSS style, i.e. XXpx or YYpt) |
|
| 206 | + * |
|
| 207 | + * @param string $value |
|
| 208 | + * @return PHPExcel_Comment |
|
| 209 | + */ |
|
| 210 | + public function setMarginLeft($value = '59.25pt') { |
|
| 211 | + $this->_marginLeft = $value; |
|
| 212 | + return $this; |
|
| 213 | + } |
|
| 214 | 214 | |
| 215 | - /** |
|
| 216 | - * Get top margin (CSS style, i.e. XXpx or YYpt) |
|
| 217 | - * |
|
| 218 | - * @return string |
|
| 219 | - */ |
|
| 220 | - public function getMarginTop() { |
|
| 221 | - return $this->_marginTop; |
|
| 222 | - } |
|
| 215 | + /** |
|
| 216 | + * Get top margin (CSS style, i.e. XXpx or YYpt) |
|
| 217 | + * |
|
| 218 | + * @return string |
|
| 219 | + */ |
|
| 220 | + public function getMarginTop() { |
|
| 221 | + return $this->_marginTop; |
|
| 222 | + } |
|
| 223 | 223 | |
| 224 | - /** |
|
| 225 | - * Set top margin (CSS style, i.e. XXpx or YYpt) |
|
| 226 | - * |
|
| 227 | - * @param string $value |
|
| 228 | - * @return PHPExcel_Comment |
|
| 229 | - */ |
|
| 230 | - public function setMarginTop($value = '1.5pt') { |
|
| 231 | - $this->_marginTop = $value; |
|
| 232 | - return $this; |
|
| 233 | - } |
|
| 224 | + /** |
|
| 225 | + * Set top margin (CSS style, i.e. XXpx or YYpt) |
|
| 226 | + * |
|
| 227 | + * @param string $value |
|
| 228 | + * @return PHPExcel_Comment |
|
| 229 | + */ |
|
| 230 | + public function setMarginTop($value = '1.5pt') { |
|
| 231 | + $this->_marginTop = $value; |
|
| 232 | + return $this; |
|
| 233 | + } |
|
| 234 | 234 | |
| 235 | - /** |
|
| 236 | - * Is the comment visible by default? |
|
| 237 | - * |
|
| 238 | - * @return boolean |
|
| 239 | - */ |
|
| 240 | - public function getVisible() { |
|
| 241 | - return $this->_visible; |
|
| 242 | - } |
|
| 235 | + /** |
|
| 236 | + * Is the comment visible by default? |
|
| 237 | + * |
|
| 238 | + * @return boolean |
|
| 239 | + */ |
|
| 240 | + public function getVisible() { |
|
| 241 | + return $this->_visible; |
|
| 242 | + } |
|
| 243 | 243 | |
| 244 | - /** |
|
| 245 | - * Set comment default visibility |
|
| 246 | - * |
|
| 247 | - * @param boolean $value |
|
| 248 | - * @return PHPExcel_Comment |
|
| 249 | - */ |
|
| 250 | - public function setVisible($value = false) { |
|
| 251 | - $this->_visible = $value; |
|
| 252 | - return $this; |
|
| 253 | - } |
|
| 244 | + /** |
|
| 245 | + * Set comment default visibility |
|
| 246 | + * |
|
| 247 | + * @param boolean $value |
|
| 248 | + * @return PHPExcel_Comment |
|
| 249 | + */ |
|
| 250 | + public function setVisible($value = false) { |
|
| 251 | + $this->_visible = $value; |
|
| 252 | + return $this; |
|
| 253 | + } |
|
| 254 | 254 | |
| 255 | - /** |
|
| 256 | - * Get fill color |
|
| 257 | - * |
|
| 258 | - * @return PHPExcel_Style_Color |
|
| 259 | - */ |
|
| 260 | - public function getFillColor() { |
|
| 261 | - return $this->_fillColor; |
|
| 262 | - } |
|
| 255 | + /** |
|
| 256 | + * Get fill color |
|
| 257 | + * |
|
| 258 | + * @return PHPExcel_Style_Color |
|
| 259 | + */ |
|
| 260 | + public function getFillColor() { |
|
| 261 | + return $this->_fillColor; |
|
| 262 | + } |
|
| 263 | 263 | |
| 264 | - /** |
|
| 265 | - * Set Alignment |
|
| 266 | - * |
|
| 267 | - * @param string $pValue |
|
| 268 | - * @return PHPExcel_Comment |
|
| 269 | - */ |
|
| 270 | - public function setAlignment($pValue = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL) { |
|
| 264 | + /** |
|
| 265 | + * Set Alignment |
|
| 266 | + * |
|
| 267 | + * @param string $pValue |
|
| 268 | + * @return PHPExcel_Comment |
|
| 269 | + */ |
|
| 270 | + public function setAlignment($pValue = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL) { |
|
| 271 | 271 | $this->_alignment = $pValue; |
| 272 | 272 | return $this; |
| 273 | - } |
|
| 273 | + } |
|
| 274 | 274 | |
| 275 | - /** |
|
| 276 | - * Get Alignment |
|
| 277 | - * |
|
| 278 | - * @return string |
|
| 279 | - */ |
|
| 280 | - public function getAlignment() { |
|
| 275 | + /** |
|
| 276 | + * Get Alignment |
|
| 277 | + * |
|
| 278 | + * @return string |
|
| 279 | + */ |
|
| 280 | + public function getAlignment() { |
|
| 281 | 281 | return $this->_alignment; |
| 282 | - } |
|
| 282 | + } |
|
| 283 | 283 | |
| 284 | 284 | /** |
| 285 | 285 | * Get hash code |
@@ -287,19 +287,19 @@ discard block |
||
| 287 | 287 | * @return string Hash code |
| 288 | 288 | */ |
| 289 | 289 | public function getHashCode() { |
| 290 | - return md5( |
|
| 291 | - $this->_author |
|
| 292 | - . $this->_text->getHashCode() |
|
| 293 | - . $this->_width |
|
| 294 | - . $this->_height |
|
| 295 | - . $this->_marginLeft |
|
| 296 | - . $this->_marginTop |
|
| 297 | - . ($this->_visible ? 1 : 0) |
|
| 298 | - . $this->_fillColor->getHashCode() |
|
| 299 | - . $this->_alignment |
|
| 300 | - . __CLASS__ |
|
| 301 | - ); |
|
| 302 | - } |
|
| 290 | + return md5( |
|
| 291 | + $this->_author |
|
| 292 | + . $this->_text->getHashCode() |
|
| 293 | + . $this->_width |
|
| 294 | + . $this->_height |
|
| 295 | + . $this->_marginLeft |
|
| 296 | + . $this->_marginTop |
|
| 297 | + . ($this->_visible ? 1 : 0) |
|
| 298 | + . $this->_fillColor->getHashCode() |
|
| 299 | + . $this->_alignment |
|
| 300 | + . __CLASS__ |
|
| 301 | + ); |
|
| 302 | + } |
|
| 303 | 303 | |
| 304 | 304 | /** |
| 305 | 305 | * Implement PHP __clone to create a deep clone, not just a shallow copy. |
@@ -106,10 +106,10 @@ |
||
| 106 | 106 | public function __construct() |
| 107 | 107 | { |
| 108 | 108 | // Initialise variables |
| 109 | - $this->_author = 'Author'; |
|
| 110 | - $this->_text = new PHPExcel_RichText(); |
|
| 111 | - $this->_fillColor = new PHPExcel_Style_Color('FFFFFFE1'); |
|
| 112 | - $this->_alignment = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL; |
|
| 109 | + $this->_author = 'Author'; |
|
| 110 | + $this->_text = new PHPExcel_RichText(); |
|
| 111 | + $this->_fillColor = new PHPExcel_Style_Color('FFFFFFE1'); |
|
| 112 | + $this->_alignment = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL; |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | /** |
@@ -38,10 +38,10 @@ discard block |
||
| 38 | 38 | /** constants */ |
| 39 | 39 | const PROPERTY_TYPE_BOOLEAN = 'b'; |
| 40 | 40 | const PROPERTY_TYPE_INTEGER = 'i'; |
| 41 | - const PROPERTY_TYPE_FLOAT = 'f'; |
|
| 42 | - const PROPERTY_TYPE_DATE = 'd'; |
|
| 43 | - const PROPERTY_TYPE_STRING = 's'; |
|
| 44 | - const PROPERTY_TYPE_UNKNOWN = 'u'; |
|
| 41 | + const PROPERTY_TYPE_FLOAT = 'f'; |
|
| 42 | + const PROPERTY_TYPE_DATE = 'd'; |
|
| 43 | + const PROPERTY_TYPE_STRING = 's'; |
|
| 44 | + const PROPERTY_TYPE_UNKNOWN = 'u'; |
|
| 45 | 45 | |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | * |
| 50 | 50 | * @var string |
| 51 | 51 | */ |
| 52 | - private $_creator = 'Unknown Creator'; |
|
| 52 | + private $_creator = 'Unknown Creator'; |
|
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | 55 | * LastModifiedBy |
@@ -77,56 +77,56 @@ discard block |
||
| 77 | 77 | * |
| 78 | 78 | * @var string |
| 79 | 79 | */ |
| 80 | - private $_title = 'Untitled Spreadsheet'; |
|
| 80 | + private $_title = 'Untitled Spreadsheet'; |
|
| 81 | 81 | |
| 82 | 82 | /** |
| 83 | 83 | * Description |
| 84 | 84 | * |
| 85 | 85 | * @var string |
| 86 | 86 | */ |
| 87 | - private $_description = ''; |
|
| 87 | + private $_description = ''; |
|
| 88 | 88 | |
| 89 | 89 | /** |
| 90 | 90 | * Subject |
| 91 | 91 | * |
| 92 | 92 | * @var string |
| 93 | 93 | */ |
| 94 | - private $_subject = ''; |
|
| 94 | + private $_subject = ''; |
|
| 95 | 95 | |
| 96 | 96 | /** |
| 97 | 97 | * Keywords |
| 98 | 98 | * |
| 99 | 99 | * @var string |
| 100 | 100 | */ |
| 101 | - private $_keywords = ''; |
|
| 101 | + private $_keywords = ''; |
|
| 102 | 102 | |
| 103 | 103 | /** |
| 104 | 104 | * Category |
| 105 | 105 | * |
| 106 | 106 | * @var string |
| 107 | 107 | */ |
| 108 | - private $_category = ''; |
|
| 108 | + private $_category = ''; |
|
| 109 | 109 | |
| 110 | 110 | /** |
| 111 | 111 | * Manager |
| 112 | 112 | * |
| 113 | 113 | * @var string |
| 114 | 114 | */ |
| 115 | - private $_manager = ''; |
|
| 115 | + private $_manager = ''; |
|
| 116 | 116 | |
| 117 | 117 | /** |
| 118 | 118 | * Company |
| 119 | 119 | * |
| 120 | 120 | * @var string |
| 121 | 121 | */ |
| 122 | - private $_company = 'Microsoft Corporation'; |
|
| 122 | + private $_company = 'Microsoft Corporation'; |
|
| 123 | 123 | |
| 124 | 124 | /** |
| 125 | 125 | * Custom Properties |
| 126 | 126 | * |
| 127 | 127 | * @var string |
| 128 | 128 | */ |
| 129 | - private $_customProperties = array(); |
|
| 129 | + private $_customProperties = array(); |
|
| 130 | 130 | |
| 131 | 131 | |
| 132 | 132 | /** |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | public function __construct() |
| 136 | 136 | { |
| 137 | 137 | // Initialise values |
| 138 | - $this->_lastModifiedBy = $this->_creator; |
|
| 138 | + $this->_lastModifiedBy = $this->_creator; |
|
| 139 | 139 | $this->_created = time(); |
| 140 | 140 | $this->_modified = time(); |
| 141 | 141 | } |
@@ -438,8 +438,8 @@ discard block |
||
| 438 | 438 | * 'b' : Boolean |
| 439 | 439 | * @return PHPExcel_DocumentProperties |
| 440 | 440 | */ |
| 441 | - public function setCustomProperty($propertyName,$propertyValue='',$propertyType=NULL) { |
|
| 442 | - if (($propertyType === NULL) || (!in_array($propertyType,array(self::PROPERTY_TYPE_INTEGER, |
|
| 441 | + public function setCustomProperty($propertyName, $propertyValue = '', $propertyType = NULL) { |
|
| 442 | + if (($propertyType === NULL) || ( ! in_array($propertyType, array(self::PROPERTY_TYPE_INTEGER, |
|
| 443 | 443 | self::PROPERTY_TYPE_FLOAT, |
| 444 | 444 | self::PROPERTY_TYPE_STRING, |
| 445 | 445 | self::PROPERTY_TYPE_DATE, |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | $propertyType = self::PROPERTY_TYPE_STRING; |
| 449 | 449 | } elseif (is_float($propertyValue)) { |
| 450 | 450 | $propertyType = self::PROPERTY_TYPE_FLOAT; |
| 451 | - } elseif(is_int($propertyValue)) { |
|
| 451 | + } elseif (is_int($propertyValue)) { |
|
| 452 | 452 | $propertyType = self::PROPERTY_TYPE_INTEGER; |
| 453 | 453 | } elseif (is_bool($propertyValue)) { |
| 454 | 454 | $propertyType = self::PROPERTY_TYPE_BOOLEAN; |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | } |
| 476 | 476 | } |
| 477 | 477 | |
| 478 | - public static function convertProperty($propertyValue,$propertyType) { |
|
| 478 | + public static function convertProperty($propertyValue, $propertyType) { |
|
| 479 | 479 | switch ($propertyType) { |
| 480 | 480 | case 'empty' : // Empty |
| 481 | 481 | return ''; |
@@ -70,137 +70,137 @@ |
||
| 70 | 70 | */ |
| 71 | 71 | private $_workbookPassword; |
| 72 | 72 | |
| 73 | - /** |
|
| 74 | - * Create a new PHPExcel_DocumentSecurity |
|
| 75 | - */ |
|
| 76 | - public function __construct() |
|
| 77 | - { |
|
| 78 | - // Initialise values |
|
| 79 | - $this->_lockRevision = false; |
|
| 80 | - $this->_lockStructure = false; |
|
| 81 | - $this->_lockWindows = false; |
|
| 82 | - $this->_revisionsPassword = ''; |
|
| 83 | - $this->_workbookPassword = ''; |
|
| 84 | - } |
|
| 85 | - |
|
| 86 | - /** |
|
| 87 | - * Is some sort of dcument security enabled? |
|
| 88 | - * |
|
| 89 | - * @return boolean |
|
| 90 | - */ |
|
| 91 | - function isSecurityEnabled() { |
|
| 92 | - return $this->_lockRevision || |
|
| 93 | - $this->_lockStructure || |
|
| 94 | - $this->_lockWindows; |
|
| 95 | - } |
|
| 96 | - |
|
| 97 | - /** |
|
| 98 | - * Get LockRevision |
|
| 99 | - * |
|
| 100 | - * @return boolean |
|
| 101 | - */ |
|
| 102 | - function getLockRevision() { |
|
| 103 | - return $this->_lockRevision; |
|
| 104 | - } |
|
| 105 | - |
|
| 106 | - /** |
|
| 107 | - * Set LockRevision |
|
| 108 | - * |
|
| 109 | - * @param boolean $pValue |
|
| 110 | - * @return PHPExcel_DocumentSecurity |
|
| 111 | - */ |
|
| 112 | - function setLockRevision($pValue = false) { |
|
| 113 | - $this->_lockRevision = $pValue; |
|
| 114 | - return $this; |
|
| 115 | - } |
|
| 116 | - |
|
| 117 | - /** |
|
| 118 | - * Get LockStructure |
|
| 119 | - * |
|
| 120 | - * @return boolean |
|
| 121 | - */ |
|
| 122 | - function getLockStructure() { |
|
| 123 | - return $this->_lockStructure; |
|
| 124 | - } |
|
| 125 | - |
|
| 126 | - /** |
|
| 127 | - * Set LockStructure |
|
| 128 | - * |
|
| 129 | - * @param boolean $pValue |
|
| 130 | - * @return PHPExcel_DocumentSecurity |
|
| 131 | - */ |
|
| 132 | - function setLockStructure($pValue = false) { |
|
| 73 | + /** |
|
| 74 | + * Create a new PHPExcel_DocumentSecurity |
|
| 75 | + */ |
|
| 76 | + public function __construct() |
|
| 77 | + { |
|
| 78 | + // Initialise values |
|
| 79 | + $this->_lockRevision = false; |
|
| 80 | + $this->_lockStructure = false; |
|
| 81 | + $this->_lockWindows = false; |
|
| 82 | + $this->_revisionsPassword = ''; |
|
| 83 | + $this->_workbookPassword = ''; |
|
| 84 | + } |
|
| 85 | + |
|
| 86 | + /** |
|
| 87 | + * Is some sort of dcument security enabled? |
|
| 88 | + * |
|
| 89 | + * @return boolean |
|
| 90 | + */ |
|
| 91 | + function isSecurityEnabled() { |
|
| 92 | + return $this->_lockRevision || |
|
| 93 | + $this->_lockStructure || |
|
| 94 | + $this->_lockWindows; |
|
| 95 | + } |
|
| 96 | + |
|
| 97 | + /** |
|
| 98 | + * Get LockRevision |
|
| 99 | + * |
|
| 100 | + * @return boolean |
|
| 101 | + */ |
|
| 102 | + function getLockRevision() { |
|
| 103 | + return $this->_lockRevision; |
|
| 104 | + } |
|
| 105 | + |
|
| 106 | + /** |
|
| 107 | + * Set LockRevision |
|
| 108 | + * |
|
| 109 | + * @param boolean $pValue |
|
| 110 | + * @return PHPExcel_DocumentSecurity |
|
| 111 | + */ |
|
| 112 | + function setLockRevision($pValue = false) { |
|
| 113 | + $this->_lockRevision = $pValue; |
|
| 114 | + return $this; |
|
| 115 | + } |
|
| 116 | + |
|
| 117 | + /** |
|
| 118 | + * Get LockStructure |
|
| 119 | + * |
|
| 120 | + * @return boolean |
|
| 121 | + */ |
|
| 122 | + function getLockStructure() { |
|
| 123 | + return $this->_lockStructure; |
|
| 124 | + } |
|
| 125 | + |
|
| 126 | + /** |
|
| 127 | + * Set LockStructure |
|
| 128 | + * |
|
| 129 | + * @param boolean $pValue |
|
| 130 | + * @return PHPExcel_DocumentSecurity |
|
| 131 | + */ |
|
| 132 | + function setLockStructure($pValue = false) { |
|
| 133 | 133 | $this->_lockStructure = $pValue; |
| 134 | 134 | return $this; |
| 135 | - } |
|
| 136 | - |
|
| 137 | - /** |
|
| 138 | - * Get LockWindows |
|
| 139 | - * |
|
| 140 | - * @return boolean |
|
| 141 | - */ |
|
| 142 | - function getLockWindows() { |
|
| 143 | - return $this->_lockWindows; |
|
| 144 | - } |
|
| 145 | - |
|
| 146 | - /** |
|
| 147 | - * Set LockWindows |
|
| 148 | - * |
|
| 149 | - * @param boolean $pValue |
|
| 150 | - * @return PHPExcel_DocumentSecurity |
|
| 151 | - */ |
|
| 152 | - function setLockWindows($pValue = false) { |
|
| 153 | - $this->_lockWindows = $pValue; |
|
| 154 | - return $this; |
|
| 155 | - } |
|
| 156 | - |
|
| 157 | - /** |
|
| 158 | - * Get RevisionsPassword (hashed) |
|
| 159 | - * |
|
| 160 | - * @return string |
|
| 161 | - */ |
|
| 162 | - function getRevisionsPassword() { |
|
| 163 | - return $this->_revisionsPassword; |
|
| 164 | - } |
|
| 165 | - |
|
| 166 | - /** |
|
| 167 | - * Set RevisionsPassword |
|
| 168 | - * |
|
| 169 | - * @param string $pValue |
|
| 170 | - * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true |
|
| 171 | - * @return PHPExcel_DocumentSecurity |
|
| 172 | - */ |
|
| 173 | - function setRevisionsPassword($pValue = '', $pAlreadyHashed = false) { |
|
| 174 | - if (!$pAlreadyHashed) { |
|
| 175 | - $pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue); |
|
| 176 | - } |
|
| 177 | - $this->_revisionsPassword = $pValue; |
|
| 178 | - return $this; |
|
| 179 | - } |
|
| 180 | - |
|
| 181 | - /** |
|
| 182 | - * Get WorkbookPassword (hashed) |
|
| 183 | - * |
|
| 184 | - * @return string |
|
| 185 | - */ |
|
| 186 | - function getWorkbookPassword() { |
|
| 187 | - return $this->_workbookPassword; |
|
| 188 | - } |
|
| 189 | - |
|
| 190 | - /** |
|
| 191 | - * Set WorkbookPassword |
|
| 192 | - * |
|
| 193 | - * @param string $pValue |
|
| 194 | - * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true |
|
| 195 | - * @return PHPExcel_DocumentSecurity |
|
| 196 | - */ |
|
| 197 | - function setWorkbookPassword($pValue = '', $pAlreadyHashed = false) { |
|
| 198 | - if (!$pAlreadyHashed) { |
|
| 199 | - $pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue); |
|
| 200 | - } |
|
| 135 | + } |
|
| 136 | + |
|
| 137 | + /** |
|
| 138 | + * Get LockWindows |
|
| 139 | + * |
|
| 140 | + * @return boolean |
|
| 141 | + */ |
|
| 142 | + function getLockWindows() { |
|
| 143 | + return $this->_lockWindows; |
|
| 144 | + } |
|
| 145 | + |
|
| 146 | + /** |
|
| 147 | + * Set LockWindows |
|
| 148 | + * |
|
| 149 | + * @param boolean $pValue |
|
| 150 | + * @return PHPExcel_DocumentSecurity |
|
| 151 | + */ |
|
| 152 | + function setLockWindows($pValue = false) { |
|
| 153 | + $this->_lockWindows = $pValue; |
|
| 154 | + return $this; |
|
| 155 | + } |
|
| 156 | + |
|
| 157 | + /** |
|
| 158 | + * Get RevisionsPassword (hashed) |
|
| 159 | + * |
|
| 160 | + * @return string |
|
| 161 | + */ |
|
| 162 | + function getRevisionsPassword() { |
|
| 163 | + return $this->_revisionsPassword; |
|
| 164 | + } |
|
| 165 | + |
|
| 166 | + /** |
|
| 167 | + * Set RevisionsPassword |
|
| 168 | + * |
|
| 169 | + * @param string $pValue |
|
| 170 | + * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true |
|
| 171 | + * @return PHPExcel_DocumentSecurity |
|
| 172 | + */ |
|
| 173 | + function setRevisionsPassword($pValue = '', $pAlreadyHashed = false) { |
|
| 174 | + if (!$pAlreadyHashed) { |
|
| 175 | + $pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue); |
|
| 176 | + } |
|
| 177 | + $this->_revisionsPassword = $pValue; |
|
| 178 | + return $this; |
|
| 179 | + } |
|
| 180 | + |
|
| 181 | + /** |
|
| 182 | + * Get WorkbookPassword (hashed) |
|
| 183 | + * |
|
| 184 | + * @return string |
|
| 185 | + */ |
|
| 186 | + function getWorkbookPassword() { |
|
| 187 | + return $this->_workbookPassword; |
|
| 188 | + } |
|
| 189 | + |
|
| 190 | + /** |
|
| 191 | + * Set WorkbookPassword |
|
| 192 | + * |
|
| 193 | + * @param string $pValue |
|
| 194 | + * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true |
|
| 195 | + * @return PHPExcel_DocumentSecurity |
|
| 196 | + */ |
|
| 197 | + function setWorkbookPassword($pValue = '', $pAlreadyHashed = false) { |
|
| 198 | + if (!$pAlreadyHashed) { |
|
| 199 | + $pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue); |
|
| 200 | + } |
|
| 201 | 201 | $this->_workbookPassword = $pValue; |
| 202 | 202 | return $this; |
| 203 | - } |
|
| 203 | + } |
|
| 204 | 204 | |
| 205 | 205 | /** |
| 206 | 206 | * Implement PHP __clone to create a deep clone, not just a shallow copy. |
@@ -77,10 +77,10 @@ discard block |
||
| 77 | 77 | { |
| 78 | 78 | // Initialise values |
| 79 | 79 | $this->_lockRevision = false; |
| 80 | - $this->_lockStructure = false; |
|
| 80 | + $this->_lockStructure = false; |
|
| 81 | 81 | $this->_lockWindows = false; |
| 82 | - $this->_revisionsPassword = ''; |
|
| 83 | - $this->_workbookPassword = ''; |
|
| 82 | + $this->_revisionsPassword = ''; |
|
| 83 | + $this->_workbookPassword = ''; |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | * @return PHPExcel_DocumentSecurity |
| 172 | 172 | */ |
| 173 | 173 | function setRevisionsPassword($pValue = '', $pAlreadyHashed = false) { |
| 174 | - if (!$pAlreadyHashed) { |
|
| 174 | + if ( ! $pAlreadyHashed) { |
|
| 175 | 175 | $pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue); |
| 176 | 176 | } |
| 177 | 177 | $this->_revisionsPassword = $pValue; |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | * @return PHPExcel_DocumentSecurity |
| 196 | 196 | */ |
| 197 | 197 | function setWorkbookPassword($pValue = '', $pAlreadyHashed = false) { |
| 198 | - if (!$pAlreadyHashed) { |
|
| 198 | + if ( ! $pAlreadyHashed) { |
|
| 199 | 199 | $pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue); |
| 200 | 200 | } |
| 201 | 201 | $this->_workbookPassword = $pValue; |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | // Check if an array was passed |
| 74 | 74 | if ($pSource == null) { |
| 75 | 75 | return; |
| 76 | - } else if (!is_array($pSource)) { |
|
| 76 | + } else if ( ! is_array($pSource)) { |
|
| 77 | 77 | throw new Exception('Invalid array parameter passed.'); |
| 78 | 78 | } |
| 79 | 79 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | */ |
| 91 | 91 | public function add(PHPExcel_IComparable $pSource = null) { |
| 92 | 92 | $hash = $pSource->getHashCode(); |
| 93 | - if (!isset($this->_items[$hash])) { |
|
| 93 | + if ( ! isset($this->_items[$hash])) { |
|
| 94 | 94 | $this->_items[$hash] = $pSource; |
| 95 | 95 | $this->_keyMap[count($this->_items) - 1] = $hash; |
| 96 | 96 | } |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | */ |
| 159 | 159 | public function getByIndex($pIndex = 0) { |
| 160 | 160 | if (isset($this->_keyMap[$pIndex])) { |
| 161 | - return $this->getByHashCode( $this->_keyMap[$pIndex] ); |
|
| 161 | + return $this->getByHashCode($this->_keyMap[$pIndex]); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | return null; |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | // Set local members |
| 90 | - $this->_name = $pName; |
|
| 90 | + $this->_name = $pName; |
|
| 91 | 91 | $this->_worksheet = $pWorksheet; |
| 92 | 92 | $this->_range = $pRange; |
| 93 | 93 | $this->_localOnly = $pLocalOnly; |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | |
| 118 | 118 | // Re-attach |
| 119 | 119 | if ($this->_worksheet !== NULL) { |
| 120 | - $this->_worksheet->getParent()->removeNamedRange($this->_name,$this->_worksheet); |
|
| 120 | + $this->_worksheet->getParent()->removeNamedRange($this->_name, $this->_worksheet); |
|
| 121 | 121 | } |
| 122 | 122 | $this->_name = $value; |
| 123 | 123 | |
@@ -70,164 +70,164 @@ |
||
| 70 | 70 | */ |
| 71 | 71 | private $_scope; |
| 72 | 72 | |
| 73 | - /** |
|
| 74 | - * Create a new NamedRange |
|
| 75 | - * |
|
| 76 | - * @param string $pName |
|
| 77 | - * @param PHPExcel_Worksheet $pWorksheet |
|
| 78 | - * @param string $pRange |
|
| 79 | - * @param bool $pLocalOnly |
|
| 80 | - * @param PHPExcel_Worksheet|null $pScope Scope. Only applies when $pLocalOnly = true. Null for global scope. |
|
| 81 | - */ |
|
| 82 | - public function __construct($pName = null, PHPExcel_Worksheet $pWorksheet, $pRange = 'A1', $pLocalOnly = false, $pScope = null) |
|
| 83 | - { |
|
| 84 | - // Validate data |
|
| 85 | - if (($pName === NULL) || ($pWorksheet === NULL) || ($pRange === NULL)) { |
|
| 86 | - throw new Exception('Parameters can not be null.'); |
|
| 87 | - } |
|
| 88 | - |
|
| 89 | - // Set local members |
|
| 90 | - $this->_name = $pName; |
|
| 91 | - $this->_worksheet = $pWorksheet; |
|
| 92 | - $this->_range = $pRange; |
|
| 93 | - $this->_localOnly = $pLocalOnly; |
|
| 94 | - $this->_scope = ($pLocalOnly == true) ? |
|
| 73 | + /** |
|
| 74 | + * Create a new NamedRange |
|
| 75 | + * |
|
| 76 | + * @param string $pName |
|
| 77 | + * @param PHPExcel_Worksheet $pWorksheet |
|
| 78 | + * @param string $pRange |
|
| 79 | + * @param bool $pLocalOnly |
|
| 80 | + * @param PHPExcel_Worksheet|null $pScope Scope. Only applies when $pLocalOnly = true. Null for global scope. |
|
| 81 | + */ |
|
| 82 | + public function __construct($pName = null, PHPExcel_Worksheet $pWorksheet, $pRange = 'A1', $pLocalOnly = false, $pScope = null) |
|
| 83 | + { |
|
| 84 | + // Validate data |
|
| 85 | + if (($pName === NULL) || ($pWorksheet === NULL) || ($pRange === NULL)) { |
|
| 86 | + throw new Exception('Parameters can not be null.'); |
|
| 87 | + } |
|
| 88 | + |
|
| 89 | + // Set local members |
|
| 90 | + $this->_name = $pName; |
|
| 91 | + $this->_worksheet = $pWorksheet; |
|
| 92 | + $this->_range = $pRange; |
|
| 93 | + $this->_localOnly = $pLocalOnly; |
|
| 94 | + $this->_scope = ($pLocalOnly == true) ? |
|
| 95 | 95 | (($pScope == null) ? $pWorksheet : $pScope) : null; |
| 96 | - } |
|
| 97 | - |
|
| 98 | - /** |
|
| 99 | - * Get name |
|
| 100 | - * |
|
| 101 | - * @return string |
|
| 102 | - */ |
|
| 103 | - public function getName() { |
|
| 104 | - return $this->_name; |
|
| 105 | - } |
|
| 106 | - |
|
| 107 | - /** |
|
| 108 | - * Set name |
|
| 109 | - * |
|
| 110 | - * @param string $value |
|
| 111 | - * @return PHPExcel_NamedRange |
|
| 112 | - */ |
|
| 113 | - public function setName($value = null) { |
|
| 114 | - if ($value !== NULL) { |
|
| 115 | - // Old title |
|
| 116 | - $oldTitle = $this->_name; |
|
| 117 | - |
|
| 118 | - // Re-attach |
|
| 119 | - if ($this->_worksheet !== NULL) { |
|
| 120 | - $this->_worksheet->getParent()->removeNamedRange($this->_name,$this->_worksheet); |
|
| 121 | - } |
|
| 122 | - $this->_name = $value; |
|
| 123 | - |
|
| 124 | - if ($this->_worksheet !== NULL) { |
|
| 125 | - $this->_worksheet->getParent()->addNamedRange($this); |
|
| 126 | - } |
|
| 127 | - |
|
| 128 | - // New title |
|
| 129 | - $newTitle = $this->_name; |
|
| 130 | - PHPExcel_ReferenceHelper::getInstance()->updateNamedFormulas($this->_worksheet->getParent(), $oldTitle, $newTitle); |
|
| 131 | - } |
|
| 132 | - return $this; |
|
| 133 | - } |
|
| 134 | - |
|
| 135 | - /** |
|
| 136 | - * Get worksheet |
|
| 137 | - * |
|
| 138 | - * @return PHPExcel_Worksheet |
|
| 139 | - */ |
|
| 140 | - public function getWorksheet() { |
|
| 141 | - return $this->_worksheet; |
|
| 142 | - } |
|
| 143 | - |
|
| 144 | - /** |
|
| 145 | - * Set worksheet |
|
| 146 | - * |
|
| 147 | - * @param PHPExcel_Worksheet $value |
|
| 148 | - * @return PHPExcel_NamedRange |
|
| 149 | - */ |
|
| 150 | - public function setWorksheet(PHPExcel_Worksheet $value = null) { |
|
| 151 | - if ($value !== NULL) { |
|
| 152 | - $this->_worksheet = $value; |
|
| 153 | - } |
|
| 154 | - return $this; |
|
| 155 | - } |
|
| 156 | - |
|
| 157 | - /** |
|
| 158 | - * Get range |
|
| 159 | - * |
|
| 160 | - * @return string |
|
| 161 | - */ |
|
| 162 | - public function getRange() { |
|
| 163 | - return $this->_range; |
|
| 164 | - } |
|
| 165 | - |
|
| 166 | - /** |
|
| 167 | - * Set range |
|
| 168 | - * |
|
| 169 | - * @param string $value |
|
| 170 | - * @return PHPExcel_NamedRange |
|
| 171 | - */ |
|
| 172 | - public function setRange($value = null) { |
|
| 173 | - if ($value !== NULL) { |
|
| 174 | - $this->_range = $value; |
|
| 175 | - } |
|
| 176 | - return $this; |
|
| 177 | - } |
|
| 178 | - |
|
| 179 | - /** |
|
| 180 | - * Get localOnly |
|
| 181 | - * |
|
| 182 | - * @return bool |
|
| 183 | - */ |
|
| 184 | - public function getLocalOnly() { |
|
| 185 | - return $this->_localOnly; |
|
| 186 | - } |
|
| 187 | - |
|
| 188 | - /** |
|
| 189 | - * Set localOnly |
|
| 190 | - * |
|
| 191 | - * @param bool $value |
|
| 192 | - * @return PHPExcel_NamedRange |
|
| 193 | - */ |
|
| 194 | - public function setLocalOnly($value = false) { |
|
| 195 | - $this->_localOnly = $value; |
|
| 196 | - $this->_scope = $value ? $this->_worksheet : null; |
|
| 197 | - return $this; |
|
| 198 | - } |
|
| 199 | - |
|
| 200 | - /** |
|
| 201 | - * Get scope |
|
| 202 | - * |
|
| 203 | - * @return PHPExcel_Worksheet|null |
|
| 204 | - */ |
|
| 205 | - public function getScope() { |
|
| 206 | - return $this->_scope; |
|
| 207 | - } |
|
| 208 | - |
|
| 209 | - /** |
|
| 210 | - * Set scope |
|
| 211 | - * |
|
| 212 | - * @param PHPExcel_Worksheet|null $value |
|
| 213 | - * @return PHPExcel_NamedRange |
|
| 214 | - */ |
|
| 215 | - public function setScope(PHPExcel_Worksheet $value = null) { |
|
| 216 | - $this->_scope = $value; |
|
| 217 | - $this->_localOnly = ($value == null) ? false : true; |
|
| 218 | - return $this; |
|
| 219 | - } |
|
| 220 | - |
|
| 221 | - /** |
|
| 222 | - * Resolve a named range to a regular cell range |
|
| 223 | - * |
|
| 224 | - * @param string $pNamedRange Named range |
|
| 225 | - * @param PHPExcel_Worksheet|null $pSheet Scope. Use null for global scope |
|
| 226 | - * @return PHPExcel_NamedRange |
|
| 227 | - */ |
|
| 228 | - public static function resolveRange($pNamedRange = '', PHPExcel_Worksheet $pSheet) { |
|
| 96 | + } |
|
| 97 | + |
|
| 98 | + /** |
|
| 99 | + * Get name |
|
| 100 | + * |
|
| 101 | + * @return string |
|
| 102 | + */ |
|
| 103 | + public function getName() { |
|
| 104 | + return $this->_name; |
|
| 105 | + } |
|
| 106 | + |
|
| 107 | + /** |
|
| 108 | + * Set name |
|
| 109 | + * |
|
| 110 | + * @param string $value |
|
| 111 | + * @return PHPExcel_NamedRange |
|
| 112 | + */ |
|
| 113 | + public function setName($value = null) { |
|
| 114 | + if ($value !== NULL) { |
|
| 115 | + // Old title |
|
| 116 | + $oldTitle = $this->_name; |
|
| 117 | + |
|
| 118 | + // Re-attach |
|
| 119 | + if ($this->_worksheet !== NULL) { |
|
| 120 | + $this->_worksheet->getParent()->removeNamedRange($this->_name,$this->_worksheet); |
|
| 121 | + } |
|
| 122 | + $this->_name = $value; |
|
| 123 | + |
|
| 124 | + if ($this->_worksheet !== NULL) { |
|
| 125 | + $this->_worksheet->getParent()->addNamedRange($this); |
|
| 126 | + } |
|
| 127 | + |
|
| 128 | + // New title |
|
| 129 | + $newTitle = $this->_name; |
|
| 130 | + PHPExcel_ReferenceHelper::getInstance()->updateNamedFormulas($this->_worksheet->getParent(), $oldTitle, $newTitle); |
|
| 131 | + } |
|
| 132 | + return $this; |
|
| 133 | + } |
|
| 134 | + |
|
| 135 | + /** |
|
| 136 | + * Get worksheet |
|
| 137 | + * |
|
| 138 | + * @return PHPExcel_Worksheet |
|
| 139 | + */ |
|
| 140 | + public function getWorksheet() { |
|
| 141 | + return $this->_worksheet; |
|
| 142 | + } |
|
| 143 | + |
|
| 144 | + /** |
|
| 145 | + * Set worksheet |
|
| 146 | + * |
|
| 147 | + * @param PHPExcel_Worksheet $value |
|
| 148 | + * @return PHPExcel_NamedRange |
|
| 149 | + */ |
|
| 150 | + public function setWorksheet(PHPExcel_Worksheet $value = null) { |
|
| 151 | + if ($value !== NULL) { |
|
| 152 | + $this->_worksheet = $value; |
|
| 153 | + } |
|
| 154 | + return $this; |
|
| 155 | + } |
|
| 156 | + |
|
| 157 | + /** |
|
| 158 | + * Get range |
|
| 159 | + * |
|
| 160 | + * @return string |
|
| 161 | + */ |
|
| 162 | + public function getRange() { |
|
| 163 | + return $this->_range; |
|
| 164 | + } |
|
| 165 | + |
|
| 166 | + /** |
|
| 167 | + * Set range |
|
| 168 | + * |
|
| 169 | + * @param string $value |
|
| 170 | + * @return PHPExcel_NamedRange |
|
| 171 | + */ |
|
| 172 | + public function setRange($value = null) { |
|
| 173 | + if ($value !== NULL) { |
|
| 174 | + $this->_range = $value; |
|
| 175 | + } |
|
| 176 | + return $this; |
|
| 177 | + } |
|
| 178 | + |
|
| 179 | + /** |
|
| 180 | + * Get localOnly |
|
| 181 | + * |
|
| 182 | + * @return bool |
|
| 183 | + */ |
|
| 184 | + public function getLocalOnly() { |
|
| 185 | + return $this->_localOnly; |
|
| 186 | + } |
|
| 187 | + |
|
| 188 | + /** |
|
| 189 | + * Set localOnly |
|
| 190 | + * |
|
| 191 | + * @param bool $value |
|
| 192 | + * @return PHPExcel_NamedRange |
|
| 193 | + */ |
|
| 194 | + public function setLocalOnly($value = false) { |
|
| 195 | + $this->_localOnly = $value; |
|
| 196 | + $this->_scope = $value ? $this->_worksheet : null; |
|
| 197 | + return $this; |
|
| 198 | + } |
|
| 199 | + |
|
| 200 | + /** |
|
| 201 | + * Get scope |
|
| 202 | + * |
|
| 203 | + * @return PHPExcel_Worksheet|null |
|
| 204 | + */ |
|
| 205 | + public function getScope() { |
|
| 206 | + return $this->_scope; |
|
| 207 | + } |
|
| 208 | + |
|
| 209 | + /** |
|
| 210 | + * Set scope |
|
| 211 | + * |
|
| 212 | + * @param PHPExcel_Worksheet|null $value |
|
| 213 | + * @return PHPExcel_NamedRange |
|
| 214 | + */ |
|
| 215 | + public function setScope(PHPExcel_Worksheet $value = null) { |
|
| 216 | + $this->_scope = $value; |
|
| 217 | + $this->_localOnly = ($value == null) ? false : true; |
|
| 218 | + return $this; |
|
| 219 | + } |
|
| 220 | + |
|
| 221 | + /** |
|
| 222 | + * Resolve a named range to a regular cell range |
|
| 223 | + * |
|
| 224 | + * @param string $pNamedRange Named range |
|
| 225 | + * @param PHPExcel_Worksheet|null $pSheet Scope. Use null for global scope |
|
| 226 | + * @return PHPExcel_NamedRange |
|
| 227 | + */ |
|
| 228 | + public static function resolveRange($pNamedRange = '', PHPExcel_Worksheet $pSheet) { |
|
| 229 | 229 | return $pSheet->getParent()->getNamedRange($pNamedRange, $pSheet); |
| 230 | - } |
|
| 230 | + } |
|
| 231 | 231 | |
| 232 | 232 | /** |
| 233 | 233 | * Implement PHP __clone to create a deep clone, not just a shallow copy. |
@@ -222,7 +222,7 @@ |
||
| 222 | 222 | * Resolve a named range to a regular cell range |
| 223 | 223 | * |
| 224 | 224 | * @param string $pNamedRange Named range |
| 225 | - * @param PHPExcel_Worksheet|null $pSheet Scope. Use null for global scope |
|
| 225 | + * @param PHPExcel_Worksheet $pSheet Scope. Use null for global scope |
|
| 226 | 226 | * @return PHPExcel_NamedRange |
| 227 | 227 | */ |
| 228 | 228 | public static function resolveRange($pNamedRange = '', PHPExcel_Worksheet $pSheet) { |
@@ -27,12 +27,12 @@ |
||
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | /** PHPExcel root directory */ |
| 30 | -if (!defined('PHPEXCEL_ROOT')) { |
|
| 30 | +if ( ! defined('PHPEXCEL_ROOT')) { |
|
| 31 | 31 | /** |
| 32 | 32 | * @ignore |
| 33 | 33 | */ |
| 34 | - define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../'); |
|
| 35 | - require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); |
|
| 34 | + define('PHPEXCEL_ROOT', dirname(__FILE__).'/../../'); |
|
| 35 | + require(PHPEXCEL_ROOT.'PHPExcel/Autoloader.php'); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -65,17 +65,17 @@ discard block |
||
| 65 | 65 | private $_colourMap; |
| 66 | 66 | |
| 67 | 67 | |
| 68 | - /** |
|
| 69 | - * Create a new PHPExcel_Theme |
|
| 68 | + /** |
|
| 69 | + * Create a new PHPExcel_Theme |
|
| 70 | 70 | * |
| 71 | - */ |
|
| 72 | - public function __construct($themeName,$colourSchemeName,$colourMap) |
|
| 73 | - { |
|
| 71 | + */ |
|
| 72 | + public function __construct($themeName,$colourSchemeName,$colourMap) |
|
| 73 | + { |
|
| 74 | 74 | // Initialise values |
| 75 | - $this->_themeName = $themeName; |
|
| 75 | + $this->_themeName = $themeName; |
|
| 76 | 76 | $this->_colourSchemeName = $colourSchemeName; |
| 77 | 77 | $this->_colourMap = $colourMap; |
| 78 | - } |
|
| 78 | + } |
|
| 79 | 79 | |
| 80 | 80 | /** |
| 81 | 81 | * Get Theme Name |
@@ -87,26 +87,26 @@ discard block |
||
| 87 | 87 | return $this->_themeName; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - /** |
|
| 91 | - * Get colour Scheme Name |
|
| 92 | - * |
|
| 93 | - * @return string |
|
| 94 | - */ |
|
| 95 | - public function getColourSchemeName() { |
|
| 90 | + /** |
|
| 91 | + * Get colour Scheme Name |
|
| 92 | + * |
|
| 93 | + * @return string |
|
| 94 | + */ |
|
| 95 | + public function getColourSchemeName() { |
|
| 96 | 96 | return $this->_colourSchemeName; |
| 97 | - } |
|
| 97 | + } |
|
| 98 | 98 | |
| 99 | - /** |
|
| 100 | - * Get colour Map Value by Position |
|
| 101 | - * |
|
| 102 | - * @return string |
|
| 103 | - */ |
|
| 104 | - public function getColourByIndex($index=0) { |
|
| 105 | - if (isset($this->_colourMap[$index])) { |
|
| 99 | + /** |
|
| 100 | + * Get colour Map Value by Position |
|
| 101 | + * |
|
| 102 | + * @return string |
|
| 103 | + */ |
|
| 104 | + public function getColourByIndex($index=0) { |
|
| 105 | + if (isset($this->_colourMap[$index])) { |
|
| 106 | 106 | return $this->_colourMap[$index]; |
| 107 | 107 | } |
| 108 | 108 | return null; |
| 109 | - } |
|
| 109 | + } |
|
| 110 | 110 | |
| 111 | 111 | /** |
| 112 | 112 | * Implement PHP __clone to create a deep clone, not just a shallow copy. |
@@ -69,12 +69,12 @@ discard block |
||
| 69 | 69 | * Create a new PHPExcel_Theme |
| 70 | 70 | * |
| 71 | 71 | */ |
| 72 | - public function __construct($themeName,$colourSchemeName,$colourMap) |
|
| 72 | + public function __construct($themeName, $colourSchemeName, $colourMap) |
|
| 73 | 73 | { |
| 74 | 74 | // Initialise values |
| 75 | - $this->_themeName = $themeName; |
|
| 76 | - $this->_colourSchemeName = $colourSchemeName; |
|
| 77 | - $this->_colourMap = $colourMap; |
|
| 75 | + $this->_themeName = $themeName; |
|
| 76 | + $this->_colourSchemeName = $colourSchemeName; |
|
| 77 | + $this->_colourMap = $colourMap; |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | /** |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | * |
| 102 | 102 | * @return string |
| 103 | 103 | */ |
| 104 | - public function getColourByIndex($index=0) { |
|
| 104 | + public function getColourByIndex($index = 0) { |
|
| 105 | 105 | if (isset($this->_colourMap[$index])) { |
| 106 | 106 | return $this->_colourMap[$index]; |
| 107 | 107 | } |
@@ -34,24 +34,24 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | class PHPExcel_Reader_Excel5_Escher |
| 36 | 36 | { |
| 37 | - const DGGCONTAINER = 0xF000; |
|
| 38 | - const BSTORECONTAINER = 0xF001; |
|
| 37 | + const DGGCONTAINER = 0xF000; |
|
| 38 | + const BSTORECONTAINER = 0xF001; |
|
| 39 | 39 | const DGCONTAINER = 0xF002; |
| 40 | - const SPGRCONTAINER = 0xF003; |
|
| 40 | + const SPGRCONTAINER = 0xF003; |
|
| 41 | 41 | const SPCONTAINER = 0xF004; |
| 42 | 42 | const DGG = 0xF006; |
| 43 | 43 | const BSE = 0xF007; |
| 44 | 44 | const DG = 0xF008; |
| 45 | - const SPGR = 0xF009; |
|
| 45 | + const SPGR = 0xF009; |
|
| 46 | 46 | const SP = 0xF00A; |
| 47 | - const OPT = 0xF00B; |
|
| 48 | - const CLIENTTEXTBOX = 0xF00D; |
|
| 49 | - const CLIENTANCHOR = 0xF010; |
|
| 50 | - const CLIENTDATA = 0xF011; |
|
| 51 | - const BLIPJPEG = 0xF01D; |
|
| 52 | - const BLIPPNG = 0xF01E; |
|
| 53 | - const SPLITMENUCOLORS = 0xF11E; |
|
| 54 | - const TERTIARYOPT = 0xF122; |
|
| 47 | + const OPT = 0xF00B; |
|
| 48 | + const CLIENTTEXTBOX = 0xF00D; |
|
| 49 | + const CLIENTANCHOR = 0xF010; |
|
| 50 | + const CLIENTDATA = 0xF011; |
|
| 51 | + const BLIPJPEG = 0xF01D; |
|
| 52 | + const BLIPPNG = 0xF01E; |
|
| 53 | + const SPLITMENUCOLORS = 0xF11E; |
|
| 54 | + const TERTIARYOPT = 0xF122; |
|
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | 57 | * Escher stream data (binary) |
@@ -112,25 +112,25 @@ discard block |
||
| 112 | 112 | $fbt = PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos + 2); |
| 113 | 113 | |
| 114 | 114 | switch ($fbt) { |
| 115 | - case self::DGGCONTAINER: $this->_readDggContainer(); break; |
|
| 116 | - case self::DGG: $this->_readDgg(); break; |
|
| 117 | - case self::BSTORECONTAINER: $this->_readBstoreContainer(); break; |
|
| 118 | - case self::BSE: $this->_readBSE(); break; |
|
| 119 | - case self::BLIPJPEG: $this->_readBlipJPEG(); break; |
|
| 120 | - case self::BLIPPNG: $this->_readBlipPNG(); break; |
|
| 121 | - case self::OPT: $this->_readOPT(); break; |
|
| 122 | - case self::TERTIARYOPT: $this->_readTertiaryOPT(); break; |
|
| 123 | - case self::SPLITMENUCOLORS: $this->_readSplitMenuColors(); break; |
|
| 124 | - case self::DGCONTAINER: $this->_readDgContainer(); break; |
|
| 125 | - case self::DG: $this->_readDg(); break; |
|
| 126 | - case self::SPGRCONTAINER: $this->_readSpgrContainer(); break; |
|
| 127 | - case self::SPCONTAINER: $this->_readSpContainer(); break; |
|
| 128 | - case self::SPGR: $this->_readSpgr(); break; |
|
| 129 | - case self::SP: $this->_readSp(); break; |
|
| 130 | - case self::CLIENTTEXTBOX: $this->_readClientTextbox(); break; |
|
| 131 | - case self::CLIENTANCHOR: $this->_readClientAnchor(); break; |
|
| 132 | - case self::CLIENTDATA: $this->_readClientData(); break; |
|
| 133 | - default: $this->_readDefault(); break; |
|
| 115 | + case self::DGGCONTAINER: $this->_readDggContainer(); break; |
|
| 116 | + case self::DGG: $this->_readDgg(); break; |
|
| 117 | + case self::BSTORECONTAINER: $this->_readBstoreContainer(); break; |
|
| 118 | + case self::BSE: $this->_readBSE(); break; |
|
| 119 | + case self::BLIPJPEG: $this->_readBlipJPEG(); break; |
|
| 120 | + case self::BLIPPNG: $this->_readBlipPNG(); break; |
|
| 121 | + case self::OPT: $this->_readOPT(); break; |
|
| 122 | + case self::TERTIARYOPT: $this->_readTertiaryOPT(); break; |
|
| 123 | + case self::SPLITMENUCOLORS: $this->_readSplitMenuColors(); break; |
|
| 124 | + case self::DGCONTAINER: $this->_readDgContainer(); break; |
|
| 125 | + case self::DG: $this->_readDg(); break; |
|
| 126 | + case self::SPGRCONTAINER: $this->_readSpgrContainer(); break; |
|
| 127 | + case self::SPCONTAINER: $this->_readSpContainer(); break; |
|
| 128 | + case self::SPGR: $this->_readSpgr(); break; |
|
| 129 | + case self::SP: $this->_readSp(); break; |
|
| 130 | + case self::CLIENTTEXTBOX: $this->_readClientTextbox(); break; |
|
| 131 | + case self::CLIENTANCHOR: $this->_readClientAnchor(); break; |
|
| 132 | + case self::CLIENTDATA: $this->_readClientData(); break; |
|
| 133 | + default: $this->_readDefault(); break; |
|
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | |
@@ -562,7 +562,7 @@ discard block |
||
| 562 | 562 | $endOffsetY = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 16); |
| 563 | 563 | |
| 564 | 564 | // set the start coordinates |
| 565 | - $this->_object->setStartCoordinates(PHPExcel_Cell::stringFromColumnIndex($c1) . ($r1 + 1)); |
|
| 565 | + $this->_object->setStartCoordinates(PHPExcel_Cell::stringFromColumnIndex($c1).($r1 + 1)); |
|
| 566 | 566 | |
| 567 | 567 | // set the start offsetX |
| 568 | 568 | $this->_object->setStartOffsetX($startOffsetX); |
@@ -571,7 +571,7 @@ discard block |
||
| 571 | 571 | $this->_object->setStartOffsetY($startOffsetY); |
| 572 | 572 | |
| 573 | 573 | // set the end coordinates |
| 574 | - $this->_object->setEndCoordinates(PHPExcel_Cell::stringFromColumnIndex($c2) . ($r2 + 1)); |
|
| 574 | + $this->_object->setEndCoordinates(PHPExcel_Cell::stringFromColumnIndex($c2).($r2 + 1)); |
|
| 575 | 575 | |
| 576 | 576 | // set the end offsetX |
| 577 | 577 | $this->_object->setEndOffsetX($endOffsetX); |
@@ -27,12 +27,12 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | /** PHPExcel root directory */ |
| 30 | -if (!defined('PHPEXCEL_ROOT')) { |
|
| 30 | +if ( ! defined('PHPEXCEL_ROOT')) { |
|
| 31 | 31 | /** |
| 32 | 32 | * @ignore |
| 33 | 33 | */ |
| 34 | - define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../'); |
|
| 35 | - require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); |
|
| 34 | + define('PHPEXCEL_ROOT', dirname(__FILE__).'/../../'); |
|
| 35 | + require(PHPEXCEL_ROOT.'PHPExcel/Autoloader.php'); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * Create a new PHPExcel_Reader_OOCalc |
| 81 | 81 | */ |
| 82 | 82 | public function __construct() { |
| 83 | - $this->_readFilter = new PHPExcel_Reader_DefaultReadFilter(); |
|
| 83 | + $this->_readFilter = new PHPExcel_Reader_DefaultReadFilter(); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | |
@@ -185,12 +185,12 @@ discard block |
||
| 185 | 185 | public function canRead($pFilename) |
| 186 | 186 | { |
| 187 | 187 | // Check if file exists |
| 188 | - if (!file_exists($pFilename)) { |
|
| 189 | - throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); |
|
| 188 | + if ( ! file_exists($pFilename)) { |
|
| 189 | + throw new Exception("Could not open ".$pFilename." for reading! File does not exist."); |
|
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | // Check if zip class exists |
| 193 | - if (!class_exists('ZipArchive')) { |
|
| 193 | + if ( ! class_exists('ZipArchive')) { |
|
| 194 | 194 | throw new Exception("ZipArchive library is not enabled"); |
| 195 | 195 | } |
| 196 | 196 | |
@@ -218,8 +218,8 @@ discard block |
||
| 218 | 218 | public function listWorksheetNames($pFilename) |
| 219 | 219 | { |
| 220 | 220 | // Check if file exists |
| 221 | - if (!file_exists($pFilename)) { |
|
| 222 | - throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); |
|
| 221 | + if ( ! file_exists($pFilename)) { |
|
| 222 | + throw new Exception("Could not open ".$pFilename." for reading! File does not exist."); |
|
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | $worksheetNames = array(); |
@@ -231,9 +231,9 @@ discard block |
||
| 231 | 231 | $namespacesContent = $xml->getNamespaces(true); |
| 232 | 232 | |
| 233 | 233 | $workbook = $xml->children($namespacesContent['office']); |
| 234 | - foreach($workbook->body->spreadsheet as $workbookData) { |
|
| 234 | + foreach ($workbook->body->spreadsheet as $workbookData) { |
|
| 235 | 235 | $workbookData = $workbookData->children($namespacesContent['table']); |
| 236 | - foreach($workbookData->table as $worksheetDataSet) { |
|
| 236 | + foreach ($workbookData->table as $worksheetDataSet) { |
|
| 237 | 237 | $worksheetDataAttributes = $worksheetDataSet->attributes($namespacesContent['table']); |
| 238 | 238 | |
| 239 | 239 | $worksheetNames[] = $worksheetDataAttributes['name']; |
@@ -262,9 +262,9 @@ discard block |
||
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | |
| 265 | - private static function identifyFixedStyleValue($styleList,&$styleAttributeValue) { |
|
| 265 | + private static function identifyFixedStyleValue($styleList, &$styleAttributeValue) { |
|
| 266 | 266 | $styleAttributeValue = strtolower($styleAttributeValue); |
| 267 | - foreach($styleList as $style) { |
|
| 267 | + foreach ($styleList as $style) { |
|
| 268 | 268 | if ($styleAttributeValue == strtolower($style)) { |
| 269 | 269 | $styleAttributeValue = $style; |
| 270 | 270 | return true; |
@@ -283,8 +283,8 @@ discard block |
||
| 283 | 283 | public function listWorksheetInfo($pFilename) |
| 284 | 284 | { |
| 285 | 285 | // Check if file exists |
| 286 | - if (!file_exists($pFilename)) { |
|
| 287 | - throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); |
|
| 286 | + if ( ! file_exists($pFilename)) { |
|
| 287 | + throw new Exception("Could not open ".$pFilename." for reading! File does not exist."); |
|
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | $worksheetInfo = array(); |
@@ -296,9 +296,9 @@ discard block |
||
| 296 | 296 | $namespacesContent = $xml->getNamespaces(true); |
| 297 | 297 | |
| 298 | 298 | $workbook = $xml->children($namespacesContent['office']); |
| 299 | - foreach($workbook->body->spreadsheet as $workbookData) { |
|
| 299 | + foreach ($workbook->body->spreadsheet as $workbookData) { |
|
| 300 | 300 | $workbookData = $workbookData->children($namespacesContent['table']); |
| 301 | - foreach($workbookData->table as $worksheetDataSet) { |
|
| 301 | + foreach ($workbookData->table as $worksheetDataSet) { |
|
| 302 | 302 | $worksheetData = $worksheetDataSet->children($namespacesContent['table']); |
| 303 | 303 | $worksheetDataAttributes = $worksheetDataSet->attributes($namespacesContent['table']); |
| 304 | 304 | |
@@ -375,8 +375,8 @@ discard block |
||
| 375 | 375 | public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel) |
| 376 | 376 | { |
| 377 | 377 | // Check if file exists |
| 378 | - if (!file_exists($pFilename)) { |
|
| 379 | - throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); |
|
| 378 | + if ( ! file_exists($pFilename)) { |
|
| 379 | + throw new Exception("Could not open ".$pFilename." for reading! File does not exist."); |
|
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | $timezoneObj = new DateTimeZone('Europe/London'); |
@@ -393,12 +393,12 @@ discard block |
||
| 393 | 393 | |
| 394 | 394 | $docProps = $objPHPExcel->getProperties(); |
| 395 | 395 | $officeProperty = $xml->children($namespacesMeta['office']); |
| 396 | - foreach($officeProperty as $officePropertyData) { |
|
| 396 | + foreach ($officeProperty as $officePropertyData) { |
|
| 397 | 397 | $officePropertyDC = array(); |
| 398 | 398 | if (isset($namespacesMeta['dc'])) { |
| 399 | 399 | $officePropertyDC = $officePropertyData->children($namespacesMeta['dc']); |
| 400 | 400 | } |
| 401 | - foreach($officePropertyDC as $propertyName => $propertyValue) { |
|
| 401 | + foreach ($officePropertyDC as $propertyName => $propertyValue) { |
|
| 402 | 402 | switch ($propertyName) { |
| 403 | 403 | case 'title' : |
| 404 | 404 | $docProps->setTitle($propertyValue); |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | if (isset($namespacesMeta['dc'])) { |
| 425 | 425 | $officePropertyMeta = $officePropertyData->children($namespacesMeta['meta']); |
| 426 | 426 | } |
| 427 | - foreach($officePropertyMeta as $propertyName => $propertyValue) { |
|
| 427 | + foreach ($officePropertyMeta as $propertyName => $propertyValue) { |
|
| 428 | 428 | $propertyValueAttributes = $propertyValue->attributes($namespacesMeta['meta']); |
| 429 | 429 | switch ($propertyName) { |
| 430 | 430 | case 'initial-creator' : |
@@ -442,18 +442,18 @@ discard block |
||
| 442 | 442 | foreach ($propertyValueAttributes as $key => $value) { |
| 443 | 443 | if ($key == 'name') { |
| 444 | 444 | $propertyValueName = (string) $value; |
| 445 | - } elseif($key == 'value-type') { |
|
| 445 | + } elseif ($key == 'value-type') { |
|
| 446 | 446 | switch ($value) { |
| 447 | 447 | case 'date' : |
| 448 | - $propertyValue = PHPExcel_DocumentProperties::convertProperty($propertyValue,'date'); |
|
| 448 | + $propertyValue = PHPExcel_DocumentProperties::convertProperty($propertyValue, 'date'); |
|
| 449 | 449 | $propertyValueType = PHPExcel_DocumentProperties::PROPERTY_TYPE_DATE; |
| 450 | 450 | break; |
| 451 | 451 | case 'boolean' : |
| 452 | - $propertyValue = PHPExcel_DocumentProperties::convertProperty($propertyValue,'bool'); |
|
| 452 | + $propertyValue = PHPExcel_DocumentProperties::convertProperty($propertyValue, 'bool'); |
|
| 453 | 453 | $propertyValueType = PHPExcel_DocumentProperties::PROPERTY_TYPE_BOOLEAN; |
| 454 | 454 | break; |
| 455 | 455 | case 'float' : |
| 456 | - $propertyValue = PHPExcel_DocumentProperties::convertProperty($propertyValue,'r4'); |
|
| 456 | + $propertyValue = PHPExcel_DocumentProperties::convertProperty($propertyValue, 'r4'); |
|
| 457 | 457 | $propertyValueType = PHPExcel_DocumentProperties::PROPERTY_TYPE_FLOAT; |
| 458 | 458 | break; |
| 459 | 459 | default : |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | } |
| 462 | 462 | } |
| 463 | 463 | } |
| 464 | - $docProps->setCustomProperty($propertyValueName,$propertyValue,$propertyValueType); |
|
| 464 | + $docProps->setCustomProperty($propertyValueName, $propertyValue, $propertyValueType); |
|
| 465 | 465 | break; |
| 466 | 466 | } |
| 467 | 467 | } |
@@ -476,10 +476,10 @@ discard block |
||
| 476 | 476 | // echo '</pre><hr />'; |
| 477 | 477 | |
| 478 | 478 | $workbook = $xml->children($namespacesContent['office']); |
| 479 | - foreach($workbook->body->spreadsheet as $workbookData) { |
|
| 479 | + foreach ($workbook->body->spreadsheet as $workbookData) { |
|
| 480 | 480 | $workbookData = $workbookData->children($namespacesContent['table']); |
| 481 | 481 | $worksheetID = 0; |
| 482 | - foreach($workbookData->table as $worksheetDataSet) { |
|
| 482 | + foreach ($workbookData->table as $worksheetDataSet) { |
|
| 483 | 483 | $worksheetData = $worksheetDataSet->children($namespacesContent['table']); |
| 484 | 484 | // print_r($worksheetData); |
| 485 | 485 | // echo '<br />'; |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | // print_r($worksheetDataAttributes); |
| 488 | 488 | // echo '<br />'; |
| 489 | 489 | if ((isset($this->_loadSheetsOnly)) && (isset($worksheetDataAttributes['name'])) && |
| 490 | - (!in_array($worksheetDataAttributes['name'], $this->_loadSheetsOnly))) { |
|
| 490 | + ( ! in_array($worksheetDataAttributes['name'], $this->_loadSheetsOnly))) { |
|
| 491 | 491 | continue; |
| 492 | 492 | } |
| 493 | 493 | |
@@ -500,11 +500,11 @@ discard block |
||
| 500 | 500 | // Use false for $updateFormulaCellReferences to prevent adjustment of worksheet references in |
| 501 | 501 | // formula cells... during the load, all formulae should be correct, and we're simply |
| 502 | 502 | // bringing the worksheet name in line with the formula, not the reverse |
| 503 | - $objPHPExcel->getActiveSheet()->setTitle($worksheetName,false); |
|
| 503 | + $objPHPExcel->getActiveSheet()->setTitle($worksheetName, false); |
|
| 504 | 504 | } |
| 505 | 505 | |
| 506 | 506 | $rowID = 1; |
| 507 | - foreach($worksheetData as $key => $rowData) { |
|
| 507 | + foreach ($worksheetData as $key => $rowData) { |
|
| 508 | 508 | // echo '<b>'.$key.'</b><br />'; |
| 509 | 509 | switch ($key) { |
| 510 | 510 | case 'table-header-rows': |
@@ -514,9 +514,9 @@ discard block |
||
| 514 | 514 | } |
| 515 | 515 | case 'table-row' : |
| 516 | 516 | $columnID = 'A'; |
| 517 | - foreach($rowData as $key => $cellData) { |
|
| 517 | + foreach ($rowData as $key => $cellData) { |
|
| 518 | 518 | if ($this->getReadFilter() !== NULL) { |
| 519 | - if (!$this->getReadFilter()->readCell($columnID, $rowID, $worksheetName)) { |
|
| 519 | + if ( ! $this->getReadFilter()->readCell($columnID, $rowID, $worksheetName)) { |
|
| 520 | 520 | continue; |
| 521 | 521 | } |
| 522 | 522 | } |
@@ -547,16 +547,16 @@ discard block |
||
| 547 | 547 | // echo 'Cell has comment<br />'; |
| 548 | 548 | $annotationText = $cellDataOffice->annotation->children($namespacesContent['text']); |
| 549 | 549 | $textArray = array(); |
| 550 | - foreach($annotationText as $t) { |
|
| 551 | - foreach($t->span as $text) { |
|
| 552 | - $textArray[] = (string)$text; |
|
| 550 | + foreach ($annotationText as $t) { |
|
| 551 | + foreach ($t->span as $text) { |
|
| 552 | + $textArray[] = (string) $text; |
|
| 553 | 553 | } |
| 554 | 554 | } |
| 555 | - $text = implode("\n",$textArray); |
|
| 555 | + $text = implode("\n", $textArray); |
|
| 556 | 556 | // echo $text,'<br />'; |
| 557 | - $objPHPExcel->getActiveSheet()->getComment( $columnID.$rowID ) |
|
| 557 | + $objPHPExcel->getActiveSheet()->getComment($columnID.$rowID) |
|
| 558 | 558 | // ->setAuthor( $author ) |
| 559 | - ->setText($this->_parseRichText($text) ); |
|
| 559 | + ->setText($this->_parseRichText($text)); |
|
| 560 | 560 | } |
| 561 | 561 | |
| 562 | 562 | if (isset($cellDataText->p)) { |
@@ -586,8 +586,8 @@ discard block |
||
| 586 | 586 | $type = PHPExcel_Cell_DataType::TYPE_NUMERIC; |
| 587 | 587 | $dateObj = new DateTime($cellDataOfficeAttributes['date-value'], $GMT); |
| 588 | 588 | $dateObj->setTimeZone($timezoneObj); |
| 589 | - list($year,$month,$day,$hour,$minute,$second) = explode(' ',$dateObj->format('Y m d H i s')); |
|
| 590 | - $dataValue = PHPExcel_Shared_Date::FormattedPHPToExcel($year,$month,$day,$hour,$minute,$second); |
|
| 589 | + list($year, $month, $day, $hour, $minute, $second) = explode(' ', $dateObj->format('Y m d H i s')); |
|
| 590 | + $dataValue = PHPExcel_Shared_Date::FormattedPHPToExcel($year, $month, $day, $hour, $minute, $second); |
|
| 591 | 591 | if ($dataValue != floor($dataValue)) { |
| 592 | 592 | $formatting = PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX15.' '.PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME4; |
| 593 | 593 | } else { |
@@ -596,7 +596,7 @@ discard block |
||
| 596 | 596 | break; |
| 597 | 597 | case 'time' : |
| 598 | 598 | $type = PHPExcel_Cell_DataType::TYPE_NUMERIC; |
| 599 | - $dataValue = PHPExcel_Shared_Date::PHPToExcel(strtotime('01-01-1970 '.implode(':',sscanf($cellDataOfficeAttributes['time-value'],'PT%dH%dM%dS')))); |
|
| 599 | + $dataValue = PHPExcel_Shared_Date::PHPToExcel(strtotime('01-01-1970 '.implode(':', sscanf($cellDataOfficeAttributes['time-value'], 'PT%dH%dM%dS')))); |
|
| 600 | 600 | $formatting = PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME4; |
| 601 | 601 | break; |
| 602 | 602 | } |
@@ -609,20 +609,20 @@ discard block |
||
| 609 | 609 | if ($hasCalculatedValue) { |
| 610 | 610 | $type = PHPExcel_Cell_DataType::TYPE_FORMULA; |
| 611 | 611 | // echo 'Formula: '.$cellDataFormula.'<br />'; |
| 612 | - $cellDataFormula = substr($cellDataFormula,strpos($cellDataFormula,':=')+1); |
|
| 613 | - $temp = explode('"',$cellDataFormula); |
|
| 612 | + $cellDataFormula = substr($cellDataFormula, strpos($cellDataFormula, ':=') + 1); |
|
| 613 | + $temp = explode('"', $cellDataFormula); |
|
| 614 | 614 | $tKey = false; |
| 615 | - foreach($temp as &$value) { |
|
| 615 | + foreach ($temp as &$value) { |
|
| 616 | 616 | // Only replace in alternate array entries (i.e. non-quoted blocks) |
| 617 | - if ($tKey = !$tKey) { |
|
| 618 | - $value = preg_replace('/\[\.(.*):\.(.*)\]/Ui','$1:$2',$value); |
|
| 619 | - $value = preg_replace('/\[\.(.*)\]/Ui','$1',$value); |
|
| 620 | - $value = PHPExcel_Calculation::_translateSeparator(';',',',$value,$inBraces); |
|
| 617 | + if ($tKey = ! $tKey) { |
|
| 618 | + $value = preg_replace('/\[\.(.*):\.(.*)\]/Ui', '$1:$2', $value); |
|
| 619 | + $value = preg_replace('/\[\.(.*)\]/Ui', '$1', $value); |
|
| 620 | + $value = PHPExcel_Calculation::_translateSeparator(';', ',', $value, $inBraces); |
|
| 621 | 621 | } |
| 622 | 622 | } |
| 623 | 623 | unset($value); |
| 624 | 624 | // Then rebuild the formula string |
| 625 | - $cellDataFormula = implode('"',$temp); |
|
| 625 | + $cellDataFormula = implode('"', $temp); |
|
| 626 | 626 | // echo 'Adjusted Formula: '.$cellDataFormula.'<br />'; |
| 627 | 627 | } |
| 628 | 628 | |
@@ -633,7 +633,7 @@ discard block |
||
| 633 | 633 | if ($i > 0) { |
| 634 | 634 | ++$columnID; |
| 635 | 635 | } |
| 636 | - $objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $dataValue),$type); |
|
| 636 | + $objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $dataValue), $type); |
|
| 637 | 637 | if ($hasCalculatedValue) { |
| 638 | 638 | // echo 'Forumla result is '.$dataValue.'<br />'; |
| 639 | 639 | $objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setCalculatedValue($dataValue); |
@@ -652,7 +652,7 @@ discard block |
||
| 652 | 652 | if ((isset($cellDataTableAttributes['number-columns-spanned'])) || (isset($cellDataTableAttributes['number-rows-spanned']))) { |
| 653 | 653 | $columnTo = $columnID; |
| 654 | 654 | if (isset($cellDataTableAttributes['number-columns-spanned'])) { |
| 655 | - $columnTo = PHPExcel_Cell::stringFromColumnIndex(PHPExcel_Cell::columnIndexFromString($columnID) + $cellDataTableAttributes['number-columns-spanned'] -2); |
|
| 655 | + $columnTo = PHPExcel_Cell::stringFromColumnIndex(PHPExcel_Cell::columnIndexFromString($columnID) + $cellDataTableAttributes['number-columns-spanned'] - 2); |
|
| 656 | 656 | } |
| 657 | 657 | $rowTo = $rowID; |
| 658 | 658 | if (isset($cellDataTableAttributes['number-rows-spanned'])) { |
@@ -91,7 +91,7 @@ |
||
| 91 | 91 | /** |
| 92 | 92 | * Can the current PHPExcel_Reader_IReader read the file? |
| 93 | 93 | * |
| 94 | - * @param string $pFileName |
|
| 94 | + * @param string $pFilename |
|
| 95 | 95 | * @return boolean |
| 96 | 96 | * @throws Exception |
| 97 | 97 | */ |
@@ -584,7 +584,7 @@ |
||
| 584 | 584 | break; |
| 585 | 585 | case 'date' : |
| 586 | 586 | $type = PHPExcel_Cell_DataType::TYPE_NUMERIC; |
| 587 | - $dateObj = new DateTime($cellDataOfficeAttributes['date-value'], $GMT); |
|
| 587 | + $dateObj = new DateTime($cellDataOfficeAttributes['date-value'], $GMT); |
|
| 588 | 588 | $dateObj->setTimeZone($timezoneObj); |
| 589 | 589 | list($year,$month,$day,$hour,$minute,$second) = explode(' ',$dateObj->format('Y m d H i s')); |
| 590 | 590 | $dataValue = PHPExcel_Shared_Date::FormattedPHPToExcel($year,$month,$day,$hour,$minute,$second); |