<?php

	//application details
		$apps[$x]['name'] = 'Messages';
		$apps[$x]['uuid'] = '4a20815d-042c-47c8-85df-085333e79b87';
		$apps[$x]['category'] = '';
		$apps[$x]['subcategory'] = '';
		$apps[$x]['version'] = '';
		$apps[$x]['license'] = 'Mozilla Public License 1.1';
		$apps[$x]['url'] = 'http://www.fusionpbx.com';
		$apps[$x]['description']['en-us'] = '';

	//permission details
		$y = 0;
		$apps[$x]['permissions'][$y]['name'] = 'message_view';
		$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
		//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
		$y++;
		$apps[$x]['permissions'][$y]['name'] = 'message_add';
		$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
		//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
		$y++;
		$apps[$x]['permissions'][$y]['name'] = 'message_edit';
		$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
		//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
		$y++;
		$apps[$x]['permissions'][$y]['name'] = 'message_delete';
		$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
		//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
		$y++;
		$apps[$x]['permissions'][$y]['name'] = 'message_all';
		$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
		$y++;
		$apps[$x]['permissions'][$y]['name'] = 'message_media_view';
		$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
		//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
		$y++;
		$apps[$x]['permissions'][$y]['name'] = 'message_media_add';
		$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
		//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
		$y++;
		$apps[$x]['permissions'][$y]['name'] = 'message_media_edit';
		$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
		//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
		$y++;
		$apps[$x]['permissions'][$y]['name'] = 'message_media_delete';
		$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
		//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
		$y++;

	//messages table
		$y = 0;
		$apps[$x]['db'][$y]['table']['name'] = 'v_messages';
		$apps[$x]['db'][$y]['table']['parent'] = '';
		$z = 0;
		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_uuid';
		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary';
		$z++;
		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid';
		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains';
		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid';
		$z++;
		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'user_uuid';
		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_users';
		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'user_uuid';
		$z++;
		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'contact_uuid';
		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_contacts';
		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'contact_uuid';
		$z++;
		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_type';
		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the message type.';
		$z++;
		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_direction';
		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the message direction.';
		$z++;
		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_date';
		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'timestamptz';
		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'date';
		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'timestamp';
		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the message date.';
		$z++;
		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_from';
		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the message from.';
		$z++;
		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_to';
		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the message to.';
		$z++;
		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the message text.';
		$z++;
		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_json';
		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';

	//message media table
		$y++;
		$apps[$x]['db'][$y]['table']['name'] = 'v_message_media';
		$apps[$x]['db'][$y]['table']['parent'] = 'v_messages';
		$z = 0;
		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_media_uuid';
		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary';
		$z++;
		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_uuid';
		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_messages';
		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'message_uuid';
		$z++;
		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid';
		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains';
		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid';
		$z++;
		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'user_uuid';
		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_users';
		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'user_uuid';
		$z++;
		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_media_type';
		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the message media type.';
		$z++;
		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_media_url';
		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the message media url.';
		$z++;
		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_media_content';
		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'text';
		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the message media content.';
		$z++;


	//default settings
		$y=0;
		$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "e26545ef-8609-4bb8-b491-fd2835a56008";
		$apps[$x]['default_settings'][$y]['default_setting_category'] = "message";
		$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "http_method";
		$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
		$apps[$x]['default_settings'][$y]['default_setting_value'] = "POST";
		$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
		$apps[$x]['default_settings'][$y]['default_setting_description'] = "HTTP method type: POST or GET";
		$y++;
		$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "7852ec0c-8fca-4c3b-9339-cd9235a0c2be";
		$apps[$x]['default_settings'][$y]['default_setting_category'] = "message";
		$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "http_content_type";
		$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
		$apps[$x]['default_settings'][$y]['default_setting_value'] = "application/json";
		$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
		$apps[$x]['default_settings'][$y]['default_setting_description'] = "Content type for the message content from the Provider API.";
		$y++;
		$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "5964ad4f-8cdd-4181-b944-d24baa4f925f";
		$apps[$x]['default_settings'][$y]['default_setting_category'] = "message";
		$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "http_destination";
		$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
		$apps[$x]['default_settings'][$y]['default_setting_value'] = "";
		$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
		$apps[$x]['default_settings'][$y]['default_setting_description'] = "URL for the REST API.";
		$y++;
		$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "306213fd-5a9e-466d-ab06-63f9fef532d0";
		$apps[$x]['default_settings'][$y]['default_setting_category'] = "message";
		$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "http_auth_enabled";
		$apps[$x]['default_settings'][$y]['default_setting_name'] = "boolean";
		$apps[$x]['default_settings'][$y]['default_setting_value'] = "true";
		$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
		$apps[$x]['default_settings'][$y]['default_setting_description'] = "HTTP authentication enabled: true or false";
		$y++;
		$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "c950b84e-d238-428b-824c-12641e83f68c";
		$apps[$x]['default_settings'][$y]['default_setting_category'] = "message";
		$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "http_auth_type";
		$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
		$apps[$x]['default_settings'][$y]['default_setting_value'] = "basic";
		$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
		$apps[$x]['default_settings'][$y]['default_setting_description'] = "HTTP authentication type: basic or digest";
		$y++;
		$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "e9c4a101-9c51-4bbb-aadc-f6a8a467cd97";
		$apps[$x]['default_settings'][$y]['default_setting_category'] = "message";
		$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "http_auth_user";
		$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
		$apps[$x]['default_settings'][$y]['default_setting_value'] = "";
		$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
		$apps[$x]['default_settings'][$y]['default_setting_description'] = "HTTP authentication username.";
		$y++;
		$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "f3db9a8e-67de-4375-8634-1a1d526fec5e";
		$apps[$x]['default_settings'][$y]['default_setting_category'] = "message";
		$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "http_auth_password";
		$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
		$apps[$x]['default_settings'][$y]['default_setting_value'] = "";
		$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
		$apps[$x]['default_settings'][$y]['default_setting_description'] = "HTTP Authentication password.";
		$y++;
		$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "882007e2-582a-47d6-a830-139c59888ae9";
		$apps[$x]['default_settings'][$y]['default_setting_category'] = "message";
		$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "display_last";
		$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
		$apps[$x]['default_settings'][$y]['default_setting_value'] = "25 messages";
		$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false";
		$apps[$x]['default_settings'][$y]['default_setting_description'] = "Define the maximum messages, or past time frame of messages, loaded for display.";
		$y++;
		$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "8c944025-f199-440f-be34-c36ce545809a";
		$apps[$x]['default_settings'][$y]['default_setting_category'] = "message";
		$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "refresh_contacts";
		$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
		$apps[$x]['default_settings'][$y]['default_setting_value'] = "10";
		$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false";
		$apps[$x]['default_settings'][$y]['default_setting_description'] = "Define how often (in SECONDS) the list of numbers/Contacts is refreshed.";
		$y++;
		$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "ba8fd4dd-bd0d-40cc-8f7e-b509107a414b";
		$apps[$x]['default_settings'][$y]['default_setting_category'] = "message";
		$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "refresh_thread";
		$apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
		$apps[$x]['default_settings'][$y]['default_setting_value'] = "5";
		$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false";
		$apps[$x]['default_settings'][$y]['default_setting_description'] = "Define how often (in SECONDS) the list of messages in a displayed thread is refreshed.";

?>