summaryrefslogtreecommitdiff
path: root/admin
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2008-05-10 21:50:37 +0000
committerMax Kremmel <xing@synapse.plus.com>2008-05-10 21:50:37 +0000
commit932390d81190619626275dfef02d695b05bc0d1d (patch)
tree96e247ba200a10af1bda3fe39c42dbf8f7f6ed51 /admin
parent5156b3ded7fdb88d71d064f8ff36bebf298a8985 (diff)
downloadliberty-932390d81190619626275dfef02d695b05bc0d1d.tar.gz
liberty-932390d81190619626275dfef02d695b05bc0d1d.tar.bz2
liberty-932390d81190619626275dfef02d695b05bc0d1d.zip
SCHEMA CHANGE: added liberty_attachment_prefs to store attachment preferences
introducing a new layer on top LibertyAttachments to deal with file uploads supporting mimetype based plugins - ported from treasury
Diffstat (limited to 'admin')
-rw-r--r--admin/mime_flv.php90
-rw-r--r--admin/schema_inc.php7
2 files changed, 97 insertions, 0 deletions
diff --git a/admin/mime_flv.php b/admin/mime_flv.php
new file mode 100644
index 0000000..a8ed911
--- /dev/null
+++ b/admin/mime_flv.php
@@ -0,0 +1,90 @@
+<?php
+require_once( '../../bit_setup_inc.php' );
+include_once( KERNEL_PKG_PATH.'simple_form_functions_lib.php' );
+
+$gBitSystem->verifyPermission( 'p_admin' );
+
+if( function_exists( 'shell_exec' )) {
+ $gBitSmarty->assign( 'ffmpeg_path', shell_exec( 'which ffmpeg' ));
+}
+
+$feedback = array();
+
+$rates = array(
+ 'video_bitrate' => array(
+ 160000 => 200,
+ 240000 => 300,
+ 320000 => 400,
+ 400000 => 500,
+ ),
+ 'video_width' => array(
+ 240 => 240,
+ 320 => 320,
+ 480 => 480,
+ 640 => 640,
+ ),
+ 'display_size' => array(
+ 0 => tra( 'Same as encoded video' ),
+ 240 => tra( 'Small' ),
+ 320 => tra( 'Medium' ),
+ 480 => tra( 'Large' ),
+ 640 => tra( 'Huge' ),
+ ),
+ 'audio_bitrate' => array(
+ 32000 => 32,
+ 64000 => 64,
+ 96000 => 96,
+ 128000 => 128,
+ ),
+ 'audio_samplerate' => array(
+ 11025 => 11025,
+ 22050 => 22050,
+ 44100 => 44100,
+ ),
+);
+$gBitSmarty->assign( 'rates', $rates );
+
+if( !empty( $_REQUEST['plugin_settings'] )) {
+ $flvSettings = array(
+ 'mime_flv_ffmpeg_path' => array(
+ 'type' => 'text',
+ ),
+ 'mime_flv_video_bitrate' => array(
+ 'type' => 'numeric',
+ ),
+ 'mime_flv_audio_samplerate' => array(
+ 'type' => 'numeric',
+ ),
+ 'mime_flv_audio_bitrate' => array(
+ 'type' => 'numeric',
+ ),
+ 'mime_flv_width' => array(
+ 'type' => 'numeric',
+ ),
+ 'mime_flv_default_size' => array(
+ 'type' => 'numeric',
+ ),
+ 'mime_flv_backcolor' => array(
+ 'type' => 'text',
+ ),
+ 'mime_flv_frontcolor' => array(
+ 'type' => 'text',
+ ),
+ );
+
+ foreach( $flvSettings as $item => $data ) {
+ if( $data['type'] == 'checkbox' ) {
+ simple_set_toggle( $item, LIBERTY_PKG_NAME );
+ } elseif( $data['type'] == 'numeric' ) {
+ simple_set_int( $item, LIBERTY_PKG_NAME );
+ } else {
+ $gBitSystem->storeConfig( $item, ( !empty( $_REQUEST[$item] ) ? $_REQUEST[$item] : NULL ), LIBERTY_PKG_NAME );
+ }
+ }
+
+ $feedback['success'] = tra( 'The plugin was successfully updated' );
+}
+
+$gBitSmarty->assign( 'feedback', $feedback );
+$gBitSystem->display( 'bitpackage:liberty/admin_mime_flv.tpl', tra( 'Flashvideo Plugin Settings' ));
+?>
diff --git a/admin/schema_inc.php b/admin/schema_inc.php
index f7eccf0..c1448b5 100644
--- a/admin/schema_inc.php
+++ b/admin/schema_inc.php
@@ -144,6 +144,13 @@ $tables = array(
'
",
+'liberty_attachment_prefs' => "
+ attachment_id I4 PRIMARY,
+ pref_name C(40) PRIMARY,
+ pref_value C(250)
+ CONSTRAINT ', CONSTRAINT `lib_attachment_prefs_content_ref` FOREIGN KEY (`attachment_id`) REFERENCES `".BIT_DB_PREFIX."liberty_attachments` (`attachment_id`)'
+",
+
'liberty_files' => "
file_id I4 PRIMARY,
user_id I4 NOTNULL,