Ejemplo n.º 1
0
 }
 $title_sub_id = (int) $catalogue['Title_Sub_ID'];
 $sql = "SELECT `Subdivision_ID`, `Template_ID` " . "FROM `Subdivision` " . "WHERE `Catalogue_ID` = {$catalogueId} AND `Parent_Sub_ID` = {$parentSubId} " . "AND `DisplayType` IN ('inherit', 'longpage_vertical') " . "AND (`Checked` = 1 OR  `Subdivision_ID` = {$title_sub_id})" . "ORDER BY `Priority`";
 $innerSubdivisions = (array) $db->get_results($sql, ARRAY_A);
 $i = 0;
 foreach ($innerSubdivisions as $innerSubdivision) {
     $innerSubdivisionId = (int) $innerSubdivision['Subdivision_ID'];
     $sql = "SELECT `Sub_Class_ID` FROM `Sub_Class` " . "WHERE `Subdivision_ID` = {$innerSubdivisionId} AND `Checked` = 1 " . "ORDER BY `Priority` ASC LIMIT 1";
     $subClass = $db->get_row($sql, ARRAY_A);
     $subdivisionTemplate = $nc_core->catalogue->get_current('Template_ID') != $innerSubdivision['Template_ID'] ? $nc_core->template->get_by_id($innerSubdivision['Template_ID']) : null;
     if ($i > 0) {
         echo "<div " . nc_ls_display_pointer($innerSubdivisionId, $sub == $innerSubdivisionId) . "></div>";
     }
     if ($subdivisionTemplate) {
         if ($File_Mode) {
             $longpageTemplateView = new nc_template_view($nc_core->TEMPLATE_FOLDER, $nc_core->db);
             $longpageTemplateView->load_template($innerSubdivision['Template_ID'], $subdivisionTemplate['File_Path']);
             foreach ($longpageTemplateView->get_all_settings_path_in_array() as $path) {
                 include $path;
             }
             $longpageTemplateView->fill_fields();
         }
         if ($File_Mode) {
             echo $longpageTemplateView->get_header();
         } else {
             eval("echo \"" . $subdivisionTemplate['Header'] . "\";");
         }
     }
     echo "<div " . nc_ls_display_container($innerSubdivisionId) . ">";
     if ($sub == $innerSubdivisionId) {
         echo $nc_result_msg;
Ejemplo n.º 2
0
<?php

if (!$isNaked || $admin_modal) {
    $template_view = new nc_template_view($nc_core->TEMPLATE_FOLDER, $nc_core->db);
    if (!$templatePreview) {
        $template_view->load_template($template, $template_env['File_Path']);
    } else {
        $template_view->load_template($templatePreview, $template_env['File_Path'], $is_preview = true);
    }
    if ($nc_core->template->get_current("CustomSettings") && $nc_core->subdivision->get_current('Template_ID') == $template) {
        require_once $nc_core->ADMIN_FOLDER . "array_to_form.inc.php";
        $nc_a2f = new nc_a2f($nc_core->template->get_current("CustomSettings"));
        $nc_a2f->set_value($nc_core->subdivision->get_current("TemplateSettings"));
        $template_settings = $nc_a2f->get_values_as_array();
    }
    if ($nc_core->template->get_current("CustomSettings") && $nc_core->subdivision->get_current('Template_ID') != $template) {
        require_once $nc_core->ADMIN_FOLDER . "array_to_form.inc.php";
        $nc_a2f = new nc_a2f($nc_core->template->get_current("CustomSettings"), array());
        $template_settings = $nc_a2f->get_values_as_array();
    }
    if (!$templatePreview) {
        $array_settings_path = $template_view->get_all_settings_path_in_array();
        foreach ($array_settings_path as $path) {
            include $path;
        }
    }
    $template_view->fill_fields();
    if ($templatePreview) {
        eval('?>' . $template_view->get_settings());
    }
    $template_env['Header'] = $template_view->get_header();