Bug fix, plugin language dictionary

This commit is contained in:
dignajar 2016-06-05 23:24:15 -03:00
parent 2aed08be5f
commit 159199a470
2 changed files with 18 additions and 3 deletions

View File

@ -71,7 +71,7 @@ class dbLanguage extends dbJSON
public function add($array)
{
$this->db = array_merge($this->db, $array);
$this->db = array_merge($array, $this->db);
}
// Returns the item from plugin-data.

View File

@ -117,6 +117,21 @@ class pluginAPI extends Plugin {
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;
@ -171,8 +186,8 @@ class pluginAPI extends Plugin {
if($parameters[2] === 'posts') {
$json = $this->getAllPosts();
}
elseif($parameters[1] === 'pages') {
$json = $this->getAllPosts();
elseif($parameters[2] === 'pages') {
$json = $this->getAllPages();
}
}
}