Permalink
Browse files

Change link to patternLink

  • Loading branch information...
aleksip committed Jan 7, 2016
1 parent 4d1ebe5 commit 2cbf6171766ef9312c8651bb8084db1fbc101f66
Showing with 7 additions and 7 deletions.
  1. +6 −6 src/PatternLab/Data.php
  2. +1 −1 src/PatternLab/Util.php
@@ -23,7 +23,7 @@
class Data {
protected static $store = array();
protected static $reservedKeys = array("listItems","cacheBuster","link","patternSpecific","patternLabHead","patternLabFoot");
protected static $reservedKeys = array("listItems","cacheBuster","patternLink","patternSpecific","patternLabHead","patternLabFoot");
/**
* Clear all of the data in the $store
@@ -37,7 +37,7 @@ public static function clear() {
*
* Reserved attributes:
* - Data::$store["listItems"] : listItems from listitems.json, duplicated into separate arrays for Data::$store["listItems"]["one"], Data::$store["listItems"]["two"]... etc.
* - Data::$store["link"] : the links to each pattern
* - Data::$store["patternLink"] : the links to each pattern
* - Data::$store["cacheBuster"] : the cache buster value to be appended to URLs
* - Data::$store["patternSpecific"] : holds attributes from the pattern-specific data files
*
@@ -136,7 +136,7 @@ public static function gather($options = array()) {
}
self::$store["cacheBuster"] = Config::getOption("cacheBuster");
self::$store["link"] = array();
self::$store["patternLink"] = array();
self::$store["patternSpecific"] = array();
$dispatcherInstance->dispatch("data.gatherEnd");
@@ -321,11 +321,11 @@ public static function printData() {
*/
public static function setOptionLink($optionName,$optionValue) {
if (!isset(self::$store["link"])) {
self::$store["link"] = array();
if (!isset(self::$store["patternLink"])) {
self::$store["patternLink"] = array();
}
self::$store["link"][$optionName] = $optionValue;
self::$store["patternLink"][$optionName] = $optionValue;
}
@@ -28,7 +28,7 @@ public static function compareReplace(&$value) {
if (is_string($value)) {
$valueCheck = strtolower($value);
$valueThin = str_replace("link.","",$valueCheck);
$linkStore = Data::getOption("link");
$linkStore = Data::getOption("patternLink");
if ((strpos($valueCheck, 'link.') !== false) && array_key_exists($valueThin,$linkStore)) {
$value = $linkStore[$valueThin];
}

0 comments on commit 2cbf617

Please sign in to comment.