summaryrefslogtreecommitdiff
path: root/kohana/views
diff options
context:
space:
mode:
Diffstat (limited to 'kohana/views')
-rw-r--r--kohana/views/kohana/template.php35
-rw-r--r--kohana/views/kohana_calendar.php52
-rw-r--r--kohana/views/kohana_error_disabled.php16
-rw-r--r--kohana/views/kohana_error_page.php26
-rw-r--r--kohana/views/kohana_errors.css21
-rw-r--r--kohana/views/kohana_profiler.php36
-rw-r--r--kohana/views/kohana_profiler_table.css53
-rw-r--r--kohana/views/kohana_profiler_table.php24
-rw-r--r--kohana/views/pagination/classic.php39
-rw-r--r--kohana/views/pagination/digg.php83
-rw-r--r--kohana/views/pagination/extended.php27
-rw-r--r--kohana/views/pagination/punbb.php37
12 files changed, 449 insertions, 0 deletions
diff --git a/kohana/views/kohana/template.php b/kohana/views/kohana/template.php
new file mode 100644
index 00000000..97c458a3
--- /dev/null
+++ b/kohana/views/kohana/template.php
@@ -0,0 +1,35 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title><?php echo html::specialchars($title) ?></title>
+
+ <style type="text/css">
+ html { background: #83c018 url(<?php echo url::base(FALSE) ?>kohana.png) 50% 0 no-repeat; }
+ body { width: 52em; margin: 200px auto 2em; font-size: 76%; font-family: Arial, sans-serif; color: #273907; line-height: 1.5; text-align: center; }
+ h1 { font-size: 3em; font-weight: normal; text-transform: uppercase; color: #fff; }
+ a { color: inherit; }
+ code { font-size: 1.3em; }
+ ul { list-style: none; padding: 2em 0; }
+ ul li { display: inline; padding-right: 1em; text-transform: uppercase; }
+ ul li a { padding: 0.5em 1em; background: #69ad0f; border: 1px solid #569f09; color: #fff; text-decoration: none; }
+ ul li a:hover { background: #569f09; }
+ .box { padding: 2em; background: #98cc2b; border: 1px solid #569f09; }
+ .copyright { font-size: 0.9em; text-transform: uppercase; color: #557d10; }
+ </style>
+
+</head>
+<body>
+
+ <h1><?php echo html::specialchars($title) ?></h1>
+ <?php echo $content ?>
+
+ <p class="copyright">
+ Rendered in {execution_time} seconds, using {memory_usage} of memory<br />
+ Copyright ©2007–2008 Kohana Team
+ </p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/kohana/views/kohana_calendar.php b/kohana/views/kohana_calendar.php
new file mode 100644
index 00000000..581c7da7
--- /dev/null
+++ b/kohana/views/kohana_calendar.php
@@ -0,0 +1,52 @@
+<?php
+
+// Get the day names
+$days = Calendar::days(TRUE);
+
+// Previous and next month timestamps
+$next = mktime(0, 0, 0, $month + 1, 1, $year);
+$prev = mktime(0, 0, 0, $month - 1, 1, $year);
+
+// Import the GET query array locally and remove the day
+$qs = $_GET;
+unset($qs['day']);
+
+// Previous and next month query URIs
+$prev = Router::$current_uri.'?'.http_build_query(array_merge($qs, array('month' => date('n', $prev), 'year' => date('Y', $prev))));
+$next = Router::$current_uri.'?'.http_build_query(array_merge($qs, array('month' => date('n', $next), 'year' => date('Y', $next))));
+
+?>
+<table class="calendar">
+<tr class="controls">
+<td class="prev"><?php echo html::anchor($prev, '&laquo;') ?></td>
+<td class="title" colspan="5"><?php echo strftime('%B %Y', mktime(0, 0, 0, $month, 1, $year)) ?></td>
+<td class="next"><?php echo html::anchor($next, '&raquo;') ?></td>
+</tr>
+<tr>
+<?php foreach ($days as $day): ?>
+<th><?php echo $day ?></th>
+<?php endforeach ?>
+</tr>
+<?php foreach ($weeks as $week): ?>
+<tr>
+<?php foreach ($week as $day):
+
+list ($number, $current, $data) = $day;
+
+if (is_array($data))
+{
+ $classes = $data['classes'];
+ $output = empty($data['output']) ? '' : '<ul class="output"><li>'.implode('</li><li>', $data['output']).'</li></ul>';
+}
+else
+{
+ $classes = array();
+ $output = '';
+}
+
+?>
+<td class="<?php echo implode(' ', $classes) ?>"><span class="day"><?php echo $day[0] ?></span><?php echo $output ?></td>
+<?php endforeach ?>
+</tr>
+<?php endforeach ?>
+</table>
diff --git a/kohana/views/kohana_error_disabled.php b/kohana/views/kohana_error_disabled.php
new file mode 100644
index 00000000..e32e7396
--- /dev/null
+++ b/kohana/views/kohana_error_disabled.php
@@ -0,0 +1,16 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+<title><?php echo $error ?></title>
+</head>
+<body>
+<style type="text/css">
+<?php include Kohana::find_file('views', 'kohana_errors', FALSE, 'css') ?>
+</style>
+<div id="framework_error" style="width:24em;margin:50px auto;">
+<h3><?php echo html::specialchars($error) ?></h3>
+<p style="text-align:center"><?php echo $message ?></p>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/kohana/views/kohana_error_page.php b/kohana/views/kohana_error_page.php
new file mode 100644
index 00000000..9e4bba88
--- /dev/null
+++ b/kohana/views/kohana_error_page.php
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+<title><?php echo $error ?></title>
+<base href="http://php.net/" />
+</head>
+<body>
+<style type="text/css">
+<?php include Kohana::find_file('views', 'kohana_errors', FALSE, 'css') ?>
+</style>
+<div id="framework_error" style="width:42em;margin:20px auto;">
+<h3><?php echo html::specialchars($error) ?></h3>
+<p><?php echo html::specialchars($description) ?></p>
+<?php if ( ! empty($line) AND ! empty($file)): ?>
+<p><?php echo Kohana::lang('core.error_file_line', $file, $line) ?></p>
+<?php endif ?>
+<p><code class="block"><?php echo $message ?></code></p>
+<?php if ( ! empty($trace)): ?>
+<h3><?php echo Kohana::lang('core.stack_trace') ?></h3>
+<?php echo $trace ?>
+<?php endif ?>
+<p class="stats"><?php echo Kohana::lang('core.stats_footer') ?></p>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/kohana/views/kohana_errors.css b/kohana/views/kohana_errors.css
new file mode 100644
index 00000000..1341f57d
--- /dev/null
+++ b/kohana/views/kohana_errors.css
@@ -0,0 +1,21 @@
+div#framework_error { background:#fff; border:solid 1px #ccc; font-family:sans-serif; color:#111; font-size:14px; line-height:130%; }
+div#framework_error h3 { color:#fff; font-size:16px; padding:8px 6px; margin:0 0 8px; background:#f15a00; text-align:center; }
+div#framework_error a { color:#228; text-decoration:none; }
+div#framework_error a:hover { text-decoration:underline; }
+div#framework_error strong { color:#900; }
+div#framework_error p { margin:0; padding:4px 6px 10px; }
+div#framework_error tt,
+div#framework_error pre,
+div#framework_error code { font-family:monospace; padding:2px 4px; font-size:12px; color:#333;
+ white-space:pre-wrap; /* CSS 2.1 */
+ white-space:-moz-pre-wrap; /* For Mozilla */
+ word-wrap:break-word; /* For IE5.5+ */
+}
+div#framework_error tt { font-style:italic; }
+div#framework_error tt:before { content:">"; color:#aaa; }
+div#framework_error code tt:before { content:""; }
+div#framework_error pre,
+div#framework_error code { background:#eaeee5; border:solid 0 #D6D8D1; border-width:0 1px 1px 0; }
+div#framework_error .block { display:block; text-align:left; }
+div#framework_error .stats { padding:4px; background: #eee; border-top:solid 1px #ccc; text-align:center; font-size:10px; color:#888; }
+div#framework_error .backtrace { margin:0; padding:0 6px; list-style:none; line-height:12px; } \ No newline at end of file
diff --git a/kohana/views/kohana_profiler.php b/kohana/views/kohana_profiler.php
new file mode 100644
index 00000000..a16c018b
--- /dev/null
+++ b/kohana/views/kohana_profiler.php
@@ -0,0 +1,36 @@
+<style type="text/css">
+#kohana-profiler
+{
+ font-family: Monaco, 'Courier New';
+ background-color: #F8FFF8;
+ margin-top: 20px;
+ clear: both;
+ padding: 10px 10px 0;
+ border: 1px solid #E5EFF8;
+ text-align: left;
+}
+#kohana-profiler pre
+{
+ margin: 0;
+ font: inherit;
+}
+#kohana-profiler .kp-meta
+{
+ margin: 0 0 10px;
+ padding: 4px;
+ background: #FFF;
+ border: 1px solid #E5EFF8;
+ color: #A6B0B8;
+ text-align: center;
+}
+<?php echo $styles ?>
+</style>
+<div id="kohana-profiler">
+<?php
+foreach ($profiles as $profile)
+{
+ echo $profile->render();
+}
+?>
+<p class="kp-meta">Profiler executed in <?php echo number_format($execution_time, 3) ?>s</p>
+</div> \ No newline at end of file
diff --git a/kohana/views/kohana_profiler_table.css b/kohana/views/kohana_profiler_table.css
new file mode 100644
index 00000000..6e7601c9
--- /dev/null
+++ b/kohana/views/kohana_profiler_table.css
@@ -0,0 +1,53 @@
+#kohana-profiler .kp-table
+{
+ font-size: 1.0em;
+ color: #4D6171;
+ width: 100%;
+ border-collapse: collapse;
+ border-top: 1px solid #E5EFF8;
+ border-right: 1px solid #E5EFF8;
+ border-left: 1px solid #E5EFF8;
+ margin-bottom: 10px;
+}
+#kohana-profiler .kp-table td
+{
+ background-color: #FFFFFF;
+ border-bottom: 1px solid #E5EFF8;
+ padding: 3px;
+ vertical-align: top;
+}
+#kohana-profiler .kp-table .kp-title td
+{
+ font-weight: bold;
+ background-color: inherit;
+}
+#kohana-profiler .kp-table .kp-altrow td
+{
+ background-color: #F7FBFF;
+}
+#kohana-profiler .kp-table .kp-totalrow td
+{
+ background-color: #FAFAFA;
+ border-top: 1px solid #D2DCE5;
+ font-weight: bold;
+}
+#kohana-profiler .kp-table .kp-column
+{
+ width: 100px;
+ border-left: 1px solid #E5EFF8;
+ text-align: center;
+}
+#kohana-profiler .kp-table .kp-data, #kohana-profiler .kp-table .kp-name
+{
+ background-color: #FAFAFB;
+ vertical-align: top;
+}
+#kohana-profiler .kp-table .kp-name
+{
+ width: 200px;
+ border-right: 1px solid #E5EFF8;
+}
+#kohana-profiler .kp-table .kp-altrow .kp-data, #kohana-profiler .kp-table .kp-altrow .kp-name
+{
+ background-color: #F6F8FB;
+} \ No newline at end of file
diff --git a/kohana/views/kohana_profiler_table.php b/kohana/views/kohana_profiler_table.php
new file mode 100644
index 00000000..aed6d094
--- /dev/null
+++ b/kohana/views/kohana_profiler_table.php
@@ -0,0 +1,24 @@
+<table class="kp-table">
+<?php
+foreach ($rows as $row):
+
+$class = empty($row['class']) ? '' : ' class="'.$row['class'].'"';
+$style = empty($row['style']) ? '' : ' style="'.$row['style'].'"';
+?>
+ <tr<?php echo $class; echo $style; ?>>
+ <?php
+ foreach ($columns as $index => $column)
+ {
+ $class = empty($column['class']) ? '' : ' class="'.$column['class'].'"';
+ $style = empty($column['style']) ? '' : ' style="'.$column['style'].'"';
+ $value = $row['data'][$index];
+ $value = (is_array($value) OR is_object($value)) ? '<pre>'.html::specialchars(print_r($value, TRUE)).'</pre>' : html::specialchars($value);
+ echo '<td', $style, $class, '>', $value, '</td>';
+ }
+ ?>
+ </tr>
+<?php
+
+endforeach;
+?>
+</table> \ No newline at end of file
diff --git a/kohana/views/pagination/classic.php b/kohana/views/pagination/classic.php
new file mode 100644
index 00000000..79299211
--- /dev/null
+++ b/kohana/views/pagination/classic.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * Classic pagination style
+ *
+ * @preview ‹ First < 1 2 3 > Last ›
+ */
+?>
+
+<p class="pagination">
+
+ <?php if ($first_page): ?>
+ <a href="<?php echo str_replace('{page}', 1, $url) ?>">&lsaquo;&nbsp;<?php echo Kohana::lang('pagination.first') ?></a>
+ <?php endif ?>
+
+ <?php if ($previous_page): ?>
+ <a href="<?php echo str_replace('{page}', $previous_page, $url) ?>">&lt;</a>
+ <?php endif ?>
+
+
+ <?php for ($i = 1; $i <= $total_pages; $i++): ?>
+
+ <?php if ($i == $current_page): ?>
+ <strong><?php echo $i ?></strong>
+ <?php else: ?>
+ <a href="<?php echo str_replace('{page}', $i, $url) ?>"><?php echo $i ?></a>
+ <?php endif ?>
+
+ <?php endfor ?>
+
+
+ <?php if ($next_page): ?>
+ <a href="<?php echo str_replace('{page}', $next_page, $url) ?>">&gt;</a>
+ <?php endif ?>
+
+ <?php if ($last_page): ?>
+ <a href="<?php echo str_replace('{page}', $last_page, $url) ?>"><?php echo Kohana::lang('pagination.last') ?>&nbsp;&rsaquo;</a>
+ <?php endif ?>
+
+</p> \ No newline at end of file
diff --git a/kohana/views/pagination/digg.php b/kohana/views/pagination/digg.php
new file mode 100644
index 00000000..888da48f
--- /dev/null
+++ b/kohana/views/pagination/digg.php
@@ -0,0 +1,83 @@
+<?php
+/**
+ * Digg pagination style
+ *
+ * @preview « Previous 1 2 … 5 6 7 8 9 10 11 12 13 14 … 25 26 Next »
+ */
+?>
+
+<p class="pagination">
+
+ <?php if ($previous_page): ?>
+ <a href="<?php echo str_replace('{page}', $previous_page, $url) ?>">&laquo;&nbsp;<?php echo Kohana::lang('pagination.previous') ?></a>
+ <?php else: ?>
+ &laquo;&nbsp;<?php echo Kohana::lang('pagination.previous') ?>
+ <?php endif ?>
+
+
+ <?php if ($total_pages < 13): /* « Previous 1 2 3 4 5 6 7 8 9 10 11 12 Next » */ ?>
+
+ <?php for ($i = 1; $i <= $total_pages; $i++): ?>
+ <?php if ($i == $current_page): ?>
+ <strong><?php echo $i ?></strong>
+ <?php else: ?>
+ <a href="<?php echo str_replace('{page}', $i, $url) ?>"><?php echo $i ?></a>
+ <?php endif ?>
+ <?php endfor ?>
+
+ <?php elseif ($current_page < 9): /* « Previous 1 2 3 4 5 6 7 8 9 10 … 25 26 Next » */ ?>
+
+ <?php for ($i = 1; $i <= 10; $i++): ?>
+ <?php if ($i == $current_page): ?>
+ <strong><?php echo $i ?></strong>
+ <?php else: ?>
+ <a href="<?php echo str_replace('{page}', $i, $url) ?>"><?php echo $i ?></a>
+ <?php endif ?>
+ <?php endfor ?>
+
+ &hellip;
+ <a href="<?php echo str_replace('{page}', $total_pages - 1, $url) ?>"><?php echo $total_pages - 1 ?></a>
+ <a href="<?php echo str_replace('{page}', $total_pages, $url) ?>"><?php echo $total_pages ?></a>
+
+ <?php elseif ($current_page > $total_pages - 8): /* « Previous 1 2 … 17 18 19 20 21 22 23 24 25 26 Next » */ ?>
+
+ <a href="<?php echo str_replace('{page}', 1, $url) ?>">1</a>
+ <a href="<?php echo str_replace('{page}', 2, $url) ?>">2</a>
+ &hellip;
+
+ <?php for ($i = $total_pages - 9; $i <= $total_pages; $i++): ?>
+ <?php if ($i == $current_page): ?>
+ <strong><?php echo $i ?></strong>
+ <?php else: ?>
+ <a href="<?php echo str_replace('{page}', $i, $url) ?>"><?php echo $i ?></a>
+ <?php endif ?>
+ <?php endfor ?>
+
+ <?php else: /* « Previous 1 2 … 5 6 7 8 9 10 11 12 13 14 … 25 26 Next » */ ?>
+
+ <a href="<?php echo str_replace('{page}', 1, $url) ?>">1</a>
+ <a href="<?php echo str_replace('{page}', 2, $url) ?>">2</a>
+ &hellip;
+
+ <?php for ($i = $current_page - 5; $i <= $current_page + 5; $i++): ?>
+ <?php if ($i == $current_page): ?>
+ <strong><?php echo $i ?></strong>
+ <?php else: ?>
+ <a href="<?php echo str_replace('{page}', $i, $url) ?>"><?php echo $i ?></a>
+ <?php endif ?>
+ <?php endfor ?>
+
+ &hellip;
+ <a href="<?php echo str_replace('{page}', $total_pages - 1, $url) ?>"><?php echo $total_pages - 1 ?></a>
+ <a href="<?php echo str_replace('{page}', $total_pages, $url) ?>"><?php echo $total_pages ?></a>
+
+ <?php endif ?>
+
+
+ <?php if ($next_page): ?>
+ <a href="<?php echo str_replace('{page}', $next_page, $url) ?>"><?php echo Kohana::lang('pagination.next') ?>&nbsp;&raquo;</a>
+ <?php else: ?>
+ <?php echo Kohana::lang('pagination.next') ?>&nbsp;&raquo;
+ <?php endif ?>
+
+</p> \ No newline at end of file
diff --git a/kohana/views/pagination/extended.php b/kohana/views/pagination/extended.php
new file mode 100644
index 00000000..7e4fa389
--- /dev/null
+++ b/kohana/views/pagination/extended.php
@@ -0,0 +1,27 @@
+<?php
+/**
+ * Extended pagination style
+ *
+ * @preview « Previous | Page 2 of 11 | Showing items 6-10 of 52 | Next »
+ */
+?>
+
+<p class="pagination">
+
+ <?php if ($previous_page): ?>
+ <a href="<?php echo str_replace('{page}', $previous_page, $url) ?>">&laquo;&nbsp;<?php echo Kohana::lang('pagination.previous') ?></a>
+ <?php else: ?>
+ &laquo;&nbsp;<?php echo Kohana::lang('pagination.previous') ?>
+ <?php endif ?>
+
+ | <?php echo Kohana::lang('pagination.page') ?> <?php echo $current_page ?> <?php echo Kohana::lang('pagination.of') ?> <?php echo $total_pages ?>
+
+ | <?php echo Kohana::lang('pagination.items') ?> <?php echo $current_first_item ?>&ndash;<?php echo $current_last_item ?> <?php echo Kohana::lang('pagination.of') ?> <?php echo $total_items ?>
+
+ | <?php if ($next_page): ?>
+ <a href="<?php echo str_replace('{page}', $next_page, $url) ?>"><?php echo Kohana::lang('pagination.next') ?>&nbsp;&raquo;</a>
+ <?php else: ?>
+ <?php echo Kohana::lang('pagination.next') ?>&nbsp;&raquo;
+ <?php endif ?>
+
+</p> \ No newline at end of file
diff --git a/kohana/views/pagination/punbb.php b/kohana/views/pagination/punbb.php
new file mode 100644
index 00000000..3bb62676
--- /dev/null
+++ b/kohana/views/pagination/punbb.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * PunBB pagination style
+ *
+ * @preview Pages: 1 … 4 5 6 7 8 … 15
+ */
+?>
+
+<p class="pagination">
+
+ <?php echo Kohana::lang('pagination.pages') ?>:
+
+ <?php if ($current_page > 3): ?>
+ <a href="<?php echo str_replace('{page}', 1, $url) ?>">1</a>
+ <?php if ($current_page != 4) echo '&hellip;' ?>
+ <?php endif ?>
+
+
+ <?php for ($i = $current_page - 2, $stop = $current_page + 3; $i < $stop; ++$i): ?>
+
+ <?php if ($i < 1 OR $i > $total_pages) continue ?>
+
+ <?php if ($current_page == $i): ?>
+ <strong><?php echo $i ?></strong>
+ <?php else: ?>
+ <a href="<?php echo str_replace('{page}', $i, $url) ?>"><?php echo $i ?></a>
+ <?php endif ?>
+
+ <?php endfor ?>
+
+
+ <?php if ($current_page <= $total_pages - 3): ?>
+ <?php if ($current_page != $total_pages - 3) echo '&hellip;' ?>
+ <a href="<?php echo str_replace('{page}', $total_pages, $url) ?>"><?php echo $total_pages ?></a>
+ <?php endif ?>
+
+</p> \ No newline at end of file