Example #1
0
         EndHtml();
         exit;
     }
     if (+$_REQUEST['isNaked']) {
         ob_clean();
         echo include_cd_files();
         InsertInOneClassificator_modal($ClassificatorID);
         exit;
     }
     InsertInOneClassificator($ClassificatorID);
     break;
 case 9:
     # окончательное добавление записи в конкретный список
     BeginHtml($Title10, $Title3 . $Delimeter . $Title5, "http://" . $DOC_DOMAIN . "/management/lists/elements/");
     $perm->ExitIfNotAccess(NC_PERM_CLASSIFICATOR, NC_PERM_ACTION_ADDELEMENT, $ClassificatorID, 0, 1);
     if (IsSystemClassificator($ClassificatorID) && !$perm->isDirectAccessClassificator(NC_PERM_ACTION_ADDELEMENT, $ClassificatorID)) {
         nc_print_status(CONTENT_CLASSIFICATORS_ERR_EDITI_GUESTRIGHTS, 'error');
         EndHtml();
         exit;
     }
     if (InsertInOneClassificatorCompleted($ClassificatorID, $NameInClassificator, $Priority, $ValueInClassificator)) {
         nc_print_status(CONTENT_CLASSIFICATORS_ELEMENTS_ADD_SUCCESS, 'ok');
         OneClassificatorList($ClassificatorID, GetSortTypeByID($ClassificatorID), GetSortDirectionByID($ClassificatorID));
     }
     break;
 case 10:
     # форма обновления записи в конкретном списке
     BeginHtml($Title12, $Title3 . $Delimeter . $Title7 . $Delimeter . $Title8, "http://" . $DOC_DOMAIN . "/management/lists/elements/settings/");
     // Доступ view, ф-ция сама определит, просто показать или показать в режиме редакторования.
     $perm->ExitIfNotAccess(NC_PERM_CLASSIFICATOR, NC_PERM_ACTION_VIEW, $ClassificatorID, 0, 0);
     $UI_CONFIG = new ui_config_classificator_item('item.edit', $ClassificatorID, $IdInClassificator);
Example #2
0
function UpdateOneClassificator_modal($ClassificatorID, $IdInClassificator)
{
    global $UI_CONFIG, $perm;
    $nc_core = nc_Core::get_object();
    $db = $nc_core->db;
    $IdInClassificator = +$IdInClassificator;
    $TableName = $db->escape(GetTableNameByID($ClassificatorID));
    $Name = GetClassificatorNameByID($ClassificatorID);
    $isSystem = IsSystemClassificator($ClassificatorID);
    if ($isSystem) {
        if (!$perm->isDirectAccessClassificator(NC_PERM_ACTION_VIEW, $ClassificatorID)) {
            nc_print_status($NO_RIGHTS_MESSAGE, 'error');
            EndHtml();
            exit;
        }
        $edit_element = $perm->isDirectAccessClassificator(NC_PERM_ACTION_EDIT, $ClassificatorID);
    } else {
        $edit_element = $perm->isAccess(NC_PERM_CLASSIFICATOR, NC_PERM_ACTION_EDIT, $ClassificatorID);
    }
    echo nc_get_simple_modal_header($Name);
    echo "<form method='post' id='adminForm' class='nc-form' action='classificator.php'>";
    $SQL = "select `" . $TableName . "_Name`,\n        `Value`\n        from `Classificator_" . $TableName . "`\n        where `" . $TableName . "_ID` = '" . $IdInClassificator . "'";
    $Array = $db->get_row($SQL, ARRAY_N);
    if (!$edit_element) {
        print "" . CONTENT_CLASSIFICATORS_ELEMENT_NAME . ": " . $Array;
        return;
    }
    echo "\n        <div>" . CONTENT_CLASSIFICATORS_ELEMENT_NAME . ":</div>\n        " . "\n        <div>" . nc_admin_input_simple('NameInClassificator', $Array[0], 0, 'width: 30%;', "maxlength='256'") . "</div>\n        <div>" . nc_admin_textarea_simple('ValueInClassificator', $Array[1], "\n            <div>" . CONTENT_CLASSIFICATORS_ELEMENT_VALUE . ":</div>\n            ", 7, 0, "style='width: 30%;'", 'soft') . "\n        </div>\n\n        <input type='hidden' name='phase' value='11'>\n        <input type='hidden' name='ClassificatorID' value='" . $ClassificatorID . "'>\n        <input type='hidden' name='IdInClassificator' value='" . $IdInClassificator . "'>\n        " . $nc_core->token->get_input() . "\n    </form>\n    <script>prepare_message_form();</script>";
    ?>
    </div>

    <div class='nc_admin_form_buttons'>
        <button type='button' class='nc_admin_metro_button nc-btn nc--blue' disable><?php 
    echo NETCAT_REMIND_SAVE_SAVE;
    ?>
</button>
        <button type='button' class='nc_admin_metro_button_cancel nc-btn nc--red nc--bordered nc--right'><?php 
    echo CONTROL_BUTTON_CANCEL;
    ?>
</button>
    </div>

    <style>
        a { color: #1a87c2; }
        a:hover { text-decoration: none; }
        a img { border: none; }
        p { margin: 0px; padding: 0px 0px 18px 0px; }
        h2 { font-size: 20px; font-family: 'Segoe UI', SegoeWP, Arial; color: #333333; font-weight: normal; margin: 0px; padding: 20px 0px 10px 0px; line-height: 20px; }
        form { margin: 0px; padding: 0px; }
        input { outline: none; }
        .clear { margin: 0px; padding: 0px; font-size: 0px; line-height: 0px; height: 1px; clear: both; float: none; }
        select, input, textarea { border: 1px solid #dddddd; }
        :focus { outline: none; }
        .input { outline: none; border: 1px solid #dddddd; }
    </style>
<?php 
}