$cache = $this->cache->get("paragraphs-$id", 'Toolbox');
if ($cache) {
- return $cache;
+ return unserialize($cache);
} else {
$sections = array();
$page = $this->pageGateway->find($id);
break;
}
-// $html = '';
$linksFormat = '<a href="#sect-%s">%s</a>';
foreach ($paragraphs as $paragraph) {
if ($paragraph['active']) {
$sect = array();
$sect = $paragraph;
-// $html .= '<div class="listing" id="sect-'.$paragraph['id'].'">';
-// $html .= "<h2>{$paragraph['title']}</h2>";
- $sect['image'] = $this->getParagraphImage($paragraph, $side[$key]);
-// $html .= $this->getParagraphImage($paragraph, $side[$key]);
- $sect['description'] = $this->keywordReplacement->findAndReplace($paragraph['description']);
-// $html .= $this->keywordReplacement->findAndReplace($paragraph['description']);
- $sect['files'] = $this->getParagraphFiles($paragraph['files']);
-// $html .= $this->getParagraphFiles($paragraph['files']);
+ $sect['image']
+ = $this->getParagraphImage($paragraph, $side[$key]);
+ $sect['description']
+ = $this->keywordReplacement->
+ findAndReplace($paragraph['description']);
+ $sect['files']
+ = $this->getParagraphFiles($paragraph['files']);
if ($paragraph['back_to_top']) {
- $sect['back_to_top'] = '<a href="#toolbox">Back to Top</a>';
-// $html .= '<a href="#toolbox">Back to Top</a>';
+ $sect['back_to_top']
+ = '<a href="#toolbox">Back to Top</a>';
}
-// $html .= '</div>';
-
$this->paragraphLinks[] = sprintf(
$linksFormat,
$paragraph['id'],
}
}
- $this->cache->save($html, "paragraphs-$id", 'Toolbox');
-// return $html;
+ $this->cache->save(
+ serialize($sections),
+ "paragraphs-$id",
+ 'Toolbox'
+ );
return $sections;
}
}
// }}}
}
-?>