Пример #1
0
 function get_child_domains($domain_parent_uuid)
 {
     global $domains, $indent;
     global $c, $row_style, $text, $v_link_label_edit, $v_link_label_delete;
     foreach ($domains as $domain_uuid => $domain) {
         if ($domain['parent_uuid'] == $domain_parent_uuid) {
             $tr_link = permission_exists('domain_edit') ? "href='domain_edit.php?id=" . $domain_uuid . "'" : null;
             echo "<tr " . $tr_link . ">\n";
             echo "\t<td valign='top' class='" . $row_style[$c] . "' " . ($indent != 0 ? "style='padding-left: " . $indent * 20 . "px;'" : null) . ">";
             echo "\t\t<a href='domain_edit.php?id=" . $domain_uuid . "'>" . $domain['name'] . "</a>";
             if ($domain['enabled'] != '' && $domain['enabled'] != 'true') {
                 echo "\t<span style='color: #aaa; font-size: 80%;'>&nbsp;&nbsp;(" . $text['label-disabled'] . ")</span>";
             }
             echo "\t</td>\n";
             echo "\t<td valign='top' class='" . $row_style[$c] . "'>";
             if (permission_exists('domain_edit')) {
                 echo "<a href='" . PROJECT_PATH . "/core/domain_settings/domains.php?domain_uuid=" . $domain_uuid . "&domain_change=true'>" . $text['label-manage'] . "</a>";
             }
             echo "\t</td>";
             echo "\t<td valign='top' class='row_stylebg'>" . $domain['description'] . "&nbsp;</td>\n";
             echo "\t<td class='list_control_icons'>";
             if (permission_exists('domain_edit')) {
                 echo "<a href='domain_edit.php?id=" . $domain_uuid . "' alt='" . $text['button-edit'] . "'>" . $v_link_label_edit . "</a>";
             }
             if (permission_exists('domain_delete')) {
                 if ($_SESSION["groups"][0]["domain_uuid"] != $domain_uuid && count($domains) > 1) {
                     echo "<a href='domain_delete.php?id=" . $domain_uuid . "' alt='" . $text['button-delete'] . "' onclick=\"return confirm('" . $text['confirm-delete'] . "')\">" . $v_link_label_delete . "</a>";
                 } else {
                     echo "<span onclick=\"alert('You cannot delete your own domain.\\n\\nPlease login with a user account under a different domain, then try again.');\">" . $v_link_label_delete . "</span>";
                 }
             }
             echo "\t</td>\n";
             echo "</tr>\n";
             $c = $c == 0 ? 1 : 0;
             $indent++;
             get_child_domains($domain_uuid);
             $indent--;
         }
     }
 }
Пример #2
0
 function get_child_domains($parent_uuid)
 {
     global $result, $indent, $domain_parent_uuid, $domain_name;
     foreach ($result as $row) {
         if ($row['domain_parent_uuid'] == $parent_uuid && $row['domain_name'] != $domain_name && ($row['domain_enabled'] == 'true' || $row['domain_enabled'] == '')) {
             $selected = $domain_parent_uuid == $row['domain_uuid'] ? "selected='selected'" : null;
             echo "<option value='" . $row['domain_uuid'] . "' " . $selected . ">" . str_repeat("&nbsp;", $indent * 5) . $row['domain_name'] . "</option>\n";
             $indent++;
             get_child_domains($row['domain_uuid']);
             $indent--;
         }
     }
 }