inc/toolkit.inc.php
changeset 4 55ed92aa7cf5
parent 3 64525a2eb098
child 6 9fcac40c1b0e
equal deleted inserted replaced
3:64525a2eb098 4:55ed92aa7cf5
    86 
    86 
    87 function show_pages($amount,$rowamount,$id='')
    87 function show_pages($amount,$rowamount,$id='')
    88 {
    88 {
    89    if ($amount > $rowamount) {
    89    if ($amount > $rowamount) {
    90       if (!isset($_GET["start"])) $_GET["start"]=1;
    90       if (!isset($_GET["start"])) $_GET["start"]=1;
    91       echo "<br /><br />Show page ";
    91       echo "<br /><br />" . _('Show page') . " ";
    92       for ($i=1;$i<=ceil($amount / $rowamount);$i++) {
    92       for ($i=1;$i<=ceil($amount / $rowamount);$i++) {
    93          if ($_GET["start"] == $i) {
    93          if ($_GET["start"] == $i) {
    94             echo "[ <b>".$i."</b> ] ";
    94             echo "[ <b>".$i."</b> ] ";
    95          } else {
    95          } else {
    96             echo "[ <a href=\"".$_SERVER["PHP_SELF"]."?start=".$i;
    96             echo "[ <a href=\"".$_SERVER["PHP_SELF"]."?start=".$i;
   114       } else {
   114       } else {
   115          $letter_taken[$dom["name"][0]] = 1;
   115          $letter_taken[$dom["name"][0]] = 1;
   116       }
   116       }
   117    }
   117    }
   118 
   118 
   119    echo "Show domains beginning with: <br />";
   119    echo _('Show domains beginning with:') . "<br />";
   120    if ($letterstart == 1) {
   120    if ($letterstart == 1) {
   121       echo "[ <b>0-9</b> ] ";
   121       echo "[ <b>0-9</b> ] ";
   122    } elseif ($letter_taken["0"] != 1) {
   122    } elseif ($letter_taken["0"] != 1) {
   123       echo "[ 0-9 ] ";
   123       echo "[ 0-9 ] ";
   124    } else {
   124    } else {
   144 	// General function for printing critical errors.
   144 	// General function for printing critical errors.
   145 	if ($msg)
   145 	if ($msg)
   146 	{
   146 	{
   147 		include_once("header.inc.php");
   147 		include_once("header.inc.php");
   148 	?>
   148 	?>
   149 	<P><TABLE CLASS="error"><TR><TD CLASS="error"><H2>Oops! An error occured!</H2>
   149 	<P><TABLE CLASS="error"><TR><TD CLASS="error"><H2><? echo _('Oops! An error occured!'); ?></H2>
   150 	<BR>
   150 	<BR>
   151 	<FONT STYLE="font-weight: Bold"><?= nl2br($msg) ?><BR><BR><a href="javascript:history.go(-1)">&lt;&lt; back</a></FONT><BR></TD></TR></TABLE></P>
   151 	<FONT STYLE="font-weight: Bold"><?= nl2br($msg) ?><BR><BR><a href="javascript:history.go(-1)">&lt;&lt; <? echo _('back'); ?></a></FONT><BR></TD></TR></TABLE></P>
   152 	<?
   152 	<?
   153 		include_once("footer.inc.php");
   153 		include_once("footer.inc.php");
   154 		die();
   154 		die();
   155 	}
   155 	}
   156 	else
   156 	else
   165  */
   165  */
   166 function message($msg)
   166 function message($msg)
   167 {
   167 {
   168     include_once("header.inc.php");
   168     include_once("header.inc.php");
   169     ?>
   169     ?>
   170     <P><TABLE CLASS="messagetable"><TR><TD CLASS="message"><H2>Success!</H2>
   170     <P><TABLE CLASS="messagetable"><TR><TD CLASS="message"><H2><? echo _('Success!'); ?></H2>
   171     <BR>
   171     <BR>
   172 	<FONT STYLE="font-weight: Bold">
   172 	<FONT STYLE="font-weight: Bold">
   173 	<P>
   173 	<P>
   174 	<?
   174 	<?
   175     if($msg)
   175     if($msg)
   176     {
   176     {
   177         echo nl2br($msg);
   177         echo nl2br($msg);
   178     }
   178     }
   179     else
   179     else
   180     {
   180     {
   181         echo "Successful!";
   181         echo _('Successful!');
   182     }
   182     }
   183     ?>
   183     ?>
   184     </P>
   184     </P>
   185     <BR>
   185     <BR>
   186     <P>
   186     <P>
   187     <a href="javascript:history.go(-1)">&lt;&lt; back</a></FONT>
   187     <a href="javascript:history.go(-1)">&lt;&lt; <? echo _('back'); ?></a></FONT>
   188     </P>
   188     </P>
   189     </TD></TR></TABLE></P>
   189     </TD></TR></TABLE></P>
   190     <?
   190     <?
   191     include_once("footer.inc.php");
   191     include_once("footer.inc.php");
   192 }
   192 }
   261 
   261 
   262 function get_status($res)
   262 function get_status($res)
   263 {
   263 {
   264 	if ($res == '0')
   264 	if ($res == '0')
   265 	{
   265 	{
   266 		return "<FONT CLASS=\"inactive\">Inactive</FONT>";
   266 		return "<FONT CLASS=\"inactive\">" . _('Inactive') . "</FONT>";
   267 	}
   267 	}
   268 	elseif ($res == '1')
   268 	elseif ($res == '1')
   269 	{
   269 	{
   270 		return "<FONT CLASS=\"active\">Active</FONT>";
   270 		return "<FONT CLASS=\"active\">" . _('Active') . "</FONT>";
   271 	}
   271 	}
   272 }
   272 }
   273 
   273 
   274 function parse_template_value($val, $domain, $webip, $mailip)
   274 function parse_template_value($val, $domain, $webip, $mailip)
   275 {
   275 {