示例#1
0
文件: users.php 项目: redhog/DemoWave
?>
</h1>

<form action="<?php 
echo $_SERVER["SCRIPT_NAME"] . '?' . queryString(queryConstruct());
?>
" method="post" enctype="multipart/form-data">
 <table class='list'>
  <?php 
echo "<tr>\n";
echo drawSortHeader($users_sort, 'users_sort', 'id', T_('Id'));
echo drawSortHeader($users_sort, 'users_sort', 'username', T_('Username'));
echo drawSortHeader($users_sort, 'users_sort', 'givenname', T_('Given name'));
echo drawSortHeader($users_sort, 'users_sort', 'surname', T_('Surname'));
echo drawSortHeader($users_sort, 'users_sort', 'vote_enabled', T_('Vote'));
echo drawSortHeader($users_sort, 'users_sort', 'usermanagement_enabled', 'Manage');
echo "</tr>\n";
foreach ($users as $attr) {
    echo "<tr class='list_item list_item_collapsed list_item_users'>\n" . " <td>{$attr['id']}</td>\n" . " <td>{$attr['username']}</td>\n" . " <td>{$attr['givenname']}</td>\n" . " <td>{$attr['surname']}</td>\n";
    echo " <td><select name='userenable_vote_{$attr['id']}'>\n";
    echo drawOption($attr['vote_enabled'] == 't', 'true', T_("Enabled"));
    echo drawOption($attr['vote_enabled'] == 'f', 'false', T_("Disabled"));
    echo " </select></td>";
    echo " <td><select name='userenable_usermanagement_{$attr['id']}'>\n";
    echo drawOption($attr['usermanagement_enabled'] == 't', 'true', T_("Enabled"));
    echo drawOption($attr['usermanagement_enabled'] == 'f', 'false', T_("Disabled"));
    echo " </select></td>";
    echo "</tr>";
}
?>
  <tr><td></td><td></td><td></td><td></td><td></td><td><input type="submit" name="save_userenable" value="Save"></td></tr>
示例#2
0
             $completed_titles[] = T_('Passed');
         } else {
             if ($status == '0') {
                 $completed_titles[] = T_('Estimate');
             } else {
                 if ($status == '-1') {
                     $completed_titles[] = T_('Rejected');
                 }
             }
         }
     }
 }
 echo drawSortHeader($referendums_sort, 'referendums_sort', 'completed', implode('/', $completed_titles), 'completed');
 echo drawSortHeader($referendums_sort, 'referendums_sort', 'area', T_('Total'), 'vote-sum');
 echo drawSortHeader($referendums_sort, 'referendums_sort', 'sum', T_('Current'), 'current-vote-sum');
 echo drawSortHeader($referendums_sort, 'referendums_sort', 'last', T_('Vote'), 'current-vote');
 echo "</tr>\n";
 $pyjamas = 'odd_row';
 if (!$referendums) {
     echo "<tr><td class='emptytable' colspan='7'>No " . implode('/', $statuses) . " found.</td></tr>\n";
 } else {
     foreach ($referendums as $attr) {
         if ($pyjamas == 'odd_row') {
             $pyjamas = 'even_row';
         } else {
             $pyjamas = 'odd_row';
         }
         if ($attr['expanded']) {
             $args = array_diff($expanded_referendums, array($attr['referendum']));
         } else {
             $args = array_merge($expanded_referendums, array($attr['referendum']));
echo drawSearchField(T_('Status'), 'globalreferendum_search_status', array(T_('Passed') => 1, T_('Active') => 0, T_('Rejected') => -1), 'list', 10, 'referendum-status');
?>
  </tr>
 </table>
 <input type="submit" name="search_referendumsglobal" value="<?php 
E_("Search");
?>
">
</form>

<?php 
printf("<h2>" . T_("Referendums found in %s categories") . "</h2>\n", $globalreferendums_len);
echo "<table class='list'>\n";
echo "<tr>\n";
echo drawSortHeader($globalreferendums_sort, 'globalreferendums_sort', 'path', T_('Category'));
echo drawSortHeader($globalreferendums_sort, 'globalreferendums_sort', 'referendums', T_('Matches'));
echo "</tr>\n";
foreach ($globalreferendums as $attr) {
    $args = array('view' => 'category', 'category' => $attr['path']);
    foreach ($_GET as $key => $value) {
        if (beginsWith($key, 'globalreferendum_')) {
            $args['referendum_' . substr($key, strlen('globalreferendum_'))] = $value;
        }
    }
    $url = $_SERVER["SCRIPT_NAME"] . "?" . queryString(queryConstruct($args, array(), array('globalreferendum_', 'referendum_')));
    $title = $attr['path'];
    if ($title) {
        $title = 'Top.' . $title;
    } else {
        $title = 'Top';
    }