コード例 #1
0
ファイル: wizard_site.php プロジェクト: Blu2z/implsk
     CatalogueForm($CatalogueID, 2, "wizard_site.php", 1, $action);
     break;
 }
 if (!IsAllowedDomain($Domain, 0)) {
     nc_print_status(CONTROL_CONTENT_CATALOUGE_ERROR_DUPLICATE_DOMAIN, 'error');
     $UI_CONFIG = new ui_config_wizard_site(1, $CatalogueID);
     CatalogueForm($CatalogueID, 2, "wizard_site.php", 1, $action);
     break;
 }
 if (strspn(strtolower($Domain), "abcdefghijklmnopqrstuvwxyz0123456789-.") != strlen($Domain)) {
     nc_print_status(CONTROL_CONTENT_CATALOUGE_ERROR_CASETREE_THREE, 'error');
     $UI_CONFIG = new ui_config_wizard_site(1, $CatalogueID);
     CatalogueForm($CatalogueID, 2, "wizard_site.php", 1, $action);
     break;
 }
 if (ActionCatalogueCompleted($CatalogueID, 1)) {
     $UI_CONFIG = new ui_config_wizard_site($phase, $CatalogueID);
     $site = $db->get_row("SELECT Catalogue_ID, Catalogue_Name, Domain, Mirrors, Checked\n                                FROM Catalogue\n                               WHERE Catalogue_ID = '" . $CatalogueID . "'\n                            ORDER BY Priority", ARRAY_A);
     if ($site['Checked']) {
         $image = 'i_site.gif';
     } else {
         $image = 'i_site_disabled.gif';
     }
     if ($type == 1) {
         $buttons = array();
         $buttons[] = array("image" => "i_preview.gif", "label" => CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_A_VIEW, "action" => "window.open('http://" . ($site['Domain'] ? $site['Domain'] : $HTTP_HOST) . "');");
         $buttons[] = array("image" => "i_folder_add.gif", "label" => CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_A_ADDSUBSECTION, "href" => "subdivision.add(0,{$site['Catalogue_ID']})");
         $UI_CONFIG->treeChanges['addNode'][] = array("nodeId" => "site-{$site['Catalogue_ID']}", "name" => $site[Catalogue_ID] . ". " . $site["Catalogue_Name"], "href" => "#site.map({$site['Catalogue_ID']})", "image" => $image, "hasChildren" => true, "acceptDropFn" => "treeSitemapAcceptDrop", "onDropFn" => "treeSitemapOnDrop", "dragEnabled" => true, "buttons" => $buttons);
         $UI_CONFIG->addNavBarCatalogue = array('name' => $site["Catalogue_Name"], 'href' => "#site.map({$site[Catalogue_ID]})");
         nc_print_status(CONTROL_CONTENT_CATALOUGE_SUCCESS_ADD, 'ok');
     }
コード例 #2
0
ファイル: index.php プロジェクト: Blu2z/implsk
 if (!IsAllowedDomain($Domain, $CatalogueID)) {
     nc_print_status(CONTROL_CONTENT_CATALOUGE_ERROR_DUPLICATE_DOMAIN, 'error');
     CatalogueForm($CatalogueID, 3, "index.php", $type, $action);
     break;
 }
 // домен сайта должен содеражить только  буквы, цифры, подчеркивание, дефис и точку, либо быть пустым
 if (!nc_preg_match($nc_core->NC_UNICODE ? "/^[-0-9a-zа-я._]*\$/i" : "/^[-0-9a-z._]*\$/i", $Domain)) {
     nc_print_status(CONTROL_CONTENT_CATALOUGE_ERROR_CASETREE_THREE, 'error');
     CatalogueForm($CatalogueID, 3, "index.php", $type, $action);
     break;
 }
 $infoMessage = checkDomain($Domain, $CatalogueID);
 if (!empty($infoMessage)) {
     nc_print_status(CONTROL_CONTENT_CATALOUGE_ERROR_INCORRECT_DOMAIN_FULLTEXT, 'info');
 }
 if (ActionCatalogueCompleted($CatalogueID, $type, $phase_action)) {
     $UI_CONFIG = new ui_config_catalogue('map', $CatalogueID);
     $site = $nc_core->catalogue->get_by_id($CatalogueID, null, 1);
     $image = $site['Checked'] ? 'i_site.gif' : 'i_site_disabled.gif';
     if ($type == 1) {
         $buttons = array();
         $buttons[] = array("image" => "i_preview.gif", "label" => CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_A_VIEW, "action" => "window.open('http://" . ($site['Domain'] ? $site['Domain'] : $HTTP_HOST) . "');", "icon" => "arrow-right", "sprite" => true);
         $buttons[] = array("image" => "i_folder_add.gif", "label" => CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_A_ADDSUBSECTION, "action" => "parent.location.hash = 'subdivision.add(0,{$site['Catalogue_ID']})'", "icon" => "folder-add", "sprite" => true);
         $UI_CONFIG->treeChanges['addNode'][] = array("nodeId" => "site-{$site['Catalogue_ID']}", "name" => $site[Catalogue_ID] . ". " . $site["Catalogue_Name"], "href" => "#site.map({$site['Catalogue_ID']})", "hasChildren" => true, "acceptDropFn" => "treeSitemapAcceptDrop", "onDropFn" => "treeSitemapOnDrop", "dragEnabled" => true, "buttons" => $buttons);
         $UI_CONFIG->addNavBarCatalogue = array('name' => $site["Catalogue_Name"], 'href' => "#site.map({$site[Catalogue_ID]})");
         nc_print_status(CONTROL_CONTENT_CATALOUGE_SUCCESS_ADD, 'ok');
         ShowFullSubdivisionList();
     } else {
         if ($type == 2) {
             $UI_CONFIG = new ui_config_catalogue('edit', $CatalogueID, $action);
             $UI_CONFIG->treeChanges['updateNode'][] = array("nodeId" => "site-{$site['Catalogue_ID']}", "name" => $site[Catalogue_ID] . ". " . $site["Catalogue_Name"], "preview_action" => "window.open('http://" . ($site['Domain'] ? $site['Domain'] : $HTTP_HOST) . "');");