diff options
| author | Nick Palmer <nick@sluggardy.net> | 2007-04-08 15:17:18 +0000 |
|---|---|---|
| committer | Nick Palmer <nick@sluggardy.net> | 2007-04-08 15:17:18 +0000 |
| commit | 9ef4cdfb6c4686a9432b36e6909129c19904b749 (patch) | |
| tree | ac0fdc6b0594388d6e2352ddaed936caa4659e92 /plugins/storage.bitfile.php | |
| parent | e65308d29d82064ab1728d8a17472826ccfcfd2a (diff) | |
| download | liberty-9ef4cdfb6c4686a9432b36e6909129c19904b749.tar.gz liberty-9ef4cdfb6c4686a9432b36e6909129c19904b749.tar.bz2 liberty-9ef4cdfb6c4686a9432b36e6909129c19904b749.zip | |
Support for multiple attachments and storing attachments without content. You must turn on multiple attachments in Liberty Settings to get this option. The new LibertyAttachable::storeAttachments() method can be used to store attachments on preview. Still need some more work in attachment browser to show attachments stored in this way. We should modify the sample package to use the storeAttachments() on preview as well as all existing content types. PAIN!
Diffstat (limited to 'plugins/storage.bitfile.php')
| -rw-r--r-- | plugins/storage.bitfile.php | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/plugins/storage.bitfile.php b/plugins/storage.bitfile.php index a04d8fd..5e9a479 100644 --- a/plugins/storage.bitfile.php +++ b/plugins/storage.bitfile.php @@ -1,10 +1,10 @@ <?php /** - * @version $Revision: 1.20 $ + * @version $Revision: 1.21 $ * @package liberty * @subpackage plugins_storage */ -global $gLibertySystem; +global $gLibertySystem, $gBitSystem, $gBitSmarty; /** * definitions @@ -24,6 +24,22 @@ $pluginParams = array ( 'edit_help' => 'This file will be uploaded to your personal storage area.<br />After selecting the file you want to upload, please return to the edit area and click the save button.' ); +if ($gBitSystem->isFeatureActive("liberty_multiple_attachments")) { + $pluginParams['edit_label'] = 'Upload File(s)'; + $pluginParams['edit_help'] = 'The file(s) will be uploaded to your personal storage area.<br />After selecting the file(s) you want to upload, please return to the edit area and click the save button.'; + $pluginParams['edit_field'] = '<div id="upload_div"></div><input type="file" name="upload" size="40" id="uploads" /> +<!-- Multiselect javascript. --> +<script> + var upload_files = document.getElementById( \'upload_div\' ); + var upload_element = document.getElementById( \'uploads\' ); + var multi_selector = new MultiSelector( upload_files, '. + $gBitSystem->getConfig('liberty_max_multiple_attachments', 10). + ' ); + multi_selector.addNamedElement( upload_element , \'uploads\'); +</script>'; + $gBitSmarty->assign( 'loadMultiFile', TRUE ); +} + //$gLibertySystem->registerPlugin( STORAGE_TYPE_BIT_FILES, $pluginParams ); $gLibertySystem->registerPlugin( PLUGIN_GUID_BIT_FILES, $pluginParams ); |
