Exemplo n.º 1
0
 case 17:
     // обновление шаблона компонента
     $AJAX_SAVER = true;
     if ($perm->isGuest()) {
         $AJAX_SAVER = false;
     }
     BeginHtml($Title2, $Title2, "http://" . $DOC_DOMAIN . "/management/class/");
     $perm->ExitIfNotAccess(NC_PERM_CLASS, 0, 0, 0, 1);
     if (!$Class_Name) {
         nc_print_status(CONTROL_CLASS_CLASS_TEMPLATE_ERROR_NAME, 'error');
         $AJAX_SAVER = true;
         ClassForm($ClassID, "index.php", 17, 2, 0);
         EndHtml();
         exit;
     }
     if (ActionClassComleted($type) === false) {
         nc_print_status(CONTROL_CLASS_CLASS_TEMPLATE_ERROR_EDIT, 'error');
         $AJAX_SAVER = true;
         ClassForm($ClassID, "index.php", 17, 2, 0);
         EndHtml();
         exit;
     } else {
         nc_print_status(CONTROL_CLASS_CLASS_TEMPLATE_SUCCESS_EDIT, 'ok');
     }
     $classData = $db->get_row("SELECT `Class_Name`, `Class_Group` FROM `Class` WHERE `Class_ID` = '" . $ClassID . "'", ARRAY_A);
     if ($action_type == 1) {
         $UI_CONFIG = new ui_config_class_template('info', $ClassID);
     } else {
         $UI_CONFIG = new ui_config_class_template('edit', $ClassID);
     }
     $UI_CONFIG->treeChanges['updateNode'][] = array("nodeId" => "classtemplate-" . $ClassID, "name" => $ClassID . ". " . $classData['Class_Name']);
Exemplo n.º 2
0
 case 2:
     $AJAX_SAVER = true;
     if ($perm->isGuest()) {
         $AJAX_SAVER = false;
     }
     BeginHtml($Title2, $Title3 . $Delimeter . $Title8, "http://" . $DOC_DOMAIN . "/settings/systables/users/");
     $perm->ExitIfNotAccess(NC_PERM_SYSTABLE, 0, 0, 0, 0);
     $UI_CONFIG = new ui_config_system_class('edit', $SystemTableID);
     ClassForm($SystemTableID, "system.php", 3, 3, 0);
     break;
     // редактирование завершено
 // редактирование завершено
 case 3:
     BeginHtml($Title2, $Title2, "http://" . $DOC_DOMAIN . "/settings/systables/");
     $perm->ExitIfNotAccess(NC_PERM_SYSTABLE, 0, 0, 0, 1);
     ActionClassComleted($type);
     if ($System_Table_ID == 3) {
         if (+$_REQUEST['isNaked']) {
             ob_clean();
             echo 'OK';
             exit;
         }
         nc_print_status(CONTROL_CONTENT_CLASS_SUCCESS_EDIT, 'ok');
         ClassForm($System_Table_ID, "system.php", 3, 3, 0);
     } else {
         SystemTableList();
     }
     break;
     // редактирование без UI_CONFIG
 // редактирование без UI_CONFIG
 case 4:
Exemplo n.º 3
0
     nc_class_wizard_start('', 'Базовые');
     EndHtml();
     break;
     // Проверка данных из первой формы а
 // Проверка данных из первой формы а
 case 2:
     BeginHtml($Title1, $Title2, "http://" . $DOC_DOMAIN . "/management/class/wizard/");
     $perm->ExitIfNotAccess(NC_PERM_CLASS, NC_PERM_ACTION_WIZARDCLASS, 0, 0, 1);
     if (!$Class_Name) {
         nc_print_status(CONTROL_CONTENT_CLASS_ERROR_NAME, 'error');
         $UI_CONFIG = new ui_config_wizard_class(1, 0, 0);
         nc_class_wizard_start('', 'Базовые');
         EndHtml();
         break;
     }
     $ClassID = ActionClassComleted(1);
     //здесь break не нужен, если все правильно - сразу переходим к добавлению полей
 //здесь break не нужен, если все правильно - сразу переходим к добавлению полей
 case 3:
     #Форма добавления поля + сообственно добавление
     BeginHtml($Title1, $Title2, "http://" . $DOC_DOMAIN . "/management/class/wizard/");
     $perm->ExitIfNotAccess(NC_PERM_CLASS, NC_PERM_ACTION_WIZARDCLASS, 0, 0, 1);
     $UI_CONFIG = new ui_config_wizard_class(2, $Class_Type, $ClassID);
     if ($addField) {
         if (($new_id = FieldCompleted(0)) <= 0) {
             nc_print_status($type_of_error[-$new_id], 'error');
         } else {
             nc_print_status(CONTROL_FIELD_MSG_ADDED, 'ok');
             $UI_CONFIG->treeChanges['deleteNode'][] = "dataclass-" . $ClassID;
             $UI_CONFIG->treeChanges['addNode'][] = array("parentNodeId" => "group-" . md5($Class_Group), "nodeId" => "dataclass-{$ClassID}", "name" => $ClassID . ". " . $ClassName, "href" => "#dataclass.edit(" . $ClassID . ")", "image" => 'i_class.gif', "buttons" => array("image" => "i_class_delete.gif", "label" => CONTROL_CLASS_DELETE, "href" => "dataclass.delete(" . $ClassID . ")"), "acceptDropFn" => "treeClassAcceptDrop", "onDropFn" => "treeClassOnDrop", "hasChildren" => true, "dragEnabled" => true);
             $UI_CONFIG->treeChanges['addNode'][] = array("parentNodeId" => "dataclass-" . $ClassID, "nodeId" => "field-{$new_id}", "name" => $new_id . ". " . $FieldName, "href" => "#field.edit({$new_id})", "image" => $field_types[$TypeOfDataID], "buttons" => array("image" => "i_field_delete.gif", "label" => CONTROL_FIELD_LIST_DELETE, "href" => "field.delete(" . $ClassID . "," . $new_id . ")"), "acceptDropFn" => "treeFieldAcceptDrop", "onDropFn" => "treeFieldOnDrop", "hasChildren" => false, "dragEnabled" => true);