Marius Cramer
2014-01-24 73813a4bd2c3d3fcefecbd73416e8bb27273225f
interface/web/sites/web_vhost_domain_list.php
File was renamed from interface/web/sites/web_domain_list.php
@@ -35,7 +35,7 @@
* Begin Form configuration
******************************************/
$list_def_file = "list/web_domain.list.php";
$list_def_file = "list/web_vhost_domain.list.php";
/******************************************
* End Form configuration
@@ -46,13 +46,37 @@
$app->load('listform_actions');
//* Get and set the vhost domain type - store in session
$query_type = 'vhost';
$show_type = 'domain';
if(isset($_GET['type']) && $_GET['type'] == 'subdomain') {
   $show_type = 'subdomain';
   $query_type = 'vhostsubdomain';
} elseif(isset($_GET['type']) && $_GET['type'] == 'aliasdomain') {
   $show_type = 'aliasdomain';
   $query_type = 'vhostalias';
} elseif(!isset($_GET['type']) && isset($_SESSION['s']['var']['vhostdomain_type']) && $_SESSION['s']['var']['vhostdomain_type'] == 'subdomain') {
   $show_type = 'subdomain';
   $query_type = 'vhostsubdomain';
} elseif(!isset($_GET['type']) && isset($_SESSION['s']['var']['vhostdomain_type']) && $_SESSION['s']['var']['vhostdomain_type'] == 'aliasdomain') {
   $show_type = 'aliasdomain';
   $query_type = 'vhostalias';
}
$_SESSION['s']['var']['vhostdomain_type'] = $show_type;
class list_action extends listform_actions {
   function onShow() {
      global $app;
      $app->tpl->setVar('vhostdomain_type', $_SESSION['s']['var']['vhostdomain_type']);
      parent::onShow();
   }
}
$list = new list_action;
$list->SQLExtWhere = "web_domain.type = 'vhost' AND web_domain.parent_domain_id = '0'";
$list->SQLExtWhere = "web_domain.type = '" . $query_type . "'" . ($show_type != 'domain' ? " AND web_domain.parent_domain_id = '0'" : "");
$list->SQLOrderBy = 'ORDER BY web_domain.domain';
$list->onLoad();