diff --git a/application/config/autoload.php b/application/config/autoload.php
index 857350d7..30fcc15d 100644
--- a/application/config/autoload.php
+++ b/application/config/autoload.php
@@ -1,4 +1,4 @@
- '',
diff --git a/application/config/email.php b/application/config/email.php
index 0c2470b0..166668d3 100644
--- a/application/config/email.php
+++ b/application/config/email.php
@@ -1,14 +1,14 @@
- array('application/mac-binhex40', 'application/mac-binhex', 'application/x-binhex40', 'application/x-mac-binhex40'),
- 'cpt' => 'application/mac-compactpro',
- 'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain'),
- 'bin' => array('application/macbinary', 'application/mac-binary', 'application/octet-stream', 'application/x-binary', 'application/x-macbinary'),
- 'dms' => 'application/octet-stream',
- 'lha' => 'application/octet-stream',
- 'lzh' => 'application/octet-stream',
- 'exe' => array('application/octet-stream', 'application/x-msdownload'),
- 'class' => 'application/octet-stream',
- 'psd' => array('application/x-photoshop', 'image/vnd.adobe.photoshop'),
- 'so' => 'application/octet-stream',
- 'sea' => 'application/octet-stream',
- 'dll' => 'application/octet-stream',
- 'oda' => 'application/oda',
- 'pdf' => array('application/pdf', 'application/force-download', 'application/x-download', 'binary/octet-stream'),
- 'ai' => array('application/pdf', 'application/postscript'),
- 'eps' => 'application/postscript',
- 'ps' => 'application/postscript',
- 'smi' => 'application/smil',
- 'smil' => 'application/smil',
- 'mif' => 'application/vnd.mif',
- 'xls' => array('application/vnd.ms-excel', 'application/msexcel', 'application/x-msexcel', 'application/x-ms-excel', 'application/x-excel', 'application/x-dos_ms_excel', 'application/xls', 'application/x-xls', 'application/excel', 'application/download', 'application/vnd.ms-office', 'application/msword'),
- 'ppt' => array('application/powerpoint', 'application/vnd.ms-powerpoint', 'application/vnd.ms-office', 'application/msword'),
- 'pptx' => array('application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/x-zip', 'application/zip'),
- 'wbxml' => 'application/wbxml',
- 'wmlc' => 'application/wmlc',
- 'dcr' => 'application/x-director',
- 'dir' => 'application/x-director',
- 'dxr' => 'application/x-director',
- 'dvi' => 'application/x-dvi',
- 'gtar' => 'application/x-gtar',
- 'gz' => 'application/x-gzip',
- 'gzip' => 'application/x-gzip',
- 'php' => array('application/x-httpd-php', 'application/php', 'application/x-php', 'text/php', 'text/x-php', 'application/x-httpd-php-source'),
- 'php4' => 'application/x-httpd-php',
- 'php3' => 'application/x-httpd-php',
- 'phtml' => 'application/x-httpd-php',
- 'phps' => 'application/x-httpd-php-source',
- 'js' => array('application/x-javascript', 'text/plain'),
- 'swf' => 'application/x-shockwave-flash',
- 'sit' => 'application/x-stuffit',
- 'tar' => 'application/x-tar',
- 'tgz' => array('application/x-tar', 'application/x-gzip-compressed'),
- 'z' => 'application/x-compress',
- 'xhtml' => 'application/xhtml+xml',
- 'xht' => 'application/xhtml+xml',
- 'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed', 'application/s-compressed', 'multipart/x-zip'),
- 'rar' => array('application/x-rar', 'application/rar', 'application/x-rar-compressed'),
- 'mid' => 'audio/midi',
- 'midi' => 'audio/midi',
- 'mpga' => 'audio/mpeg',
- 'mp2' => 'audio/mpeg',
- 'mp3' => array('audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'),
- 'aif' => array('audio/x-aiff', 'audio/aiff'),
- 'aiff' => array('audio/x-aiff', 'audio/aiff'),
- 'aifc' => 'audio/x-aiff',
- 'ram' => 'audio/x-pn-realaudio',
- 'rm' => 'audio/x-pn-realaudio',
- 'rpm' => 'audio/x-pn-realaudio-plugin',
- 'ra' => 'audio/x-realaudio',
- 'rv' => 'video/vnd.rn-realvideo',
- 'wav' => array('audio/x-wav', 'audio/wave', 'audio/wav'),
- 'bmp' => array('image/bmp', 'image/x-bmp', 'image/x-bitmap', 'image/x-xbitmap', 'image/x-win-bitmap', 'image/x-windows-bmp', 'image/ms-bmp', 'image/x-ms-bmp', 'application/bmp', 'application/x-bmp', 'application/x-win-bitmap'),
- 'gif' => 'image/gif',
- 'jpeg' => array('image/jpeg', 'image/pjpeg'),
- 'jpg' => array('image/jpeg', 'image/pjpeg'),
- 'jpe' => array('image/jpeg', 'image/pjpeg'),
- 'jp2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
- 'j2k' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
- 'jpf' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
- 'jpg2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
- 'jpx' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
- 'jpm' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
- 'mj2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
- 'mjp2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
- 'png' => array('image/png', 'image/x-png'),
- 'tiff' => 'image/tiff',
- 'tif' => 'image/tiff',
- 'css' => array('text/css', 'text/plain'),
- 'html' => array('text/html', 'text/plain'),
- 'htm' => array('text/html', 'text/plain'),
- 'shtml' => array('text/html', 'text/plain'),
- 'txt' => 'text/plain',
- 'text' => 'text/plain',
- 'log' => array('text/plain', 'text/x-log'),
- 'rtx' => 'text/richtext',
- 'rtf' => 'text/rtf',
- 'xml' => array('application/xml', 'text/xml', 'text/plain'),
- 'xsl' => array('application/xml', 'text/xsl', 'text/xml'),
- 'mpeg' => 'video/mpeg',
- 'mpg' => 'video/mpeg',
- 'mpe' => 'video/mpeg',
- 'qt' => 'video/quicktime',
- 'mov' => 'video/quicktime',
- 'avi' => array('video/x-msvideo', 'video/msvideo', 'video/avi', 'application/x-troff-msvideo'),
- 'movie' => 'video/x-sgi-movie',
- 'doc' => array('application/msword', 'application/vnd.ms-office'),
- 'docx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword', 'application/x-zip'),
- 'dot' => array('application/msword', 'application/vnd.ms-office'),
- 'dotx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword'),
- 'xlsx' => array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip', 'application/vnd.ms-excel', 'application/msword', 'application/x-zip'),
- 'word' => array('application/msword', 'application/octet-stream'),
- 'xl' => 'application/excel',
- 'eml' => 'message/rfc822',
- 'json' => array('application/json', 'text/json'),
- 'pem' => array('application/x-x509-user-cert', 'application/x-pem-file', 'application/octet-stream'),
- 'p10' => array('application/x-pkcs10', 'application/pkcs10'),
- 'p12' => 'application/x-pkcs12',
- 'p7a' => 'application/x-pkcs7-signature',
- 'p7c' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'),
- 'p7m' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'),
- 'p7r' => 'application/x-pkcs7-certreqresp',
- 'p7s' => 'application/pkcs7-signature',
- 'crt' => array('application/x-x509-ca-cert', 'application/x-x509-user-cert', 'application/pkix-cert'),
- 'crl' => array('application/pkix-crl', 'application/pkcs-crl'),
- 'der' => 'application/x-x509-ca-cert',
- 'kdb' => 'application/octet-stream',
- 'pgp' => 'application/pgp',
- 'gpg' => 'application/gpg-keys',
- 'sst' => 'application/octet-stream',
- 'csr' => 'application/octet-stream',
- 'rsa' => 'application/x-pkcs7',
- 'cer' => array('application/pkix-cert', 'application/x-x509-ca-cert'),
- '3g2' => 'video/3gpp2',
- '3gp' => array('video/3gp', 'video/3gpp'),
- 'mp4' => 'video/mp4',
- 'm4a' => 'audio/x-m4a',
- 'f4v' => array('video/mp4', 'video/x-f4v'),
- 'flv' => 'video/x-flv',
- 'webm' => 'video/webm',
- 'aac' => 'audio/x-acc',
- 'm4u' => 'application/vnd.mpegurl',
- 'm3u' => 'text/plain',
- 'xspf' => 'application/xspf+xml',
- 'vlc' => 'application/videolan',
- 'wmv' => array('video/x-ms-wmv', 'video/x-ms-asf'),
- 'au' => 'audio/x-au',
- 'ac3' => 'audio/ac3',
- 'flac' => 'audio/x-flac',
- 'ogg' => array('audio/ogg', 'video/ogg', 'application/ogg'),
- 'kmz' => array('application/vnd.google-earth.kmz', 'application/zip', 'application/x-zip'),
- 'kml' => array('application/vnd.google-earth.kml+xml', 'application/xml', 'text/xml'),
- 'ics' => 'text/calendar',
- 'ical' => 'text/calendar',
- 'zsh' => 'text/x-scriptzsh',
- '7z' => array('application/x-7z-compressed', 'application/x-compressed', 'application/x-zip-compressed', 'application/zip', 'multipart/x-zip'),
- '7zip' => array('application/x-7z-compressed', 'application/x-compressed', 'application/x-zip-compressed', 'application/zip', 'multipart/x-zip'),
- 'cdr' => array('application/cdr', 'application/coreldraw', 'application/x-cdr', 'application/x-coreldraw', 'image/cdr', 'image/x-cdr', 'zz-application/zz-winassoc-cdr'),
- 'wma' => array('audio/x-ms-wma', 'video/x-ms-asf'),
- 'jar' => array('application/java-archive', 'application/x-java-application', 'application/x-jar', 'application/x-compressed'),
- 'svg' => array('image/svg+xml', 'application/xml', 'text/xml'),
- 'vcf' => 'text/x-vcard',
- 'srt' => array('text/srt', 'text/plain'),
- 'vtt' => array('text/vtt', 'text/plain'),
- 'ico' => array('image/x-icon', 'image/x-ico', 'image/vnd.microsoft.icon'),
- 'odc' => 'application/vnd.oasis.opendocument.chart',
- 'otc' => 'application/vnd.oasis.opendocument.chart-template',
- 'odf' => 'application/vnd.oasis.opendocument.formula',
- 'otf' => 'application/vnd.oasis.opendocument.formula-template',
- 'odg' => 'application/vnd.oasis.opendocument.graphics',
- 'otg' => 'application/vnd.oasis.opendocument.graphics-template',
- 'odi' => 'application/vnd.oasis.opendocument.image',
- 'oti' => 'application/vnd.oasis.opendocument.image-template',
- 'odp' => 'application/vnd.oasis.opendocument.presentation',
- 'otp' => 'application/vnd.oasis.opendocument.presentation-template',
- 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
- 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
- 'odt' => 'application/vnd.oasis.opendocument.text',
- 'odm' => 'application/vnd.oasis.opendocument.text-master',
- 'ott' => 'application/vnd.oasis.opendocument.text-template',
- 'oth' => 'application/vnd.oasis.opendocument.text-web'
-);
+return [
+ 'hqx' => ['application/mac-binhex40', 'application/mac-binhex', 'application/x-binhex40', 'application/x-mac-binhex40'],
+ 'cpt' => 'application/mac-compactpro',
+ 'csv' => ['text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain'],
+ 'bin' => ['application/macbinary', 'application/mac-binary', 'application/octet-stream', 'application/x-binary', 'application/x-macbinary'],
+ 'dms' => 'application/octet-stream',
+ 'lha' => 'application/octet-stream',
+ 'lzh' => 'application/octet-stream',
+ 'exe' => ['application/octet-stream', 'application/x-msdownload'],
+ 'class' => 'application/octet-stream',
+ 'psd' => ['application/x-photoshop', 'image/vnd.adobe.photoshop'],
+ 'so' => 'application/octet-stream',
+ 'sea' => 'application/octet-stream',
+ 'dll' => 'application/octet-stream',
+ 'oda' => 'application/oda',
+ 'pdf' => ['application/pdf', 'application/force-download', 'application/x-download', 'binary/octet-stream'],
+ 'ai' => ['application/pdf', 'application/postscript'],
+ 'eps' => 'application/postscript',
+ 'ps' => 'application/postscript',
+ 'smi' => 'application/smil',
+ 'smil' => 'application/smil',
+ 'mif' => 'application/vnd.mif',
+ 'xls' => ['application/vnd.ms-excel', 'application/msexcel', 'application/x-msexcel', 'application/x-ms-excel', 'application/x-excel', 'application/x-dos_ms_excel', 'application/xls', 'application/x-xls', 'application/excel', 'application/download', 'application/vnd.ms-office', 'application/msword'],
+ 'ppt' => ['application/powerpoint', 'application/vnd.ms-powerpoint', 'application/vnd.ms-office', 'application/msword'],
+ 'pptx' => ['application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/x-zip', 'application/zip'],
+ 'wbxml' => 'application/wbxml',
+ 'wmlc' => 'application/wmlc',
+ 'dcr' => 'application/x-director',
+ 'dir' => 'application/x-director',
+ 'dxr' => 'application/x-director',
+ 'dvi' => 'application/x-dvi',
+ 'gtar' => 'application/x-gtar',
+ 'gz' => 'application/x-gzip',
+ 'gzip' => 'application/x-gzip',
+ 'php' => ['application/x-httpd-php', 'application/php', 'application/x-php', 'text/php', 'text/x-php', 'application/x-httpd-php-source'],
+ 'php4' => 'application/x-httpd-php',
+ 'php3' => 'application/x-httpd-php',
+ 'phtml' => 'application/x-httpd-php',
+ 'phps' => 'application/x-httpd-php-source',
+ 'js' => ['application/x-javascript', 'text/plain'],
+ 'swf' => 'application/x-shockwave-flash',
+ 'sit' => 'application/x-stuffit',
+ 'tar' => 'application/x-tar',
+ 'tgz' => ['application/x-tar', 'application/x-gzip-compressed'],
+ 'z' => 'application/x-compress',
+ 'xhtml' => 'application/xhtml+xml',
+ 'xht' => 'application/xhtml+xml',
+ 'zip' => ['application/x-zip', 'application/zip', 'application/x-zip-compressed', 'application/s-compressed', 'multipart/x-zip'],
+ 'rar' => ['application/x-rar', 'application/rar', 'application/x-rar-compressed'],
+ 'mid' => 'audio/midi',
+ 'midi' => 'audio/midi',
+ 'mpga' => 'audio/mpeg',
+ 'mp2' => 'audio/mpeg',
+ 'mp3' => ['audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'],
+ 'aif' => ['audio/x-aiff', 'audio/aiff'],
+ 'aiff' => ['audio/x-aiff', 'audio/aiff'],
+ 'aifc' => 'audio/x-aiff',
+ 'ram' => 'audio/x-pn-realaudio',
+ 'rm' => 'audio/x-pn-realaudio',
+ 'rpm' => 'audio/x-pn-realaudio-plugin',
+ 'ra' => 'audio/x-realaudio',
+ 'rv' => 'video/vnd.rn-realvideo',
+ 'wav' => ['audio/x-wav', 'audio/wave', 'audio/wav'],
+ 'bmp' => ['image/bmp', 'image/x-bmp', 'image/x-bitmap', 'image/x-xbitmap', 'image/x-win-bitmap', 'image/x-windows-bmp', 'image/ms-bmp', 'image/x-ms-bmp', 'application/bmp', 'application/x-bmp', 'application/x-win-bitmap'],
+ 'gif' => 'image/gif',
+ 'jpeg' => ['image/jpeg', 'image/pjpeg'],
+ 'jpg' => ['image/jpeg', 'image/pjpeg'],
+ 'jpe' => ['image/jpeg', 'image/pjpeg'],
+ 'jp2' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'],
+ 'j2k' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'],
+ 'jpf' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'],
+ 'jpg2' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'],
+ 'jpx' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'],
+ 'jpm' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'],
+ 'mj2' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'],
+ 'mjp2' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'],
+ 'png' => ['image/png', 'image/x-png'],
+ 'tiff' => 'image/tiff',
+ 'tif' => 'image/tiff',
+ 'css' => ['text/css', 'text/plain'],
+ 'html' => ['text/html', 'text/plain'],
+ 'htm' => ['text/html', 'text/plain'],
+ 'shtml' => ['text/html', 'text/plain'],
+ 'txt' => 'text/plain',
+ 'text' => 'text/plain',
+ 'log' => ['text/plain', 'text/x-log'],
+ 'rtx' => 'text/richtext',
+ 'rtf' => 'text/rtf',
+ 'xml' => ['application/xml', 'text/xml', 'text/plain'],
+ 'xsl' => ['application/xml', 'text/xsl', 'text/xml'],
+ 'mpeg' => 'video/mpeg',
+ 'mpg' => 'video/mpeg',
+ 'mpe' => 'video/mpeg',
+ 'qt' => 'video/quicktime',
+ 'mov' => 'video/quicktime',
+ 'avi' => ['video/x-msvideo', 'video/msvideo', 'video/avi', 'application/x-troff-msvideo'],
+ 'movie' => 'video/x-sgi-movie',
+ 'doc' => ['application/msword', 'application/vnd.ms-office'],
+ 'docx' => ['application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword', 'application/x-zip'],
+ 'dot' => ['application/msword', 'application/vnd.ms-office'],
+ 'dotx' => ['application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword'],
+ 'xlsx' => ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip', 'application/vnd.ms-excel', 'application/msword', 'application/x-zip'],
+ 'word' => ['application/msword', 'application/octet-stream'],
+ 'xl' => 'application/excel',
+ 'eml' => 'message/rfc822',
+ 'json' => ['application/json', 'text/json'],
+ 'pem' => ['application/x-x509-user-cert', 'application/x-pem-file', 'application/octet-stream'],
+ 'p10' => ['application/x-pkcs10', 'application/pkcs10'],
+ 'p12' => 'application/x-pkcs12',
+ 'p7a' => 'application/x-pkcs7-signature',
+ 'p7c' => ['application/pkcs7-mime', 'application/x-pkcs7-mime'],
+ 'p7m' => ['application/pkcs7-mime', 'application/x-pkcs7-mime'],
+ 'p7r' => 'application/x-pkcs7-certreqresp',
+ 'p7s' => 'application/pkcs7-signature',
+ 'crt' => ['application/x-x509-ca-cert', 'application/x-x509-user-cert', 'application/pkix-cert'],
+ 'crl' => ['application/pkix-crl', 'application/pkcs-crl'],
+ 'der' => 'application/x-x509-ca-cert',
+ 'kdb' => 'application/octet-stream',
+ 'pgp' => 'application/pgp',
+ 'gpg' => 'application/gpg-keys',
+ 'sst' => 'application/octet-stream',
+ 'csr' => 'application/octet-stream',
+ 'rsa' => 'application/x-pkcs7',
+ 'cer' => ['application/pkix-cert', 'application/x-x509-ca-cert'],
+ '3g2' => 'video/3gpp2',
+ '3gp' => ['video/3gp', 'video/3gpp'],
+ 'mp4' => 'video/mp4',
+ 'm4a' => 'audio/x-m4a',
+ 'f4v' => ['video/mp4', 'video/x-f4v'],
+ 'flv' => 'video/x-flv',
+ 'webm' => 'video/webm',
+ 'aac' => 'audio/x-acc',
+ 'm4u' => 'application/vnd.mpegurl',
+ 'm3u' => 'text/plain',
+ 'xspf' => 'application/xspf+xml',
+ 'vlc' => 'application/videolan',
+ 'wmv' => ['video/x-ms-wmv', 'video/x-ms-asf'],
+ 'au' => 'audio/x-au',
+ 'ac3' => 'audio/ac3',
+ 'flac' => 'audio/x-flac',
+ 'ogg' => ['audio/ogg', 'video/ogg', 'application/ogg'],
+ 'kmz' => ['application/vnd.google-earth.kmz', 'application/zip', 'application/x-zip'],
+ 'kml' => ['application/vnd.google-earth.kml+xml', 'application/xml', 'text/xml'],
+ 'ics' => 'text/calendar',
+ 'ical' => 'text/calendar',
+ 'zsh' => 'text/x-scriptzsh',
+ '7z' => ['application/x-7z-compressed', 'application/x-compressed', 'application/x-zip-compressed', 'application/zip', 'multipart/x-zip'],
+ '7zip' => ['application/x-7z-compressed', 'application/x-compressed', 'application/x-zip-compressed', 'application/zip', 'multipart/x-zip'],
+ 'cdr' => ['application/cdr', 'application/coreldraw', 'application/x-cdr', 'application/x-coreldraw', 'image/cdr', 'image/x-cdr', 'zz-application/zz-winassoc-cdr'],
+ 'wma' => ['audio/x-ms-wma', 'video/x-ms-asf'],
+ 'jar' => ['application/java-archive', 'application/x-java-application', 'application/x-jar', 'application/x-compressed'],
+ 'svg' => ['image/svg+xml', 'application/xml', 'text/xml'],
+ 'vcf' => 'text/x-vcard',
+ 'srt' => ['text/srt', 'text/plain'],
+ 'vtt' => ['text/vtt', 'text/plain'],
+ 'ico' => ['image/x-icon', 'image/x-ico', 'image/vnd.microsoft.icon'],
+ 'odc' => 'application/vnd.oasis.opendocument.chart',
+ 'otc' => 'application/vnd.oasis.opendocument.chart-template',
+ 'odf' => 'application/vnd.oasis.opendocument.formula',
+ 'otf' => 'application/vnd.oasis.opendocument.formula-template',
+ 'odg' => 'application/vnd.oasis.opendocument.graphics',
+ 'otg' => 'application/vnd.oasis.opendocument.graphics-template',
+ 'odi' => 'application/vnd.oasis.opendocument.image',
+ 'oti' => 'application/vnd.oasis.opendocument.image-template',
+ 'odp' => 'application/vnd.oasis.opendocument.presentation',
+ 'otp' => 'application/vnd.oasis.opendocument.presentation-template',
+ 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
+ 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
+ 'odt' => 'application/vnd.oasis.opendocument.text',
+ 'odm' => 'application/vnd.oasis.opendocument.text-master',
+ 'ott' => 'application/vnd.oasis.opendocument.text-template',
+ 'oth' => 'application/vnd.oasis.opendocument.text-web'
+];
diff --git a/application/config/profiler.php b/application/config/profiler.php
index b3c36367..4c08a5a3 100644
--- a/application/config/profiler.php
+++ b/application/config/profiler.php
@@ -1,4 +1,4 @@
-session->set_userdata('dest_url', site_url('backend/index' . (!empty($appointment_hash) ? '/' . $appointment_hash : '')));
+ $this->session->set_userdata('dest_url', site_url('backend/index' . (! empty($appointment_hash) ? '/' . $appointment_hash : '')));
if ( ! $this->has_privileges(PRIV_APPOINTMENTS))
{
@@ -77,7 +77,7 @@ class Backend extends EA_Controller {
$view['available_providers'] = $this->providers_model->get_available_providers();
$view['available_services'] = $this->services_model->get_available_services();
$view['customers'] = $this->customers_model->get_batch();
- $view['calendar_view'] = !empty($calendar_view_query_param) ? $calendar_view_query_param : $user['settings']['calendar_view'];
+ $view['calendar_view'] = ! empty($calendar_view_query_param) ? $calendar_view_query_param : $user['settings']['calendar_view'];
$view['timezones'] = $this->timezones->to_array();
$this->set_user_data($view);
diff --git a/application/controllers/Backend_api.php b/application/controllers/Backend_api.php
index 9e68d8bc..6e9c9cfe 100755
--- a/application/controllers/Backend_api.php
+++ b/application/controllers/Backend_api.php
@@ -14,7 +14,6 @@
use EA\Engine\Notifications\Email as EmailClient;
use EA\Engine\Types\Email;
use EA\Engine\Types\Text;
-use EA\Engine\Types\Url;
/**
* Backend API Controller
@@ -420,9 +419,9 @@ class Backend_api extends EA_Controller {
// Notify admins
$admins = $this->admins_model->get_batch();
- foreach($admins as $admin)
+ foreach ($admins as $admin)
{
- if (!$admin['settings']['notifications'] === '0')
+ if ( ! $admin['settings']['notifications'] === '0')
{
continue;
}
@@ -435,9 +434,9 @@ class Backend_api extends EA_Controller {
// Notify secretaries
$secretaries = $this->secretaries_model->get_batch();
- foreach($secretaries as $secretary)
+ foreach ($secretaries as $secretary)
{
- if (!$secretary['settings']['notifications'] === '0')
+ if ( ! $secretary['settings']['notifications'] === '0')
{
continue;
}
@@ -562,7 +561,7 @@ class Backend_api extends EA_Controller {
$limit = 1000;
}
- $customers = $this->customers_model->get_batch($where, $limit, null, $order_by);
+ $customers = $this->customers_model->get_batch($where, $limit, NULL, $order_by);
foreach ($customers as &$customer)
{
@@ -1319,7 +1318,7 @@ class Backend_api extends EA_Controller {
$result = $this->providers_model->delete($this->input->post('provider_id'));
- $response =$result ? AJAX_SUCCESS : AJAX_FAILURE;
+ $response = $result ? AJAX_SUCCESS : AJAX_FAILURE;
}
catch (Exception $exception)
{
@@ -1393,7 +1392,7 @@ class Backend_api extends EA_Controller {
$secretary_id = $this->secretaries_model->add($secretary);
- $response =[
+ $response = [
'status' => AJAX_SUCCESS,
'id' => $secretary_id
];
@@ -1427,7 +1426,7 @@ class Backend_api extends EA_Controller {
$result = $this->secretaries_model->delete($this->input->post('secretary_id'));
- $response =$result ? AJAX_SUCCESS : AJAX_FAILURE;
+ $response = $result ? AJAX_SUCCESS : AJAX_FAILURE;
}
catch (Exception $exception)
{
@@ -1605,7 +1604,7 @@ class Backend_api extends EA_Controller {
}
else
{
- $response =AJAX_FAILURE;
+ $response = AJAX_FAILURE;
}
}
catch (Exception $exception)
@@ -1679,7 +1678,7 @@ class Backend_api extends EA_Controller {
$this->providers_model->set_setting('working_plan', $working_plan, $provider['id']);
}
- $response =AJAX_SUCCESS;
+ $response = AJAX_SUCCESS;
}
catch (Exception $exception)
{
diff --git a/application/controllers/Console.php b/application/controllers/Console.php
index 40818b8f..d34d6842 100644
--- a/application/controllers/Console.php
+++ b/application/controllers/Console.php
@@ -41,6 +41,22 @@ class Console extends EA_Controller {
$this->load->model('settings_model');
}
+ /**
+ * Perform a console installation.
+ *
+ * Use this method to install Easy!Appointments directly from the terminal.
+ *
+ * Usage:
+ *
+ * php index.php console install
+ */
+ public function install()
+ {
+ $this->migrate('fresh');
+ $this->seed();
+ $this->output->set_output(PHP_EOL . '⇾ Installation completed, login with "administrator" / "administrator".' . PHP_EOL . PHP_EOL);
+ }
+
/**
* Migrate the database to the latest state.
*
@@ -142,22 +158,6 @@ class Console extends EA_Controller {
]);
}
- /**
- * Perform a console installation.
- *
- * Use this method to install Easy!Appointments directly from the terminal.
- *
- * Usage:
- *
- * php index.php console install
- */
- public function install()
- {
- $this->migrate('fresh');
- $this->seed();
- $this->output->set_output(PHP_EOL . '⇾ Installation completed, login with "administrator" / "administrator".' . PHP_EOL . PHP_EOL);
- }
-
/**
* Create a backup file.
*
diff --git a/application/controllers/Google.php b/application/controllers/Google.php
index 9aab4c80..1f5f0d9e 100644
--- a/application/controllers/Google.php
+++ b/application/controllers/Google.php
@@ -29,67 +29,6 @@ class Google extends EA_Controller {
$this->load->model('providers_model');
}
- /**
- * Authorize Google Calendar API usage for a specific provider.
- *
- * Since it is required to follow the web application flow, in order to retrieve a refresh token from the Google API
- * service, this method is going to authorize the given provider.
- *
- * @param int $provider_id The provider id, for whom the sync authorization is made.
- */
- public function oauth($provider_id)
- {
- // Store the provider id for use on the callback function.
- $this->session->set_userdata('oauth_provider_id', $provider_id);
-
- // Redirect browser to google user content page.
- header('Location: ' . $this->google_sync->get_auth_url());
- }
-
- /**
- * Callback method for the Google Calendar API authorization process.
- *
- * Once the user grants consent with his Google Calendar data usage, the Google OAuth service will redirect him back
- * in this page. Here we are going to store the refresh token, because this is what will be used to generate access
- * tokens in the future.
- *
- * IMPORTANT: Because it is necessary to authorize the application using the web server flow (see official
- * documentation of OAuth), every Easy!Appointments installation should use its own calendar api key. So in every
- * api console account, the "http://path-to-Easy!Appointments/google/oauth_callback" should be included in an allowed redirect URL.
- */
- public function oauth_callback()
- {
- $code = $this->input->get('code');
-
- if (empty($code))
- {
- $this->output->set_output('Code authorization failed.');
- return;
- }
-
- $token = $this->google_sync->authenticate($code);
-
- if (empty($token))
- {
- $this->output->set_output('Token authorization failed.');
- return;
- }
-
- // Store the token into the database for future reference.
- $oauth_provider_id = $this->session->userdata('oauth_provider_id');
-
- if ($oauth_provider_id)
- {
- $this->providers_model->set_setting('google_sync', TRUE, $oauth_provider_id);
- $this->providers_model->set_setting('google_token', json_encode($token), $oauth_provider_id);
- $this->providers_model->set_setting('google_calendar', 'primary', $oauth_provider_id);
- }
- else
- {
- $this->output->set_output('Sync provider id not specified.');
- }
- }
-
/**
* Complete synchronization of appointments between Google Calendar and Easy!Appointments.
*
@@ -288,5 +227,66 @@ class Google extends EA_Controller {
->set_output(json_encode($response));
}
+ /**
+ * Authorize Google Calendar API usage for a specific provider.
+ *
+ * Since it is required to follow the web application flow, in order to retrieve a refresh token from the Google API
+ * service, this method is going to authorize the given provider.
+ *
+ * @param int $provider_id The provider id, for whom the sync authorization is made.
+ */
+ public function oauth($provider_id)
+ {
+ // Store the provider id for use on the callback function.
+ $this->session->set_userdata('oauth_provider_id', $provider_id);
+
+ // Redirect browser to google user content page.
+ header('Location: ' . $this->google_sync->get_auth_url());
+ }
+
+ /**
+ * Callback method for the Google Calendar API authorization process.
+ *
+ * Once the user grants consent with his Google Calendar data usage, the Google OAuth service will redirect him back
+ * in this page. Here we are going to store the refresh token, because this is what will be used to generate access
+ * tokens in the future.
+ *
+ * IMPORTANT: Because it is necessary to authorize the application using the web server flow (see official
+ * documentation of OAuth), every Easy!Appointments installation should use its own calendar api key. So in every
+ * api console account, the "http://path-to-Easy!Appointments/google/oauth_callback" should be included in an allowed redirect URL.
+ */
+ public function oauth_callback()
+ {
+ $code = $this->input->get('code');
+
+ if (empty($code))
+ {
+ $this->output->set_output('Code authorization failed.');
+ return;
+ }
+
+ $token = $this->google_sync->authenticate($code);
+
+ if (empty($token))
+ {
+ $this->output->set_output('Token authorization failed.');
+ return;
+ }
+
+ // Store the token into the database for future reference.
+ $oauth_provider_id = $this->session->userdata('oauth_provider_id');
+
+ if ($oauth_provider_id)
+ {
+ $this->providers_model->set_setting('google_sync', TRUE, $oauth_provider_id);
+ $this->providers_model->set_setting('google_token', json_encode($token), $oauth_provider_id);
+ $this->providers_model->set_setting('google_calendar', 'primary', $oauth_provider_id);
+ }
+ else
+ {
+ $this->output->set_output('Sync provider id not specified.');
+ }
+ }
+
}
diff --git a/application/controllers/Installation.php b/application/controllers/Installation.php
index 00a9b363..a18d239b 100644
--- a/application/controllers/Installation.php
+++ b/application/controllers/Installation.php
@@ -74,7 +74,7 @@ class Installation extends EA_Controller {
$admin['timezone'] = 'UTC';
$admin['settings']['username'] = $admin['username'];
$admin['settings']['password'] = $admin['password'];
- $admin['settings']['notifications'] = true;
+ $admin['settings']['notifications'] = TRUE;
$admin['settings']['calendar_view'] = CALENDAR_VIEW_DEFAULT;
unset($admin['username'], $admin['password']);
$admin['id'] = $this->admins_model->add($admin);
@@ -116,7 +116,7 @@ class Installation extends EA_Controller {
],
'settings' => [
'username' => 'johndoe',
- 'password' => hash_password($salt, $password),
+ 'password' => hash_password($salt, $password),
'salt' => $salt,
'working_plan' => '{"monday":{"start":"09:00","end":"18:00","breaks":[{"start":"14:30","end":"15:00"}]},"tuesday":{"start":"09:00","end":"18:00","breaks":[{"start":"14:30","end":"15:00"}]},"wednesday":{"start":"09:00","end":"18:00","breaks":[{"start":"14:30","end":"15:00"}]},"thursday":{"start":"09:00","end":"18:00","breaks":[{"start":"14:30","end":"15:00"}]},"friday":{"start":"09:00","end":"18:00","breaks":[{"start":"14:30","end":"15:00"}]},"saturday":null,"sunday":null}',
'notifications' => FALSE,
diff --git a/application/controllers/api/v1/Providers.php b/application/controllers/api/v1/Providers.php
index 004e55f4..5d163b18 100644
--- a/application/controllers/api/v1/Providers.php
+++ b/application/controllers/api/v1/Providers.php
@@ -50,7 +50,7 @@ class Providers extends API_V1_Controller {
try
{
$conditions = $id !== NULL ? ['id' => $id] : NULL;
-
+
$providers = $this->providers_model->get_batch($conditions);
if ($id !== NULL && count($providers) === 0)
diff --git a/application/controllers/api/v1/Secretaries.php b/application/controllers/api/v1/Secretaries.php
index 1fc38d9a..d25001cc 100644
--- a/application/controllers/api/v1/Secretaries.php
+++ b/application/controllers/api/v1/Secretaries.php
@@ -50,7 +50,7 @@ class Secretaries extends API_V1_Controller {
try
{
$conditions = $id !== NULL ? ['id' => $id] : NULL;
-
+
$secretaries = $this->secretaries_model->get_batch($conditions);
if ($id !== NULL && count($secretaries) === 0)
diff --git a/application/controllers/api/v1/Services.php b/application/controllers/api/v1/Services.php
index 7533c162..e5cb42f7 100644
--- a/application/controllers/api/v1/Services.php
+++ b/application/controllers/api/v1/Services.php
@@ -50,7 +50,7 @@ class Services extends API_V1_Controller {
try
{
$conditions = $id !== NULL ? ['id' => $id] : NULL;
-
+
$services = $this->services_model->get_batch($conditions);
if ($id !== NULL && count($services) === 0)
diff --git a/application/controllers/api/v1/Unavailabilities.php b/application/controllers/api/v1/Unavailabilities.php
index 2ea3ec47..71c123d4 100644
--- a/application/controllers/api/v1/Unavailabilities.php
+++ b/application/controllers/api/v1/Unavailabilities.php
@@ -49,7 +49,7 @@ class Unavailabilities extends API_V1_Controller {
{
try
{
- $where = $id !== NULL ? ['id' => $id] : ['is_unavailable' => true];
+ $where = $id !== NULL ? ['id' => $id] : ['is_unavailable' => TRUE];
$unavailabilities = $this->appointments_model->get_batch($where);
diff --git a/application/language/arabic/db_lang.php b/application/language/arabic/db_lang.php
index 94044736..6d620868 100644
--- a/application/language/arabic/db_lang.php
+++ b/application/language/arabic/db_lang.php
@@ -2,12 +2,12 @@
/**
* System messages translation for CodeIgniter(tm)
*
- * @author CodeIgniter community
- * @copyright Copyright (c) 2014-2018, British Columbia Institute of Technology (http://bcit.ca/)
- * @license http://opensource.org/licenses/MIT MIT License
- * @link https://codeigniter.com
+ * @author CodeIgniter community
+ * @copyright Copyright (c) 2014-2018, British Columbia Institute of Technology (http://bcit.ca/)
+ * @license http://opensource.org/licenses/MIT MIT License
+ * @link https://codeigniter.com
*/
-defined('BASEPATH') OR exit('No direct script access allowed');
+defined('BASEPATH') or exit('No direct script access allowed');
$lang['db_invalid_connection_str'] = 'غير قادر على إيجاد إعدادات الإتصال بقواعد البيانات بناء على البيانات المرسلة.';
$lang['db_unable_to_connect'] = 'غير قادر على الإتصال بقواعد البيانات بناء على الإعدادات المقدمة.';
diff --git a/application/language/arabic/email_lang.php b/application/language/arabic/email_lang.php
index b087eda5..3229327e 100644
--- a/application/language/arabic/email_lang.php
+++ b/application/language/arabic/email_lang.php
@@ -2,12 +2,12 @@
/**
* System messages translation for CodeIgniter(tm)
*
- * @author CodeIgniter community
- * @copyright Copyright (c) 2014-2018, British Columbia Institute of Technology (http://bcit.ca/)
- * @license http://opensource.org/licenses/MIT MIT License
- * @link https://codeigniter.com
+ * @author CodeIgniter community
+ * @copyright Copyright (c) 2014-2018, British Columbia Institute of Technology (http://bcit.ca/)
+ * @license http://opensource.org/licenses/MIT MIT License
+ * @link https://codeigniter.com
*/
-defined('BASEPATH') OR exit('No direct script access allowed');
+defined('BASEPATH') or exit('No direct script access allowed');
$lang['email_must_be_array'] = 'يجب تمرير مصفوفة إلى دالة التحقق من البريد الإلكتروني.';
$lang['email_invalid_address'] = 'عنوان بريد إلكتروني خاطئ: %s';
diff --git a/application/language/arabic/migration_lang.php b/application/language/arabic/migration_lang.php
index 06b88f95..4deda43a 100644
--- a/application/language/arabic/migration_lang.php
+++ b/application/language/arabic/migration_lang.php
@@ -2,12 +2,12 @@
/**
* System messages translation for CodeIgniter(tm)
*
- * @author CodeIgniter community
- * @copyright Copyright (c) 2014-2018, British Columbia Institute of Technology (http://bcit.ca/)
- * @license http://opensource.org/licenses/MIT MIT License
- * @link https://codeigniter.com
+ * @author CodeIgniter community
+ * @copyright Copyright (c) 2014-2018, British Columbia Institute of Technology (http://bcit.ca/)
+ * @license http://opensource.org/licenses/MIT MIT License
+ * @link https://codeigniter.com
*/
-defined('BASEPATH') OR exit('No direct script access allowed');
+defined('BASEPATH') or exit('No direct script access allowed');
$lang['migration_none_found'] = "لا يوجد أي عمليات ترحيل.";
$lang['migration_not_found'] = "تعذر العثور على عملية الترحيل هذه.";
diff --git a/application/language/czech/db_lang.php b/application/language/czech/db_lang.php
index 3af9174a..8249a944 100644
--- a/application/language/czech/db_lang.php
+++ b/application/language/czech/db_lang.php
@@ -35,7 +35,7 @@
* @since Version 1.0.0
* @filesource
*/
-defined('BASEPATH') OR exit('No direct script access allowed');
+defined('BASEPATH') or exit('No direct script access allowed');
$lang['db_invalid_connection_str'] = 'Z řetězce spojení které jste zadali nelze určit nastavení databáze.';
$lang['db_unable_to_connect'] = 'Se zadanými nastaveními se není možné připojit k databázovému serveru.';
@@ -60,4 +60,4 @@ $lang['db_table_name_required'] = 'Pro tuto operaci je vyžadován název tabulk
$lang['db_column_name_required'] = 'Pro tuto operaci je vyžadován název sloupce.';
$lang['db_column_definition_required'] = 'Pro tuto operaci je vyžadována definice sloupce.';
$lang['db_unable_to_set_charset'] = 'Není možné nastavit znakovou sadu spojení klienta: %s';
-$lang['db_error_heading'] = 'Vyskytla se chyba databáze';
\ No newline at end of file
+$lang['db_error_heading'] = 'Vyskytla se chyba databáze';
diff --git a/application/language/czech/email_lang.php b/application/language/czech/email_lang.php
index b8814d96..0cc687bd 100644
--- a/application/language/czech/email_lang.php
+++ b/application/language/czech/email_lang.php
@@ -35,7 +35,7 @@
* @since Version 1.0.0
* @filesource
*/
-defined('BASEPATH') OR exit('No direct script access allowed');
+defined('BASEPATH') or exit('No direct script access allowed');
$lang['email_must_be_array'] = 'Metoda validace emailu musí být předána jako pole.';
$lang['email_invalid_address'] = 'Neplatná emailová adresa: %s';
@@ -55,4 +55,4 @@ $lang['email_failed_smtp_login'] = 'Odeslání příkazu AUTH LOGIN selhalo. Chy
$lang['email_smtp_auth_un'] = 'Autentizace uživatelského jména selhala. Chyba: %s';
$lang['email_smtp_auth_pw'] = 'Autentizace hesla selhala. Chyba: %s';
$lang['email_smtp_data_failure'] = 'Není možné odeslat data: %s';
-$lang['email_exit_status'] = 'Výstupní kód ukončení programu: %s';
\ No newline at end of file
+$lang['email_exit_status'] = 'Výstupní kód ukončení programu: %s';
diff --git a/application/language/czech/migration_lang.php b/application/language/czech/migration_lang.php
index d1dce638..21a7d99b 100644
--- a/application/language/czech/migration_lang.php
+++ b/application/language/czech/migration_lang.php
@@ -2,18 +2,18 @@
/**
* System messages translation for CodeIgniter(tm)
*
- * @author CodeIgniter community
- * @copyright Copyright (c) 2014-2018, British Columbia Institute of Technology (http://bcit.ca/)
- * @license http://opensource.org/licenses/MIT MIT License
- * @link https://codeigniter.com
+ * @author CodeIgniter community
+ * @copyright Copyright (c) 2014-2018, British Columbia Institute of Technology (http://bcit.ca/)
+ * @license http://opensource.org/licenses/MIT MIT License
+ * @link https://codeigniter.com
*/
-defined('BASEPATH') OR exit('No direct script access allowed');
+defined('BASEPATH') or exit('No direct script access allowed');
-$lang['migration_none_found'] = 'Nebyla nalezena žádná migrace.';
-$lang['migration_not_found'] = 'Migrace s číslem verze %s nebyla nalezena.';
-$lang['migration_sequence_gap'] = 'V blízkosti sekvence migrace s číslem verze %s se nachází mezera.';
-$lang['migration_multiple_version'] = 'Existuje více migrací se shodným číslem verze: %s.';
-$lang['migration_class_doesnt_exist'] = 'Třída migrace "%s" nebyla nalezena.';
-$lang['migration_missing_up_method'] = 'Třída migrace "%s" postrádá metodu "up".';
-$lang['migration_missing_down_method'] = 'Třída migrace "%s" postrádá metodu "down".';
-$lang['migration_invalid_filename'] = 'Migrace "%s" má neplatný název souboru.';
+$lang['migration_none_found'] = 'Nebyla nalezena žádná migrace.';
+$lang['migration_not_found'] = 'Migrace s číslem verze %s nebyla nalezena.';
+$lang['migration_sequence_gap'] = 'V blízkosti sekvence migrace s číslem verze %s se nachází mezera.';
+$lang['migration_multiple_version'] = 'Existuje více migrací se shodným číslem verze: %s.';
+$lang['migration_class_doesnt_exist'] = 'Třída migrace "%s" nebyla nalezena.';
+$lang['migration_missing_up_method'] = 'Třída migrace "%s" postrádá metodu "up".';
+$lang['migration_missing_down_method'] = 'Třída migrace "%s" postrádá metodu "down".';
+$lang['migration_invalid_filename'] = 'Migrace "%s" má neplatný název souboru.';
diff --git a/application/language/czech/translations_lang.php b/application/language/czech/translations_lang.php
index f236a06f..6db7c9d6 100644
--- a/application/language/czech/translations_lang.php
+++ b/application/language/czech/translations_lang.php
@@ -1,4 +1,4 @@
-= $company_name ?>
-
+
1
-
+
2
-
+
3
-
diff --git a/application/views/appointments/book_success.php b/application/views/appointments/book_success.php
index 8bbc94cb..ae655193 100755
--- a/application/views/appointments/book_success.php
+++ b/application/views/appointments/book_success.php
@@ -17,83 +17,83 @@
-
-
-
-
-
-
+
+
+
+
+
+
-
-
= lang('appointment_registered') ?>
+
+
= lang('appointment_registered') ?>
-
- = lang('appointment_details_was_sent_to_you') ?>
-
+
+ = lang('appointment_details_was_sent_to_you') ?>
+
-
-
- = lang('check_spam_folder') ?>
-
-
+
+
+ = lang('check_spam_folder') ?>
+
+
-
-
- = lang('go_to_booking_page') ?>
-
+
+
+ = lang('go_to_booking_page') ?>
+
-
-
-
+
+
+
-
-
-
= lang('unexpected_issues') ?>
+
+
+
= lang('unexpected_issues') ?>
-
- = exceptionToHtml($exception) ?>
-
-
-
-
+
+ = exceptionToHtml($exception) ?>
+
+
+
+
-
+
+
-
-
-
-
+
+
+
+
-
+ var EALang = = json_encode($this->lang->language) ?>;
+
-
-
-
+
+
+
-
+