This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".
The branch, feature/twig-template-engine has been updated
via a6a1303d78d9d0f12744aec8adc83d4dd848f2e2 (commit)
via 32b4ccf7f8add925e49161283e7ea23d2a9d1a6c (commit)
from de2febc46f53dc62c71cc599b4cd42f15b0a6a65 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit a6a1303d78d9d0f12744aec8adc83d4dd848f2e2
Author: Roland Mas <[email protected]>
Date: Sun Jun 7 12:50:50 2015 +0200
Implement error_msg, warning_msg, feedback and information with Twig
diff --git a/src/www/themes/funky-twig/Theme.class.php
b/src/www/themes/funky-twig/Theme.class.php
index ea8e21e..6569582 100644
--- a/src/www/themes/funky-twig/Theme.class.php
+++ b/src/www/themes/funky-twig/Theme.class.php
@@ -393,21 +393,33 @@ class Theme extends Layout {
// TODO
return parent::multiTableRow($row_attrs, $cell_data, $istitle);
}
- function feedback($feedback) {
- // TODO
- return parent::feedback($feedback);
+ function feedback($msg) {
+ $template = $this->twig->loadTemplate('feedback.html');
+
+ $vars = array('message' => strip_tags($msg, '<br>'));
+
+ return $template->render($vars);
}
function warning_msg($msg) {
- // TODO
- return parent::warning_msg($msg);
+ $template = $this->twig->loadTemplate('warningMessage.html');
+
+ $vars = array('message' => strip_tags($msg, '<br>'));
+
+ return $template->render($vars);
}
function error_msg($msg) {
- // TODO
- return parent::error_msg($msg);
+ $template = $this->twig->loadTemplate('errorMessage.html');
+
+ $vars = array('message' => strip_tags($msg, '<br>'));
+
+ return $template->render($vars);
}
function information($msg) {
- // TODO
- return parent::information($msg);
+ $template = $this->twig->loadTemplate('information.html');
+
+ $vars = array('message' => strip_tags($msg, '<br>'));
+
+ return $template->render($vars);
}
function confirmBox($msg, $params, $buttons, $image='*none*') {
$template = $this->twig->loadTemplate('ConfirmBox.html');
diff --git a/src/www/themes/funky-twig/templates/errorMessage.html
b/src/www/themes/funky-twig/templates/errorMessage.html
new file mode 100644
index 0000000..0c7e2c7
--- /dev/null
+++ b/src/www/themes/funky-twig/templates/errorMessage.html
@@ -0,0 +1,3 @@
+{% if message %}
+<p class="error">{{ message }}</p>
+{% endif %}
diff --git a/src/www/themes/funky-twig/templates/feedback.html
b/src/www/themes/funky-twig/templates/feedback.html
new file mode 100644
index 0000000..1aa9652
--- /dev/null
+++ b/src/www/themes/funky-twig/templates/feedback.html
@@ -0,0 +1,3 @@
+{% if message %}
+<p class="feedback">{{ message }}</p>
+{% endif %}
diff --git a/src/www/themes/funky-twig/templates/information.html
b/src/www/themes/funky-twig/templates/information.html
new file mode 100644
index 0000000..c5832b7
--- /dev/null
+++ b/src/www/themes/funky-twig/templates/information.html
@@ -0,0 +1,3 @@
+{% if message %}
+<p class="information">{{ message }}</p>
+{% endif %}
diff --git a/src/www/themes/funky-twig/templates/warningMessage.html
b/src/www/themes/funky-twig/templates/warningMessage.html
new file mode 100644
index 0000000..03fbd03
--- /dev/null
+++ b/src/www/themes/funky-twig/templates/warningMessage.html
@@ -0,0 +1,3 @@
+{% if message %}
+<p class="warning_msg">{{ message }}</p>
+{% endif %}
commit 32b4ccf7f8add925e49161283e7ea23d2a9d1a6c
Author: Roland Mas <[email protected]>
Date: Sun Jun 7 12:11:49 2015 +0200
Fixed PHP warning
diff --git a/src/www/include/Layout.class.php b/src/www/include/Layout.class.php
index 4a204b8..e413d59 100644
--- a/src/www/include/Layout.class.php
+++ b/src/www/include/Layout.class.php
@@ -177,7 +177,7 @@ class Layout extends Error {
if (file_exists($filename)) {
$js .= '?'.date ("U", filemtime($filename));
} else {
- $filename = preg_replace(',^/scripts/',
$GLOBALS['fusionforge_basedir'].'/vendor/', $js);
+ $filename = preg_replace(',^/scripts/,',
$GLOBALS['fusionforge_basedir'].'/vendor/', $js);
if (file_exists($filename)) {
$js .= '?'.date ("U",
filemtime($filename));
}
-----------------------------------------------------------------------
Summary of changes:
src/www/include/Layout.class.php | 2 +-
src/www/themes/funky-twig/Theme.class.php | 30 +++++++++++++++-------
.../themes/funky-twig/templates/errorMessage.html | 3 +++
src/www/themes/funky-twig/templates/feedback.html | 3 +++
.../themes/funky-twig/templates/information.html | 3 +++
.../funky-twig/templates/warningMessage.html | 3 +++
6 files changed, 34 insertions(+), 10 deletions(-)
create mode 100644 src/www/themes/funky-twig/templates/errorMessage.html
create mode 100644 src/www/themes/funky-twig/templates/feedback.html
create mode 100644 src/www/themes/funky-twig/templates/information.html
create mode 100644 src/www/themes/funky-twig/templates/warningMessage.html
diff --git a/src/www/include/Layout.class.php b/src/www/include/Layout.class.php
index 4a204b8..e413d59 100644
--- a/src/www/include/Layout.class.php
+++ b/src/www/include/Layout.class.php
@@ -177,7 +177,7 @@ class Layout extends Error {
if (file_exists($filename)) {
$js .= '?'.date ("U", filemtime($filename));
} else {
- $filename = preg_replace(',^/scripts/',
$GLOBALS['fusionforge_basedir'].'/vendor/', $js);
+ $filename = preg_replace(',^/scripts/,',
$GLOBALS['fusionforge_basedir'].'/vendor/', $js);
if (file_exists($filename)) {
$js .= '?'.date ("U",
filemtime($filename));
}
diff --git a/src/www/themes/funky-twig/Theme.class.php
b/src/www/themes/funky-twig/Theme.class.php
index ea8e21e..6569582 100644
--- a/src/www/themes/funky-twig/Theme.class.php
+++ b/src/www/themes/funky-twig/Theme.class.php
@@ -393,21 +393,33 @@ class Theme extends Layout {
// TODO
return parent::multiTableRow($row_attrs, $cell_data, $istitle);
}
- function feedback($feedback) {
- // TODO
- return parent::feedback($feedback);
+ function feedback($msg) {
+ $template = $this->twig->loadTemplate('feedback.html');
+
+ $vars = array('message' => strip_tags($msg, '<br>'));
+
+ return $template->render($vars);
}
function warning_msg($msg) {
- // TODO
- return parent::warning_msg($msg);
+ $template = $this->twig->loadTemplate('warningMessage.html');
+
+ $vars = array('message' => strip_tags($msg, '<br>'));
+
+ return $template->render($vars);
}
function error_msg($msg) {
- // TODO
- return parent::error_msg($msg);
+ $template = $this->twig->loadTemplate('errorMessage.html');
+
+ $vars = array('message' => strip_tags($msg, '<br>'));
+
+ return $template->render($vars);
}
function information($msg) {
- // TODO
- return parent::information($msg);
+ $template = $this->twig->loadTemplate('information.html');
+
+ $vars = array('message' => strip_tags($msg, '<br>'));
+
+ return $template->render($vars);
}
function confirmBox($msg, $params, $buttons, $image='*none*') {
$template = $this->twig->loadTemplate('ConfirmBox.html');
diff --git a/src/www/themes/funky-twig/templates/errorMessage.html
b/src/www/themes/funky-twig/templates/errorMessage.html
new file mode 100644
index 0000000..0c7e2c7
--- /dev/null
+++ b/src/www/themes/funky-twig/templates/errorMessage.html
@@ -0,0 +1,3 @@
+{% if message %}
+<p class="error">{{ message }}</p>
+{% endif %}
diff --git a/src/www/themes/funky-twig/templates/feedback.html
b/src/www/themes/funky-twig/templates/feedback.html
new file mode 100644
index 0000000..1aa9652
--- /dev/null
+++ b/src/www/themes/funky-twig/templates/feedback.html
@@ -0,0 +1,3 @@
+{% if message %}
+<p class="feedback">{{ message }}</p>
+{% endif %}
diff --git a/src/www/themes/funky-twig/templates/information.html
b/src/www/themes/funky-twig/templates/information.html
new file mode 100644
index 0000000..c5832b7
--- /dev/null
+++ b/src/www/themes/funky-twig/templates/information.html
@@ -0,0 +1,3 @@
+{% if message %}
+<p class="information">{{ message }}</p>
+{% endif %}
diff --git a/src/www/themes/funky-twig/templates/warningMessage.html
b/src/www/themes/funky-twig/templates/warningMessage.html
new file mode 100644
index 0000000..03fbd03
--- /dev/null
+++ b/src/www/themes/funky-twig/templates/warningMessage.html
@@ -0,0 +1,3 @@
+{% if message %}
+<p class="warning_msg">{{ message }}</p>
+{% endif %}
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits