list_zones.php
author rejo
Mon, 24 Dec 2007 21:07:38 +0000
changeset 44 f8886b13c495
parent 37 b785e54690ce
child 47 ae140472d97c
permissions -rw-r--r--
[feladat @ 91] Fixing some language issues. Translations not working due to wrong file names, see r89 as well. Fixing two broken references in menu and list_zones.php.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
     1
<?php
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
     2
require_once("inc/i18n.inc.php");
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
     3
require_once("inc/toolkit.inc.php");
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
     4
include_once("inc/header.inc.php");
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
     5
29
e1c60f72d494 [feladat @ 76]
rejo
parents: 26
diff changeset
     6
$num_all_domains = zone_count(0);
e1c60f72d494 [feladat @ 76]
rejo
parents: 26
diff changeset
     7
$doms = zone_count(0, LETTERSTART);
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
     8
?>
44
f8886b13c495 [feladat @ 91]
rejo
parents: 37
diff changeset
     9
   <h2><? echo _('List all zones'); ?></h2>
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    10
<?
29
e1c60f72d494 [feladat @ 76]
rejo
parents: 26
diff changeset
    11
        echo "<div class=\"showmax\">";
e1c60f72d494 [feladat @ 76]
rejo
parents: 26
diff changeset
    12
        show_pages($doms,ROWAMOUNT);
e1c60f72d494 [feladat @ 76]
rejo
parents: 26
diff changeset
    13
        echo "</div>";
20
76e20b9d45e6 [feladat @ 67]
rejo
parents: 15
diff changeset
    14
29
e1c60f72d494 [feladat @ 76]
rejo
parents: 26
diff changeset
    15
if ($num_all_domains > ROWAMOUNT)
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    16
{
29
e1c60f72d494 [feladat @ 76]
rejo
parents: 26
diff changeset
    17
        echo "<div class=\"showmax\">";
e1c60f72d494 [feladat @ 76]
rejo
parents: 26
diff changeset
    18
        show_letters(LETTERSTART);
e1c60f72d494 [feladat @ 76]
rejo
parents: 26
diff changeset
    19
        echo "</div>";
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    20
}
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    21
?>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    22
   <table>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    23
    <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    24
     <th>&nbsp;</th>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    25
     <th><? echo _('Name'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    26
     <th><? echo _('Type'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    27
     <th><? echo _('Records'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    28
     <th><? echo _('Owner'); ?></th>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    29
    </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    30
    <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    31
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    32
<?
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    33
if ($num_all_domains < ROWAMOUNT) {
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    34
   $doms = get_domains(0,"all",ROWSTART,ROWAMOUNT);
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    35
} else {
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    36
   $doms = get_domains(0,LETTERSTART,ROWSTART,ROWAMOUNT);
34
a2826b0ebcff [feladat @ 81]
rejo
parents: 29
diff changeset
    37
   $num_show_domains = ($doms == -1) ? 0 : count($doms);
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    38
}
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    39
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    40
// If the user doesnt have any domains print a message saying so
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    41
if ($doms < 0)
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    42
{
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    43
	?>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    44
    <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    45
     <td>&nbsp;</td>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    46
     <td colspan="4"><? echo _('There are no zones.'); ?></td>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    47
    </tr>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    48
<?
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    49
}
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    50
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    51
// If he has domains, dump them (duh)
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    52
else
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    53
{
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    54
	foreach ($doms as $c)
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    55
	{
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    56
		?>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    57
		
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    58
    <tr>
37
b785e54690ce [feladat @ 84]
rejo
parents: 36
diff changeset
    59
     <td>
b785e54690ce [feladat @ 84]
rejo
parents: 36
diff changeset
    60
      <a href="edit.php?id=<? echo $c["id"] ?>"><img src="images/edit.gif" title="<? echo _('Edit zone') . " " . $c['name']; ?>" alt="[ <? echo _('Edit zone') . " " . $c['name']; ?> ]"></a>
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    61
<?
36
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    62
		if (level(5))
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    63
		{
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    64
?>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    65
      <a href="delete_domain.php?id=<? echo $c["id"] ?>"><img src="images/delete.gif" title="<? print _('Delete zone') . " " . $c['name']; ?>" alt="[<? echo _('Delete zone') . " " . $c['name']; ?>]"></a>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    66
<?
36
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    67
		}
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    68
?>
37
b785e54690ce [feladat @ 84]
rejo
parents: 36
diff changeset
    69
     </td>
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    70
     <td class="y"><? echo $c["name"] ?></td>
26
5d63f1e71d6e [feladat @ 73]
rejo
parents: 20
diff changeset
    71
     <td class="y"><? echo strtolower(get_domain_type($c["id"])) ?></td>
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    72
     <td class="y"><? echo $c["numrec"] ?></td>
36
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    73
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    74
<?
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    75
		$zone_owners = get_owners_from_domainid($c["id"]);
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    76
		if ($zone_owners == "")
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    77
		{
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    78
			echo "<td class=\"n\"></td>";
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    79
		}
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    80
		else
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    81
		{
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    82
			print "<td class=\"y\">".$zone_owners."</td>";
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    83
		}
4ec5ab29f634 [feladat @ 83]
rejo
parents: 34
diff changeset
    84
		print "<tr>\n";
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    85
	}
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    86
}
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    87
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    88
?>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    89
   </table>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    90
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    91
<?
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    92
if ($num_all_domains < ROWAMOUNT) {
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    93
?>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    94
   <p><? printf(_('This lists shows all %s zones(s) you have access to.'), $num_all_domains); ?></p>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    95
<?
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    96
}
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    97
else
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    98
{
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    99
?>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   100
   <p><? printf(_('This lists shows %s out of %s zones you have access to.'), $num_show_domains, $num_all_domains); ?></p>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   101
<?
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   102
}
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   103
?>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   104
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   105
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   106
<? // RZ TODO Check next, does it work? 
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   107
//  <small> echo _('You only administer some records of domains marked with an (*).'); </small>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   108
?>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   109
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   110
<?
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   111
include_once("inc/footer.inc.php");
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
   112
?>