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 eba8035fe7005b904299409d350e798473233bde (commit)
via 775c00fd6f2d02dd0975d9f3a8be0e7e2a18c8ac (commit)
via bc063ddc7ec12c53c8039faf7a7a3599cc2e69a6 (commit)
via 0baca9cac77f6f30d9f02d50c623679f79e38d47 (commit)
via 6ba4f0cff10c18ff225b9a748b8f051f406ff4ac (commit)
via 5419b7855fb6d2f20cfc3f36fb00fff105de8218 (commit)
via 490b03c66a0d48ec8072ed2da1d96aae8f026830 (commit)
via 19db1157537f2f6c7a4f0f3b1bd53a9d461a3801 (commit)
via 19a8d8f81d868468432f12e9a852b74cb701dedb (commit)
via fb33234ca5c86661138d293c512a4b2e2f1522d5 (commit)
from 531408ffb0a39aa3bb49af8048440d366034b719 (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 eba8035fe7005b904299409d350e798473233bde
Author: Roland Mas <[email protected]>
Date: Wed May 13 10:47:55 2015 +0200
Fixed HTML syntax in Tabs template
diff --git a/src/www/themes/funky-twig/templates/Tabs.html
b/src/www/themes/funky-twig/templates/Tabs.html
index f8b2529..a33d9e7 100644
--- a/src/www/themes/funky-twig/templates/Tabs.html
+++ b/src/www/themes/funky-twig/templates/Tabs.html
@@ -22,6 +22,7 @@
<span{% if tab.selected %} class="selected"{% endif %}>
<span title="{{ tab.tooltip }}"{% if nested %} class="nested"{% endif %}>{{
tab.title }}</span>
</span>
+ </a>
</td>
{% endfor %}
</tr>
commit 775c00fd6f2d02dd0975d9f3a8be0e7e2a18c8ac
Author: Roland Mas <[email protected]>
Date: Wed May 13 10:46:42 2015 +0200
Implement boxTop, boxMiddle and boxBottom with Twig
diff --git a/src/www/include/Layout.class.php b/src/www/include/Layout.class.php
index 607b465..ffd07e1 100644
--- a/src/www/include/Layout.class.php
+++ b/src/www/include/Layout.class.php
@@ -545,7 +545,7 @@ if (isset($params['group']) && $params['group']) {
* @param string $title Box title
* @return string the html code
*/
- function boxTop($title) {
+ function boxTop($title, $id='') {
return '
<!-- Box Top Start -->
@@ -570,7 +570,7 @@ if (isset($params['group']) && $params['group']) {
* @param string $title Box title
* @return string The html code
*/
- function boxMiddle($title) {
+ function boxMiddle($title, $id='') {
return '
<!-- Box Middle Start -->
</td>
diff --git a/src/www/themes/funky-twig/Theme.class.php
b/src/www/themes/funky-twig/Theme.class.php
index 1870573..fab78d7 100644
--- a/src/www/themes/funky-twig/Theme.class.php
+++ b/src/www/themes/funky-twig/Theme.class.php
@@ -240,17 +240,28 @@ class Theme extends Layout {
// TODO
return parent::getRootIndex();
}
- function boxTop($title) {
- // TODO
- return parent::boxTop($title);
+ function boxTop($title, $id='') {
+ $template = $this->twig->loadTemplate('BoxTop.html');
+
+ $vars = array('id' => $id,
+ 'title' => $title);
+
+ return $template->render($vars);
}
- function boxMiddle($title) {
- // TODO
- return parent::boxMiddle($title);
+ function boxMiddle($title, $id='') {
+ $template = $this->twig->loadTemplate('BoxMiddle.html');
+
+ $vars = array('id' => $id,
+ 'title' => $title);
+
+ return $template->render($vars);
}
function boxBottom() {
- // TODO
- return parent::boxBottom();
+ $template = $this->twig->loadTemplate('BoxBottom.html');
+
+ $vars = array();
+
+ return $template->render($vars);
}
function boxGetAltRowStyle($i, $classonly = false) {
// TODO
diff --git a/src/www/themes/funky-twig/templates/BoxBottom.html
b/src/www/themes/funky-twig/templates/BoxBottom.html
new file mode 100644
index 0000000..c85a3d4
--- /dev/null
+++ b/src/www/themes/funky-twig/templates/BoxBottom.html
@@ -0,0 +1 @@
+</div> <!-- class="box-surround" -->
diff --git a/src/www/themes/funky-twig/templates/BoxMiddle.html
b/src/www/themes/funky-twig/templates/BoxMiddle.html
new file mode 100644
index 0000000..daf3565
--- /dev/null
+++ b/src/www/themes/funky-twig/templates/BoxMiddle.html
@@ -0,0 +1,3 @@
+<div {% if id %}id="{{ id }}-title"{% endif %} class="box-middle">
+ {{ title }}
+</div>
diff --git a/src/www/themes/funky-twig/templates/BoxTop.html
b/src/www/themes/funky-twig/templates/BoxTop.html
new file mode 100644
index 0000000..c21455b
--- /dev/null
+++ b/src/www/themes/funky-twig/templates/BoxTop.html
@@ -0,0 +1,6 @@
+<div {% if id %}id="{{ id }}"{% endif %} class="box-surround">
+ <div {% if id %}id="{{ id }}-title"{% endif %} class="box-surround">
+ <div {% if id %}id="{{ id }}-title-content"{% endif %}
class="box-surround">
+ {{ title }}
+ </div>
+ </div>
commit bc063ddc7ec12c53c8039faf7a7a3599cc2e69a6
Author: Roland Mas <[email protected]>
Date: Wed May 13 10:29:00 2015 +0200
Fixed HTMLDeclaration
diff --git a/src/www/themes/funky-twig/Theme.class.php
b/src/www/themes/funky-twig/Theme.class.php
index 46213d4..1870573 100644
--- a/src/www/themes/funky-twig/Theme.class.php
+++ b/src/www/themes/funky-twig/Theme.class.php
@@ -177,6 +177,8 @@ class Theme extends Layout {
return parent::headerStart($params);
}
function headerHTMLDeclaration() {
+ global $sysDTDs, $sysXMLNSs;
+
$template = $this->twig->loadTemplate('HTMLDeclaration.html');
$vars = array();
@@ -188,7 +190,7 @@ class Theme extends Layout {
$vars['lang'] = _('en');
$vars['ns'] = $sysXMLNSs;
- return $template->render($vars);
+ print $template->render($vars);
}
function headerTitle($params) {
// TODO
diff --git a/src/www/themes/funky-twig/templates/HTMLDeclaration.html
b/src/www/themes/funky-twig/templates/HTMLDeclaration.html
index 31a09d9..302a3fa 100644
--- a/src/www/themes/funky-twig/templates/HTMLDeclaration.html
+++ b/src/www/themes/funky-twig/templates/HTMLDeclaration.html
@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
-{{ dtd }}
-<html xml:lang="{{ lang }}" lang="{{ lang }}" {{ ns }}>
+{{ dtd|raw }}
+<html xml:lang="{{ lang }}" lang="{{ lang }}" {{ ns|raw }}>
commit 0baca9cac77f6f30d9f02d50c623679f79e38d47
Author: Roland Mas <[email protected]>
Date: Tue May 12 21:04:02 2015 +0200
Fixed syntax errors
diff --git a/src/www/themes/funky-twig/Theme.class.php
b/src/www/themes/funky-twig/Theme.class.php
index 891bd9e..46213d4 100644
--- a/src/www/themes/funky-twig/Theme.class.php
+++ b/src/www/themes/funky-twig/Theme.class.php
@@ -145,7 +145,7 @@ class Theme extends Layout {
}
$this->javascripts = array();
- $vars = array('js' => $scripts);,
+ $vars = array('js' => $scripts);
return $template->render($vars);
}
@@ -164,7 +164,7 @@ class Theme extends Layout {
}
$this->stylesheets = array();
- $vars = array('sheets' => $sheets);,
+ $vars = array('sheets' => $sheets);
return $template->render($vars);
}
@@ -232,7 +232,7 @@ class Theme extends Layout {
}
function footerEnd() {
// TODO
- return parent::footerEnd() { ;
+ return parent::footerEnd();
}
function getRootIndex() {
// TODO
@@ -274,10 +274,6 @@ class Theme extends Layout {
// TODO
return parent::projectTabs($toptab, $group_id);
}
- function tabGenerator($TABS_DIRS, $TABS_TITLES, $TABS_TOOLTIPS,
$nested=false, $selected=false, $sel_tab_bgcolor='white', $total_width='100%') {
- // TODO
- return parent::tabGenerator($TABS_DIRS, $TABS_TITLES,
$TABS_TOOLTIPS, $nested, $selected, $sel_tab_bgcolor, $total_width);
- }
function searchBox() {
// TODO
return parent::searchBox();
@@ -352,7 +348,7 @@ class Theme extends Layout {
}
function html_checkbox($name, $value, $id = '', $label = '', $checked =
'', $extra_params = array()) {
// TODO
- return parent::html_checkbox($name, $value, $id, $label,
$checked, $extra_params) {
+ return parent::html_checkbox($name, $value, $id, $label,
$checked, $extra_params);
}
function html_text_input_img_submit($name, $img_src, $id = '', $label =
'', $value = '', $img_title = '', $img_alt = '', $extra_params = array(),
$img_extra_params = '') {
// TODO
@@ -464,7 +460,7 @@ class Theme extends Layout {
}
function widget(&$widget, $layout_id, $readonly, $column_id,
$is_minimized, $display_preferences, $owner_id, $owner_type) {
// TODO
- return parent::widget(&$widget, $layout_id, $readonly,
$column_id, $is_minimized, $display_preferences, $owner_id, $owner_type);
+ return parent::widget($widget, $layout_id, $readonly,
$column_id, $is_minimized, $display_preferences, $owner_id, $owner_type);
}
function _getTogglePlusForWidgets() {
// TODO
commit 6ba4f0cff10c18ff225b9a748b8f051f406ff4ac
Author: Roland Mas <[email protected]>
Date: Tue May 12 20:40:42 2015 +0200
Implement confirmBox and jQueryUIconfirmBox with Twig
diff --git a/src/www/themes/funky-twig/Theme.class.php
b/src/www/themes/funky-twig/Theme.class.php
index 61c92e4..891bd9e 100644
--- a/src/www/themes/funky-twig/Theme.class.php
+++ b/src/www/themes/funky-twig/Theme.class.php
@@ -323,12 +323,28 @@ class Theme extends Layout {
return parent::information($msg);
}
function confirmBox($msg, $params, $buttons, $image='*none*') {
- // TODO
- return parent::confirmBox($msg, $params, $buttons, $image);
+ $template = $this->twig->loadTemplate('ConfirmBox.html');
+
+ if ($image == '*none*') {
+ $image = html_image('stop.png','48','48',array());
+ }
+
+ $vars = array('params' => $params,
+ 'buttons' => $buttons,
+ 'image' => $image,
+ 'msg' => $msg,
+ 'action' =>
getStringFromServer('PHP_SELF'));
+
+ return $template->render($vars);
}
function jQueryUIconfirmBox($id = 'dialog-confirm', $title = 'Confirm
your action', $message = 'Do you confirm your action?') {
- // TODO
- return parent::jQueryUIconfirmBox($id, $title, $message);
+ $template =
$this->twig->loadTemplate('jQueryUIConfirmBox.html');
+
+ $vars = array('id' => $id,
+ 'title' => $title,
+ 'message' => $message);
+
+ return $template->render($vars);
}
function html_input($name, $id = '', $label = '', $type = 'text',
$value = '', $extra_params = '') {
// TODO
diff --git a/src/www/themes/funky-twig/templates/ConfirmBox.html
b/src/www/themes/funky-twig/templates/ConfirmBox.html
new file mode 100644
index 0000000..0a20208
--- /dev/null
+++ b/src/www/themes/funky-twig/templates/ConfirmBox.html
@@ -0,0 +1,20 @@
+<div id='infobox' style="margin-top: 15%; margin-left: 15%; margin-right: 15%;
text-align: center;">
+ <table align="center">
+ <tr>
+ <td>{{ image }}</td>
+ <td>{{ msg }}</td>
+ </tr>
+ <tr>
+ <td colspan="2" align="center">
+ <form action="{{ action }}" method="get">
+ {% for k,v in params %}
+ <input type="hidden" name="{{ k }}" value="{{ v }}" />
+ {% endfor %}
+ {% for k,v in buttons %}
+ <input type="submit" name="{{ k }}" value="{{ v }}" />
+ {% endfor %}
+ </form>
+ </td>
+ </tr>
+ </table>
+</div>
diff --git a/src/www/themes/funky-twig/templates/jQueryUIConfirmBox.html
b/src/www/themes/funky-twig/templates/jQueryUIConfirmBox.html
new file mode 100644
index 0000000..2fbd1d2
--- /dev/null
+++ b/src/www/themes/funky-twig/templates/jQueryUIConfirmBox.html
@@ -0,0 +1,7 @@
+<div id="{{ id }}" title="{{ title }}" class="hide">
+ <p>
+ <span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px
0;">
+ {{ message }}
+ </span>
+ </p>
+</div>
commit 5419b7855fb6d2f20cfc3f36fb00fff105de8218
Author: Roland Mas <[email protected]>
Date: Tue May 12 20:26:08 2015 +0200
Implement headerHTMLDeclaration with Twig
diff --git a/src/www/themes/funky-twig/Theme.class.php
b/src/www/themes/funky-twig/Theme.class.php
index 073d7e2..61c92e4 100644
--- a/src/www/themes/funky-twig/Theme.class.php
+++ b/src/www/themes/funky-twig/Theme.class.php
@@ -177,8 +177,18 @@ class Theme extends Layout {
return parent::headerStart($params);
}
function headerHTMLDeclaration() {
- // TODO
- return parent::headerHTMLDeclaration();
+ $template = $this->twig->loadTemplate('HTMLDeclaration.html');
+
+ $vars = array();
+
+ if (!util_ifsetor($this->doctype) ||
!util_ifsetor($sysDTDs[$this->doctype])) {
+ $this->doctype = 'transitional';
+ }
+ $vars['dtd'] = $sysDTDs[$this->doctype]['doctype'];
+ $vars['lang'] = _('en');
+ $vars['ns'] = $sysXMLNSs;
+
+ return $template->render($vars);
}
function headerTitle($params) {
// TODO
diff --git a/src/www/themes/funky-twig/templates/HTMLDeclaration.html
b/src/www/themes/funky-twig/templates/HTMLDeclaration.html
new file mode 100644
index 0000000..31a09d9
--- /dev/null
+++ b/src/www/themes/funky-twig/templates/HTMLDeclaration.html
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+{{ dtd }}
+<html xml:lang="{{ lang }}" lang="{{ lang }}" {{ ns }}>
commit 490b03c66a0d48ec8072ed2da1d96aae8f026830
Author: Roland Mas <[email protected]>
Date: Tue May 12 20:20:22 2015 +0200
Implement getJavascripts and getStylesheets with Twig
diff --git a/src/www/themes/funky-twig/Theme.class.php
b/src/www/themes/funky-twig/Theme.class.php
index 8529333..073d7e2 100644
--- a/src/www/themes/funky-twig/Theme.class.php
+++ b/src/www/themes/funky-twig/Theme.class.php
@@ -137,12 +137,36 @@ class Theme extends Layout {
return parent::addStylesheet($css, $media);
}
function getJavascripts() {
- // TODO
- return parent::getJavascripts();
+ $template = $this->twig->loadTemplate('JavaScripts.html');
+
+ $scripts = array();
+ foreach ($this->javascripts as $js) {
+ $scripts[] = util_make_uri($js);
+ }
+ $this->javascripts = array();
+
+ $vars = array('js' => $scripts);,
+
+ return $template->render($vars);
}
function getStylesheets() {
- // TODO
- return parent::getStylesheets();
+ $template = $this->twig->loadTemplate('StyleSheets.html');
+
+ $sheets = array();
+ foreach ($this->stylesheets as $c) {
+ $sheet = array('css' => util_make_uri($c['css']));
+ if ($c['media']) {
+ $sheet['media'] = $c['media'];
+ } else {
+ $sheet['media'] = '';
+ }
+ $sheets[] = $sheet;
+ }
+ $this->stylesheets = array();
+
+ $vars = array('sheets' => $sheets);,
+
+ return $template->render($vars);
}
function header($params) {
// TODO
diff --git a/src/www/themes/funky-twig/templates/JavaScripts.html
b/src/www/themes/funky-twig/templates/JavaScripts.html
new file mode 100644
index 0000000..3d2f2a2
--- /dev/null
+++ b/src/www/themes/funky-twig/templates/JavaScripts.html
@@ -0,0 +1,3 @@
+{% for i in js %}
+<script type='text/javascript' src='{{ i }}' />
+{% endfor %}
diff --git a/src/www/themes/funky-twig/templates/StyleSheets.html
b/src/www/themes/funky-twig/templates/StyleSheets.html
new file mode 100644
index 0000000..3d7092b
--- /dev/null
+++ b/src/www/themes/funky-twig/templates/StyleSheets.html
@@ -0,0 +1,3 @@
+{% for i in sheets %}
+<link type='text/css' src='{{ i.css }}' {% if i.media != '' %}media='{{
i.media }}' {% endif %}/>
+{% endfor %}
commit 19db1157537f2f6c7a4f0f3b1bd53a9d461a3801
Author: Roland Mas <[email protected]>
Date: Tue May 12 20:08:59 2015 +0200
Added reminders of what methods to reimplement
diff --git a/src/www/themes/funky-twig/Theme.class.php
b/src/www/themes/funky-twig/Theme.class.php
index 4a2fb06..8529333 100644
--- a/src/www/themes/funky-twig/Theme.class.php
+++ b/src/www/themes/funky-twig/Theme.class.php
@@ -45,170 +45,6 @@ class Theme extends Layout {
}
- function bodyHeader($params) {
- if (!isset($params['h1']) && isset($params['title'])) {
- $params['h1'] = $params['title'];
- }
-
- if (!isset($params['title'])) {
- $params['title'] = forge_get_config('forge_name');
- } else {
- $params['title'] = $params['title'] . " -
".forge_get_config('forge_name');
- }
-
- echo $this->listTableTop(array(), array(), 'fullwidth',
'header');
- $cells = array();
- $cells[] = array(util_make_link('/',
html_image('/header/top-logo.png', null, null, array('alt'=>'FusionForge
Home'))), 'id' => 'header-col1');
- $items = $this->navigation->getUserLinks();
- for ($j = 0; $j < count($items['titles']); $j++) {
- $links[] = util_make_link($items['urls'][$j],
$items['titles'][$j], array('class' => 'userlink'), true);
- }
- $params['links'] = &$links;
- plugin_hook('headermenu', $params);
- $template = isset($params['template']) ? $params['template'] :
' | ';
- $cells[] = array(implode($template, $links), 'id' =>
'header-col2');
- echo $this->multiTableRow(array(), $cells);
- $cells = array();
- $cells[] = array($this->quickNav().$this->searchBox(), 'id' =>
'header-line2', 'colspan' => 2);
- echo $this->multiTableRow(array(), $cells);
- echo $this->listTableBottom();
- $this->outerTabs($params);
- echo '<!-- inner tabs -->' . "\n";
- echo html_ao('div', array('class' => 'innertabs'));
- if (isset($params['group']) && $params['group']) {
- $this->projectTabs($params['toptab'], $params['group']);
- }
-
- echo html_ac(html_ap() -1);
- echo html_ao('div', array('id' => 'maindiv'));
-
- plugin_hook('message');
-
- if(isset($GLOBALS['error_msg']) && $GLOBALS['error_msg']) {
- echo $this->error_msg($GLOBALS['error_msg']);
- }
- if(isset($GLOBALS['warning_msg']) && $GLOBALS['warning_msg']) {
- echo $this->warning_msg($GLOBALS['warning_msg']);
- }
- if(isset($GLOBALS['feedback']) && $GLOBALS['feedback']) {
- echo $this->feedback($GLOBALS['feedback']);
- }
-
- if (isset($params['h1'])) {
- echo html_e('h1', array(), $params['h1'], false);
- } elseif (isset($params['title'])) {
- echo html_e('h1', array('class' => 'hide'),
$params['title'], false);
- }
- if (isset($params['submenu']))
- echo $params['submenu'];
- }
-
- function bodyFooter($params) {
- echo html_ac(html_ap() -1).'<!-- id="maindiv" -->' . "\n";
- }
-
- function footer($params = array()) {
- $this->bodyFooter($params);
- echo html_ao('div', array('class' => 'footer'));
- echo $this->navigation->getPoweredBy();
- echo $this->navigation->getShowSource();
- echo html_e('div', array('style' => 'clear:both'), '', false);
- echo html_ac(html_ap() -1);
- plugin_hook('webanalytics_url');
- echo html_ac(html_ap() -1);
- echo '</html>' . "\n";
- }
-
- /**
- * boxTop() - Top HTML box
- *
- * @param string $title Box title
- * @param string $id
- * @return string
- */
- function boxTop($title, $id = '') {
- if ($id) {
- $id = $this->toSlug($id);
- $idid = $id;
- $idtitle = $id.'-title"';
- $idtcont = $id.'-title-content"';
- } else {
- $idid = "";
- $idtitle = "";
- $idtcont = "";
- }
-
- $t_result = '';
- $t_result .= html_ao('div', array('id' => $idid, 'class' =>
'box-surround'));
- $t_result .= html_ao('div', array('id' => $idtitle, 'class' =>
'box-title'));
- $t_result .= html_e('div', array('id' => $idtcont, 'class' =>
'box-title-content'), $title, false);
- $t_result .= html_ac(html_ap() -1);
- return $t_result;
- }
-
- /**
- * boxMiddle() - Middle HTML box
- *
- * @param string $title Box title
- * @param string $id
- * @return string
- */
- function boxMiddle($title, $id = '') {
- if ($id) {
- $id = $this->toSlug($id);
- $idtitle = $id.'-title"';
- } else {
- $idtitle = "";
- }
-
- return html_e('div', array('id' => $idtitle, 'class' =>
'box-middle'), $title, false);
- }
-
- /**
- * boxContent() - Content HTML box
- *
- * @param string $content Box content
- * @param string $id
- * @return string
- */
- function boxContent($content, $id = '') {
- if ($id) {
- $id = $this->toSlug($id);
- $idcont = $id.'-content"';
- } else {
- $idcont = "";
- }
-
- return html_e('div', array('id' => $idcont, 'class' =>
'box-content'), $content, false);
- }
-
- /**
- * boxBottom() - Bottom HTML box
- *
- * @return string
- */
- function boxBottom() {
- return html_ac(html_ap() -1).'<!-- class="box-surround"
-->'."\n";
- }
-
- /**
- * boxGetAltRowStyle() - Get an alternating row style for tables
- *
- * @param int $i Row number
- * @param bool $classonly Return class name only
- * @return string
- */
- function boxGetAltRowStyle($i, $classonly = false) {
- if ($i % 2 == 0)
- $ret = 'bgcolor-white';
- else
- $ret = 'bgcolor-grey';
- if ($classonly)
- return $ret;
- else
- return 'class="'.$ret.'"';
- }
-
function tabGenerator($TABS_DIRS, $TABS_TITLES, $TABS_TOOLTIPS,
$nested=false, $selected=false, $sel_tab_bgcolor='WHITE',
$total_width='100%') {
global $use_tooltips;
@@ -237,144 +73,6 @@ class Theme extends Layout {
return $template->render($vars);
}
- /**
- * beginSubMenu() - Opening a submenu.
- *
- * @return string Html to start a submenu.
- */
- function beginSubMenu() {
- return html_ao('ul', array('class' => 'submenu'));
- }
-
- /**
- * endSubMenu() - Closing a submenu.
- *
- * @return string Html to end a submenu.
- */
- function endSubMenu() {
- return html_ac(html_ap() -1);
- }
-
- /**
- * printSubMenu() - Takes two array of titles and links and builds the
contents of a menu.
- *
- * @param array $title_arr The array of titles.
- * @param array $links_arr The array of title links.
- * @param array $attr_arr The array of attributs by link
- * @return string Html to build a submenu.
- */
- function printSubMenu($title_arr, $links_arr, $attr_arr) {
- $count = count($title_arr) - 1;
- $return = '';
-
- if (!count($attr_arr)) {
- for ($i=0; $i<count($title_arr); $i++) {
- $attr_arr[] = NULL;
- }
- }
- for ($i = 0; $i < $count; $i++) {
- $return .= html_ao('li');
- $return .= html_e('span', array(),
util_make_link($links_arr[$i], $title_arr[$i], $attr_arr[$i]), false);
- $return .= html_ac(html_ap() -1);
- }
-
- $return .= html_ao('li');
- $return .= html_e('span', array(),
util_make_link($links_arr[$i], $title_arr[$i], $attr_arr[$i]), false);
- $return .= html_ac(html_ap() -1);
- return $return;
- }
-
- /**
- * subMenu() - Takes two array of titles and links and build a menu.
- *
- * @param array $title_arr The array of titles.
- * @param array $links_arr The array of title links.
- * @param array $attr_arr The array of attributes by link
- * @return string Html to build a submenu.
- */
- function subMenu($title_arr, $links_arr, $attr_arr = array()) {
- $return = $this->beginSubMenu();
- $return .= $this->printSubMenu($title_arr, $links_arr,
$attr_arr);
- $return .= $this->endSubMenu();
- return $return;
- }
-
- /**
- * multiTableRow() - create a multilevel row in a table
- *
- * @param array $row_attrs the row attributes
- * @param array $cell_data the array of cell data, each
element is an array,
- * the first item being the text,
- * the subsequent items are
attributes (dont include
- * the bgcolor for the title here,
that will be
- * handled by $istitle
- * @param bool $istitle is this row part of the title ?
- *
- * @return string
- */
- function multiTableRow($row_attrs, $cell_data, $istitle = false) {
- $ap = html_ap();
- (isset($row_attrs['class'])) ? $row_attrs['class'] .= ' ff' :
$row_attrs['class'] = 'ff';
- if ( $istitle ) {
- $row_attrs['class'] .= ' align-center';
- }
- $return = html_ao('tr', $row_attrs);
- for ( $c = 0; $c < count($cell_data); $c++ ) {
- $locAp = html_ap();
- $cellAttrs = array();
- foreach (array_slice($cell_data[$c],1) as $k => $v) {
- $cellAttrs[$k] = $v;
- }
- (isset($cellAttrs['class'])) ? $cellAttrs['class'] .= '
ff' : $cellAttrs['class'] = 'ff';
- $return .= html_ao('td', $cellAttrs);
- if ( $istitle ) {
- $return .= html_ao('strong');
- }
- $return .= $cell_data[$c][0];
- if ( $istitle ) {
- $return .= html_ac(html_ap() -1);
- }
- $return .= html_ac($locAp);
- }
- $return .= html_ac($ap);
- return $return;
- }
-
- /**
- * headerJS() - creates the JS headers and calls the plugin javascript
hook
- * @todo generalize this
- */
- function headerJS() {
- echo html_e('script', array('type' => 'text/javascript', 'src'
=> util_make_uri('/js/common.js')), '', false);
-
- plugin_hook("javascript_file");
-
- // invoke the 'javascript' hook for custom javascript addition
- $params = array('return' => false);
- plugin_hook("javascript", $params);
- $javascript = $params['return'];
- if($javascript) {
- echo html_ao('script', array('type' =>
'text/javascript')).'//<![CDATA['."\n";
- echo $javascript;
- echo "\n".'//]]'."\n";
- echo html_ac(html_ap() -1);
- }
- html_use_storage();
- html_use_coolfieldset();
- html_use_jqueryui();
- echo $this->getJavascripts();
- echo html_ao('script', array('type' => 'text/javascript'));
- echo ' //<![CDATA[
- jQuery(window).load(function(){
-
setTimeout("jQuery(\'.feedback\').hide(\'slow\')", 5000);
- setInterval(function() {
-
setTimeout("jQuery(\'.feedback\').hide(\'slow\')", 5000);
- }, 5000);
- });
- //]]>'."\n";
- echo html_ac(html_ap() -1);
- }
-
function makeLink($path, $text, $extra_params = false, $absolute =
false) {
global $use_tooltips;
@@ -428,6 +126,324 @@ class Theme extends Layout {
return $template->render($vars);
}
+
+ // Methods to reimplement (if relevant)
+ function addJavascript($js) {
+ // TODO
+ return parent::addJavascript($js);
+ }
+ function addStylesheet($css, $media='') {
+ // TODO
+ return parent::addStylesheet($css, $media);
+ }
+ function getJavascripts() {
+ // TODO
+ return parent::getJavascripts();
+ }
+ function getStylesheets() {
+ // TODO
+ return parent::getStylesheets();
+ }
+ function header($params) {
+ // TODO
+ return parent::header($params);
+ }
+ function headerStart($params) {
+ // TODO
+ return parent::headerStart($params);
+ }
+ function headerHTMLDeclaration() {
+ // TODO
+ return parent::headerHTMLDeclaration();
+ }
+ function headerTitle($params) {
+ // TODO
+ return parent::headerTitle($params);
+ }
+ function headerFavIcon() {
+ // TODO
+ return parent::headerFavIcon();
+ }
+ function headerRSS() {
+ // TODO
+ return parent::headerRSS();
+ }
+ function headerSearch() {
+ // TODO
+ return parent::headerSearch();
+ }
+ function headerCSS() {
+ // TODO
+ return parent::headerCSS();
+ }
+ function headerJS() {
+ // TODO
+ return parent::headerJS();
+ }
+ function headerLinkedDataAutodiscovery() {
+ // TODO
+ return parent::headerLinkedDataAutodiscovery();
+ }
+ function headerForgepluckerMeta() {
+ // TODO
+ return parent::headerForgepluckerMeta();
+ }
+ function bodyHeader($params){
+ // TODO
+ return parent::bodyHeader($params);
+ }
+ function footer($params = array()) {
+ // TODO
+ return parent::footer($params);
+ }
+ function footerEnd() {
+ // TODO
+ return parent::footerEnd() { ;
+ }
+ function getRootIndex() {
+ // TODO
+ return parent::getRootIndex();
+ }
+ function boxTop($title) {
+ // TODO
+ return parent::boxTop($title);
+ }
+ function boxMiddle($title) {
+ // TODO
+ return parent::boxMiddle($title);
+ }
+ function boxBottom() {
+ // TODO
+ return parent::boxBottom();
+ }
+ function boxGetAltRowStyle($i, $classonly = false) {
+ // TODO
+ return parent::boxGetAltRowStyle($i, $classonly);
+ }
+ function listTableTop($titleArray = array(), $linksArray = array(),
$class = '', $id = '', $thClassArray = array(), $thTitleArray = array(),
$thOtherAttrsArray = array()) {
+ // TODO
+ return parent::listTableTop($titleArray, $linksArray, $class,
$id, $thClassArray, $thTitleArray, $thOtherAttrsArray);
+ }
+ function listTableBottom() {
+ // TODO
+ return parent::listTableBottom();
+ }
+ function outerTabs($params) {
+ // TODO
+ return parent::outerTabs($params);
+ }
+ function quickNav() {
+ // TODO
+ return parent::quickNav();
+ }
+ function projectTabs($toptab, $group_id) {
+ // TODO
+ return parent::projectTabs($toptab, $group_id);
+ }
+ function tabGenerator($TABS_DIRS, $TABS_TITLES, $TABS_TOOLTIPS,
$nested=false, $selected=false, $sel_tab_bgcolor='white', $total_width='100%') {
+ // TODO
+ return parent::tabGenerator($TABS_DIRS, $TABS_TITLES,
$TABS_TOOLTIPS, $nested, $selected, $sel_tab_bgcolor, $total_width);
+ }
+ function searchBox() {
+ // TODO
+ return parent::searchBox();
+ }
+ function beginSubMenu() {
+ // TODO
+ return parent::beginSubMenu();
+ }
+ function endSubMenu() {
+ // TODO
+ return parent::endSubMenu();
+ }
+ function printSubMenu($title_arr, $links_arr, $attr_arr) {
+ // TODO
+ return parent::printSubMenu($title_arr, $links_arr, $attr_arr);
+ }
+ function subMenuSeparator() {
+ // TODO
+ return parent::subMenuSeparator();
+ }
+ function subMenu($title_arr, $links_arr, $attr_arr = array()) {
+ // TODO
+ return parent::subMenu($title_arr, $links_arr, $attr_arr);
+ }
+ function multiTableRow($row_attrs, $cell_data, $istitle = false) {
+ // TODO
+ return parent::multiTableRow($row_attrs, $cell_data, $istitle);
+ }
+ function feedback($feedback) {
+ // TODO
+ return parent::feedback($feedback);
+ }
+ function warning_msg($msg) {
+ // TODO
+ return parent::warning_msg($msg);
+ }
+ function error_msg($msg) {
+ // TODO
+ return parent::error_msg($msg);
+ }
+ function information($msg) {
+ // TODO
+ return parent::information($msg);
+ }
+ function confirmBox($msg, $params, $buttons, $image='*none*') {
+ // TODO
+ return parent::confirmBox($msg, $params, $buttons, $image);
+ }
+ function jQueryUIconfirmBox($id = 'dialog-confirm', $title = 'Confirm
your action', $message = 'Do you confirm your action?') {
+ // TODO
+ return parent::jQueryUIconfirmBox($id, $title, $message);
+ }
+ function html_input($name, $id = '', $label = '', $type = 'text',
$value = '', $extra_params = '') {
+ // TODO
+ return parent::html_input($name, $id, $label, $type, $value,
$extra_params);
+ }
+ function html_checkbox($name, $value, $id = '', $label = '', $checked =
'', $extra_params = array()) {
+ // TODO
+ return parent::html_checkbox($name, $value, $id, $label,
$checked, $extra_params) {
+ }
+ function html_text_input_img_submit($name, $img_src, $id = '', $label =
'', $value = '', $img_title = '', $img_alt = '', $extra_params = array(),
$img_extra_params = '') {
+ // TODO
+ return parent::html_text_input_img_submit($name, $img_src, $id,
$label, $value, $img_title, $img_alt, $extra_params, $img_extra_params);
+ }
+ function html_select($vals, $name, $label = '', $id = '', $checked_val
= '', $text_is_value = false, $extra_params = '') {
+ // TODO
+ return parent::html_select($vals, $name, $label, $id,
$checked_val, $text_is_value, $extra_params);
+ }
+ function html_textarea($name, $id = '', $label = '', $value = '',
$extra_params = '') {
+ // TODO
+ return parent::html_textarea($name, $id, $label, $value,
$extra_params);
+ }
+ function html_table_top($cols, $summary = '', $class = '',
$extra_params = '') {
+ // TODO
+ return parent::html_table_top($cols, $summary, $class,
$extra_params);
+ }
+ function getMonitorPic($title = '', $alt = '') {
+ // TODO
+ return parent::getMonitorPic($title, $alt);
+ }
+ function getStartMonitoringPic($title = '', $alt = '') {
+ // TODO
+ return parent::getStartMonitoringPic($title, $alt);
+ }
+ function getStopMonitoringPic($title = '', $alt = '') {
+ // TODO
+ return parent::getStopMonitoringPic($title, $alt);
+ }
+ function getReleaseNotesPic($title = '', $alt = '') {
+ // TODO
+ return parent::getReleaseNotesPic($title, $alt);
+ }
+ function getDownloadPic($title = '', $alt = '') {
+ // TODO
+ return parent::getDownloadPic($title, $alt);
+ }
+ function getHomePic($title = '', $alt = '') {
+ // TODO
+ return parent::getHomePic($title, $alt);
+ }
+ function getFollowPic($title = '', $alt = '') {
+ // TODO
+ return parent::getFollowPic($title, $alt);
+ }
+ function getForumPic($title = '', $alt = '') {
+ // TODO
+ return parent::getForumPic($title, $alt);
+ }
+ function getDocmanPic($title = '', $alt = '') {
+ // TODO
+ return parent::getDocmanPic($title, $alt);
+ }
+ function getMailPic($title = '', $alt = '') {
+ // TODO
+ return parent::getMailPic($title, $alt);
+ }
+ function getPmPic($title = '', $alt = '') {
+ // TODO
+ return parent::getPmPic($title, $alt);
+ }
+ function getSurveyPic($title = '', $alt = '') {
+ // TODO
+ return parent::getSurveyPic($title, $alt);
+ }
+ function getScmPic($title = '', $alt = '') {
+ // TODO
+ return parent::getScmPic($title, $alt);
+ }
+ function getFtpPic($title = '', $alt = '') {
+ // TODO
+ return parent::getFtpPic($title, $alt);
+ }
+ function getDeletePic($title = '', $alt = '', $otherAttr = array()) {
+ // TODO
+ return parent::getDeletePic($title, $alt, $otherAttr);
+ }
+ function getRemovePic($title = '', $alt = '', $otherAttr = array()) {
+ // TODO
+ return parent::getRemovePic($title, $alt, $otherAttr);
+ }
+ function getConfigurePic($title = '', $alt = '', $otherAttr = array()) {
+ // TODO
+ return parent::getConfigurePic($title, $alt, $otherAttr);
+ }
+ function getZipPic($title = '', $alt = '', $otherAttr = array()) {
+ // TODO
+ return parent::getZipPic($title, $alt, $otherAttr);
+ }
+ function getAddDirPic($title = '', $alt = '', $otherAttr = array()) {
+ // TODO
+ return parent::getAddDirPic($title, $alt, $otherAttr);
+ }
+ function getNewPic($title = '', $alt = '', $otherAttr = array()) {
+ // TODO
+ return parent::getNewPic($title, $alt, $otherAttr);
+ }
+ function getFolderPic($title = '', $alt = '', $otherAttr = array()) {
+ // TODO
+ return parent::getFolderPic($title, $alt, $otherAttr);
+ }
+ function getPicto($url, $title, $alt, $width = '20', $height = '20',
$otherAttr = array()) {
+ // TODO
+ return parent::getPicto($url, $title, $alt, $width, $height,
$otherAttr);
+ }
+ function toSlug($string, $space = "-") {
+ // TODO
+ return parent::toSlug($string, $space);
+ }
+ function widget(&$widget, $layout_id, $readonly, $column_id,
$is_minimized, $display_preferences, $owner_id, $owner_type) {
+ // TODO
+ return parent::widget(&$widget, $layout_id, $readonly,
$column_id, $is_minimized, $display_preferences, $owner_id, $owner_type);
+ }
+ function _getTogglePlusForWidgets() {
+ // TODO
+ return parent::_getTogglePlusForWidgets();
+ }
+ function _getToggleMinusForWidgets() {
+ // TODO
+ return parent::_getToggleMinusForWidgets();
+ }
+ function printSoftwareMapLinks() {
+ // TODO
+ return parent::printSoftwareMapLinks();
+ }
+ function displayStylesheetElements() {
+ // TODO
+ return parent::displayStylesheetElements();
+ }
+ function openForm($args) {
+ // TODO
+ return parent::openForm($args);
+ }
+ function closeForm() {
+ // TODO
+ return parent::closeForm();
+ }
+ function addRequiredFieldsInfoBox() {
+ // TODO
+ return parent::addRequiredFieldsInfoBox();
+ }
}
// Local Variables:
commit 19a8d8f81d868468432f12e9a852b74cb701dedb
Author: Roland Mas <[email protected]>
Date: Tue May 12 19:31:43 2015 +0200
Implement html_chartid with Twig
diff --git a/src/www/themes/funky-twig/Theme.class.php
b/src/www/themes/funky-twig/Theme.class.php
index 6c1ebdb..4a2fb06 100644
--- a/src/www/themes/funky-twig/Theme.class.php
+++ b/src/www/themes/funky-twig/Theme.class.php
@@ -420,6 +420,14 @@ class Theme extends Layout {
return $template->render($vars);
}
+ function html_chartid($id = 0, $title = '') {
+ $template = $this->twig->loadTemplate('ChartId.html');
+
+ $vars = array('chart_id' => $id,
+ 'title' => $title);
+
+ return $template->render($vars);
+ }
}
// Local Variables:
diff --git a/src/www/themes/funky-twig/templates/ChartId.html
b/src/www/themes/funky-twig/templates/ChartId.html
new file mode 100644
index 0000000..41f554e
--- /dev/null
+++ b/src/www/themes/funky-twig/templates/ChartId.html
@@ -0,0 +1,5 @@
+<figure>
+ <figcaption>{{ title }}</figcaption>
+ <div id={{ chart_id }}>
+ </div>
+</figure>
commit fb33234ca5c86661138d293c512a4b2e2f1522d5
Author: Roland Mas <[email protected]>
Date: Tue May 12 19:25:23 2015 +0200
Implement make_list with Twig
diff --git a/src/www/themes/funky-twig/Theme.class.php
b/src/www/themes/funky-twig/Theme.class.php
index d9ad48e..6c1ebdb 100644
--- a/src/www/themes/funky-twig/Theme.class.php
+++ b/src/www/themes/funky-twig/Theme.class.php
@@ -398,6 +398,28 @@ class Theme extends Layout {
return $template->render($vars);
}
+ function html_list($elements, $attrs = array(), $type = 'ul') {
+ if ($type == 'ol') {
+ $template =
$this->twig->loadTemplate('OrderedList.html');
+ } else {
+ $template =
$this->twig->loadTemplate('UnorderedList.html');
+ }
+
+ $items = array();
+ for ($i = 0; $i < count($elements); $i++) {
+ $items[$i]['element'] = $elements[$i];
+ if ($i <= count($attrs)) {
+ $items[$i]['attr'] = $attrs[$i];
+ } else {
+ $items[$i]['attr'] = '';
+ }
+ }
+
+ $vars = array('items' => $items);
+
+ return $template->render($vars);
+ }
+
}
// Local Variables:
diff --git a/src/www/themes/funky-twig/templates/OrderedList.html
b/src/www/themes/funky-twig/templates/OrderedList.html
new file mode 100644
index 0000000..52ddffc
--- /dev/null
+++ b/src/www/themes/funky-twig/templates/OrderedList.html
@@ -0,0 +1,7 @@
+<ol>
+{% for i in items %}
+ <li {{ i.attr }}>
+ {{ i.element }}
+ </li>
+{% endfor %}
+</ol>
diff --git a/src/www/themes/funky-twig/templates/UnorderedList.html
b/src/www/themes/funky-twig/templates/UnorderedList.html
new file mode 100644
index 0000000..ee6ebcb
--- /dev/null
+++ b/src/www/themes/funky-twig/templates/UnorderedList.html
@@ -0,0 +1,7 @@
+<ul>
+{% for i in items %}
+ <li {{ i.attr }}>
+ {{ i.element }}
+ </li>
+{% endfor %}
+</ul>
-----------------------------------------------------------------------
Summary of changes:
src/www/include/Layout.class.php | 4 +-
src/www/themes/funky-twig/Theme.class.php | 705 ++++++++++++---------
src/www/themes/funky-twig/templates/BoxBottom.html | 1 +
src/www/themes/funky-twig/templates/BoxMiddle.html | 3 +
src/www/themes/funky-twig/templates/BoxTop.html | 6 +
src/www/themes/funky-twig/templates/ChartId.html | 5 +
.../themes/funky-twig/templates/ConfirmBox.html | 20 +
.../funky-twig/templates/HTMLDeclaration.html | 3 +
.../themes/funky-twig/templates/JavaScripts.html | 3 +
.../themes/funky-twig/templates/OrderedList.html | 7 +
.../themes/funky-twig/templates/StyleSheets.html | 3 +
src/www/themes/funky-twig/templates/Tabs.html | 1 +
.../themes/funky-twig/templates/UnorderedList.html | 7 +
.../funky-twig/templates/jQueryUIConfirmBox.html | 7 +
14 files changed, 473 insertions(+), 302 deletions(-)
create mode 100644 src/www/themes/funky-twig/templates/BoxBottom.html
create mode 100644 src/www/themes/funky-twig/templates/BoxMiddle.html
create mode 100644 src/www/themes/funky-twig/templates/BoxTop.html
create mode 100644 src/www/themes/funky-twig/templates/ChartId.html
create mode 100644 src/www/themes/funky-twig/templates/ConfirmBox.html
create mode 100644 src/www/themes/funky-twig/templates/HTMLDeclaration.html
create mode 100644 src/www/themes/funky-twig/templates/JavaScripts.html
create mode 100644 src/www/themes/funky-twig/templates/OrderedList.html
create mode 100644 src/www/themes/funky-twig/templates/StyleSheets.html
create mode 100644 src/www/themes/funky-twig/templates/UnorderedList.html
create mode 100644 src/www/themes/funky-twig/templates/jQueryUIConfirmBox.html
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits