summaryrefslogtreecommitdiff
path: root/src/views/pages/users/index.html.php
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2011-08-01 01:22:36 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2011-08-01 01:22:36 -0400
commit09dfe32eb6b538225686fd6ed0220240010bc574 (patch)
tree29c1afc5e79519ba8689a3d5d170c312d3cf5033 /src/views/pages/users/index.html.php
initial commit.
Partway through a rewrite. I have some old files I didn't want to entirely delete.
Diffstat (limited to 'src/views/pages/users/index.html.php')
-rw-r--r--src/views/pages/users/index.html.php65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/views/pages/users/index.html.php b/src/views/pages/users/index.html.php
new file mode 100644
index 0000000..5f1ab02
--- /dev/null
+++ b/src/views/pages/users/index.html.php
@@ -0,0 +1,65 @@
+<?php global $VARS;
+$t = $VARS['template'];
+$attribs = $VARS['template'];
+$users = $VARS['users'];
+
+$t->header('Users');
+
+$t->openTag('form', array('action'=>$t->url('users/index'),
+ 'method'=>'post'));
+
+$t->openTag('table');
+
+$t->openTag('tr');
+foreach ($attribs as $attrib) {
+ $t->tag('th', array(), $attrib['name']);
+}
+$t->tag('th');
+$t->closeTag('tr');
+
+foreach ($users as $user) {
+ $t->openTag('tr');
+
+ foreach ($attribs as $attrib) {
+ $props = $user[$attrib['key']];
+
+ $value = $props['value'];
+ $editable = $props['editable'];
+ $post_key = $props['post_key'];
+ $bool = is_bool($value);
+
+ $arr = array('name'=>$post_key);
+ if (!$editable) {
+ $arr['readonly'] = 'readonly';
+ if ($bool) $arr['disabled'] = $disabled;
+ }
+ if ($bool) {
+ if ($value==true) {
+ $arr['checked'] = 'checked';
+ }
+ $arr['value'] = 'true';
+ $arr['type'] = 'checkbox';
+ } else {
+ $arr['value'] = $value;
+ $arr['type'] = 'text';
+ }
+
+ $t->openTag('td');
+ $t->tag('input', $arr);
+ $t->closeTag('td');
+ }
+
+ $t->openTag('td');
+ $t->link($t->url('users/'.$user['auth_name']['value']), 'More');
+ $t->closeTag('td');
+
+ $t->closeTag('tr');
+}
+
+$t->closeTag('table');
+
+$t->tag('input', array('type'=>'submit',
+ 'value'=>'Save/Update'));
+$t->closeTag('form');
+
+$t->footer();