Beispiel #1
0
     } else {
         $perm->ExitIfNotAccess(NC_PERM_ITEM_SITE, NC_PERM_ACTION_DELSUB, $CatalogueID, 0, 1);
         $UI_CONFIG = new ui_config_catalogue('map', $CatalogueID);
     }
     DeleteSubdivision();
     ShowSubdivisionList();
     break;
 case 13:
     // 2.4 - собственно перенесем рубрику в новую родительскую рубрику
     break;
 case 14:
     //Просмотр
     if ($SubClassID || $SubdivisionID) {
         $href = '';
         if ($SubdivisionID) {
             $href = nc_folder_url($SubdivisionID);
             $SubClassID = 0;
         }
         if ($SubClassID) {
             $href = nc_infoblock_url($SubClassID);
             $SubdivisionID = 0;
         }
         $UI_CONFIG = new ui_config_subdivision_preview($SubdivisionID, $SubClassID);
         $UI_CONFIG->actionButtons[] = array("id" => "preview", "caption" => SUBDIVISION_TAB_PREVIEW_BUTTON_PREVIEW, "action" => "urlDispatcher.load('{$href}', '1')");
         print "<script>window.onload = function(){ window.location.href='{$href}'; }</script>";
     }
     break;
 case 15:
     // покажем права для раздела
     BeginHtml($Title5, $Title1 . $Delimeter . $sh->Link, "http://" . $DOC_DOMAIN . "/management/sites/sections/info/");
     $perm->ExitIfNotAccess(NC_PERM_ITEM_SUB, NC_PERM_ACTION_INFO, $SubdivisionID, 0, 0);
Beispiel #2
0
 $alter_goBackLink = "";
 $alter_goBackLink_true = false;
 if (isset($_REQUEST['goBackLink'])) {
     $alter_goBackLink = $_REQUEST['goBackLink'];
     if ($admin_mode && preg_match("/^[\\/a-z0-9_-]+\\?catalogue=[[:digit:]]+&sub=[[:digit:]]+&cc=[[:digit:]]+(&curPos=[[:digit:]]{0,12})?\$/im", $alter_goBackLink)) {
         $alter_goBackLink_true = true;
     }
     if (!$admin_mode && preg_match("/^[\\/a-z0-9_-]+(\\.html)?(\\?curPos=[[:digit:]]{0,12})?\$/im", $alter_goBackLink)) {
         $alter_goBackLink_true = true;
     }
 }
 if (!$alter_goBackLink_true) {
     if ($admin_mode) {
         $goBackLink = $admin_url_prefix . "?catalogue=" . $catalogue . "&sub=" . $sub . "&cc=" . $cc . "&curPos=" . $curPos;
     } else {
         $goBackLink = ($user_table_mode ? nc_folder_url($current_sub['Subdivision_ID']) : nc_infoblock_url($current_cc['Sub_Class_ID'])) . ($curPos ? "?curPos=" . $curPos : "");
     }
 } else {
     $goBackLink = $alter_goBackLink;
 }
 $goBack = "<a href='" . $goBackLink . "'>" . NETCAT_MODERATION_BACKTOSECTION . "</a>";
 $cc_settings = nc_get_visual_settings($cc);
 $nc_core->page->set_current_metatags($current_sub);
 if ($posting && $nc_core->token->is_use($action)) {
     if (!$nc_core->token->verify()) {
         echo NETCAT_TOKEN_INVALID;
         break;
     }
 }
 if (!isset($cc_env['File_Mode'])) {
     try {
Beispiel #3
0
 $allow_id = $perm->GetAllowSub($current_site, MASK_ADMIN, false, true, false);
 $qry_where = is_array($allow_id) && !$perm->isGuest() ? " WHERE Subdivision_ID IN(" . join(',', (array) $allow_id) . ") " : "";
 $sub_admin = (array) $db->get_col("SELECT `Subdivision_ID` FROM `Subdivision` " . $qry_where);
 $is_site_admin = $perm->isAccess(NC_PERM_ITEM_SITE, NC_PERM_ACTION_ADMIN, $site['Catalogue_ID'], 0);
 foreach ((array) $subdivisions as $sub) {
     $is_subdivision_admin = in_array($sub['Subdivision_ID'], $sub_admin);
     $buttons = array();
     /*if ($is_subdivision_admin) {
           $buttons[] = array(
               'label' => TOOLS_COPYSUB_COPY_SUB_LOWER,
               'action' => "parent.location.hash = 'tools.copy(sub, ".$sub['Catalogue_ID'].",".$sub['Subdivision_ID'].")'",
               'icon'   => 'copy',
               'sprite' => true
           );
       }*/
     $buttons[] = array("label" => CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_A_VIEW, "action" => "window.open('" . nc_folder_url($sub['Subdivision_ID']) . "');", 'icon' => 'arrow-right', 'sprite' => true);
     if ($is_subdivision_admin) {
         $buttons[] = array("label" => CONTROL_CONTENT_SUBDIVISION_FUNCS_MAINDATA_A_ADDSUBSECTION, "action" => "parent.location.hash = 'subdivision.add(" . $sub['Subdivision_ID'] . ")'", 'icon' => 'folder-add', 'sprite' => true);
         $buttons[] = array("label" => CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_A_KILL, "action" => "parent.location.hash = 'subdivision.delete(" . $sub['Subdivision_ID'] . ")'", 'icon' => 'remove', 'sprite' => true);
         $tree_image = "folder" . ($sub["Checked"] ? "" : " nc--dark") . ($sub["LabelColor"] ? " nc--badge-" . $sub["LabelColor"] : "");
     } else {
         $tree_image = "folder" . ($sub["Checked"] ? "" : " nc--dark") . ($sub["LabelColor"] ? " nc--badge-" . $sub["LabelColor"] : "");
     }
     $ret_sub[$sub['Subdivision_ID']] = array("nodeId" => "sub-{$sub['Subdivision_ID']}", "parentNodeId" => $sub['Parent_Sub_ID'] ? "sub-{$sub['Parent_Sub_ID']}" : "site-{$sub['Catalogue_ID']}", "name" => $sub[Subdivision_ID] . ". " . strip_tags(str_replace(array("\r", "\n"), '', $sub["Subdivision_Name"])), "href" => $is_subdivision_admin ? "#subdivision.edit({$sub['Subdivision_ID']})" : "#subdivision.view({$sub['Subdivision_ID']})", "sprite" => $tree_image, "dragEnabled" => $is_subdivision_admin, "buttons" => $buttons, "acceptDropFn" => "treeSitemapAcceptDrop", "onDropFn" => "treeSitemapOnDrop", "className" => $sub["Checked"] ? "" : "disabled", "checked" => $sub["Checked"], "hasChildren" => $sub['hasChildren'] ? true : false, "subclasses" => array());
 }
 // of foreach subdivision
 /* информация о шаблонах в разделах. необходима для:
  *  1. формирования ссылки на список объектов
  *  2. для определения возможности перемещения объекта в конкретный раздел
  */
 $all_subs = join(",", array_keys($ret_sub));