cvs: bugtracker /htdocs/index index.php /includes functions.php template.php /template/generic/bug index.php
| From: | Barry Carlyon | Date: | Thu, 07 Aug 2008 09:25:44 +0000 |
| Subject: | cvs: bugtracker /htdocs/index index.php /includes functions.php template.php /template/generic/bug index.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-2330@lists.php.net to get a copy of this message | ||
bcarlyon Thu Aug 7 09:25:44 2008 UTC
Modified files:
/bugtracker/htdocs/index index.php
/bugtracker/includes functions.php template.php
/bugtracker/template/generic/bug index.php
Log:
Update to the template engine
PHP template should not run whilst inside the template engines load template function
http://cvs.php.net/viewvc.cgi/bugtracker/htdocs/index/index.php?r1=1.16&r2=1.17&diff_format=u
Index: bugtracker/htdocs/index/index.php
diff -u bugtracker/htdocs/index/index.php:1.16 bugtracker/htdocs/index/index.php:1.17
--- bugtracker/htdocs/index/index.php:1.16 Thu Aug 7 08:59:50 2008
+++ bugtracker/htdocs/index/index.php Thu Aug 7 09:25:44 2008
@@ -54,12 +54,9 @@
//its related to the page we are requesting from the server
$template->determine_template();
-$template->in_engine = TRUE;
$template->load_template();
-$template->in_engine = FALSE;
-if ($template->alert)
-{
+if ($template->include) {
include($template->template_file);
}
http://cvs.php.net/viewvc.cgi/bugtracker/includes/functions.php?r1=1.18&r2=1.19&diff_format=u
Index: bugtracker/includes/functions.php
diff -u bugtracker/includes/functions.php:1.18 bugtracker/includes/functions.php:1.19
--- bugtracker/includes/functions.php:1.18 Thu Aug 7 08:59:50 2008
+++ bugtracker/includes/functions.php Thu Aug 7 09:25:44 2008
@@ -207,7 +207,10 @@
$backtrace .= '</td></tr>';
foreach ($data as $nref => $ndata)
{
- $backtrace .= '<tr><td></td><td>' . $nref .
'</td><td>' . $ndata . '</td></tr>';
+ if (get_class($ndata))
+ $backtrace .= '<tr><td></td><td>Class
Error:</td><td>' . get_class($ndata) . '</td></tr>';
+ else
+ $backtrace .= '<tr><td></td><td>' . $nref .
'</td><td>' . $ndata . '</td></tr>';
}
}
else
http://cvs.php.net/viewvc.cgi/bugtracker/includes/template.php?r1=1.8&r2=1.9&diff_format=u
Index: bugtracker/includes/template.php
diff -u bugtracker/includes/template.php:1.8 bugtracker/includes/template.php:1.9
--- bugtracker/includes/template.php:1.8 Thu Aug 7 08:59:50 2008
+++ bugtracker/includes/template.php Thu Aug 7 09:25:44 2008
@@ -339,11 +339,11 @@
}
function load_template() {
global $db,$cache;
- $bypass = FALSE;
+ $this->include = FALSE;
if ($this->template_type == 'php') {
- include($this->template_file);
- if ($bypass == TRUE)
- $this->alert = TRUE;
+// include($this->template_file);
+ $this->include = TRUE;
+ //we need to step out of the template class
}
if ($this->template_type == 'html') {
$this->prehtml = file_get_contents($this->template_file);
http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/bug/index.php?r1=1.21&r2=1.22&diff_format=u
Index: bugtracker/template/generic/bug/index.php
diff -u bugtracker/template/generic/bug/index.php:1.21
bugtracker/template/generic/bug/index.php:1.22
--- bugtracker/template/generic/bug/index.php:1.21 Wed Aug 6 11:18:16 2008
+++ bugtracker/template/generic/bug/index.php Thu Aug 7 09:25:44 2008
@@ -6,8 +6,8 @@
if (is_numeric($bug_id))
{
- $this->page_title .= 'Bug #' . $bug_id;
- $this->content_title = 'Bug #' . $bug_id;
+ $template->page_title .= 'Bug #' . $bug_id;
+ $template->content_title = 'Bug #' . $bug_id;
$query = "SELECT
*,UNIX_TIMESTAMP(reported_on),UNIX_TIMESTAMP(assigned_on),UNIX_TIMESTAMP(updated),UNIX_TIMESTAMP(closed_on)
FROM bug WHERE bug_id = '{$bug_id}'";
$db->get_data($query);
@@ -15,22 +15,24 @@
if (!$db->total_rows)
{
//invalid bug
- $this->page_title .= ' - Invalid';
- $this->content_title .= ' - Invalid';
+ $template->page_title .= ' - Invalid';
+ $template->content_title .= ' - Invalid';
$content = 'There is no bug with the ID you requested (' . $bug_id . ')';
}
else
{
- $this->javascript = '<script type="text/javascript"
src="/elements/js/lineno.js" ></script>';
- $this->javascript .= '
-{DSP_SHOW_REPRODUCE}
+ $template->javascript = '<script type="text/javascript"
src="/elements/js/lineno.js" ></script>';
+ $template->javascript .= '
<script type="text/javascript">
function onload()
{
- createTextAreaWithLines(\'reproduce\');
+ if (document.getElementById(\'reproduce\'))
+ {
+ createTextAreaWithLines(\'reproduce\');
+ }
}
</script>
-{DSP_END_REPRODUCE}';
+';
$row = $db->fetch_row();
@@ -49,8 +51,8 @@
$bug_row['password'] = '';
$bug_row = array_merge($bug_row, $comments);
- $this->page_title .= ' ' . $bug_row['summary'];
- $this->content_title .= ' ' . $bug_row['summary'];
+ $template->page_title .= ' ' . $bug_row['summary'];
+ $template->content_title .= ' ' . $bug_row['summary'];
//lets generate for display
@@ -117,7 +119,7 @@
$bug_row['show_reproduce'] = $bug_row['end_reproduce'] = '';
}
- $content .= $this->loop(array($bug_row), $html);
+ $content .= $template->loop(array($bug_row), $html);
}
}
else if ($bug_id)
@@ -139,8 +141,8 @@
$db->get_data($query);
- $this->page_title .= 'Bug Index';
- $this->content_title = 'Bug Summary';
+ $template->page_title .= 'Bug Index';
+ $template->content_title = 'Bug Summary';
$content .= 'There are Currenty ' . $db->total_rows . ' bugs in the system, of
which ' . $pending . ' are pending review, the average review time is {AVERAGE_REVIEW},
the average close time is {AVERAGE_CLOSE}';
if ($db->total_rows)
@@ -165,7 +167,7 @@
$loop_data[] = $this_loop;
}
trace('go for loop');
- $content .= $this->loop($loop_data, $loop_html);
+ $content .= $template->loop($loop_data, $loop_html);
$content .= '</table>';
}
else
@@ -175,5 +177,5 @@
}
}
//we are inside the template engine!!!
-$this->prehtml = $content;
+$template->prehtml = $content;