Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/PatternLab/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
*
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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;

}

Expand Down
2 changes: 1 addition & 1 deletion src/PatternLab/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down