Example #1
0
     $i = 0;
     foreach ($favorites as $fkey => $favorite) {
         if ($catalogue != $favorite['Catalogue_ID']) {
             echo "\t<div class='block_title_line'>";
             echo "\t\t<i class='nc-icon nc--site'></i>";
             $domainError = checkDomain($favorite['Domain'], $favorite['Catalogue_ID']);
             echo "\t\t<span><a href='subdivision/full.php?CatalogueID=" . $favorite['Catalogue_ID'] . "'" . (!$favorite['CatalogueChecked'] ? " class='gray'" : "") . ">" . $favorite['Catalogue_Name'] . "</a>" . $domainError . "</span>\n";
             echo "\t</div>\n";
             $catalogue = $favorite['Catalogue_ID'];
             $count++;
         }
         $subclass_id = $db->get_var("SELECT Sub_Class_ID\n                                       FROM Sub_Class\n                                      WHERE Subdivision_ID = '" . $favorite['Subdivision_ID'] . "'\n                                   ORDER BY Priority\n                                      LIMIT 1");
         echo "\t<div class='" . ($i % 2 ? "block_line" : "block_line_gray") . "'>\n";
         echo "\t\t<i class='nc-icon nc--folder" . (!$favorite['SubChecked'] ? " nc--disabled" : "") . "'></i>\n";
         echo "\t\t<span><a href='" . ($subclass_id ? "../?inside_admin=1&cc={$subclass_id}" : "subdivision/SubClass.php?phase=1&SubdivisionID=" . $favorite['Subdivision_ID']) . "' title='" . $favorite['Subdivision_Name'] . "'" . (!$favorite['SubChecked'] ? " class='gray'" : "") . ">" . $favorite['Subdivision_Name'] . "</a></span>\n";
         echo "\t\t<div class='block_line_link'><img border='0' src=" . $ADMIN_TEMPLATE . "img/px.gif width='16' height='16' style='margin:0px 2px 0px 2px;'>" . ($subclass_id ? "<a href='http://" . $EDIT_DOMAIN . $SUB_FOLDER . $HTTP_ROOT_PATH . "?inside_admin=1&cc=" . $subclass_id . (strlen(session_id()) > 0 ? "&" . session_name() . "=" . session_id() . "" : "") . "'><i class='nc-icon nc--edit nc--hovered' title='" . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_A_EDIT . "'></i></a>" : "<img border='0' src=" . $ADMIN_TEMPLATE . "img/px.gif width='19' height='19' style='margin:0px 2px 0px 2px;'>") . "<a href='" . nc_subdivision_preview_link($favorite) . "' target='_blank'><i class='nc-icon nc--arrow-right nc--hovered' title='" . CONTROL_CONTENT_SUBDIVISION_FUNCS_TOVIEW . "'></i></a></div>\n";
         echo "\t</div>\n";
         if ($catalogue != $favorites[$fkey + 1]['Catalogue_ID']) {
             echo "\t<div class='block_line block_map'>";
             echo "\t\t<span><a href='subdivision/full.php?CatalogueID=" . $favorite['Catalogue_ID'] . "'" . (!$favorite['CatalogueChecked'] ? " class='gray'" : "") . ">" . NETCAT_TREE_SITEMAP . "</a></span>\n";
             echo "\t</div>\n";
         }
         $i++;
     }
 } else {
     echo "\t<div class='block_line_gray'>\n";
     echo "\t\t<span>" . CONTROL_CONTENT_SUBDIVISION_FUNCS_NOONEFAVORITES . "</span>\n";
     echo "\t</div>\n";
 }
 echo "</div>\n";
 echo "<br style='clear: both;'>";
Example #2
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')");
}
Example #3
0
					<div class="nc--right">
						<?php 
            if (isset($subclass_link[$sub_id])) {
                ?>
							<a href='<?php 
                echo $subclass_link[$sub_id];
                ?>
'><i class='nc-icon nc--edit nc--white nc--hovered' title='<?php 
                echo CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_A_EDIT;
                ?>
'></i></a>
						<?php 
            }
            ?>
						<a href='<?php 
            echo nc_subdivision_preview_link($sub);
            ?>
' target='_blank'><i class='nc-icon nc--arrow-right nc--white nc--hovered' title='<?php 
            echo CONTROL_CONTENT_SUBDIVISION_FUNCS_TOVIEW;
            ?>
'></i></a>
					</div>
				</td>
			</tr>
		<?php 
        }
        ?>
	<?php 
    }
    ?>
	</table>
Example #4
0
function write_sub($ParentSubID, $CatalogueID, $count = 1)
{
    global $db, $nc_core;
    global $DOMAIN_NAME, $HTTP_ROOT_PATH, $EDIT_DOMAIN, $DOMAIN_NAME, $SUB_FOLDER, $ADMIN_PATH, $ADMIN_TEMPLATE;
    global $perm;
    $CatalogueID = intval($CatalogueID);
    $ParentSubID = intval($ParentSubID);
    static $security_limit, $initialized;
    if (!$initialized) {
        $initialized = true;
        $allow_id = $perm->GetAllowSub($CatalogueID, MASK_ADMIN | MASK_MODERATE);
        $security_limit = is_array($allow_id) && !$perm->isGuest() ? " Subdivision_ID IN (" . join(', ', (array) $allow_id) . ")" : " 1";
    }
    $Result = $db->get_results("SELECT a.Subdivision_ID,a.Subdivision_Name,a.Priority,a.Checked,a.Hidden_URL,b.Domain,a.Catalogue_ID,a.ExternalURL FROM Subdivision AS a, Catalogue AS b\n    WHERE a.Catalogue_ID=b.Catalogue_ID AND a.Catalogue_ID=" . $CatalogueID . "\n    AND a.Parent_Sub_ID='" . $ParentSubID . "' AND " . $security_limit . " ORDER BY a.Priority", ARRAY_N);
    if (empty($Result)) {
        return "";
    }
    $cat_fields = $nc_core->catalogue->get_all();
    foreach ($cat_fields as $kc => $vc) {
        foreach ($vc as $ks => $vs) {
            if ($ks == 'Title_Sub_ID' || $ks == 'E404_Sub_ID') {
                $subs_serv[] = $vs;
            }
        }
    }
    foreach ($Result as $Array) {
        $result .= "<tr>";
        $result .= "<td class='name " . ($Array[3] ? "active" : "unactive") . "' style='padding-left: " . ($count + 15) . "px;'>\n            <img src='" . $ADMIN_PATH . "images/arrow_sec.gif' width='14' height='10' alt='' title=''><span>" . $Array[0] . ". </span>\n            <a href='" . $ADMIN_PATH . "subdivision/index.php?phase=5&SubdivisionID={$Array[0]}&view=edit'>" . $Array[1] . "</a>\n            </td>";
        // edit
        $result .= "<td class='nc--compact'>";
        if (GetSubClassCount($Array[0])) {
            $cc_id = $db->get_var("SELECT Sub_Class_ID FROM Sub_Class WHERE Subdivision_ID = '" . $Array[0] . "'");
            $result .= "<a href='http://" . $EDIT_DOMAIN . $SUB_FOLDER . $HTTP_ROOT_PATH . "?inside_admin=1&cc=" . $cc_id . (strlen(session_id()) > 0 ? "&" . session_name() . "=" . session_id() . "" : "") . "'><i class='nc-icon nc--edit nc--hovered' title='" . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_A_EDIT . "'></i></a>";
        }
        $result .= "</td>";
        // view
        $show_url_arr = array("Hidden_URL" => $Array[4], "Domain" => $Array[5], "ExternalURL" => $Array[7], "Subdivision_ID" => $Array[0]);
        $result .= "<td class='nc--compact'><a href='" . nc_subdivision_preview_link($show_url_arr) . "' target='_blank'><i class='nc-icon nc--arrow-right nc--hovered' title='" . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_A_VIEW . "'></i></a></td>";
        // add
        $result .= "<td class='nc--compact'><a href='" . $ADMIN_PATH . "subdivision/index.php?phase=2&ParentSubID=" . $Array[0] . "'><i class='nc-icon nc--folder-add nc--hovered' title='" . CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_A_ADDSUBSECTION . "'></i></a></td>";
        // settings
        $result .= "<td class='nc--compact'><a href='" . $ADMIN_PATH . "subdivision/index.php?view=edit&phase=5&SubdivisionID=" . $Array[0] . "'><i class='nc-icon nc--settings nc--hovered' title='" . CONTROL_CONTENT_SUBDIVISION_FUNCS_TOOPTIONS . "'></i></a></td>";
        // checkbox
        $disabled = in_array($Array[0], $subs_serv) ? " disabled='disabled'" : '';
        $result .= "<td class='nc--compact nc-padding-10 nc-text-center'><input name='Delete" . $Array[0] . "' value='" . $Array[0] . "' type='checkbox'" . $disabled . "></td>";
        $result .= "</tr>";
        $result .= write_sub($Array[0], $CatalogueID, $count + 20);
    }
    return $result;
}