Skip to content

Commit

Permalink
Bug fix, plugin language dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
dignajar committed Jun 6, 2016
1 parent 2aed08b commit 159199a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bl-kernel/dblanguage.class.php
Expand Up @@ -71,7 +71,7 @@ public function p($string)

public function add($array)
{
$this->db = array_merge($this->db, $array);
$this->db = array_merge($array, $this->db);
}

// Returns the item from plugin-data.
Expand Down
19 changes: 17 additions & 2 deletions bl-plugins/api/plugin.php
Expand Up @@ -117,6 +117,21 @@ private function getPage($key)
return $Page->json();
}

private function getAllPages()
{
$pages = buildAllPages();

$tmp = array();

foreach($pages as $Page) {
if($Page->published()) {
array_push($tmp, $Page->json( $returnsArray=true ));
}
}

return json_encode($tmp);
}

public function beforeRulesLoad()
{
global $Url;
Expand Down Expand Up @@ -171,8 +186,8 @@ public function beforeRulesLoad()
if($parameters[2] === 'posts') {
$json = $this->getAllPosts();
}
elseif($parameters[1] === 'pages') {
$json = $this->getAllPosts();
elseif($parameters[2] === 'pages') {
$json = $this->getAllPages();
}
}
}
Expand Down

0 comments on commit 159199a

Please sign in to comment.