Bug fix, plugin language dictionary
This commit is contained in:
parent
2aed08be5f
commit
159199a470
|
@ -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.
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue