$skin_type = '_a'; } if ($_SESSION['show_active_skins_only'] == 'Y' && empty($skin_type)) { continue; } } $dirs[$file] = array('name' => $file, 'type' => 'D', 'perms' => fn_display_perms(fileperms($tpath . '/' . $file)), 'skin_type' => $skin_type); } if (@is_file($tpath . '/' . $file)) { $files[$file] = array('name' => $file, 'type' => 'F', 'ext' => fn_get_file_ext($file), 'perms' => fn_display_perms(fileperms($tpath . '/' . $file))); } } ksort($dirs, SORT_STRING); ksort($files, SORT_STRING); $__cols = fn_array_merge($dirs, $files, false); $view->assign('columns', fn_split($__cols, (sizeof($__cols) + 1) / 2, false)); $current_path .= empty($dir) ? '' : $dir . '/'; $current_path = fn_normalize_path($current_path); Registry::get('ajax')->assign('current_path', str_replace(DIR_ROOT, '', $tpath)); Registry::get('ajax')->assign('show_legend', !empty($current_path)); @closedir($dh); Registry::get('ajax')->assign('files_list', $view->display('views/template_editor/components/file_list.tpl', false)); Registry::get('ajax')->assign('directory_data', fn_array_merge($dirs, $files)); } exit; } elseif ($mode == 'delete_file') { $file = basename($_REQUEST['file']); $fname = fn_normalize_path(DIR_SKINS . $current_path . $file); $fn_name = @is_dir($fname) ? 'fn_rm' : 'unlink'; $object = @is_dir($fname) ? 'directory' : 'file'; if (!in_array(fn_get_file_ext($file), Registry::get('config.forbidden_file_extensions'))) {
} $options[$sid] = fn_array_merge($options[$sid], $elements, false); $options[$sid] = fn_sort_array_by_key($options[$sid], 'position'); } // [Page sections] if (isset($options['main'])) { Registry::set('navigation.tabs.main', array('title' => fn_get_lang_var('main'), 'js' => true)); } foreach ($subsections as $k => $v) { Registry::set('navigation.tabs.' . $k, array('title' => $v['description'], 'js' => true)); } $view->assign('notabs', isset($options['main']) && sizeof($subsections) < 1 || !isset($options['main']) && sizeof($subsections) <= 1 ? 'Y' : 'N'); // [/Page sections] $section_columns = 3; // number of columns with sections links (in the frontend) $section_cols = fn_split($sections, $section_columns); $view->assign('options', @$options); $view->assign('sections', @$sections); $view->assign('section_cols', @$section_cols); $view->assign('subsections', @$subsections); $view->assign('section_id', $section_id); } //----------------------------------------------------------------------- // // Settings related functions // // Return part of SQL query to get object description from settings_descriptions table; function fn_settings_descr_query($object_id, $object_type, $lang_code = CART_LANGUAGE, $table, $oid_name = 'object_id') { return db_quote(" LEFT JOIN ?:settings_descriptions ON ?:{$table}.{$object_id} = ?:settings_descriptions.{$oid_name} AND ?:settings_descriptions.object_type = ?s AND ?:settings_descriptions.lang_code = ?s", $object_type, $lang_code); }