瀏覽代碼

Update to support PHP 8.1

FusionPBX 2 年之前
父節點
當前提交
637f311acc
共有 1 個文件被更改,包括 16 次插入17 次删除
  1. 16 17
      clip_list.php

+ 16 - 17
clip_list.php

@@ -166,7 +166,7 @@
 	echo "<body style='margin: 0; padding: 5px;' onfocus='blur();'>\n";
 
 	echo "<div style='text-align: left; padding-top: 3px;'>\n";
-	echo "<div style='padding-bottom: 3px;'><a href='javascript:void(0);' onclick=\"window.open('clip_options.php?id=".urlencode($row['id'])."','clipwin','left=20,top=20,width=310,height=350,toolbar=0,resizable=0');\" style='text-decoration:none; cursor: pointer;' title=\"".$text['label-clip-library']."\"><img src='resources/images/icon_gear.png' border='0' align='absmiddle' style='margin: 0px 2px 4px -1px;'>".$text['label-clip-library']."</a></div>\n";
+	echo "<div style='padding-bottom: 3px;'><a href='javascript:void(0);' onclick=\"window.open('clip_options.php','clipwin','left=20,top=20,width=310,height=350,toolbar=0,resizable=0');\" style='text-decoration:none; cursor: pointer;' title=\"".$text['label-clip-library']."\"><img src='resources/images/icon_gear.png' border='0' align='absmiddle' style='margin: 0px 2px 4px -1px;'>".$text['label-clip-library']."</a></div>\n";
 
 	$sql = "select * from v_clips order by clip_folder asc, clip_name asc";
 	$database = new database;
@@ -198,28 +198,27 @@
 		}
 		unset($result, $row);
 
-		function parse_array($arr) {
-			if (is_array($arr)) {
-				//folder/clip
-				foreach ($arr as $name => $sub_arr) {
-					if ($name != $sub_arr['name']) {
-						//folder
-						echo "<a onclick='Toggle(this);' style='display: block; cursor: pointer; text-decoration: none;'><img src='resources/images/icon_folder.png' border='none' align='absmiddle' style='margin: 1px 2px 3px 0px;'>".$name."</a>";
-						echo "<div style='display: none; padding-left: 16px;'>\n";
-						parse_array($sub_arr);
-						echo "</div>\n";
-					}
-					else {
+		function parse_array($array) {
+			if (is_array($array)) {
+				foreach ($array as $folder_name => $clips) {
+					//folder
+					echo "<a onclick='Toggle(this);' style='display: block; cursor: pointer; text-decoration: none;'><img src='resources/images/icon_folder.png' border='none' align='absmiddle' style='margin: 1px 2px 3px 0px;'>".$folder_name."</a>";
+					echo "<div style='display: none; padding-left: 16px;'>\n";
+
+					//clips
+					foreach($clips as $row) {
 						//clip
 						echo "<div style='white-space: nowrap;'>\n";
-						echo "<a href='javascript:void(0);' onclick=\"parent.insert_clip(document.getElementById('before_".$sub_arr['uuid']."').value, document.getElementById('after_".$sub_arr['uuid']."').value);\">";
+						echo "<a href='javascript:void(0);' onclick=\"parent.insert_clip(document.getElementById('before_".$row['uuid']."').value, document.getElementById('after_".$row['uuid']."').value);\">";
 						echo "<img src='resources/images/icon_file.png' border='0' align='absmiddle' style='margin: 1px 2px 3px -1px;'>";
-						echo escape($sub_arr['name']);
+						echo escape($row['name']);
 						echo "</a>\n";
-						echo "<textarea style='display: none' id='before_".$sub_arr['uuid']."'>".$sub_arr['before']."</textarea>\n";
-						echo "<textarea style='display: none' id='after_".$sub_arr['uuid']."'>".$sub_arr['after']."</textarea>\n";
+						echo "<textarea style='display: none' id='before_".$row['uuid']."'>".$row['before']."</textarea>\n";
+						echo "<textarea style='display: none' id='after_".$row['uuid']."'>".$row['after']."</textarea>\n";
 						echo "</div>\n";
 					}
+					
+					echo "</div>\n";
 				}
 			}
 		}