Portions created by the Initial Developer are Copyright (C) 2008-2023 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane James Rose */ //includes files require_once dirname(__DIR__, 2) . "/resources/require.php"; require_once "resources/check_auth.php"; //check permissions if (permission_exists('clip_edit')) { //access granted } else { echo "access denied"; exit; } //add multi-lingual support $language = new text; $text = $language->get(); //include require_once "header.php"; //show the content echo ""; echo ""; echo "\n"; echo "\n"; echo "
\n"; $sql = "select * from v_clips order by clip_folder asc, clip_name asc"; $database = new database; $result = $database->select($sql, null, 'all'); unset($sql); if (is_array($result) && @sizeof($result) != 0) { $master_array = array(); foreach ($result as $row) { $clip_folder = rtrim($row['clip_folder'], '/'); $clip_folder .= '/'.$row['clip_name']; $parts = explode('/', $clip_folder); $folders = array(); while ($bottom = array_pop($parts)) { if (sizeof($folders) > 0) { $folders = array($bottom => $folders); } else { $clip['uuid'] = $row['clip_uuid']; $clip['name'] = $row['clip_name']; $clip['before'] = $row['clip_text_start']; $clip['after'] = $row['clip_text_end']; $folders = array($bottom => $clip); } } $master_array = array_merge_recursive($master_array, $folders); } function parse_array($array) { if (is_array($array)) { foreach ($array as $folder_name => $clips) { //folder echo "".$folder_name.""; echo "
\n"; //clips foreach($clips as $row) { //clip echo "
\n"; echo ""; echo ""; echo escape($row['name']); echo "\n"; echo "\n"; echo "\n"; echo "
\n"; } echo "
\n"; } } } parse_array($master_array); } unset($result, $row); echo "
\n"; //include the footer require_once "footer.php";