<?php /* $Id: classificator.php 8321 2012-11-01 12:56:22Z lemonade $ */ # работа со списками require "function.inc.php"; require "classificator.inc.php"; $Delimeter = " > "; $main_section = "control"; $item_id = 4; $Title1 = ""; $Title2 = CONTENT_CLASSIFICATORS; $Title3 = "<a href=" . $ADMIN_PATH . "classificator.php>" . CONTENT_CLASSIFICATORS . "</a>"; $Title4 = CONTROL_CONTENT_CATALOUGE_ADD; $Title5 = GetClassificatorNameByID($ClassificatorID); $Title6 = GetClassificatorNameByID($ClassificatorID) . " (" . CONTENT_CLASSIFICATORS_ELEMENTS . ")"; $Title7 = "<a href=\"" . $ADMIN_PATH . "classificator.php?phase=6&ClassificatorID=" . $ClassificatorID . "\">" . GetClassificatorNameByID($ClassificatorID) . " (" . CONTENT_CLASSIFICATORS_ELEMENTS . ")</a>"; if ($ClassificatorID) { $Title8 = GetOneClassificatorName($ClassificatorID, $IdInClassificator); } $Title9 = CONTENT_CLASSIFICATORS_LIST_ADD; $Title10 = CONTENT_CLASSIFICATORS_LIST_EDIT; $Title11 = CONTENT_CLASSIFICATORS_ELEMENTS_ADD; $Title12 = CONTENT_CLASSIFICATORS_ELEMENTS_EDIT; $Title13 = ucfirst(CONTENT_CLASSIFICATORS_ELEMENTS); $Title14 = "<a href=" . $ADMIN_PATH . "classificator.php>" . CLASSIFICATORS_IMPORT_HEADER . "</a>"; $Title15 = CLASSIFICATORS_IMPORT_HEADER; if (in_array($phase, array(2, 31, 5, 9, 11, 13))) { if (!$nc_core->token->verify()) { BeginHtml($Title2, $Title2, "http://" . $DOC_DOMAIN . "/management/lists/"); nc_print_status(NETCAT_TOKEN_INVALID, 'error'); EndHtml();
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 }