Changeset 741552
- Timestamp:
- 07/16/2013 09:16:24 AM (13 years ago)
- Location:
- travel-search/tags/1.2.5
- Files:
-
- 2 edited
-
classes/tgSearchboxesRenderer.class.php (modified) (3 diffs)
-
controllers/controller-frontend.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
travel-search/tags/1.2.5/classes/tgSearchboxesRenderer.class.php
r723445 r741552 14 14 private $defaultSize = '300x250'; 15 15 private $defaultSelectedTab = 'flights'; 16 private $subID = '106'; 16 private $subID; 17 /* added to be able to compare if default subID is in use or not | Tibi | 2013-Jul-10 */ 18 private $defaultSubID = '106'; 17 19 private $defaultAlignment = 'alignnone'; 18 20 … … 33 35 $this->atts = $atts; 34 36 /** make the subID hookable - only for internal uses */ 35 $this->subID = apply_filters('tg_searchboxes_subID', $this-> subID);37 $this->subID = apply_filters('tg_searchboxes_subID', $this->defaultSubID); 36 38 /** current number of boxes needed for incremental IDs for inputs / labels */ 37 39 self::$nrOfBoxes++; … … 59 61 $queryString.= '&'. urlencode($name) .'='. urlencode($value); 60 62 } 63 64 /* @note subID comparison to default subID added because subID was not transfered to the JS file and custom subID was lost when SB loaded from JS 65 @date 2013-JUL-10 66 @author Tibi */ 67 if ($this->defaultSubID!=$this->subID) 68 $queryString .= '&subID='. (int)$this->subID; 69 61 70 $queryString .= '&tgsbPlaceholder=tgsb_'.self::$nrOfBoxes; 62 71 //the link to the javascript file (php that generates JS code) -
travel-search/tags/1.2.5/controllers/controller-frontend.php
r724002 r741552 73 73 $currentIndex++; 74 74 } 75 76 /** @note If we get a subID via GET parameter, we have to use that subID | for the filter using priority of 20 - this should be enough to make sure no other filters were registered after this filter 77 @date 2013-JUL-10 78 @author Tibi */ 79 if ($req['subID']) { 80 $this->javascriptSubID = $req['subID']; 81 add_filter('tg_searchboxes_subID', array($this, 'set_javascript_subid'), 20); 82 }; 75 83 76 84 // building up shortcode … … 105 113 // exiting the script to prevent any other output 106 114 exit(); 115 } 116 117 /** @note used to set the subID got via GET parameter if searchbox is loaded via JS | binded to `tg_searchboxes_subID` filter 118 @date 2013-JUL-10 119 @author Tibi */ 120 public function set_javascript_subid($defSubId){ 121 return $this->javascriptSubID ? $this->javascriptSubID : $defSubId; 107 122 } 108 123
Note: See TracChangeset
for help on using the changeset viewer.