diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2022-01-11 12:35:47 +0100 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2022-01-11 12:35:47 +0100 |
commit | 19985dbb8c0aa66dc4bf7905abc1148de909097d (patch) | |
tree | 2cd5a5d20d7e80fc2a51adf60d838d8a2c40999e /main/survey/app/global_function.php | |
download | 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.gz 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.bz2 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.lz 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.xz 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.zst 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.zip |
Diffstat (limited to 'main/survey/app/global_function.php')
-rw-r--r-- | main/survey/app/global_function.php | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/main/survey/app/global_function.php b/main/survey/app/global_function.php new file mode 100644 index 0000000..1ed4165 --- /dev/null +++ b/main/survey/app/global_function.php @@ -0,0 +1,70 @@ +<?php
+
+// funkcija, ki pridobi iz razreda VariableClass ustrezno vrednost spremenljivke
+function get($variable_get)
+{
+ return \App\Controllers\VariableClass::get($variable_get);
+}
+
+// funkcija, ki shrani v VariableClass ustrezno vrednost spremenljivke
+function save($variable, $value, $return = null)
+{
+ \App\Controllers\VariableClass::save($variable, $value);
+
+ if(!is_null($return) && $return == 1)
+ return $value;
+}
+
+// funkcija, ki shrani v VariableClass vrednost k že obstoječi spremenljivki
+function add($variable, $value, $return = null)
+{
+ \App\Controllers\VariableClass::add($variable, $value, $return);
+
+ return get($variable);
+}
+
+// Init naše razrede
+
+function Helper()
+{
+ return new \App\Controllers\HelperController();
+}
+
+function Display()
+{
+ return new \App\Controllers\DisplayController();
+}
+
+function Language()
+{
+ return new \App\Controllers\LanguageController();
+}
+
+/************************************************
+ * Vrnemo pot do datoteke z jeziki ali direkto pot ali pa preko urlja
+ ************************************************/
+function lang_path($izbrani_jezik = null, $use_site_url = null)
+{
+ global $site_path;
+ global $site_url;
+
+ if (is_null($izbrani_jezik))
+ return $site_path . 'lang/';
+
+ if (is_null($use_site_url))
+ return $site_path . 'lang/' . $izbrani_jezik . '.php';
+
+ // Vrnemo link do lang preko site urlja
+ return $site_url . 'lang/' . $izbrani_jezik . '.php';
+}
+
+function survey_path($file = null)
+{
+ global $site_path;
+ if(is_null($file))
+ return $site_path . 'main/survey/';
+
+ return $site_path . 'main/survey/'.$file;
+}
+
+
|