Skip to content

Commit

Permalink
Merge branch '2.1' into backend
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudD committed May 5, 2011
2 parents e9e6136 + a344873 commit 81ad61e
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 27 deletions.
21 changes: 11 additions & 10 deletions app/controllers/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,17 @@ public function indexAction () {
$progressMonitor = fz_config_get ('app', 'progress_monitor');
$progressMonitor = new $progressMonitor ();

set ('upload_id' , md5 (uniqid (mt_rand (), true)));
set ('start_from' , Zend_Date::now ()->get (Zend_Date::DATE_SHORT));
set ('refresh_rate' , 1200);
set ('files' , Fz_Db::getTable ('File')
->findByOwnerOrderByUploadDateDesc ($user));
set ('use_progress_bar' , $progressMonitor->isInstalled ());
set ('upload_id_name' , $progressMonitor->getUploadIdName ());
set ('free_space_left' , $freeSpaceLeft);
set ('max_upload_size' , $maxUploadSize);
set ('disk_usage' , array (
set ('upload_id' , md5 (uniqid (mt_rand (), true)));
set ('start_from' , Zend_Date::now ()->get (Zend_Date::DATE_SHORT));
set ('refresh_rate' , 1200);
set ('files' , Fz_Db::getTable ('File')
->findByOwnerOrderByUploadDateDesc ($user));
set ('use_progress_bar' , $progressMonitor->isInstalled ());
set ('upload_id_name' , $progressMonitor->getUploadIdName ());
set ('free_space_left' , $freeSpaceLeft);
set ('max_upload_size' , $maxUploadSize);
set ('sharing_destinations' , fz_config_get ('app', 'sharing_destinations', array()));
set ('disk_usage' , array (
'space' => '<b id="disk-usage-value">'.bytesToShorthand (Fz_Db::getTable('File')->getTotalDiskSpaceByUser ($user)).'</b>',
'quota' => fz_config_get('app', 'user_quota')));
return html ('main/index.php');
Expand Down
12 changes: 4 additions & 8 deletions app/views/file/_mailForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@
<textarea cols="80" rows="10" name="msg" value="<?php echo params ('msg') ?>"></textarea>
</p>
<p>
<a href="#" class="open-email-client" target="_blank"><?php echo __('Open in my email client') ?></a>
<script type="text/javascript">
$(document).ready (function () {
$('.open-email-client').click (function (e) {
$('.ui-dialog-content').dialog('close');
});
});
</script>
<a href="<?php echo isset ($file) ? 'mailto:?body='.__('You can download the file I uploaded here').' : '.$file->getDownloadUrl () : '#' ?>"
class="open-email-client" target="_blank">
<?php echo __('Open in my email client') ?>
</a>
</p>
<p class="submit">
<input type="submit" class="awesome blue large" value="<?php echo __('Send') ?>" />
Expand Down
12 changes: 10 additions & 2 deletions app/views/main/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,22 @@
<p id="share-link"><a href=""></a></p>
<p class="instruction"><?php echo __('or share using') ?> :</p>
<ul id="share-destinations">
<li class="email" ><a href="" data-url="%url%/email"><?php echo __('your email') ?></a></li>
<!-- TODO make next share destinations configurable ! -->
<?php if (in_array ('email', $sharing_destinations)): ?>
<li class="email" ><a href="" data-url="%url%/email"><?php echo __('your email') ?></a></li>
<?php endif; ?>
<?php if (in_array ('facebook', $sharing_destinations)): ?>
<li class="facebook"><a href="" target="_blank" data-url="http://www.facebook.com/sharer.php?u=%url%&t=%filename%"><?php echo __('Facebook') ?></a></li>
<?php endif; ?>
<?php if (in_array ('twitter', $sharing_destinations)): ?>
<li class="twitter" ><a href="" target="_blank" data-url="http://twitter.com/home?status=%filename% %url%"><?php echo __('Twitter') ?></a></li>
<?php endif; ?>
</ul>
<div class="cleartboth"></div>
</div>

<div id="email-modal" class="fz-modal" style="display: none;">
<?php echo partial ('file/_mailForm.php') ?>
</div>

<script type="text/javascript">
$(document).ready (function () {
Expand Down
1 change: 1 addition & 0 deletions config/filez.default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ user_factory_class = Fz_User_Factory_Ldap
user_quota = 2G
https=login_only
progress_monitor=Fz_UploadMonitor_Apc
sharing_destinations[] = 'email'

[db]
dsn = "mysql:host=localhost;dbname=filez"
Expand Down
6 changes: 6 additions & 0 deletions doc/CHANGELOG.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ Filez-2.1.0
* Fixed the max length of a hash to 10
* Added german translation
* Redesigned file list
* Added other share destination (FB, twitter) optional
* Added German translation (thanks to @spiorf)
* Added Italian translation (thanks to @tini)
* Added optional Antivirus check (thanks to @daserzw)
* Added admin backend (thanks to @almaghi)
* Added automatic database update

Filez-2.0.2

Expand Down
21 changes: 14 additions & 7 deletions resources/js/filez.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,23 @@ $.fn.initFileActions = function () {
.replace ('%filename%', $.trim(filename)));
});

$('#share-modal #share-destinations li.email a').click (function (e) {
e.preventDefault ();
$('#share-modal').dialog ('close');

$('form', modal).attr ('action', $(this).attr ('href'));
$('.open-email-client')
.attr ('href', 'mailto:?body='+settings.messages.emailMessage+' : '+fileUrl)
.click (function (e) { $('.ui-dialog-content').dialog('close'); });

$('#email-modal').dialog ('open');
});

$('#share-modal').dialog ('option', 'title', filename);
$('#email-modal').dialog ('option', 'title', filename);

modal.dialog ('open');
/*
$('form', modal).attr ('action', $(this).attr ('href'));
$('.open-email-client', modal).attr ('href', 'mailto:'
+'?body='+settings.messages.emailMessage+' : '+fileUrl);
*/
return false;
}),
});

$('a.delete', this).click (function (e) {
if (confirm (settings.messages.confirmDelete))
Expand Down

0 comments on commit 81ad61e

Please sign in to comment.