echo '
| User Extension Editor |
|---|
| '
form_open
form_action 'editor'
#form_submit 'Enter Here'
form_close
echo ' |
'
table_close
echo ''
echo ''
table_close
#if [ "$action" = "sip_peers" ]; then
# asterisk_header="SIP Peers"
# asterisk_command="sip show peers"
#el
#if [ "$action" = "editor" ]; then
if ( [ "$content" != "" ] && [ -f "$path/$file" ] ) ; then
echo "$content" > "$path/$file"
fi
header ''
echo ''
echo '
'
ls -1 $path/. | awk -F'\n' '
{
file_path = path "/" $0
if ((system("test -f " file_path) == 0) && ((getline sample < file_path) >= 0)) {
close(file_path)
print "| "
print " |
"
}
}' path="$path" script_name="$script_name" -
table_close
if [ "$action" = "edit" ]; then
header "File: $file"
echo ''
if [ -f "$path/$file" ]; then
content=$(cat "$path/$file" | sed -e 's/\&/\&/g; s/\</g; s/>/\>/g')
table_open
echo '
'
form_open
textarea 'content' '27' '90'
echo -n "$content"
textarea_close
form_hidden_field 'file' "$file"
form_action 'editor'
echo ' '
form_submit 'Save'
form_close
echo ' |
'
table_close
else
echo "The $path/$file file doesn't exist.
"
fi