|
17 | 17 | use \Mustache_Loader_FilesystemLoader as FilesystemLoader;
|
18 | 18 |
|
19 | 19 | class Builder {
|
20 |
| - |
21 |
| - // i was lazy when i started this project & kept (mainly) to two letter vars. sorry. |
22 |
| - protected $mpl; // mustache pattern loader instance |
23 |
| - protected $mfs; // mustache file system loader instance |
24 |
| - protected $mv; // mustache vanilla instance |
25 |
| - protected $d; // data from data.json files |
26 |
| - protected $sp; // source patterns dir |
27 |
| - protected $pp; // public patterns dir |
28 |
| - protected $sd; // source dir |
29 |
| - protected $pd; // public dir |
30 |
| - protected $ie; // extensions to ignore |
31 |
| - protected $id; // directories to ignore |
32 |
| - protected $xipHostname; // the xip address for the pattern lab site if using one |
33 |
| - protected $autoReloadPort; // for populating the websockets template partial |
34 |
| - protected $pageFollowPort; // for populating the websockets template partial |
35 |
| - protected $patternTypes; // a list of pattern types that match the directory structure |
36 |
| - protected $patternPaths; // the paths to patterns for use with mustache partials |
37 |
| - protected $patternLineages; // the list of patterns that make up a particular pattern |
38 |
| - protected $patternLineagesR; // the list of patterns where a particular pattern is used |
39 |
| - protected $patternTypesRegex; // the simple regex for the pattern types. used in getPath() |
40 |
| - protected $patternStates; // the states from the config to be used in the state comparison |
41 |
| - protected $navItems; // the items for the nav. includes view all links |
42 |
| - protected $viewAllPaths; // the paths to the view all pages |
43 |
| - protected $enableCSS; // decide if we'll enable CSS parsing |
44 |
| - protected $patternCSS; // an array to hold the CSS generated for patterns |
45 |
| - protected $cssRuleSaver; // where css rule saver will be initialized |
46 |
| - protected $cacheBuster; // a timestamp used to bust the cache for static assets like CSS and JS |
47 |
| - protected $noCacheBuster; // should we turn the cache buster on or off? |
48 |
| - protected $patternHead; // the header to be included on patterns |
49 |
| - protected $patternFoot; // the footer to be included on patterns |
50 |
| - protected $mainPageHead; // the header to be included on main pages |
51 |
| - protected $mainPageFoot; // the footer to be included on main pages |
52 |
| - protected $addPatternHF; // should the pattern header and footer be added |
53 |
| - protected $cleanPublic; // whether the public directory should be cleaned out or not on generate |
54 |
| - protected $styleGuideExcludes;// which pattern types to exclude from the style guide |
55 | 20 |
|
56 | 21 | /**
|
57 | 22 | * When initializing the Builder class or the sub-classes make sure the base properties are configured
|
@@ -83,6 +48,14 @@ public function __construct($config = array()) {
|
83 | 48 | $this->$key->$value2 = true;
|
84 | 49 | }
|
85 | 50 | }
|
| 51 | + if ($this->pageFollowNav == "false") { |
| 52 | + $value = "tools-follow"; |
| 53 | + $this->$key->$value = true; |
| 54 | + } |
| 55 | + if ($this->autoReloadNav == "false") { |
| 56 | + $value = "tools-reload"; |
| 57 | + $this->$key->$value = true; |
| 58 | + } |
86 | 59 | } else {
|
87 | 60 | $this->$key = $value;
|
88 | 61 | }
|
@@ -203,14 +176,19 @@ protected function generateMainPages() {
|
203 | 176 | }
|
204 | 177 |
|
205 | 178 | // render out the main pages and move them to public
|
206 |
| - $this->navItems['autoreloadport'] = $this->autoReloadPort; |
207 |
| - $this->navItems['pagefollowport'] = $this->pageFollowPort; |
208 |
| - $this->navItems['patternpaths'] = json_encode($patternPathDests); |
209 |
| - $this->navItems['viewallpaths'] = json_encode($this->viewAllPaths); |
210 |
| - $this->navItems['mqs'] = $this->gatherMQs(); |
211 |
| - $this->navItems['ipaddress'] = getHostByName(getHostName()); |
212 |
| - $this->navItems['xiphostname'] = $this->xipHostname; |
213 |
| - $this->navItems['ishControlsHide'] = $this->ishControlsHide; |
| 179 | + $this->navItems['autoreloadnav'] = $this->autoReloadNav; |
| 180 | + $this->navItems['autoreloadport'] = $this->autoReloadPort; |
| 181 | + $this->navItems['pagefollownav'] = $this->pageFollowNav; |
| 182 | + $this->navItems['pagefollowport'] = $this->pageFollowPort; |
| 183 | + $this->navItems['patternpaths'] = json_encode($patternPathDests); |
| 184 | + $this->navItems['viewallpaths'] = json_encode($this->viewAllPaths); |
| 185 | + $this->navItems['mqs'] = $this->gatherMQs(); |
| 186 | + $this->navItems['qrcodegeneratoron'] = $this->qrCodeGeneratorOn; |
| 187 | + $this->navItems['ipaddress'] = getHostByName(getHostName()); |
| 188 | + $this->navItems['xiphostname'] = $this->xipHostname; |
| 189 | + $this->navItems['ishminimum'] = $this->ishMinimum; |
| 190 | + $this->navItems['ishmaximum'] = $this->ishMaximum; |
| 191 | + $this->navItems['ishControlsHide'] = $this->ishControlsHide; |
214 | 192 |
|
215 | 193 | // grab the partials into a data object for the style guide
|
216 | 194 | $sd = array("partials" => array());
|
@@ -391,7 +369,7 @@ protected function generateViewAllPages() {
|
391 | 369 | protected function gatherData() {
|
392 | 370 |
|
393 | 371 | // set the cacheBuster
|
394 |
| - $this->cacheBuster = $this->noCacheBuster ? 0 : time(); |
| 372 | + $this->cacheBuster = ($this->noCacheBuster || ($this->cacheBusterOn == "false")) ? 0 : time(); |
395 | 373 |
|
396 | 374 | // gather the data from the main source data.json
|
397 | 375 | if (file_exists($this->sd."/_data/_data.json")) {
|
|
0 commit comments