Ejemplo n.º 1
0
 /**
  * Проверка правильности настроек сервера, выводится на странице «Информация»
  * в панели управления модулем.
  * @return void
  */
 public function check_environment()
 {
     nc_search_util::check_sites_language();
     // multibyte string function overload must be disabled
     if (intval(ini_get("mbstring.func_overload")) & 2) {
         nc_print_status(NETCAT_MODULE_SEARCH_MB_OVERLOAD_ENABLED_ERROR, 'error');
     }
     // Lucene index folder must be writable
     $index_path = $this->get_index_path();
     $path_exists = file_exists($index_path);
     if ($path_exists && !is_writeable($index_path) && (!$path_exists && !is_writable("{$index_path}/../"))) {
         nc_print_status(NETCAT_MODULE_SEARCH_INDEX_DIRECTORY_NOT_WRITABLE_ERROR, 'error', array($index_path));
     }
     // try to open the index
     try {
         $this->open_index();
     } catch (Exception $e) {
         nc_print_status(NETCAT_MODULE_SEARCH_CANNOT_OPEN_INDEX_ERROR, 'error', array($index_path));
     }
 }
Ejemplo n.º 2
0
/**
 * Show confirm deleting object
 *
 * @param array post
 */
function confim_delete_sub_class_object($array)
{
    global $UI_CONFIG, $db, $nc_core;
    $in = array();
    reset($array);
    while (list($key, $val) = each($array)) {
        if (nc_substr($key, 0, 6) == "Delete") {
            $in[] = intval($val);
        }
    }
    $in_array = join(',', $in);
    $sub_class = $db->get_col("SELECT `Sub_Class_Name` FROM `Sub_Class` WHERE Sub_Class_ID IN(" . $in_array . ")");
    if ($db->num_rows) {
        print "<form action='index.php' method='post'>\n\n             <input type='hidden' name='phase' value='4'>\n\n             <input type='hidden' name='sub_class' value='" . $in_array . "'>\n\n             " . $nc_core->token->get_input() . "\n           </form>\n";
        nc_print_status(REPORTS_STAT_CLASS_CONFIRM, 'ok');
        print "<ui>";
        foreach ($sub_class as $v) {
            print "<li>" . $v;
        }
        $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => REPORTS_STAT_CLASS_CONFIRM_OK, "action" => "mainView.submitIframeForm()");
    } else {
        nc_print_status(REPORTS_STAT_CLASS_NOT_CC, 'error');
    }
}
Ejemplo n.º 3
0
function ChangePassword($UserID, $Password, $db)
{
    global $nc_core;
    $UserID = intval($UserID);
    $Password = $db->escape($Password);
    // новый пароль совпадает с текущим?
    if ($db->get_var("SELECT `User_ID` FROM `User` WHERE `User_ID` = '" . $UserID . "' AND `Password` = " . $nc_core->MYSQL_ENCRYPT . "('" . $Password . "')")) {
        nc_print_status(CONTROL_USER_ERROR_NEWPASS_IS_CURRENT, 'error');
        return;
    }
    // Есть ли поле RegistrationCode в таблице пользователей?
    $RegistrationCodeExists = false;
    $res = $db->get_results("EXPLAIN `User`", ARRAY_A);
    foreach ($res as $row) {
        if ($row['Field'] == 'RegistrationCode') {
            $RegistrationCodeExists = true;
            break;
        }
    }
    // если нет, то нужно создать
    if (!$RegistrationCodeExists) {
        $db->query("ALTER TABLE `User` ADD `RegistrationCode` VARCHAR( 255 ) NOT NULL ");
    }
    $db->last_error = '';
    // execute core action
    $nc_core->event->execute("updateUserPrep", $UserID);
    // сообственно, запро
    $db->query("UPDATE `User` SET `Password`=" . $nc_core->MYSQL_ENCRYPT . "('" . $Password . "'), `RegistrationCode` = '' WHERE `User_ID` = '" . $UserID . "'");
    if (!$db->last_error) {
        nc_print_status(CONTROL_USER_OK_CHANGEDPASS, 'ok');
    } else {
        nc_print_status(CONTROL_USER_ERROR_NOTCANGEPASS, 'error');
    }
    // execute core action
    $nc_core->event->execute("updateUser", $UserID);
}
Ejemplo n.º 4
0
function ActionForm_for_modal($SubClassID)
{
    global $CatalogueID, $SubdivisionID, $loc, $perm;
    global $SUB_FOLDER, $HTTP_ROOT_PATH, $MODULE_FOLDER, $ADMIN_FOLDER, $ADMIN_PATH;
    $nc_core = nc_Core::get_object();
    $db = $nc_core->db;
    $type = 2;
    $SubdivisionID = $SubdivisionID ? +$SubdivisionID : $nc_core->sub_class->get_by_id($SubClassID, 'Subdivision_ID');
    $CatalogueID = $CatalogueID ? +$CatalogueID : $nc_core->subdivision->get_by_id($SubdivisionID, 'Catalogue_ID');
    $SubEnv = $nc_core->sub_class->get_by_id($SubClassID);
    $ClassEnv = $db->get_row("SELECT * FROM `Class` WHERE `Class_ID` = '" . intval($SubEnv["Class_ID"]) . "'", ARRAY_A);
    if (nc_module_check_by_keyword("cache")) {
        $cache_select_fields = "s.`Cache_Access_ID`, s.`Cache_Lifetime`, s.`CacheForUser`,";
    } else {
        $cache_select_fields = "";
    }
    $select = "SELECT " . $cache_select_fields . "\n                          s.`Sub_Class_Name`,\n                          s.`Subdivision_ID`,\n                          s.`Priority`,\n                          s.`Read_Access_ID`,\n                          s.`Write_Access_ID`,\n                          s.`Edit_Access_ID`,\n                          s.`Checked_Access_ID`,\n                          s.`Delete_Access_ID`,\n                          s.`Moderation_ID`,\n                          s.`EnglishName`,\n                          s.`Checked`,\n                          s.`Subscribe_Access_ID`,\n                          s.`DaysToHold`,\n                          s.`AllowTags`,\n                          s.`NL2BR`,\n                          s.`RecordsPerPage`,\n                          s.`SortBy`,\n                          s.`Created`,\n                          s.`LastUpdated`,\n                          c.`Class_Name`,\n                          c.`Class_ID`,\n                          c.`System_Table_ID`,\n                          s.`DefaultAction`,\n                          s.`UseCaptcha`,\n                          c.`CustomSettingsTemplate`,\n                          s.`CustomSettings`,\n                          s.`Class_Template_ID`,\n                          s.`isNaked`,\n                          s.`SrcMirror`,\n                          s.`AllowRSS`,\n                          s.`Edit_Class_Template`\n                       FROM `Sub_Class` as s,\n                            `Class` as c\n                           WHERE `Sub_Class_ID` = " . +$SubClassID . "\n                             AND c.`Class_ID` = s.`Class_ID`";
    $Array = $db->get_row($select, ARRAY_A);
    if ($db->is_error) {
        throw new nc_Exception_DB_Error($db->last_query, $db->last_error);
    }
    if (empty($Array)) {
        nc_print_status(CONTROL_CONTENT_CATALOUGE_FUNCS_ERROR_NOSUBCLASS, 'info');
        return;
    }
    if ($Array['Class_Template_ID']) {
        $Array['CustomSettingsTemplate'] = $db->get_var("SELECT `CustomSettingsTemplate`\n                                                                 FROM `Class`\n                                                                     WHERE `Class_ID` = " . $Array['Class_Template_ID']);
    }
    $mobile = $nc_core->catalogue->get_by_id($CatalogueID, 'ncMobile');
    $classTemplatesArr = $db->get_results("SELECT `Class_Name`,\n                                                      `Class_ID`\n                                                   FROM `Class`\n                                                       WHERE `ClassTemplate` = '" . $Array['Class_ID'] . "'\n                                                         AND `Type` " . (!$mobile ? "IN ('useful', 'title', 'mobile')" : "= 'mobile'"), ARRAY_A);
    $class_array = nc_get_class_template_array_by_id($Array['Class_Template_ID'] ? $Array['Class_Template_ID'] : $Array['Class_ID']);
    $edit_class_select = null;
    if (count($class_array) > 1) {
        $edit_class_select = nc_get_class_template_form_select_by_array($class_array, $Array['Edit_Class_Template']);
    }
    $classInfo = nc_sub_class_get_classInfo($perm, $Array, $classTemplatesArr, $edit_class_select);
    if ($loc->SubdivisionID) {
        $wsts = CONTROL_CONTENT_SUBCLASS_ONSECTION;
    } else {
        $wsts = CONTROL_CONTENT_SUBCLASS_ONSITE;
    }
    $wsts_msg = nc_sub_class_get_wsts_msg($wsts);
    require_once $ADMIN_FOLDER . "related/format.inc.php";
    $field = new field_relation_subclass();
    $fieldsets = new nc_admin_fieldset_collection();
    $fieldsets->set_prefix(nc_sub_class_get_prefix($SubClassID, $Array));
    $fieldsets->set_static_prefix(nc_sub_class_get_style_prefix());
    $fieldsets->set_suffix("\n            </div>\n            " . $nc_core->token->get_input() . "\n            <input type='hidden' name='phase' value='4' />\n            <input type='hidden' name='SubClassID' value='{$SubClassID}' />\n            <input type='hidden' name='SubdivisionID' value='{$loc->SubdivisionID}' />\n            <input type='hidden' name='CatalogueID' value='{$loc->CatalogueID}' />\n            <input type='submit' style='display: none;' />\n            ");
    $fieldsets->new_fieldset('main_info', CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_MAININFO)->add(nc_sub_class_get_main_info($Array, $classInfo, $wsts_msg, $field));
    $fieldsets->new_fieldset('objlist', CONTROL_CONTENT_SUBDIVISION_FUNCS_OBJ_HOWSHOW)->add(nc_sub_class_get_objlist($Array));
    if ($Array['CustomSettingsTemplate']) {
        require_once $ADMIN_FOLDER . 'array_to_form.inc.php';
        $values = $CustomSettings ? $CustomSettings : $Array['CustomSettings'];
        $a2f = new nc_a2f($Array['CustomSettingsTemplate'], 'CustomSettings');
        $a2f->set_value($values);
        $fieldsets->new_fieldset('CustomSettings', CONTROL_CONTENT_SUBDIVISION_CUSTOM_SETTINGS_TEMPLATE)->add(nc_sub_class_get_CustomSettings($a2f));
    }
    $fieldsets->new_fieldset('access', CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_ACCESS)->add(nc_subdivision_show_access($SubEnv));
    #$fieldsets->new_fieldset('rss', 'RSS')->add(nc_subclass_show_export('rss', $SubdivisionID, $SubClassID));
    #$fieldsets->new_fieldset('xml', 'XML')->add(nc_subclass_show_export('xml', $SubdivisionID, $SubClassID));
    if (nc_module_check_by_keyword('cache')) {
        $fieldsets->new_fieldset('cache', CONTROL_CONTENT_SUBCLASS_FUNCS_CACHE)->add(nc_subdivision_show_cache($SubEnv));
    }
    if (nc_module_check_by_keyword('comments')) {
        $fieldsets->new_fieldset('comments', CONTROL_CONTENT_SUBCLASS_FUNCS_COMMENTS)->add(nc_subdivision_show_comments($SubEnv));
    }
    echo $fieldsets->to_string();
}
Ejemplo n.º 5
0
/**
 * Функция выводит список пользовательских настроек
 *
 * @param int номер компонента
 * @param int номер макета дизайн
 * @param array массив с настройками
 * @return int
 */
function nc_customsettings_show($ClassID = 0, $TemplateID = 0, $custom_settings = array(), $Class_Template = 0)
{
    global $UI_CONFIG;
    $suffix = +$_REQUEST['fs'] ? '_fs' : '';
    if (!$ClassID && !$TemplateID) {
        return false;
    }
    if ($ClassID && !$Class_Template) {
        $ac = "urlDispatcher.load('dataclass{$suffix}.custom.new(" . $ClassID . ")')";
        $ac1 = "urlDispatcher.load('dataclass{$suffix}.custom.manual(" . $ClassID . ")')";
    } else {
        if ($ClassID && $Class_Template) {
            $ac = "urlDispatcher.load('classtemplate{$suffix}.custom.new(" . $ClassID . ")')";
            $ac1 = "urlDispatcher.load('classtemplate{$suffix}.custom.manual(" . $ClassID . ")')";
        } else {
            $ac = "urlDispatcher.load('template{$suffix}.custom.new(" . $TemplateID . ")')";
            $ac1 = "urlDispatcher.load('template{$suffix}.custom.manual(" . $TemplateID . ")')";
        }
    }
    $UI_CONFIG->actionButtons[] = array("id" => "addcs", "caption" => CONTROL_FIELD_LIST_ADD, "action" => $ac, 'align' => 'left');
    $UI_CONFIG->actionButtons[] = array("id" => "del", "caption" => NETCAT_CUSTOM_ONCE_MANUAL_EDIT, "action" => $ac1, 'align' => 'left');
    if (empty($custom_settings)) {
        nc_print_status(NETCAT_CUSTOM_NONE_SETTINGS, 'info');
        return false;
    }
    $a2f = new nc_a2f($custom_settings, '');
    $header = " <table class='nc-table nc--striped nc--small nc--hovered' style='width:100%'>\n            <tr>\n              <th width='30%'>" . NETCAT_CUSTOM_ONCE_FIELD_NAME . "</th>\n              <th width='45%'>" . NETCAT_CUSTOM_ONCE_FIELD_DESC . "</th>\n              <th  width='20%'>" . NETCAT_CUSTOM_TYPE . "</th>\n              <td align=center width='5%'>\n                " . nc_admin_img('delete', NETCAT_CUSTOM_ONCE_DROP) . "\n              </td>\n            </tr>";
    echo "<form action='index.php' method='post' >";
    echo "<input type='hidden' name='phase' value='" . ($ClassID ? $Class_Template ? "2410" : "241" : "81") . "' />";
    echo "<input type='hidden' name='ClassID' value='" . $ClassID . "' />";
    echo "<input type='hidden' name='TemplateID' value='" . $TemplateID . "' />";
    echo "<input type='hidden' name='fs' value='" . +$_REQUEST['fs'] . "' />";
    echo $a2f->render_settings($header, '<tr style="background-color: #FFF;"><td><a href="index.php?phase=' . ($ClassID ? $Class_Template ? 250 : 25 : 9) . '&amp;' . ($ClassID ? "ClassID=" . $ClassID : "TemplateID=" . $TemplateID) . '&amp;param=%NAME&fs=' . +$_REQUEST['fs'] . '">%NAME</a></td><td>%CAPTION</td><td>%TYPENAME</td><td align="center">' . nc_admin_checkbox_simple("kill[]", "%NAME") . '</td></tr>', '</table>');
    $custom_settings = $a2f->eval_value($custom_settings);
    $UI_CONFIG->actionButtons[] = array("id" => "del", "caption" => NETCAT_CUSTOM_ONCE_DROP_SELECTED, "action" => "mainView.submitIframeForm()", "align" => "right", "red_border" => true);
    echo "</form>";
    return false;
}
Ejemplo n.º 6
0
function FullTemplateList()
{
    global $db;
    global $HTTP_DOMAIN;
    global $UI_CONFIG;
    if ($result = write_template(0)) {
        echo $result;
    } else {
        nc_print_status(CONTROL_TEMPLATE_NONE, "info");
    }
    $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => CONTROL_TEMPLATE_TEPL_CREATE, "action" => "urlDispatcher.load('template" . (+$_REQUEST['fs'] ? '_fs' : '') . ".add(0)')", "align" => "left");
    $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => CONTROL_TEMPLATE_TEPL_IMPORT, "action" => "urlDispatcher.load('tools.databackup.import')", "align" => "left");
}
Ejemplo n.º 7
0
function ExecSQLMultiline($file)
{
    global $db, $nc_core;
    $fp = fopen($file, "r");
    if (!$fp) {
        nc_print_status(sprintf(TOOLS_SQL_ERR_OPEN_FILE, $file), 'error');
        return false;
    }
    $i = 0;
    while (!feof($fp)) {
        $statement = chop(fgets($fp, 65536));
        if (strlen($statement)) {
            while (substr($statement, strlen($statement) - 1, 1) != ";" && substr($statement, 0, 1) != "#" && substr($statement, 0, 2) != "--") {
                $statement .= chop(fgets($fp, 65536));
            }
            if (substr($statement, 0, 1) != "#" && substr($statement, 0, 2) != "--") {
                $statement = str_replace('%%MYSQL_CHARSET%%', $nc_core->MYSQL_CHARSET, $statement);
                if (!$nc_core->NC_UNICODE) {
                    $statement = $nc_core->utf8->utf2win($statement);
                }
                $db->query($statement);
                # если запрос выполнился и нет ошибок
                if ($db->last_error) {
                    nc_print_status(sprintf(TOOLS_SQL_ERR_FILE_QUERY, $file, $db->last_error), 'error');
                }
            }
        }
    }
    fclose($fp);
    return true;
}
Ejemplo n.º 8
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:
     $AJAX_SAVER = true;
     if ($perm->isGuest()) {
         $AJAX_SAVER = false;
     }
     BeginHtml($Title2, $Title3 . $Delimeter . $Title8, "http://" . $DOC_DOMAIN . "/settings/systables/");
     $perm->ExitIfNotAccess(NC_PERM_SYSTABLE, 0, 0, 0, 0);
     ClassActionForm($SystemTableID, "system.php", 5, 2, $myaction);
Ejemplo n.º 9
0
 /**
  *
  * @param string $data_class
  */
 public function delete($data_class)
 {
     $ids = (array) $this->get_input('id', $this->get_input('ids'));
     foreach ($ids as $id) {
         /** @var nc_search_data_persistent $record */
         $record = new $data_class();
         $record->set_id($id)->delete();
     }
     // по-хорошему тут нужно использовать паттерн GET-POST-REDIRECT
     nc_print_status(NETCAT_MODULE_SEARCH_ADMIN_STATUS_DELETED, 'info');
 }
Ejemplo n.º 10
0
}
$qry = $field_data->get_list_query($sub);
$cc_list = listQuery($qry, "<a href='#' onclick='top.selectItem(\$data[ItemID])' title='\".NETCAT_MODERATION_SELECT_RELATED.\"'>\n     <span class='id'>\$data[ItemID].</span> \$data[ItemCaption]\n    <div class='icons icon_related icon_subclass_select'></div></a>");
?>
<html>
    <head>
        <title>Subclass list</title>
        <link type='text/css' rel='Stylesheet' href='<?php 
echo $ADMIN_TEMPLATE;
?>
css/admin.css'>
        <link type='text/css' rel='Stylesheet' href='<?php 
echo $ADMIN_TEMPLATE;
?>
css/main.css'>
        <link type='text/css' rel='Stylesheet' href='<?php 
echo $ADMIN_TEMPLATE;
?>
css/sprites.css'>
    </head>

    <body style='margin:6px'>
        <?php 
if ($cc_list) {
    print "<div class='related_list related_list_subclass'>" . $cc_list . "</div>";
} else {
    nc_print_status(NETCAT_MODERATION_RELATED_NO_ANY_CLASS_IN_SUB, 'info');
}
?>
    </body>
</html>
 public function action_edit($template_id, $partial_name)
 {
     $this->partial = $partial_name;
     $this->template_id = (int) $template_id;
     $data = array('action' => 'edit');
     $this->ui_config('edit', CONTROL_TEMPLATE_PARTIALS . ' <small>' . $partial_name . '</small>');
     $this->ui_config->locationHash = "template.partials_edit({$this->template_id}, {$partial_name})";
     if (nc_core()->input->fetch_get('addNode')) {
         $node_id = $template_id;
         $partial = $partial_name;
         $fs_suffix = '_fs';
         $this->ui_config->treeChanges['addNode'][] = array("parentNodeId" => "template_partials-{$node_id}", "nodeId" => "template_partial-{$node_id}-{$partial}", "name" => $partial, "href" => "#template.partials_edit({$node_id}, {$partial})", "sprite" => 'dev-com-templates', "buttons" => array(nc_get_array_2json_button(CONTROL_TEMPLATE_PARTIALS_REMOVE, "template{$fs_suffix}.partials_remove({$node_id}, {$partial})", "nc-icon nc--remove nc--hovered")));
     }
     $partial_file = $this->nc_core->template->get_partials_path($this->template_id, $partial_name);
     if (file_exists($partial_file)) {
         if (isset($_POST['partial_source'])) {
             $partial_source = $this->nc_core->input->fetch_post('partial_source');
             file_put_contents($partial_file, $partial_source);
         }
         $partial_source = file_get_contents($partial_file);
         $data['partial_name'] = $partial_name;
         $data['partial_source'] = $partial_source;
     } else {
         nc_print_status('Template not found', 'error');
         return;
     }
     $this->ui_config->actionButtons[] = array('caption' => NETCAT_CUSTOM_ONCE_SAVE, 'action' => "nc.view.main('form').submit(); return false");
     return $this->view('template_partials/edit', $data);
 }
Ejemplo n.º 12
0
?>
css/admin.css'>
        <link type='text/css' rel='Stylesheet' href='<?php 
echo $ADMIN_TEMPLATE;
?>
css/main.css'>
    </head>

    <body style='margin:0; overflow: hidden'>
        <?php 
// 1. Список *подходящих* шаблонов в разделе
$cc_list = $db->get_results("SELECT Sub_Class_ID, Sub_Class_Name\n                                 FROM Sub_Class\n                                WHERE Subdivision_ID={$sub}\n                                  AND Class_ID={$field_format->class_id}\n                                ORDER BY Priority", ARRAY_A);
if (!$cc_list) {
    $class_name = $db->get_var("SELECT Class_Name FROM Class WHERE Class_ID={$field_format->class_id}");
    print "<div class='related_list_container'>";
    nc_print_status(sprintf(NETCAT_MODERATION_RELATED_NO_CONCRETE_CLASS_IN_SUB, $class_name), 'info');
    print "</div>";
} else {
    print "<table border='0' cellspacing='0' cellpadding='0' width='100%' height='100%'>\n";
    print "<tr><td class='toolbar'>\n";
    if (!$cc) {
        $cc = $cc_list[0]["Sub_Class_ID"];
    }
    foreach ($cc_list as $cc_data) {
        if ($cc_data['Sub_Class_ID'] == $cc) {
            print "<a class='button button_on' href='#'>" . "<span class='button_caption'>{$cc_data['Sub_Class_Name']}</span>" . "</a>\n";
        } else {
            print "<a class='button' href='?sub={$sub}&cc={$cc_data[Sub_Class_ID]}&field_id={$field_id}'>" . "<span class='button_caption'>{$cc_data['Sub_Class_Name']}</span>" . "</a>\n";
        }
    }
    print "</td></tr>\n";
Ejemplo n.º 13
0
    // Это ошибочная ситуация POST c одним классом , а предросмотр с другим.
    BeginHtml(NETCAT_PREVIEW_ERROR_WRONGDATA);
    nc_print_status(NETCAT_PREVIEW_ERROR_WRONGDATA, "error");
    EndHtml();
    die;
}
// В предпросмотре admin_mode=0;
$admin_mode = 0;
// Первый вызов предпросмотра идет без $sub - мы рисуем карту сайта чтобы пользователь выбрал раздел.
if (!isset($sub) || !$sub) {
    require_once $INCLUDE_FOLDER . "s_common.inc.php";
    require_once $INCLUDE_FOLDER . "s_browse.inc.php";
    $sbrowse_mapsub['prefix'] = "<ul style='list-style: disc inside'>";
    $sbrowse_mapsub['suffix'] = "</ul>";
    $sbrowse_mapsub['unactive'] = "<li><a \".(\$data[\$i][Checked]==0?\"style='color:gray'\":\"\").\"href='%URL?template={$template}&templatePreview={$templatePreview}'>\".\$data[\$i][Subdivision_ID].\". %NAME</a>\".s_browse_sub(\$data[\$i][Subdivision_ID],\$GLOBALS[sbrowse_mapsub]).\"</li>";
    $sbrowse_mapsub['active'] = $sbrowse_mapsub['unactive'];
    if (!isset($catalogue) || !$catalogue) {
        $catalogue = $nc_core->catalogue->get_by_host_name($HTTP_HOST);
        $catalogue = $catalogue["Catalogue_ID"];
    } else {
        $catalogue += 0;
    }
    BeginHtml(NETCAT_PREVIEW_INFO_CHOOSESUB);
    nc_print_status(NETCAT_PREVIEW_INFO_CHOOSESUB, "info");
    $current_sub['Subdivision_ID'] = 100000;
    $current_sub['Catalogue_ID'] = $catalogue;
    $admin_mode = 0;
    echo s_browse_sub(0, $sbrowse_mapsub, 1);
    EndHtml();
    die;
}
Ejemplo n.º 14
0
    </head>


    <body class='admin_form' style='margin: 0px;'>
        <?php 
$favorites = GetFavorites();
$nc_settings = $nc_core->get_settings();
if ($nc_settings['InstallationID']) {
    echo "<table border='0' width=100% id='main_page_table'><tr><td>";
    if ($nc_settings['ProductNumber'] && $nc_settings['Code']) {
        $text = sprintf(TOOLS_ACTIVATION_REMIND_UNCOMPLETED, $ADMIN_PATH . '/patch/activation.php');
        echo nc_print_status($text, 'info', null, true);
    } else {
        $text = str_replace("%DAY", intval((strtotime($nc_settings['InstallationDateOut']) - time()) / 86400 + 1), TOOLS_ACTIVATION_DAY);
        echo nc_print_status($text, 'error', null, true);
    }
    echo "</td></tr></table>";
}
echo "<table border='0' width=100% id='main_page_table'>\n";
echo "<tr>\n";
echo "<td width=48%>\n";
//Welcome
echo "<div class='main_page_text'>\n";
echo "\t<div class='block_title'>\n";
//echo "\t\t<img src='".$ADMIN_TEMPLATE."img/i_netcat_big.gif' alt='Netcat'>\n";
echo "\t\t<span>" . SECTION_INDEX_WELCOME . "</span>\n";
echo "\t</div>\n";
echo "\t<div class='block_text'>\n";
printf(SECTION_INDEX_WELCOME_MESSAGE, $perm->getLogin(), $PROJECT_NAME, $perm->GetMaxPerm());
echo "\t</div>\n";
Ejemplo n.º 15
0
$query = "SELECT `latest`.`Timestamp`,\n                 `latest`.`QueryString`,\n                 `latest`.`ResultsCount`,\n                 `latest`.`IP`,\n                 `latest`.`User_ID`,\n                 `q`.`QueryCount`,\n                 `u`.`Login`\n            FROM (SELECT MAX(`Query_ID`) AS `Query_ID`,\n                         COUNT(`Query_ID`) AS `QueryCount`\n                    FROM `Search_Query`\n                   WHERE {$where}\n                   GROUP BY `QueryString`\n                   ORDER BY {$order_by}\n                   LIMIT {$per_page} OFFSET {$offset}) AS `q`\n            JOIN `Search_Query` AS `latest` ON (`q`.`Query_ID` = `latest`.`Query_ID`)\n            LEFT JOIN `User` AS `u` ON (`latest`.`User_ID` = `u`.`User_ID`)";
$res = $this->get_db()->get_results($query, ARRAY_A);
if ($res) {
    $found_rows = $this->get_db()->get_var("SELECT COUNT(DISTINCT(`QueryString`))\n                                              FROM `Search_Query`\n                                             WHERE {$where}");
    // строка с вариантами сортировки
    $sort_link = $this->make_page_query(array('sort_by'));
    echo '<div class="query_sort">', $this->link_if($sort_by != '', $sort_link, NETCAT_MODULE_SEARCH_ADMIN_QUERY_SORT_BY_RESULT_COUNT), " | ", $this->link_if($sort_by != 'time', "{$sort_link}&amp;sort_by=time", NETCAT_MODULE_SEARCH_ADMIN_QUERY_SORT_BY_TIME), " | ", $this->link_if($sort_by != 'query', "{$sort_link}&amp;sort_by=query", NETCAT_MODULE_SEARCH_ADMIN_QUERY_SORT_BY_QUERY), "</div>";
    // таблица с результатами
    echo "<table class='nc-table nc--large nc--hovered nc--striped list'>\n", "<tr>", "<th rowspan='2' width='40%'>", NETCAT_MODULE_SEARCH_ADMIN_QUERY_STRING, "</th>", "<th rowspan='2' width='10%' class='nc-text-center'>", NETCAT_MODULE_SEARCH_ADMIN_QUERY_COUNT, "</th>", "<th colspan='3' class='nc-text-center'>", NETCAT_MODULE_SEARCH_ADMIN_QUERY_LAST_QUERY, "</th>", "</tr>\n", "<tr>", "<th class='nc-text-center'>", NETCAT_MODULE_SEARCH_ADMIN_QUERY_LAST_QUERY_TIME, "</th>", "<th class='nc-text-center'>", NETCAT_MODULE_SEARCH_ADMIN_QUERY_LAST_QUERY_RESULT_COUNT, "</th>", "<th class='nc-text-center'>", NETCAT_MODULE_SEARCH_ADMIN_QUERY_LAST_QUERY_USER, "</th>", "</tr>\n";
    $result_link_title = "title='" . htmlspecialchars(NETCAT_MODULE_SEARCH_ADMIN_QUERY_OPEN_RESULTS_LINK_HINT) . "'";
    foreach ($res as $row) {
        // ссылка на страницу с результатами поиска
        $search_link = nc_search::get_object()->get_search_url($row['Catalogue_ID'], true) . "?nologging=1&amp;search_query=" . rawurlencode($row['QueryString']) . "&amp;area=" . rawurlencode($row['Area']);
        echo "<tr class='nc-text-center'>", "<td align='left'><a href='?view=queries_details&amp;query=", rawurlencode($row['QueryString']), "'>", htmlspecialchars($row['QueryString']), "</a></td>", "<td>", $row['QueryCount'], "</td>", "<td>", nc_search_util::format_time($row['Timestamp']), "</td>", "<td><a href='{$search_link}' target='_blank' {$result_link_title}>{$row['ResultsCount']}</a></td>", "<td>", long2ip($row['IP']), $row['User_ID'] ? " (" . $this->hash_link("#user.edit({$row['User_ID']})", $row["Login"]) . ")" : "", "</td>", "</tr>\n";
    }
    echo "</table>";
    echo $this->result_count($offset + 1, $per_page, $found_rows);
    // листалка по страницам
    $ui = $this->get_ui();
    $page_link = $this->make_page_query(array('offset'), true);
    if ($offset > 0) {
        $prev_page = $page_link . "&amp;offset=" . ($offset - $per_page);
        $ui->actionButtons[] = array("id" => "prev_page", "caption" => NETCAT_MODULE_SEARCH_ADMIN_QUERY_PREV_PAGE, "action" => "mainView.loadIframe('{$prev_page}')", "align" => "left");
    }
    if ($found_rows > $offset + $per_page) {
        $next_page = $page_link . "&amp;offset=" . ($offset + $per_page);
        $ui->actionButtons[] = array("id" => "next_page", "caption" => NETCAT_MODULE_SEARCH_ADMIN_QUERY_NEXT_PAGE, "action" => "mainView.loadIframe('{$next_page}')");
    }
} else {
    nc_print_status(NETCAT_MODULE_SEARCH_ADMIN_QUERY_NO_ENTRIES, 'info');
}
Ejemplo n.º 16
0
if (!IsAllowedSubdivisionEnglishName($english_name, $sub_id, 0, $catalogue_id)) {
    nc_print_status(CONTROL_CONTENT_SUBDIVISION_INDEX_ERROR_THREE_KEYWORD, 'error');
    exit;
}
// проверка символов для ключевого слова (было бы неплохо проверить скорость работы этой связки при сравнении с регулярными выражениями)
if (strspn(strtolower($english_name), "abcdefghijklmnopqrstuvwxyz0123456789-") != strlen($english_name)) {
    nc_print_status(CONTROL_CONTENT_SUBDIVISION_SUBCLASS_ERROR_KEYWORD_INVALID, 'error');
    exit;
}
if (!isset($subdivision_name) || !isset($english_name) || !isset($template_id) || !isset($class_id) || !isset($sub_id) || !isset($catalogue_id)) {
    trigger_error("Wrong params", E_USER_ERROR);
}
if ($sub_id) {
    $hidden_url = $db->get_var("SELECT Hidden_URL FROM Subdivision WHERE Subdivision_ID = '" . $sub_id . "'");
} else {
    $hidden_url = '/';
}
// Добавление раздела
$db->query("INSERT INTO Subdivision\n                    SET Catalogue_ID = '" . $catalogue_id . "',\n                        Parent_Sub_ID = '" . $sub_id . "',\n                        Subdivision_Name = '" . mysql_real_escape_string($subdivision_name) . "',\n                        Template_ID = '" . $template_id . "',\n                        Checked = 1,\n                        EnglishName = '" . $english_name . "',\n                        Hidden_URL = '" . $hidden_url . $english_name . "/',\n                        Priority = '" . $db->get_var("SELECT MAX(Priority)+1 FROM Subdivision where Parent_Sub_ID=0 AND Catalogue_ID='{$catalogue_id}'") . "'");
$inserted_sub = $db->insert_id;
// Добавление шаблона к разделу
if ($class_id) {
    $db->query("INSERT INTO Sub_Class (\n                          Subdivision_ID,\n                          Catalogue_ID,\n                          Class_ID,\n                          Sub_Class_Name,\n                          Read_Access_ID,\n                          Write_Access_ID,\n                          Edit_Access_ID,\n                          Subscribe_Access_ID,\n                          Moderation_ID,\n                          Checked,\n                          Priority,\n                          EnglishName,\n                          DaysToHold,\n                          AllowTags,\n                          NL2BR,\n                          RecordsPerPage,\n                          SortBy,\n                          Created,\n                          DefaultAction,\n                          UseCaptcha)\n                     VALUES (\n                          '" . $inserted_sub . "', \n                          '" . $catalogue_id . "', \n                          '" . $class_id . "',\n                          '" . $subdivision_name . "',\n                          '0',\n                          '0',\n                          '0',\n                          '0',\n                          '0',\n                          '1',\n                          '1',\n                          '" . $english_name . "',\n                          NULL,\n                          '-1',\n                          '-1',\n                          NULL,\n                          '',\n                          '" . date("%Y-%m-%d %H:%i:%s") . "',\n                          'index',\n                          '-1')");
    $inserted_cc = $db->insert_id;
}
/* Вставить добавление шаблона в SubClass */
if ($inserted_sub) {
    echo $inserted_sub;
} else {
    nc_print_status(CONTROL_CONTENT_SUBDIVISION_INDEX_ERROR, 'error');
}
Ejemplo n.º 17
0
<?php

/* $Id: ExportToFile.php 7983 2012-08-17 09:34:36Z lemonade $ */
$NETCAT_FOLDER = join(strstr(__FILE__, "/") ? "/" : "\\", array_slice(preg_split("/[\\/\\\\]+/", __FILE__), 0, -4)) . (strstr(__FILE__, "/") ? "/" : "\\");
include_once $NETCAT_FOLDER . "vars.inc.php";
$template_id = intval($_GET['TemplateID']);
require $ADMIN_FOLDER . "function.inc.php";
if (!$nc_core->token->verify()) {
    BeginHtml("", "");
    nc_print_status(NETCAT_TOKEN_INVALID, 'error');
    EndHtml();
    exit;
}
// Выдача файла с шаблоном при экспорте
header("Content-type: text/xml");
header("Content-Disposition: attachment; filename=NetCat_" . $template_id . "_template.xml");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
header("Pragma: public");
require $ADMIN_FOLDER . "template/function.inc.php";
echo CascadeExportTemplate($TemplateID);
function CascadeExportTemplate($TemplateID)
{
    // system superior object
    $nc_core = nc_Core::get_object();
    include $nc_core->DOCUMENT_ROOT . $nc_core->ADMIN_PATH . "tar.inc.php";
    $db =& $nc_core->db;
    $VersionNumber = $nc_core->get_settings("VersionNumber");
    $SystemID = $nc_core->get_settings("SystemID");
    $LastPatch = $nc_core->get_settings("LastPatch");
    $TemplateID = intval($TemplateID);
Ejemplo n.º 18
0
            nc_print_status(NETCAT_PREVIEW_ERROR_NOSUB, "error");
            EndHtml();
            die;
            break;
            // Раздел всего один - сразу перенаправляем на него.
        // Раздел всего один - сразу перенаправляем на него.
        case $sub_count == 1:
            $Location = $nc_core->SUB_FOLDER . $res_arr[0]["Hidden_URL"] . $res_arr[0]["EnglishName"] . ".html?classPreview=" . $classPreview;
            header("Location: " . $Location);
            die;
            break;
            // Разделов с таким компонентом больше одного предоставим возможность пользователю выбрать.
        // Разделов с таким компонентом больше одного предоставим возможность пользователю выбрать.
        case $sub_count > 1:
            BeginHtml(NETCAT_PREVIEW_INFO_MORESUB);
            nc_print_status(NETCAT_PREVIEW_INFO_MORESUB, "info");
            echo "<div>";
            foreach ($res_arr as $tmp_arr) {
                if (!$sort_title_id || $sort_title_id != $tmp_arr['Subdivision_ID']) {
                    echo $sort_title_id ? "</ul>" : "";
                    $sort_title_id = $tmp_arr['Subdivision_ID'];
                    echo "<b>" . $tmp_arr["Subdivision_ID"] . " . " . $tmp_arr["Subdivision_Name"] . "</b><ul>";
                }
                echo "<li><a href='" . $nc_core->SUB_FOLDER . $tmp_arr["Hidden_URL"] . $tmp_arr["EnglishName"] . ".html?classPreview=" . $classPreview . "'>" . $tmp_arr["Sub_Class_ID"] . " . " . $tmp_arr["Sub_Class_Name"] . "</a></li>";
            }
            echo "</ul></div>";
            EndHtml();
            die;
            break;
    }
}
Ejemplo n.º 19
0
<?php

$NETCAT_FOLDER = join(strstr(__FILE__, "/") ? "/" : "\\", array_slice(preg_split("/[\\/\\\\]+/", __FILE__), 0, -4)) . (strstr(__FILE__, "/") ? "/" : "\\");
include_once $NETCAT_FOLDER . "vars.inc.php";
require $ADMIN_FOLDER . "function.inc.php";
if (!$_GET['url']) {
    die('no url');
}
if (!(require_once $ADMIN_FOLDER . "siteinfo/" . MAIN_LANG . ".lang.php")) {
    require_once $ADMIN_FOLDER . "siteinfo/en.lang.php";
}
if (!$perm->isSupervisor()) {
    nc_print_status($NO_RIGHTS_MESSAGE, 'error');
    exit;
}
//LoadModuleEnv();
//$MODULE_VARS = $nc_core->modules->get_module_vars();
?>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=<?php 
echo MAIN_ENCODING;
?>
" />
        <title><?php 
echo htmlspecialchars($_GET['url']);
?>
</title>
        <style>
            body, td { font: 8pt Tahoma, sans-serif }
            h1, h4 { font: bold 12pt Arial, sans-serif; padding: 0px; margin:10px 0px 5px; }
Ejemplo n.º 20
0
function nc_widgetclass_delete_warning($delete, $from_tree)
{
    global $db, $UI_CONFIG;
    nc_print_status(sprintf(WIDGET_DELETE_WARNING, CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_WARNING_SITEDELETE_I, CONTROL_CONTENT_CATALOUGE_FUNCS_CATALOGUEFORM_WARNING_SITEDELETE_U), 'info');
    echo "<form method='post' action='index.php'>" . "<input type='hidden' name='delete' value='" . ($from_tree == 1 ? $delete : implode(',', $delete)) . "'>" . "<input type='hidden' name='from_tree' value='" . $from_tree . "'>" . "<input type='hidden' name='phase' value='61'>" . "<input type='hidden' name='fs' value='" . get_fs() . "'>" . "</form>";
    $delete = count($delete) > 1 ? $delete : (is_array($delete) ? $delete[0] : $delete);
    $widgetclass = $db->get_results("SELECT * FROM `Widget_Class` WHERE " . (count($delete) > 1 ? "`Widget_Class_ID` IN (" . implode(',', $delete) . ")" : " `Widget_Class_ID`='" . $delete . "'"), ARRAY_A);
    $widget = $db->get_results("SELECT * FROM `Widget`", ARRAY_A);
    foreach ($widgetclass as $wc) {
        echo "<span class='widgetclass-name'><strong>" . WIDGET_LIST_DELETE_WIDGETCLASS . "</strong> <a href='index.php?phase=30&widgetclass_id=" . $wc['Widget_Class_ID'] . "'>" . $wc['Name'] . "</a></span><br />";
        foreach ($widget as $w) {
            if ($w['Widget_Class_ID'] == $wc['Widget_Class_ID']) {
                $widget_html .= "<span class='widget-name'> <a href='admin.php?phase=30&widget_id=" . $w['Widget_ID'] . "'>" . $w['Name'] . "</a></span>";
            }
        }
        if ($widget_html) {
            echo "<strong>" . WIDGET_LIST_DELETE_WIDGET . "</strong> ";
            echo $widget_html;
        }
        $widget_html = '';
        echo "<br /><br />";
    }
    $UI_CONFIG->actionButtons[] = array("id" => "submit", "caption" => WIDGET_DELETE_CONFIRMDELETE, "action" => "mainView.submitIframeForm()", "red_border" => true);
}
Ejemplo n.º 21
0
 /**
  * Set current subclass data by the id
  *
  * @param int $id subclass id
  * @param bool $reset reset stored data in the static variable
  *
  * @return array|false current cc id that was set
  */
 public function set_current_by_id($id, $reset = false)
 {
     // validate
     $id = intval($id);
     if (!$id) {
         return $this->current = array();
     }
     try {
         //if ($id) {
         $this->current = $this->get_by_id($id, "");
         // set additional data
         $this->_current_id = $id;
         // return result
         return $this->current;
         //}
     } catch (Exception $e) {
         nc_print_status($e->getMessage(), 'error');
     }
     // reject
     return false;
 }
Ejemplo n.º 22
0
}
if (in_array($phase, array(2, 3))) {
    if (!$nc_core->token->verify()) {
        BeginHtml($Title2, $Title2, "http://" . $DOC_DOMAIN . "/settings/sql/");
        nc_print_status(NETCAT_TOKEN_INVALID, 'error');
        EndHtml();
        exit;
    }
}
switch ($phase) {
    case 0:
        # список переадресаций
        BeginHtml($Title2, $Title2, "http://" . $DOC_DOMAIN . "/settings/redirect/");
        $perm->ExitIfNotAccess(NC_PERM_REDIRECT, 0, 0, 0, 0);
        if ($nc_core->NC_REDIRECT_DISABLED) {
            nc_print_status(TOOLS_REDIRECT_DISABLED, 'info');
        }
        RedirectList();
        break;
    case 1:
        # форма для добавления / изменения
        BeginHtml($Title4, $Title3 . $Delimeter . $Title4, "http://" . $DOC_DOMAIN . "/settings/redirect/");
        $perm->ExitIfNotAccess(NC_PERM_REDIRECT, 0, 0, 0, 0);
        if ($RedirectID) {
            $UI_CONFIG = new ui_config_tool(REDIRECT_TAB_LIST, REDIRECT_TAB_EDIT, 'i_settings_big.gif', 'redirect.edit(' . $RedirectID . ')');
        } else {
            $UI_CONFIG = new ui_config_tool(REDIRECT_TAB_LIST, REDIRECT_TAB_ADD, 'i_settings_big.gif', 'redirect.add');
        }
        RedirectForm($RedirectID);
        break;
    case 2:
Ejemplo n.º 23
0
             $template_header = str_replace(NC_OPENSTAT_COUNTER, "", $template_header);
             $template_footer = str_replace(NC_OPENSTAT_COUNTER, "", $template_footer);
         } else {
             $pos = nc_strpos($template_footer, NC_OPENSTAT_COUNTER);
             if ($pos !== FALSE) {
                 $template_footer = nc_substr($template_footer, 0, $pos) . nc_openstat_get_code() . nc_substr($template_footer, $pos + nc_strlen(NC_OPENSTAT_COUNTER));
                 $template_footer = str_replace(NC_OPENSTAT_COUNTER, "", $template_footer);
             }
         }
     }
 }
 if (!$check_auth && NC_AUTH_IN_PROGRESS !== 1) {
     eval("echo \"" . $template_header . "\";");
     if ($AUTH_USER_ID || !$AUTH_USER_ID && !$nc_core->modules->get_vars('auth')) {
         if ($nc_core->inside_admin) {
             nc_print_status(NETCAT_MODERATION_ERROR_NORIGHTS, 'error');
         } else {
             print NETCAT_MODERATION_ERROR_NORIGHTS;
         }
     } elseif (!$AUTH_USER_ID && $nc_core->modules->get_vars('auth')) {
         $nc_auth->login_form();
     }
     eval("echo \"" . $template_footer . "\";");
     exit;
 }
 if (!$message && $action == "full") {
     exit;
 }
 if ($AUTH_USER_ID) {
     $current_user = $nc_core->user->get_by_id($AUTH_USER_ID);
 }
Ejemplo n.º 24
0
 /**
  * @return null|void
  */
 public function check_environment()
 {
     //DOM
     if (!class_exists('DOMDocument')) {
         nc_print_status(NETCAT_MODULE_SEARCH_NO_DOM_ERROR, 'error');
     }
     // mbstring
     if (!function_exists('mb_convert_encoding')) {
         nc_print_status(NETCAT_MODULE_SEARCH_NO_MB_EXTENSION_ERROR, 'error');
     }
     // PCRE UTF support (rare configuration quirk)
     if (!@preg_match("/\\pL/u", "А")) {
         nc_print_status(NETCAT_MODULE_SEARCH_PCRE_UTF_ERROR, 'error');
     }
 }
Ejemplo n.º 25
0
    case 6:
        # подтверждение удаления поля или нескольких полей
        BeginHtml($Title2, $Title1 . $Delimeter . $Title2, $DocPath);
        $perm->ExitIfNotAccess(NC_PERM_FIELD, 0, $isSys, 0, 1);
        if ($Delete) {
            $UI_CONFIG = new ui_config_field('delete', 0, $Id, $isSys);
            ConfirmFieldsRemoval($Delete, $Id, $isSys, $widgetclass_id);
        } else {
            $class_widget = $isWidget ? new ui_config_widgetclass('fields', $Id) : new ui_config_class('fields', $Id);
            $UI_CONFIG = $isSys ? new ui_config_system_class('fields', $Id) : $class_widget;
            UpdateFieldPriority($priority);
            nc_print_status(CONTROL_FIELD_MSG_FIELDS_CHANGED, 'ok');
            FieldList($Id, $isSys, 0, $isWidget);
        }
        break;
    case 7:
        # удалим поля и покажем список
        BeginHtml($Title2, $Title1 . $Delimeter . $Title2, $DocPath);
        $perm->ExitIfNotAccess(NC_PERM_FIELD, 0, $isSys, 0, 1);
        $class_widget = $isWidget ? new ui_config_widgetclass('fields', $Id) : new ui_config_class('fields', $Id);
        $UI_CONFIG = $isSys ? new ui_config_system_class('fields', $Id) : $class_widget;
        UpdateFieldPriority($priority);
        if (DeleteFields($Delete) > 1) {
            nc_print_status(CONTROL_FIELD_MSG_DELETED_MANY, 'ok');
        } else {
            nc_print_status(CONTROL_FIELD_MSG_DELETED_ONE, 'ok');
        }
        FieldList($Id, $isSys, 0, $isWidget);
        break;
}
EndHtml();
Ejemplo n.º 26
0
        ?>
</a></td>
    		<td width=1>
    			<a href='<?php 
        echo $action_url;
        ?>
edit&partial=<?php 
        echo $partial;
        ?>
'><i class='nc-icon nc--edit'></i></a>
    		</td>
    		<td width=1>
    			<a href='<?php 
        echo $action_url;
        ?>
remove&partial=<?php 
        echo $partial;
        ?>
'><i class='nc-icon nc--remove'></i></a>
    		</td>
    	</tr>
    <?php 
    }
    ?>
    </table>
<?php 
} else {
    ?>
    <?php 
    nc_print_status(CONTROL_TEMPLATE_PARTIALS_NOT_EXISTS, 'info');
}
Ejemplo n.º 27
0
                <th class="nc-text-center"><?php 
    echo NETCAT_MODULE_SEARCH_ADMIN_EDIT;
    ?>
</th>
                <th class="nc-text-center"><i class='nc-icon nc--remove' title="<?php 
    echo NETCAT_MODULE_SEARCH_ADMIN_DELETE;
    ?>
"></i></th>
            </tr>

        <?php 
    foreach ($stopwords as $s) {
        $id = $s->get_id();
        echo "<tr>", "<td class='language'>", $s->get('language'), "</td>", "<td class='word'>", $s->get('word'), "</td>", "<td class='nc-text-center'><a href='?view=stopwords_edit&amp;id={$id}'>", "<i class='nc-icon nc--edit nc--hovered' title='" . NETCAT_MODULE_SEARCH_ADMIN_EDIT . "'></i>", "</a></td>", "<td class='nc-text-center'><input type='checkbox' name='ids[]' value='{$id}' /></td>", "</tr>\n";
    }
    ?>

    </table>
</form>

<script type="text/javascript">
    $nc('#stopword_filter').createFilterFor($nc('#stopword_table'));
</script>

<?php 
    $ui->add_submit_button(NETCAT_MODULE_SEARCH_ADMIN_DELETE_SELECTED);
} else {
    // no entries
    nc_print_status(NETCAT_MODULE_SEARCH_ADMIN_EMPTY_LIST, 'info');
}
$ui->actionButtons[] = array("id" => "add", "caption" => NETCAT_MODULE_SEARCH_ADMIN_ADD, "location" => "#module.search.stopwords_edit", "align" => "left");
Ejemplo n.º 28
0
        if (!$rename_result || !$parse_result) {
            nc_print_status(CONTROL_TEMPLATE_IMPORT_ERROR_NOTUPLOADED, 'error');
            EndHtml();
            exit;
        }
        $importHandler->showTplList($UI_CONFIG, $fs);
        break;
    case 3:
        //upload
        $post = $nc_core->input->fetch_post();
        $parse_result = $importHandler->ParseXmlFile($post['filename']);
        if (!$parse_result) {
            nc_print_status(CONTROL_TEMPLATE_IMPORT_ERROR_NOTUPLOADED, 'error');
            EndHtml();
            exit;
        }
        $result_id = $importHandler->uploadData($post['upload_from']);
        if (is_array($result_id)) {
            nc_print_status($result_id['e'], 'error');
            EndHtml();
            exit;
        } else {
            $AJAX_SAVER = true;
            BeginHtml($Title2);
            $UI_CONFIG = new ui_config_template('edit', $result_id);
            nc_print_status(CONTROL_TEMPLATE_IMPORT_SUCCESS, 'ok');
            TemplateForm($result_id, 2, 2, $fs, true);
        }
        break;
}
EndHtml();
Ejemplo n.º 29
0
        $UI_CONFIG = new ui_config_class('import', $ClassID, $ClassGroup);
        AddClassForm();
        break;
    case 2:
        # добавим шаблон
        if (!$nc_core->token->verify()) {
            BeginHtml($Title2, $Title2, "http://" . $DOC_DOMAIN . "/management/class/");
            nc_print_status(NETCAT_TOKEN_INVALID, 'error');
            EndHtml();
            exit;
        }
        BeginHtml($Title2, $Title2, "http://" . $DOC_DOMAIN . "/management/class/");
        $UI_CONFIG = new ui_config_class('import', $ClassID, $ClassGroup);
        if (!$FilePatch['tmp_name']) {
            nc_print_status(CONTROL_CLASS_IMPORT_ERROR_NOTUPLOADED, 'error');
            break;
            #InstallationAborted(CONTROL_CLASS_IMPORT_ERROR_NOTUPLOADED);
        }
        $res = ParseClassFile($FilePatch['tmp_name']);
        if ($res) {
            $AJAX_SAVER = true;
            BeginHtml($Title2, $Title2, "http://" . $DOC_DOMAIN . "/management/class/");
            $UI_CONFIG = new ui_config_class('edit', $res, '');
            nc_print_status(CONTROL_CONTENT_CLASS_SUCCESS_ADD, 'ok');
            ClassForm($res, "index.php", 5, 2, 0);
        } else {
            nc_print_status(CONTROL_CLASS_IMPORT_ERROR_CANNOTBEINSTALLED, 'error');
        }
        break;
}
EndHtml();
Ejemplo n.º 30
0
                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');
                }
            }
            nc_site_wizard_map();
            //nc_site_wizard_main_sub_form(3, $CatalogueID);
        } else {
            // Настраиваем основные разделы
            $UI_CONFIG = new ui_config_wizard_site($phase, $CatalogueID);
            nc_site_wizard_map();
            //nc_site_wizard_main_sub_form(3, $CatalogueID);
        }
        break;
}
EndHtml();