Changeset 4147
- Timestamp:
- 06/21/07 22:56:10 (6 years ago)
- Files:
-
- modules/branches/2.3/recordings/audio.php (added)
- modules/branches/2.3/recordings/crypt.php (added)
- modules/branches/2.3/recordings/functions.inc.php (modified) (1 diff)
- modules/branches/2.3/recordings/images (added)
- modules/branches/2.3/recordings/images/play.png (added)
- modules/branches/2.3/recordings/page.recordings.php (modified) (5 diffs)
- modules/branches/2.3/recordings/popup.css (added)
- modules/branches/2.3/recordings/popup.php (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.3/recordings/functions.inc.php
r3774 r4147 150 150 151 151 foreach ($_REQUEST as $key => $val) { 152 $up = strpos($key, "up"); 153 $down = strpos($key, "down"); 154 $del = strpos($key, "del"); 152 if (strpos($key,"_") == 0) { 153 $up = strpos($key, "up"); 154 155 $down = strpos($key, "down"); 156 $del = strpos($key, "del"); 157 } 155 158 if ( $up !== false ) { 156 159 $up = substr($key, 2); modules/branches/2.3/recordings/page.recordings.php
r3774 r4147 213 213 echo "&id=$id>Remove Recording</a> <i style='font-size: x-small'>(Note, does not delete file from computer)</i>"; 214 214 ?> 215 <form name="prompt" action="<?php $_SERVER['PHP_SELF'] ?>" method="post" onsubmit="return rec_onsubmit();">215 <form name="prompt" action="<?php $_SERVER['PHP_SELF'] ?>" method="post" onsubmit="return rec_onsubmit();"> 216 216 <input type="hidden" name="action" value="edited"> 217 217 <input type="hidden" name="display" value="recordings"> … … 238 238 $counter = 0; 239 239 $arraymax = count($files)-1; 240 // globals seem to busted in PHP5 define here for now 241 $recordings_astsnd_path = isset($asterisk_conf['astvarlibdir'])?$asterisk_conf['astvarlibdir']:'/var/lib/asterisk'; 242 $recordings_astsnd_path .= "/sounds/"; 243 240 244 foreach ($files as $item) { 241 recordings_display_sndfile($item, $counter, $arraymax );245 recordings_display_sndfile($item, $counter, $arraymax, $recordings_astsnd_path); 242 246 $counter++; 243 247 } 244 recordings_display_sndfile('', $counter, $arraymax );248 recordings_display_sndfile('', $counter, $arraymax, $recordings_astsnd_path); 245 249 ?> 246 250 </table> 247 251 <input name="Submit" type="submit" value="<?php echo _("Save")?>"></h6> 252 <?php recordings_popup_jscript(); ?> 248 253 <?php recordings_form_jscript(); ?> 249 254 </form> … … 284 289 } 285 290 291 function recordings_popup_jscript() { 292 ?> 293 <script language="javascript"> 294 <!-- Begin 295 function popUp(URL,optionId) { 296 var selIndex=optionId.selectedIndex 297 var file=optionId.options[selIndex].value 298 299 /*alert(selIndex);*/ 300 if (file != "") 301 popup = window.open(URL+file, 'play', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=320,height=110'); 302 } 303 // End --> 304 </script> 305 <?php 306 } 307 286 308 function recordings_form_jscript() { 287 309 ?> … … 333 355 } 334 356 335 function recordings_display_sndfile($item, $count, $max ) {357 function recordings_display_sndfile($item, $count, $max, $astpath) { 336 358 // Note that when using this, it needs a <table> definition around it. 337 359 $astsnd = isset($asterisk_conf['astvarlibdir'])?$asterisk_conf['astvarlibdir']:'/var/lib/asterisk'; 338 360 $astsnd .= "/sounds/"; 339 361 $sysrecs = recordings_readdir($astsnd, strlen($astsnd)+1); 340 print "<tr><td><select name='sysrec$count'>\n";362 print "<tr><td><select id='sysrec$count' name='sysrec$count'>\n"; 341 363 echo '<option value=""'.($item == '' ? ' SELECTED' : '')."></option>\n"; 342 364 foreach ($sysrecs as $sr) { … … 344 366 } 345 367 print "</select></td>\n"; 368 369 echo "<td>"; 370 $audio=$astpath.$item; 371 $audio=$astpath; 372 $recurl="modules/recordings/popup.php?recording=".$audio; 373 echo "<a href='#' type='submit' onClick=\"javascript:popUp('$recurl',document.prompt.sysrec$count); return false;\" input='foo' >"; 374 echo "<img border='0' width='20' height='20' src='images/play.png' title='Click here to play this recording' />"; 375 echo "</img></td>"; 376 346 377 if ($count==0) { 347 378 print "<td></td>\n"; 348 379 } else { 349 echo '<td><input name="up'.$count.'" type="submit" value="'._("Move Up")."\"></td>\n"; 380 echo "<img border='0' width='3' height='11' style='float: none; margin-left: 0px; margin-bottom: 0px;' src='images/blank.gif' />"; 381 echo '<td><input name="up'.$count.'" width=10 height=20 border=5 title="Move Up" type="image" src="images/scrollup.gif" value="'._("Move Up").'"/>'; 382 print "</td>\n"; 383 } if ($count > $max) { 384 print "<td></td>\n"; 385 } else { 386 echo "<img border='0' width='3' height='11' style='float: none; margin-left: 0px; margin-bottom: 0px;' src='images/blank.gif' />"; 387 echo '<td><input name="down'.$count.'" width=10 height=20 border=0 title="Move Down" type="image" src="images/scrolldown.gif" value="'._("Move Down")."\">\n"; 388 echo "<img border='0' width='3' height='11' style='float: none; margin-left: 0px; margin-bottom: 0px;' src='images/blank.gif' />"; 389 print "</td>\n"; 350 390 } 351 if ($count > $max) { 352 print "<td></td>\n"; 353 } else { 354 echo '<td><input name="down'.$count.'" type="submit" value="'._("Move Down")."\"></td>\n"; 355 } 356 echo '<td><input name="del'.$count.'" type="submit" value="'._("Delete")."\"></td>\n"; 391 echo '<td><input name="del'.$count.'" type="image" border=0 title="Delete" src="images/trash.png" value="'._("Delete")."\">\n"; 392 echo "<img border='0' width='9' height='11' style='float: none; margin-left: 0px; margin-bottom: 0px;' src='images/blank.gif' />"; 393 echo "<img border='0' width='9' height='11' style='float: none; margin-left: 0px; margin-bottom: 0px;' src='images/blank.gif' />"; 394 print "</td>\n"; 395 357 396 print "</tr>\n"; 358 397 }
