diff options
author | Laria Carolin Chabowski <laria@laria.me> | 2020-09-25 21:24:53 +0200 |
---|---|---|
committer | Laria Carolin Chabowski <laria@laria.me> | 2020-09-25 21:29:45 +0200 |
commit | ecec65566a4ec77edf2054984663d97df55b877a (patch) | |
tree | 6d508c03ca95c02c86757ca150c92bb3f1f9c060 /ratatoeskr | |
parent | 378881378aab5454c84cb1fecbbcc675f64dc27f (diff) | |
download | ratatoeskr-cms-ecec65566a4ec77edf2054984663d97df55b877a.tar.gz ratatoeskr-cms-ecec65566a4ec77edf2054984663d97df55b877a.tar.bz2 ratatoeskr-cms-ecec65566a4ec77edf2054984663d97df55b877a.zip |
Fix some broken references to the \ste namespace
Should be \r7r\ste now
Diffstat (limited to 'ratatoeskr')
-rw-r--r-- | ratatoeskr/backend.php | 14 | ||||
-rw-r--r-- | ratatoeskr/frontend.php | 23 | ||||
-rw-r--r-- | ratatoeskr/setup/setup.php | 4 | ||||
-rw-r--r-- | ratatoeskr/sys/translation.php | 3 |
4 files changed, 26 insertions, 18 deletions
diff --git a/ratatoeskr/backend.php b/ratatoeskr/backend.php index 1b898ea..12a57de 100644 --- a/ratatoeskr/backend.php +++ b/ratatoeskr/backend.php @@ -9,8 +9,12 @@ * See "ratatoeskr/licenses/ratatoeskr" for more information. */ -use r7r\cms\sys\Esc; +use r7r\ste\STECore; +use r7r\ste\ParseCompileError; +use r7r\ste\Transcompiler; +use r7r\ste\Parser; use r7r\cms\sys\Env; +use r7r\cms\sys\Esc; require_once(dirname(__FILE__) . "/sys/models.php"); require_once(dirname(__FILE__) . "/sys/pwhash.php"); @@ -98,7 +102,7 @@ function build_backend_subactions() }, "login" => url_action_simple(function ($data) { /** - * @var \ste\STECore $ste + * @var STECore $ste * @var Group|null $admin_grp */ global $ste, $admin_grp; @@ -138,7 +142,7 @@ function build_backend_subactions() "content" => url_action_subactions([ "write" => function (&$data, $url_now, &$url_next) { /** - * @var \ste\STECore $ste + * @var STECore $ste * @var array $translation * @var Settings $ratatoeskr_settings * @var array $languages @@ -977,10 +981,10 @@ function build_backend_subactions() $ste->vars["template_code"] = $_POST["template_code"]; try { - \ste\transcompile(\ste\parse(\ste\precompile($_POST["template_code"]), $_POST["template_name"])); + Transcompiler::transcompile(Parser::parse($_POST["template_code"], $_POST["template_name"])); file_put_contents(SITE_BASE_PATH . "/ratatoeskr/templates/src/usertemplates/" . $_POST["template_name"], $_POST["template_code"]); $ste->vars["success"] = $translation["template_successfully_saved"]; - } catch (\ste\ParseCompileError $e) { + } catch (ParseCompileError $e) { $e->rewrite($_POST["template_code"]); $ste->vars["error"] = $translation["could_not_compile_template"] . $e->getMessage(); } diff --git a/ratatoeskr/frontend.php b/ratatoeskr/frontend.php index 696d446..6484796 100644 --- a/ratatoeskr/frontend.php +++ b/ratatoeskr/frontend.php @@ -9,6 +9,7 @@ * See "ratatoeskr/licenses/ratatoeskr" for more information. */ +use r7r\ste; use r7r\cms\sys\Env; use r7r\cms\sys\Esc; @@ -18,7 +19,7 @@ require_once(dirname(__FILE__) . "/sys/models.php"); require_once(dirname(__FILE__) . "/sys/textprocessors.php"); require_once(dirname(__FILE__) . "/libs/kses.php"); -/** @var \ste\STECore $ste */ +/** @var ste\STECore $ste */ assert(isset($ste)); /* @@ -189,7 +190,7 @@ $ste->register_tag("articles_get", function ($ste, $params, $sub) { $lang = $ste->vars["language"]; if (!isset($params["var"])) { - throw new \ste\RuntimeError("Parameter var is needed in article_get!"); + throw new ste\RuntimeError("Parameter var is needed in article_get!"); } $criterias = ["langavail" => $lang, "onlyvisible" => true]; @@ -273,7 +274,7 @@ $ste->register_tag("section_list", function ($ste, $params, $sub) { $default_section = $ratatoeskr_settings["default_section"]; if (!isset($params["var"])) { - throw new \ste\RuntimeException("Parameter var is needed in article_get!"); + throw new ste\RuntimeException("Parameter var is needed in article_get!"); } $result = Section::all(); @@ -318,7 +319,7 @@ $ste->register_tag("section_list", function ($ste, $params, $sub) { */ $ste->register_tag("article_comments_count", function ($ste, $params, $sub) { if (!isset($params["article"])) { - throw new \ste\RuntimeException("Need parameter 'article' in ste:article_comments_count."); + throw new ste\RuntimeException("Need parameter 'article' in ste:article_comments_count."); } $tpl_article = $ste->get_var_reference($params["article"], false); $lang = $ste->vars["language"]; @@ -355,10 +356,10 @@ $ste->register_tag("article_comments_count", function ($ste, $params, $sub) { */ $ste->register_tag("article_comments", function ($ste, $params, $sub) { if (!isset($params["var"])) { - throw new \ste\RuntimeException("Need parameter 'var' in ste:article_comments."); + throw new ste\RuntimeException("Need parameter 'var' in ste:article_comments."); } if (!isset($params["article"])) { - throw new \ste\RuntimeException("Need parameter 'article' in ste:article_comments."); + throw new ste\RuntimeException("Need parameter 'article' in ste:article_comments."); } $tpl_article = $ste->get_var_reference($params["article"], false); $lang = $ste->vars["language"]; @@ -427,7 +428,7 @@ $ste->register_tag("article_comments", function ($ste, $params, $sub) { $ste->register_tag("comment_form", function ($ste, $params, $sub) { global $translation; if (!isset($params["article"])) { - throw new \ste\RuntimeException("Need parameter 'article' in ste:comment_form."); + throw new ste\RuntimeException("Need parameter 'article' in ste:comment_form."); } $tpl_article = $ste->get_var_reference($params["article"], false); @@ -493,10 +494,10 @@ $ste->register_tag("comment_form", function ($ste, $params, $sub) { $ste->register_tag("page_prev", function ($ste, $params, $sub) { global $translation; if (!isset($params["current"])) { - throw new \ste\RuntimeException("Need parameter 'current' in ste:page_prev."); + throw new ste\RuntimeException("Need parameter 'current' in ste:page_prev."); } if (!isset($params["maxpage"])) { - throw new \ste\RuntimeException("Need parameter 'maxpage' in ste:page_prev."); + throw new ste\RuntimeException("Need parameter 'maxpage' in ste:page_prev."); } if ($params["current"] == 1) { @@ -512,10 +513,10 @@ $ste->register_tag("page_prev", function ($ste, $params, $sub) { $ste->register_tag("page_next", function ($ste, $params, $sub) { global $translation; if (!isset($params["current"])) { - throw new \ste\RuntimeException("Need parameter 'current' in ste:page_next."); + throw new ste\RuntimeException("Need parameter 'current' in ste:page_next."); } if (!isset($params["maxpage"])) { - throw new \ste\RuntimeException("Need parameter 'maxpage' in ste:page_next."); + throw new ste\RuntimeException("Need parameter 'maxpage' in ste:page_next."); } if ($params["current"] == $params["maxpage"]) { diff --git a/ratatoeskr/setup/setup.php b/ratatoeskr/setup/setup.php index f1c6dee..23205b8 100644 --- a/ratatoeskr/setup/setup.php +++ b/ratatoeskr/setup/setup.php @@ -1,5 +1,7 @@ <?php +use r7r\ste; + define("SETUP", true); require_once(dirname(__FILE__) . "/../vendor/autoload.php"); @@ -10,7 +12,7 @@ require_once(dirname(__FILE__) . "/../sys/pwhash.php"); require_once(dirname(__FILE__) . "/../languages.php"); require_once(dirname(__FILE__) . "/create_tables.php"); -/** @var \ste\STECore $ste */ +/** @var ste\STECore $ste */ assert(isset($ste)); $rel_path_to_root = "."; diff --git a/ratatoeskr/sys/translation.php b/ratatoeskr/sys/translation.php index 0679ca7..d9d6cfd 100644 --- a/ratatoeskr/sys/translation.php +++ b/ratatoeskr/sys/translation.php @@ -9,12 +9,13 @@ * See "ratatoeskr/licenses/ratatoeskr" for more information. */ +use r7r\ste; use r7r\cms\sys\Esc; require_once(dirname(__FILE__) . "/utils.php"); require_once(dirname(__FILE__) . "/init_ste.php"); -/** @var \ste\STECore $ste */ +/** @var ste\STECore $ste */ assert(isset($ste)); if (!defined("SETUP")) { |