summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-16 18:57:06 +0300
committerAndrew Dolgov <[email protected]>2021-02-16 18:57:06 +0300
commit91e796938301b3ca3206515e7232db938d7adccc (patch)
tree43e85352a36d991da94f4101d73a172a0ef9d8d2 /include
parent24c79d91c27d41a30e7593b7dca6b5b8bfe84199 (diff)
replace a few more controls to new style
Diffstat (limited to 'include')
-rw-r--r--include/controls_compat.php102
1 files changed, 49 insertions, 53 deletions
diff --git a/include/controls_compat.php b/include/controls_compat.php
index 597eb9879..d62265471 100644
--- a/include/controls_compat.php
+++ b/include/controls_compat.php
@@ -1,5 +1,53 @@
<?php
+
+function stylesheet_tag($filename, $id = false) {
+ $timestamp = filemtime($filename);
+
+ $id_part = $id ? "id=\"$id\"" : "";
+
+ return "<link rel=\"stylesheet\" $id_part type=\"text/css\" data-orig-href=\"$filename\" href=\"$filename?$timestamp\"/>\n";
+}
+
+function javascript_tag($filename) {
+ $query = "";
+
+ if (!(strpos($filename, "?") === false)) {
+ $query = substr($filename, strpos($filename, "?")+1);
+ $filename = substr($filename, 0, strpos($filename, "?"));
+ }
+
+ $timestamp = filemtime($filename);
+
+ if ($query) $timestamp .= "&$query";
+
+ return "<script type=\"text/javascript\" charset=\"utf-8\" src=\"$filename?$timestamp\"></script>\n";
+}
+
+function format_warning($msg, $id = "") {
+ return "<div class=\"alert\" id=\"$id\">$msg</div>";
+}
+
+function format_notice($msg, $id = "") {
+ return "<div class=\"alert alert-info\" id=\"$id\">$msg</div>";
+}
+
+function format_error($msg, $id = "") {
+ return "<div class=\"alert alert-danger\" id=\"$id\">$msg</div>";
+}
+
+function print_notice($msg) {
+ return print format_notice($msg);
+}
+
+function print_warning($msg) {
+ return print format_warning($msg);
+}
+
+function print_error($msg) {
+ return print format_error($msg);
+}
+
// the following is deprecated and will be eventually removed
/*function print_select($id, $default, $values, $attributes = "", $name = "") {
@@ -35,9 +83,8 @@ function print_select_hash($id, $default, $values, $attributes = "", $name = "")
}
print "</select>";
-}*/
+}
-/*
function format_hidden($name, $value) {
return "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"$name\" value=\"$value\">";
}
@@ -45,7 +92,6 @@ function format_hidden($name, $value) {
function print_hidden($name, $value) {
print format_hidden($name, $value);
}
-*/
function format_checkbox($id, $checked, $value = "", $attributes = "") {
$checked_str = $checked ? "checked" : "";
@@ -58,7 +104,6 @@ function print_checkbox($id, $checked, $value = "", $attributes = "") {
print format_checkbox($id, $checked, $value, $attributes);
}
-/*
function format_button($type, $value, $attributes = "") {
return "<button dojoType=\"dijit.form.Button\" $attributes type=\"$type\">$value</button>";
}
@@ -239,56 +284,7 @@ function format_feed_cat_select($id, $default_id, $attributes, $include_all_cats
return $ret;
}
-*/
-
-function stylesheet_tag($filename, $id = false) {
- $timestamp = filemtime($filename);
-
- $id_part = $id ? "id=\"$id\"" : "";
-
- return "<link rel=\"stylesheet\" $id_part type=\"text/css\" data-orig-href=\"$filename\" href=\"$filename?$timestamp\"/>\n";
-}
-
-function javascript_tag($filename) {
- $query = "";
-
- if (!(strpos($filename, "?") === false)) {
- $query = substr($filename, strpos($filename, "?")+1);
- $filename = substr($filename, 0, strpos($filename, "?"));
- }
-
- $timestamp = filemtime($filename);
-
- if ($query) $timestamp .= "&$query";
-
- return "<script type=\"text/javascript\" charset=\"utf-8\" src=\"$filename?$timestamp\"></script>\n";
-}
-
-function format_warning($msg, $id = "") {
- return "<div class=\"alert\" id=\"$id\">$msg</div>";
-}
-
-function format_notice($msg, $id = "") {
- return "<div class=\"alert alert-info\" id=\"$id\">$msg</div>";
-}
-
-function format_error($msg, $id = "") {
- return "<div class=\"alert alert-danger\" id=\"$id\">$msg</div>";
-}
-
-function print_notice($msg) {
- return print format_notice($msg);
-}
-
-function print_warning($msg) {
- return print format_warning($msg);
-}
-
-function print_error($msg) {
- return print format_error($msg);
-}
-/*
function print_label_select($name, $value, $attributes = "") {
$pdo = Db::pdo();