summaryrefslogtreecommitdiff
path: root/src/views/pages/users
diff options
context:
space:
mode:
Diffstat (limited to 'src/views/pages/users')
-rw-r--r--src/views/pages/users/index.html.php46
-rw-r--r--src/views/pages/users/individual.html.php12
-rw-r--r--src/views/pages/users/new-locked.html.php9
3 files changed, 52 insertions, 15 deletions
diff --git a/src/views/pages/users/index.html.php b/src/views/pages/users/index.html.php
index 7f51592..daed9f7 100644
--- a/src/views/pages/users/index.html.php
+++ b/src/views/pages/users/index.html.php
@@ -13,14 +13,35 @@ $t->openTag('form', array('action'=>$t->url('users/index'),
$t->tag('input', array('type'=>'submit',
'value'=>'Save/Update'));
-$t->openTag('table');
+$t->openTag('table', array('class'=>'sortable', 'id'=>'bar'));
+$t->openTag('thead');
$t->openTag('tr');
foreach ($attribs as $attrib) {
- $t->tag('th', array(), $attrib['name']);
+ switch ($attrib['type']) {
+ case 'bool': $class = 'small'; break;
+ default: $class = ''; break;
+ }
+ $t->tag('th', array('class'=>$class), $attrib['name']);
}
-$t->tag('th');
+$t->tag('th', array(), '-');
$t->closeTag('tr');
+$t->closeTag('thead');
+
+$t->openTag('tfoot');
+$t->openTag('tr');
+foreach ($attribs as $attrib) {
+ switch ($attrib['type']) {
+ case 'bool': $class = 'small'; break;
+ default: $class = ''; break;
+ }
+ $t->tag('th', array('class'=>$class), $attrib['name']);
+}
+$t->tag('th', array(), '-');
+$t->closeTag('tr');
+$t->closeTag('tfoot');
+
+$t->openTag('tbody');
foreach ($users as $user) {
$t->openTag('tr');
@@ -29,11 +50,15 @@ foreach ($users as $user) {
$t->openTag('td');
$props = $user[$attrib['key']];
-
- $value = $props['value'];
+
+ $bool = $attrib['type']=='bool';
+ if ($bool) {
+ $value = $props['value']=='true';
+ } else {
+ $value = $props['value'];
+ }
$editable = $props['editable'];
$post_key = $props['post_key'];
- $bool = is_bool($value);
$arr = array('name'=>$post_key);
if (!$editable) {
@@ -48,6 +73,7 @@ foreach ($users as $user) {
$arr['value'] = 'true';
$arr['type'] = 'checkbox';
} else {
+ $t->tag('span', array('class'=>'cell_width'), $value);
$arr['value'] = $value;
$arr['type'] = 'text';
}
@@ -66,13 +92,7 @@ foreach ($users as $user) {
$t->closeTag('tr');
}
-$t->openTag('tr');
-foreach ($attribs as $attrib) {
- $t->tag('th', array(), $attrib['name']);
-}
-$t->tag('th');
-$t->closeTag('tr');
-
+$t->closeTag('tbody');
$t->closeTag('table');
$t->tag('input', array('type'=>'submit',
diff --git a/src/views/pages/users/individual.html.php b/src/views/pages/users/individual.html.php
index 5722977..39360b7 100644
--- a/src/views/pages/users/individual.html.php
+++ b/src/views/pages/users/individual.html.php
@@ -1,6 +1,7 @@
<?php global $VARS, $CONTACT_METHODS;
$t = $VARS['template'];
-$user = $VARS['user'];
+$users = $VARS['users'];
+$username = $VARS['username'];
function inputText($user, $key, $label, $hint='') {
global $VARS; $t = $VARS['template'];
@@ -56,8 +57,14 @@ function inputField($user, $arr) {
////////////////////////////////////////////////////////////////////////////////
+if (count($users)>1) {
+ $t->header("Users: $username");
+} else {
+ $t->header("User: $username");
+}
+
+foreach($users as $user) {
$username = $user->getName();
-$t->header("Users: $username");
$t->tag('h1', array(), ($user->canEdit()?'Edit':'View')." User <q>$username</q> (UID: ".$user->getUID().")");
@@ -136,4 +143,5 @@ if ($user->canEdit()) {
$t->tag('input', array('type'=>'submit', 'value'=>'Save'));
}
$t->closeTag('form');
+}
$t->footer();
diff --git a/src/views/pages/users/new-locked.html.php b/src/views/pages/users/new-locked.html.php
new file mode 100644
index 0000000..dc7ad0d
--- /dev/null
+++ b/src/views/pages/users/new-locked.html.php
@@ -0,0 +1,9 @@
+<?php global $VARS;
+$t = $VARS['template'];
+
+$t->status('403 Forbidden');
+$t->header('Create new user');
+
+$t->paragraph("Sorry, new user registration is disabled.");
+
+$t->footer();