2 require_once(
"../class/config.php");
3 include_once(
"head.php");
5 # Function to create/edit subdomain
6 # Take the values of the subdomain in arguments
23 $sd=
$dom->get_sub_domain_all($sub_domain_id);
31 <form action=
"dom_subdoedit.php" method=
"post" name=
"main" id=
"main">
35 <input type=
"hidden" name=
"domain" value=
"<?php ehe($domain) ?>" />
36 <input type=
"hidden" name=
"sub_domain_id" value=
"<?php echo $sub_domain_id ?>" />
37 <input type=
"hidden" name=
"action" value=
"add" />
40 __(
"Edit a subdomain:");
42 __(
"Create a subdomain:");
45 <input type=
"text" class=
"int" name=
"sub" style=
"text-align:right" value=
"<?php ehe($sub); ?>" size=
"22" id=
"sub" /><span
class=
"int" id=
"newsubname">.<?php echo
$domain; ?></span></td>
49 foreach(
$dom->domains_type_lst() as
$dt) {
51 if (
$dt[
'enable'] ==
'NONE' && strtoupper($type)!=strtoupper(
$dt[
'name']))
continue ;
53 if ((
$dt[
'enable'] ==
'ADMIN') && (! $admin->enabled and ! intval($oldid)))
continue;
55 if ( (!
$r[
'dns'] ) and (
$dt[
'need_dns']) )
continue;
56 $targval=(strtoupper($type)==strtoupper(
$dt[
'name']))?$sd[
'dest']:
'';
58 if (
$dt[
'advanced']) {
59 $lst_advanced[]=
$dt[
'name'];
60 if ($first_advanced) {
61 $first_advanced=
false;
62 echo
"<tr><td colspan=\"2\" class=\"advdom\"></td></tr>";
63 echo
"<tr id='domtype_show' onClick=\"domtype_advanced_show();\"><td colspan='2'><a href=\"javascript:domtype_advanced_show();\"><b>+ ";
__(
"Show advanced options"); echo
"</b></a></td></tr>";
64 echo
"<tr id='domtype_hide' onClick=\"domtype_advanced_hide();\" style='display:none'><td colspan='2'><a href=\"javascript:domtype_advanced_hide();\"><b>- ";
__(
"Hide advanced options"); echo
"</b></a></td></tr>";
65 echo
"<tr><td colspan=\"2\" class=\"advdom\"></td></tr>";
69 <tr
id=
"tr_<?php echo $dt['name']; ?>">
71 <input type=
"radio" id=
"r_<?php echo $dt['name']?>" class=
"inc" name=
"type" value=
"<?php echo $dt['name']; ?>" <?php
cbox(strtoupper($type)==strtoupper(
$dt[
'name'])); ?> OnClick=
"getElementById('t_<?php echo $dt['name']?>').focus();"/>
72 <label
for=
"r_<?php echo $dt['name']?>"><?php
__(
$dt[
'description']); ?></label>
77 switch (
$dt[
'target']) {
82 <input type=
"text" class=
"int" name=
"t_<?php echo $dt['name']?>" id=
"t_<?php echo $dt['name']?>" value=
"<?php ehe($targval); ?>" size=
"28" onKeyPress=
"getElementById('r_<?php echo $dt['name']?>').checked=true;" />
87 <input type=
"text" class=
"int" name=
"t_<?php echo $dt['name']?>" id=
"t_<?php echo $dt['name']?>" value=
"<?php ehe( (empty($targval)?'http://':$targval) ); ?>" size=
"50" onKeyPress=
"getElementById('r_<?php echo $dt['name']?>').checked=true;" />
88 <small><?php
__(
"(enter an URL here)"); ?></small><?php
91 <input type=
"text" class=
"int" name=
"t_<?php echo $dt['name']?>" id=
"t_<?php echo $dt['name']?>" value=
"<?php ehe($targval); ?>" size=
"16" onKeyPress=
"getElementById('r_<?php echo $dt['name']?>').checked=true;" />
92 <small><?php
__(
"(enter an IPv4 address, for example 192.168.1.2)"); ?></small><?php
95 <input type=
"text" class=
"int" name=
"t_<?php echo $dt['name']?>" id=
"t_<?php echo $dt['name']?>" value=
"<?php ehe($targval); ?>" size=
"32" onKeyPress=
"getElementById('r_<?php echo $dt['name']?>').checked=true;" />
96 <small><?php
__(
"(enter an IPv6 address, for example 2001:0910::0)"); ?></small><?php
99 <input type=
"text" class=
"int" name=
"t_<?php echo $dt['name']?>" id=
"t_<?php echo $dt['name']?>" value=
"<?php ehe($targval);?>" size=
"32" onKeyPress=
"getElementById('r_<?php echo $dt['name']?>').checked=true;" />
100 <small><?php
__(
"(enter a TXT content for this domain)"); ?></small><?php
103 <input type=
"text" class=
"int" name=
"t_<?php echo $dt['name']?>" id=
"t_<?php echo $dt['name']?>" value=
"<?php ehe($targval);?>" size=
"32" onKeyPress=
"getElementById('r_<?php echo $dt['name']?>').checked=true;" />
104 <small><?php
__(
"(enter a domain name or subdomain)"); ?></small><?php
112 <td colspan=
"2"><input type=
"submit" class=
"inb ok" name=
"add" onclick=
'return check_type_selected();' value=
"<?php
114 __("Edit
this subdomain
");
116 __("Add
this subdomain
");
123 <script type=
"text/javascript">
125 function check_type_selected() {
126 if ( $(
'input[name=type]:radio:checked').val() ) {
128 var ll = $(
'input[name=type]:radio:checked').val();
129 var tt = $(
'#t_'+ll);
130 if ( tt.length == 0 ) {
134 if ( tt.val() ==
'' ) {
135 alert(
"<?php __("Missing value
for this sub-domain
"); ?>");
141 alert(
"<?php __("Please select a type
for this sub-domain
"); ?>");
145 function domtype_advanced_hide() {
146 <?php
foreach ($lst_advanced as $adv) echo
"$(\"#tr_$adv\").hide();\n"?>
147 $(
"#domtype_show").show();
148 $(
"#domtype_hide").hide();
150 function domtype_advanced_show() {
151 <?php
foreach ($lst_advanced as $adv) echo
"$(\"#tr_$adv\").show();\n"?>
152 $(
"#domtype_show").hide();
153 $(
"#domtype_hide").show();
156 <?php
if (
isset($type) && in_array($type, $lst_advanced) ) {
157 domtype_advanced_show();
159 domtype_advanced_hide();