Exemple #1
0
function ShowFavorites()
{
    global $db, $UI_CONFIG, $nc_core;
    global $EDIT_DOMAIN, $HTTP_ROOT_PATH, $DOMAIN_NAME;
    global $loc, $perm, $ADMIN_PATH, $ADMIN_TEMPLATE, $SUB_FOLDER;
    $favorites = GetFavorites('OBJECT');
    if ($favorites) {
        $totrows = $db->num_rows;
        ?>
        <form method='post' action='favorites.php'>
            <table border='0' cellpadding='0' cellspacing='0' width='100%'>
                <tr>
                    <td>
                        <table class='admin_table' width='100%'>
                            <tr>
                                <th>ID</th>
								<th width='100%'><?php 
        echo CONTROL_CONTENT_SUBDIVISION_FUNCS_SECTION;
        ?>
</th>
								<th><?php 
        echo CONTROL_CONTENT_SUBDIVISION_FUNCS_SUBSECTIONS;
        ?>
</th>
								<th class='align-center'><?php 
        echo CONTROL_CONTENT_SUBDIVISION_FUNCS_GOTO;
        ?>
</th>
								<td class='align-center'><div class='icons icon_delete' title='<?php 
        echo CONTROL_CONTENT_SUBDIVISION_FUNCS_DELETE;
        ?>
'></div></td>
							</tr>

		<?php 
        $temp_group = "";
        foreach ($favorites as $Array) {
            if ($temp_group != $Array->Catalogue_ID) {
                print "<tr><td'><br></td><td colspan=5><a href=" . $ADMIN_PATH . "subdivision/full.php?CatalogueID=" . $Array->Catalogue_ID . " title='" . CONTROL_CONTENT_CATALOUGE_ONESITE . "'>" . (!$Array->CatalogueChecked ? "" : "") . $Array->Catalogue_Name . (!$Array->CatalogueChecked ? "" : "") . "</a></td></tr>";
            }
            print "<tr>\n                     <td>" . $Array->Subdivision_ID . "</td>\n                     <td><a href=\"index.php?phase=4&SubdivisionID=" . $Array->Subdivision_ID . "\">" . (!$Array->SubChecked ? "" : "") . $Array->Subdivision_Name . "</a></td>\n                     <td><a href=index.php?phase=1&ParentSubID=" . $Array->Subdivision_ID . ">" . (!$Array->SubChecked ? "" : "") . (!ChildrenNumber($Array->Subdivision_ID) ? CONTROL_CONTENT_SUBDIVISION_FUNCS_NONE : CONTROL_CONTENT_SUBDIVISION_FUNCS_LIST . " (" . ChildrenNumber($Array->Subdivision_ID) . ")") . "</a></td>\n                     <td align=center nowrap><a href=index.php?phase=5&SubdivisionID=" . $Array->Subdivision_ID . "><div class='icons icon_settings' title='" . CONTROL_CONTENT_SUBDIVISION_FUNCS_TOOPTIONS . "'></div></a>" . (!GetSubClassCount($Array->Subdivision_ID) ? "<img src=" . $ADMIN_TEMPLATE . "img/px.gif width=16 height=16 style='margin:0px 2px 0px 2px;'>" : "<a target=_blank href=http://" . $EDIT_DOMAIN . $HTTP_ROOT_PATH . "?catalogue=" . $Array->Catalogue_ID . "&sub=" . $Array->Subdivision_ID . (session_id() ? "?" . session_name() . "=" . session_id() : "") . "><div class='icons icon_pencil' title='" . CONTROL_CONTENT_SUBDIVISION_FUNCS_TOEDIT . "'></div></a>") . "<a href=" . nc_subdivision_preview_link($Array) . " target=_blank><div class='icons icon_preview' title='" . CONTROL_CONTENT_SUBDIVISION_FUNCS_TOVIEW . "'></div></a></td>\n                     <td align=center>" . nc_admin_checkbox_simple("Delete[" . $Array->Subdivision_ID . "]", $Array->Subdivision_ID) . "</td>\n\n                   </tr>\n";
            $temp_group = $Array->Catalogue_ID;
        }
        ?>
                                                                        </table>
                                                                        </td>
                                                                        </tr>
                                                                        </table>
                                                                        <input type='hidden' name='phase' value='6'>
                                                                        <input type='submit' class='hidden'>
                                                                        <?php 
        echo $nc_core->token->get_input();
        ?>
                                                                        </form>
                                                                        <?php 
        $UI_CONFIG->actionButtons[] = array("id" => "delete", "caption" => NETCAT_ADMIN_DELETE_SELECTED, "action" => "mainView.submitIframeForm()", "align" => "left", "red_border" => true);
    } else {
        nc_print_status(CONTROL_CONTENT_SUBDIVISION_FUNCS_NOONEFAVORITES, 'info');
    }
    $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => CONTROL_CONTENT_SUBDIVISION_FUNCS_ADDSECTION, "action" => "window.open('" . $ADMIN_PATH . "subdivision/favorites.php?phase=4','LIST','top=50, left=100,directories=no,height=600,location=no,menubar=no,resizable=no,scrollbars=yes,status=yes,toolbar=no,width=400')");
}
Exemple #2
0
function ShowSubdivisionMenu($SubdivisionID, $phase1, $action1, $phase2, $action2, $phase3, $action3)
{
    global $db;
    global $EDIT_DOMAIN, $HTTP_ROOT_PATH, $DOMAIN_NAME, $SUB_FOLDER;
    global $UI_CONFIG;
    $nc_core = nc_Core::get_object();
    $Array = $nc_core->subdivision->get_by_id($SubdivisionID);
    $Domain = $nc_core->catalogue->get_by_id($Array["Catalogue_ID"], 'Domain');
    $Array["Hidden_Host"] = $Domain ? strchr($Domain, ".") ? $Domain : $Domain . "." . $DOMAIN_NAME : $DOMAIN_NAME;
    $SubClassCount = $db->get_var("SELECT COUNT(*) FROM `Sub_Class` WHERE `Subdivision_ID` = '" . intval($SubdivisionID) . "'");
    $info = $nc_core->template->get_by_id($Array['Template_ID']);
    //  In My SQL 4.1, TIMESTAMP display format changes to be the same as DATETIME.
    if ($Array['LastUpdated'][4] != '-') {
        $Array['LastUpdated'] = substr($Array['LastUpdated'], 0, 4) . "-" . substr($Array['LastUpdated'], 4, 2) . "-" . substr($Array['LastUpdated'], 6, 2) . " " . substr($Array['LastUpdated'], 8, 2) . ":" . substr($Array['LastUpdated'], 10, 2) . ":" . substr($Array['LastUpdated'], 12, 2);
    }
    ?>

                <table class='nc-table nc--wide'>
                        <tr>
                            <td><?php 
    echo CONTROL_CONTENT_SUBDIVISION_FUNCS_INFO_UPDATED;
    ?>
:</td>
                            <td><?php 
    echo $Array['LastUpdated'];
    ?>
</td>
                        </tr>
                        <tr>
                            <td><?php 
    echo CONTROL_CONTENT_SUBDIVISION_FUNCS_INFO_SUBSECTIONS_COUNT;
    ?>
:</td>
                            <td><?php 
    echo $children = ChildrenNumber($SubdivisionID);
    ?>
                                (<?php 
    echo $children ? "<a href=index.php?phase=1&ParentSubID=" . $SubdivisionID . ">" . CONTROL_CONTENT_SUBDIVISION_FUNCS_LIST . "</a>, " : "";
    ?>
                                <a href="index.php?phase=2&ParentSubID=<?php 
    print $SubdivisionID;
    ?>
"><?php 
    echo CONTROL_CONTENT_SUBDIVISION_FUNCS_ADD;
    ?>
</a>)
                            </td>
                        </tr>
                        <tr>
                            <td><?php 
    echo CONTROL_CONTENT_SUBDIVISION_FUNCS_INFO_CLASS_COUNT;
    ?>
:</td>
                            <td><?php 
    echo $SubClassCount;
    ?>
 (<?php 
    echo $SubClassCount ? "<a href=SubClass.php?SubdivisionID=" . $SubdivisionID . ">" . CONTROL_CONTENT_SUBDIVISION_FUNCS_LIST . "</a>, " : "";
    ?>
<a href=SubClass.php?phase=1&SubdivisionID=<?php 
    echo $SubdivisionID;
    ?>
><?php 
    echo CONTROL_CONTENT_SUBDIVISION_FUNCS_ADD;
    ?>
</a>)</td>
                        </tr>
                        <tr>
                            <td><?php 
    echo CONTROL_CONTENT_SUBDIVISION_FUNCS_INFO_STATUS;
    ?>
:</td>
                            <td><?php 
    echo $Array["Checked"] ? CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_TURNON : CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_TURNOFF;
    ?>
</td>
                        </tr>
                        <tr>
                            <td><?php 
    echo CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_MULTI_SUB_CLASS;
    ?>
:</td>
                            <td><?php 
    echo $Array["UseMultiSubClass"] ? CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_TURNON : CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_TURNOFF;
    ?>
</td>
                        </tr>
                        <tr>
                            <td><?php 
    echo CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_DTEMPLATE;
    ?>
:</td>
                            <td><?php 
    echo $info["Template_ID"];
    ?>
. <?php 
    echo $info['Description'];
    ?>
</td>
                        </tr>
                        <tr>
                            <td><?php 
    echo CONTROL_TEMPLATE_CUSTOM_SETTINGS;
    ?>
:</td>
                            <td>
                                <?php 
    if ($info['CustomSettings']) {
        ?>
                                    <?php 
        eval($info['CustomSettings']);
        ?>
                                        <?php 
        foreach ($settings_array as $settings) {
            ?>
                                            <?php 
            echo $settings['caption'];
            ?>
<br>
                                        <?php 
        }
        ?>
                                <?php 
    } else {
        ?>
                                    <?php 
        echo CONTROL_TEMPLATE_CUSTOM_SETTINGS_ISNOTSET;
        ?>
                                <?php 
    }
    ?>
                            </td>
                        </tr>
                    </table>

    <?php 
}