diff --git a/api/api_default.php b/api/api_default.php
index 36391df..7626bd4 100644
--- a/api/api_default.php
+++ b/api/api_default.php
@@ -6,27 +6,34 @@ abstract class api_default extends api_system {
//https://developers.google.com/webmasters/ajax-crawling/docs/getting-started
//mojotrollz.eu:80/web/flingit/?_escaped_fragment_=start%3Bhash.ce5504f67533ab3d881a32e1dcdd330aaeb27f19
public static function static__escaped_fragment_($_escaped_fragment_){
- $state = \SYSTEM\PAGE\State::get(1, $_escaped_fragment_,false);
$html = new \DOMDocument();
- $html->loadHTML(static::default_page()->html($_escaped_fragment_));
+ $html->loadHTML(static::default_page($_escaped_fragment_));
+ $state = \SYSTEM\PAGE\State::get(static::get_apigroup(), $_escaped_fragment_,false);
foreach($state as $row){
$frag = new \DOMDocument();
parse_str(\parse_url($row['url'],PHP_URL_QUERY), $params);
- $frag->loadHTML(\SYSTEM\API\api::run('\SYSTEM\API\verify', static::get_class(), $params, 1, true, true)->html());
- $html->getElementById(substr($row['div'], 1))->appendChild($html->importNode($frag->documentElement, true));
- //Load subpage css
- foreach($row['css'] as $css){
- $css_frag = new \DOMDocument();
- $css_frag->loadHTML('');
- $html->getElementsByTagName('head')[0]->appendChild($html->importNode($css_frag->documentElement,true));
+ $class = static::get_class($params);
+ if($class){
+ $frag->loadHTML(\SYSTEM\API\api::run('\SYSTEM\API\verify', $class, static::get_params($params), static::get_apigroup(), true, false));
+ $html->getElementById(substr($row['div'], 1))->appendChild($html->importNode($frag->documentElement, true));
+ //Load subpage css
+ foreach($row['css'] as $css){
+ $css_frag = new \DOMDocument();
+ $css_frag->loadHTML('');
+ $html->getElementsByTagName('head')[0]->appendChild($html->importNode($css_frag->documentElement,true));
+ }
}
}
- echo $html->saveHTML();
+ echo $html->saveHTML();
+ new \SYSTEM\LOG\COUNTER("API was called sucessfully.");
die();
}
-
- public static function get_class(){
+ public static function get_apigroup(){
+ throw new \RuntimeException("Unimplemented");}
+ public static function get_class($params = null){
return self::class;}
+ public static function get_params($params){
+ return $params;}
public static function default_page($_escaped_fragment_ = null){
throw new \RuntimeException("Unimplemented");}
diff --git a/dbd/sql/mysql/data/sai_api.sql b/dbd/sql/mysql/data/sai_api.sql
index 494515f..f6ca346 100644
--- a/dbd/sql/mysql/data/sai_api.sql
+++ b/dbd/sql/mysql/data/sai_api.sql
@@ -5,6 +5,7 @@ INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `nam
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1, 42, 1, 0, NULL, 'js', NULL);
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (2, 42, 1, 0, NULL, 'css', NULL);
-- INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (3, 42, 0, 0, NULL, 'page', NULL);
+INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5, 42, 4, -1, NULL, '_escaped_fragment_', 'STRING');
-- system_api
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10, 42, 0, -1, NULL, 'call', NULL);
diff --git a/sai/modules/saistart_sys_sai/tpl/content.tpl b/sai/modules/saistart_sys_sai/tpl/content.tpl
index d502706..69b4aec 100644
--- a/sai/modules/saistart_sys_sai/tpl/content.tpl
+++ b/sai/modules/saistart_sys_sai/tpl/content.tpl
@@ -1,4 +1,4 @@
-Welcome to the SYSTEM Admin Interface - short SAI.
+Welcome to the SYSTEM Admin Interface - short SAI.
From here you can control and manage your Website.