Changeset 14576
- Timestamp:
- 01/10/09 13:04:44 (4 years ago)
- Files:
-
- plugins/tsTitlePlugin/lib/response/tsTitleWebResponse.class.php (modified) (2 diffs)
- plugins/tsTitlePlugin/lib/util/tsTitle.class.php (modified) (2 diffs)
- plugins/tsTitlePlugin/test/tsTitleTest.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/tsTitlePlugin/lib/response/tsTitleWebResponse.class.php
r14400 r14576 49 49 */ 50 50 public function setTitle($title, $escape = true) { 51 52 51 if ($escape) { 53 52 … … 57 56 $this->getTitle()->push($title); 58 57 } 58 59 60 /** 61 * @see sfResponse 62 */ 63 public function serialize() 64 { 65 return serialize(array( 66 67 $this->content, 68 $this->statusCode, 69 $this->statusText, 70 $this->options, 71 $this->cookies, 72 $this->headerOnly, 73 $this->headers, 74 $this->metas, 75 $this->httpMetas, 76 $this->stylesheets, 77 $this->javascripts, 78 $this->slots, 79 80 $this->_title 81 )); 82 } 83 84 /** 85 * @see sfResponse 86 */ 87 public function unserialize($serialized) 88 { 89 list( 90 91 $this->content, 92 $this->statusCode, 93 $this->statusText, 94 $this->options, 95 $this->cookies, 96 $this->headerOnly, 97 $this->headers, 98 $this->metas, 99 $this->httpMetas, 100 $this->stylesheets, 101 $this->javascripts, 102 $this->slots, 103 104 $this->_title 105 106 ) = unserialize($serialized); 107 } 108 109 /** 110 * 111 * @see sfWebResponse 112 */ 113 public function copyProperties(sfWebResponse $response) 114 { 115 parent::copyProperties($response); 116 $this->_title = $response->_title; 117 } 59 118 } plugins/tsTitlePlugin/lib/util/tsTitle.class.php
r14400 r14576 9 9 * @version SVN: $Id$ 10 10 */ 11 class tsTitle {11 class tsTitle implements Serializable{ 12 12 13 13 /** … … 101 101 return $this->generate(); 102 102 } 103 104 public function serialize(){ 105 106 return serialize($this->_registry); 107 } 108 109 public function unserialize($serialized){ 110 111 $this->_registry = unserialize($serialized); 112 } 103 113 } plugins/tsTitlePlugin/test/tsTitleTest.php
r14400 r14576 12 12 public function testGenerateTitle() { 13 13 14 $title = new myTitle();14 $title = new tsTitle(); 15 15 $title->set(array('Preved', 'medved', 'Krossavcheg')); 16 16 … … 23 23 public function testToString() { 24 24 25 $title = new myTitle(array('alfa', 'beta', 'gamma'));25 $title = new tsTitle(array('alfa', 'beta', 'gamma')); 26 26 $this->assertEquals('alfa | beta | gamma', strval($title)); 27 27 } … … 29 29 public function testTitleUnshift() { 30 30 31 $title = new myTitle(array('alfa', 'beta'));31 $title = new tsTitle(array('alfa', 'beta')); 32 32 $title->unshift('omikron'); 33 33 … … 37 37 public function testTitleUnshift2() { 38 38 39 $title = new myTitle(array('alfa', 'beta'));39 $title = new tsTitle(array('alfa', 'beta')); 40 40 $title->unshift('omikron'); 41 41 $title->unshift('persey');