Merge gitorious.org:owncloud/owncloud into vcategories

Conflicts:
	apps/contacts/ajax/saveproperty.php
	apps/contacts/lib/vcard.php
remotes/origin/stable4
Thomas Tanghus 13 years ago
commit ae7aab2d6e
  1. 11
      apps/calendar/lib/object.php
  2. 2
      apps/contacts/ajax/addcard.php
  3. 2
      apps/contacts/ajax/addcontact.php
  4. 2
      apps/contacts/ajax/addproperty.php
  5. 2
      apps/contacts/ajax/deleteproperty.php
  6. 2
      apps/contacts/ajax/savecrop.php
  7. 6
      apps/contacts/ajax/saveproperty.php
  8. 2
      apps/contacts/ajax/setproperty.php
  9. 10
      apps/contacts/import.php
  10. 35
      apps/contacts/js/contacts.js
  11. 2
      apps/contacts/lib/app.php
  12. 112
      apps/contacts/lib/vcard.php
  13. 2
      apps/contacts/templates/part.contactphoto.php
  14. 2
      core/css/styles.css
  15. 26
      files/ajax/newfile.php
  16. 4
      files/ajax/newfolder.php
  17. 67
      files/js/files.js
  18. 1
      files/templates/index.php

@ -96,8 +96,7 @@ class OC_Calendar_Object{
list($type,$startdate,$enddate,$summary,$repeating,$uid) = self::extractData($object);
if(is_null($uid)){
$uid = self::createUID();
$object->add('UID',$uid);
$object->setUID();
$data = $object->serialize();
}
@ -208,14 +207,6 @@ class OC_Calendar_Object{
return true;
}
/**
* @brief Creates a UID
* @return string
*/
protected static function createUID(){
return substr(md5(rand().time()),0,10);
}
/**
* @brief Extracts data from a vObject-Object
* @param Sabre_VObject $object

@ -92,7 +92,7 @@ foreach( $add as $propname){
}
}
}
$id = OC_Contacts_VCard::add($aid,$vcard->serialize());
$id = OC_Contacts_VCard::add($aid,$vcard);
if(!$id) {
OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('There was an error adding the contact.'))));
OC_Log::write('contacts','ajax/addcard.php: Recieved non-positive ID on adding card: '.$id, OC_Log::ERROR);

@ -52,7 +52,7 @@ $vcard->setUID();
$vcard->setString('FN',$fn);
$vcard->setString('N',$n);
$id = OC_Contacts_VCard::add($aid,$vcard->serialize());
$id = OC_Contacts_VCard::add($aid,$vcard);
if(!$id) {
OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('There was an error adding the contact.'))));
OC_Log::write('contacts','ajax/addcontact.php: Recieved non-positive ID on adding card: '.$id, OC_Log::ERROR);

@ -116,7 +116,7 @@ foreach ($parameters as $key=>$element) {
}
$checksum = md5($vcard->children[$line]->serialize());
if(!OC_Contacts_VCard::edit($id,$vcard->serialize())) {
if(!OC_Contacts_VCard::edit($id,$vcard)) {
OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error adding contact property.'))));
OC_Log::write('contacts','ajax/addproperty.php: Error updating contact property: '.$name, OC_Log::ERROR);
exit();

@ -39,7 +39,7 @@ if(is_null($line)){
unset($vcard->children[$line]);
if(!OC_Contacts_VCard::edit($id,$vcard->serialize())) {
if(!OC_Contacts_VCard::edit($id,$vcard)) {
OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error deleting contact property.'))));
OC_Log::write('contacts','ajax/deleteproperty.php: Error deleting contact property', OC_Log::ERROR);
exit();

@ -95,7 +95,7 @@ if(file_exists($tmp_path)) {
OC_Log::write('contacts','savecrop.php: files: Adding PHOTO property.', OC_Log::DEBUG);
$card->addProperty('PHOTO', $image->__toString(), array('ENCODING' => 'b', 'TYPE' => $image->mimeType()));
}
if(!OC_Contacts_VCard::edit($id,$card->serialize())) {
if(!OC_Contacts_VCard::edit($id,$card)) {
bailOut('Error saving contact.');
}
unlink($tmpfname);

@ -128,8 +128,14 @@ switch($element) {
$checksum = md5($vcard->children[$line]->serialize());
debug('New checksum: '.$checksum);
<<<<<<< HEAD
if(!OC_Contacts_VCard::edit($id,$vcard->serialize())) {
bailOut(OC_Contacts_App::$l10n->t('Error updating contact property.'));
=======
if(!OC_Contacts_VCard::edit($id,$vcard)) {
OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error updating contact property.'))));
OC_Log::write('contacts','ajax/setproperty.php: Error updating contact property: '.$value, OC_Log::ERROR);
>>>>>>> d8cfe77ba5348d29a9e2b046e2c7efc1dd4758cb
exit();
}

@ -80,7 +80,7 @@ foreach($missingparameters as $i){
// NOTE: This checksum is not used..?
$checksum = md5($vcard->children[$line]->serialize());
if(!OC_Contacts_VCard::edit($id,$vcard->serialize())) {
if(!OC_Contacts_VCard::edit($id,$vcard)) {
OC_JSON::error(array('data' => array('message' => $l->t('Error updating contact property.'))));
OC_Log::write('contacts','ajax/setproperty.php: Error updating contact property: '.$value, OC_Log::ERROR);
exit();

@ -97,11 +97,15 @@ if(is_writable('import_tmp/')){
fclose($progressfopen);
}
if(count($parts) == 1){
OC_Contacts_VCard::add($id, $file);
}else{
$importready = array($file);
}
foreach($importready as $import){
OC_Contacts_VCard::add($id, $import);
$card = OC_VObject::parse($import);
if (!$card) {
OC_Log::write('contacts','Import: skipping card. Error parsing VCard: '.$import, OC_Log::ERROR);
continue; // Ditch cards that can't be parsed by Sabre.
}
OC_Contacts_VCard::add($id, $card);
}
//done the import
if(is_writable('import_tmp/')){

@ -166,7 +166,7 @@ Contacts={
return $(obj).parents('.propertycontainer').first().data('element');
},
showHideContactInfo:function() {
var show = ($('#emaillist li[class*="propertycontainer"]').length > 0 || $('#phonelist li[class*="propertycontainer"]').length > 0 || $('#addressdisplay dl[class*="propertycontainer"]').length > 0);
var show = ($('#emaillist li.propertycontainer').length > 0 || $('#phonelist li.propertycontainer').length > 0 || $('#addressdisplay dl.propertycontainer').length > 0);
console.log('showHideContactInfo: ' + show);
if(show) {
$('#contact_communication').show();
@ -180,19 +180,19 @@ Contacts={
switch (type) {
case 'EMAIL':
console.log('emails: '+$('#emaillist>li').length);
if($('#emaillist li[class*="propertycontainer"]').length == 0) {
if($('#emaillist li.propertycontainer').length == 0) {
$('#emails').hide();
}
break;
case 'TEL':
console.log('phones: '+$('#phonelist>li').length);
if($('#phonelist li[class*="propertycontainer"]').length == 0) {
if($('#phonelist li.propertycontainer').length == 0) {
$('#phones').hide();
}
break;
case 'ADR':
console.log('addresses: '+$('#addressdisplay>dl').length);
if($('#addressdisplay dl[class*="propertycontainer"]').length == 0) {
if($('#addressdisplay dl.propertycontainer').length == 0) {
$('#addresses').hide();
}
break;
@ -259,7 +259,7 @@ Contacts={
classes: 'categories'
});
// Style phone types
$('#phonelist').find('select[class*="contacts_property"]').multiselect({
$('#phonelist').find('select.contacts_property').multiselect({
noneSelectedText: t('contacts', 'Select type'),
header: false,
selectedList: 4,
@ -459,7 +459,7 @@ Contacts={
loadSingleProperties:function() {
var props = ['BDAY', 'NICKNAME', 'ORG'];
// Clear all elements
$('#ident .propertycontainer[class*="propertycontainer"]').each(function(){
$('#ident .propertycontainer').each(function(){
if(props.indexOf($(this).data('element')) > -1) {
$(this).data('checksum', '');
$(this).find('input').val('');
@ -534,6 +534,9 @@ Contacts={
$('#fn_select option').remove();
$('#fn_select').combobox('value', this.fn);
var names = [this.fullname, this.givname + ' ' + this.famname, this.famname + ' ' + this.givname, this.famname + ', ' + this.givname];
if(this.data.ORG) {
names[names.length]=this.data.ORG[0].value;
}
$.each(names, function(key, value) {
$('#fn_select')
.append($('<option></option>')
@ -652,8 +655,8 @@ Contacts={
var checksum = container.data('checksum');
var name = container.data('element');
console.log('saveProperty: ' + name);
var fields = container.find('input[class*="contacts_property"],select[class*="contacts_property"]').serializeArray();
var q = container.find('input[class*="contacts_property"],select[class*="contacts_property"]').serialize();
var fields = container.find('input.contacts_property,select.contacts_property').serializeArray();
var q = container.find('input.contacts_property,select.contacts_property').serialize();
if(q == '' || q == undefined) {
console.log('Couldn\'t serialize elements.');
Contacts.UI.loading(container, false);
@ -863,7 +866,7 @@ Contacts={
},
loadAddresses:function(){
$('#addresses').hide();
$('#addressdisplay dl[class*="propertycontainer"]').remove();
$('#addressdisplay dl.propertycontainer').remove();
for(var adr in this.data.ADR) {
$('#addressdisplay dl').first().clone().insertAfter($('#addressdisplay dl').last()).show();
$('#addressdisplay dl').last().removeClass('template').addClass('propertycontainer');
@ -1079,15 +1082,15 @@ Contacts={
},
addMail:function() {
//alert('addMail');
$('#emaillist li[class*="template"]:first-child').clone().appendTo($('#emaillist')).show();
$('#emaillist li[class*="template"]:last-child').removeClass('template').addClass('propertycontainer');
$('#emaillist li.template:first-child').clone().appendTo($('#emaillist')).show();
$('#emaillist li.template:last-child').removeClass('template').addClass('propertycontainer');
$('#emaillist li:last-child').find('input[type="email"]').focus();
Contacts.UI.loadListHandlers();
return false;
},
loadMails:function() {
$('#emails').hide();
$('#emaillist li[class*="propertycontainer"]').remove();
$('#emaillist li.propertycontainer').remove();
for(var mail in this.data.EMAIL) {
this.addMail();
//$('#emaillist li:first-child').clone().appendTo($('#emaillist')).show();
@ -1109,9 +1112,9 @@ Contacts={
return false;
},
addPhone:function() {
$('#phonelist li[class*="template"]:first-child').clone().appendTo($('#phonelist')); //.show();
$('#phonelist li[class*="template"]:last-child').find('select').addClass('contacts_property');
$('#phonelist li[class*="template"]:last-child').removeClass('template').addClass('propertycontainer');
$('#phonelist li.template:first-child').clone().appendTo($('#phonelist')); //.show();
$('#phonelist li.template:last-child').find('select').addClass('contacts_property');
$('#phonelist li.template:last-child').removeClass('template').addClass('propertycontainer');
$('#phonelist li:last-child').find('input[type="text"]').focus();
Contacts.UI.loadListHandlers();
$('#phonelist li:last-child').find('select').multiselect({
@ -1125,7 +1128,7 @@ Contacts={
},
loadPhones:function() {
$('#phones').hide();
$('#phonelist li[class*="propertycontainer"]').remove();
$('#phonelist li.propertycontainer').remove();
for(var phone in this.data.TEL) {
this.addPhone();
$('#phonelist li:last-child').find('select').multiselect('destroy');

@ -94,7 +94,7 @@ class OC_Contacts_App {
OC_Log::write('contacts','getContactVCard, found FN field: '.$vcard->__get('FN'), OC_Log::DEBUG);
$n = implode(';', array_reverse(array_slice(explode(' ', $vcard->__get('FN')), 0, 2))).';;;';
$vcard->setString('N', $n);
OC_Contacts_VCard::edit( $id, $vcard->serialize());
OC_Contacts_VCard::edit( $id, $vcard);
} else { // Else just add an empty 'N' field :-P
$vcard->setString('N', 'Unknown;Name;;;');
}

@ -175,6 +175,9 @@ class OC_Contacts_VCard{
if($property->name == 'UID'){
$uid = $property->value;
}
if($property->name == 'ORG'){
$org = $property->value;
}
if($property->name == 'EMAIL' && is_null($email)){ // only use the first email as substitute for missing N or FN.
$email = $property->value;
}
@ -185,6 +188,8 @@ class OC_Contacts_VCard{
$fn = join(' ', array_reverse(array_slice(explode(';', $n), 0, 2)));
} elseif($email) {
$fn = $email;
} elseif($org) {
$fn = $org;
} else {
$fn = 'Unknown Name';
}
@ -218,32 +223,37 @@ class OC_Contacts_VCard{
/**
* @brief Adds a card
* @param integer $id Addressbook id
* @param string $data vCard file
* @return insertid on success or null if card is not parseable.
* @param integer $aid Addressbook id
* @param OC_VObject $card vCard file
* @param string $uri the uri of the card, default based on the UID
* @return insertid on success or null if no card.
*/
public static function add($id,$data){
$fn = null;
public static function add($aid, $card, $uri=null){
if(is_null($card)){
OC_Log::write('contacts','OC_Contacts_VCard::add. No vCard supplied', OC_Log::ERROR);
return null;
};
$card = OC_VObject::parse($data);
if(!is_null($card)){
OC_Contacts_App::$categories->loadFromVObject($card);
self::updateValuesFromAdd($card);
$data = $card->serialize();
}
else{
OC_Log::write('contacts','OC_Contacts_VCard::add. Error parsing VCard: '.$data,OC_Log::ERROR);
return null; // Ditch cards that can't be parsed by Sabre.
};
$fn = $card->getAsString('FN');
if (empty($fn)) {
$fn = null;
}
if (!$uri) {
$uid = $card->getAsString('UID');
$uri = $uid.'.vcf';
}
$data = $card->serialize();
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*contacts_cards (addressbookid,fullname,carddata,uri,lastmodified) VALUES(?,?,?,?,?)' );
$result = $stmt->execute(array($id,$fn,$data,$uri,time()));
$result = $stmt->execute(array($aid,$fn,$data,$uri,time()));
$newid = OC_DB::insertid('*PREFIX*contacts_cards');
OC_Contacts_Addressbook::touch($id);
OC_Contacts_Addressbook::touch($aid);
return $newid;
}
@ -257,23 +267,7 @@ class OC_Contacts_VCard{
*/
public static function addFromDAVData($id,$uri,$data){
$card = OC_VObject::parse($data);
if(!is_null($card)){
OC_Contacts_App::$categories->loadFromVObject($card);
self::updateValuesFromAdd($card);
$data = $card->serialize();
} else {
OC_Log::write('contacts','OC_Contacts_VCard::addFromDAVData. Error parsing VCard: '.$data, OC_Log::ERROR);
return null; // Ditch cards that can't be parsed by Sabre.
};
$fn = $card->getAsString('FN');
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*contacts_cards (addressbookid,fullname,carddata,uri,lastmodified) VALUES(?,?,?,?,?)' );
$result = $stmt->execute(array($id,$fn,$data,$uri,time()));
$newid = OC_DB::insertid('*PREFIX*contacts_cards');
OC_Contacts_Addressbook::touch($id);
return $newid;
return self::add($id, $data, $uri);
}
/**
@ -302,29 +296,25 @@ class OC_Contacts_VCard{
/**
* @brief edits a card
* @param integer $id id of card
* @param string $data vCard file
* @param OC_VObject $card vCard file
* @return boolean
*/
public static function edit($id, $data){
public static function edit($id, OC_VObject $card){
$oldcard = self::find($id);
$fn = null;
$card = OC_VObject::parse($data);
if(!is_null($card)){
OC_Contacts_App::$categories->loadFromVObject($card);
foreach($card->children as $property){
if($property->name == 'FN'){
$fn = $property->value;
break;
}
}
} else {
if(is_null($card)) {
return false;
}
$fn = $card->getAsString('FN');
if (empty($fn)) {
$fn = null;
}
$now = new DateTime;
$card->setString('REV', $now->format(DateTime::W3C));
$data = $card->serialize();
$data = $card->serialize();
$stmt = OC_DB::prepare( 'UPDATE *PREFIX*contacts_cards SET fullname = ?,carddata = ?, lastmodified = ? WHERE id = ?' );
$result = $stmt->execute(array($fn,$data,time(),$id));
@ -342,28 +332,8 @@ class OC_Contacts_VCard{
*/
public static function editFromDAVData($aid,$uri,$data){
$oldcard = self::findWhereDAVDataIs($aid,$uri);
$fn = null;
$card = OC_VObject::parse($data);
if(!is_null($card)){
OC_Contacts_App::$categories->loadFromVObject($card);
foreach($card->children as $property){
if($property->name == 'FN'){
$fn = $property->value;
break;
}
}
}
$now = new DateTime;
$card->setString('REV', $now->format(DateTime::W3C));
$data = $card->serialize();
$stmt = OC_DB::prepare( 'UPDATE *PREFIX*contacts_cards SET fullname = ?,carddata = ?, lastmodified = ? WHERE id = ?' );
$result = $stmt->execute(array($fn,$data,time(),$oldcard['id']));
OC_Contacts_Addressbook::touch($oldcard['addressbookid']);
return true;
return self::edit($oldcard['id'], $card);
}
/**
@ -379,14 +349,6 @@ class OC_Contacts_VCard{
return true;
}
/**
* @brief Creates a UID
* @return string
*/
public static function createUID(){
return substr(md5(rand().time()),0,10);
}
/**
* @brief deletes a card with the data provided by sabredav
* @param integer $aid Addressbook id

@ -3,7 +3,7 @@ $id = $_['id'];
$wattr = isset($_['width'])?'width="'.$_['width'].'"':'';
$hattr = isset($_['height'])?'height="'.$_['height'].'"':'';
?>
<img class="loading" id="contacts_details_photo" <?php echo $wattr; ?> <?php echo $hattr; ?> src="<?php echo OC_Helper::linkToAbsolute('contacts', 'photo.php'); ?>?id=<?php echo $id; ?>&amp;refresh=<?php echo rand(); ?>" />
<img class="loading" id="contacts_details_photo" <?php echo $wattr; ?> <?php echo $hattr; ?> src="<?php echo OC_Helper::linkToAbsolute('contacts', 'photo.php'); ?>?id=<?php echo $id; ?>" />
<progress id="contacts_details_photo_progress" style="display:none;" value="0" max="100">0 %</progress>

@ -60,7 +60,7 @@ input[type="submit"].highlight{ background:#ffc100; border:1px solid #db0; text-
#leftcontent, .leftcontent { position:fixed; overflow: auto; top:6.4em; width:20em; background:#f8f8f8; border-right:1px solid #ddd; }
#leftcontent li, .leftcontent li { background:#f8f8f8; padding:.3em .8em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; -webkit-transition:background-color 500ms; -moz-transition:background-color 500ms; -o-transition:background-color 500ms; transition:background-color 500ms; }
#leftcontent li:hover, #leftcontent li:active, #leftcontent li.active, .leftcontent li:hover, .leftcontent li:active, .leftcontent li.active { background:#eee; }
#rightcontent, .rightcontent { position:fixed; top: 6.4em; left: 32.5em; }
#rightcontent, .rightcontent { position:fixed; top: 6.4em; left: 32.5em; overflow: auto }
/* LOG IN & INSTALLATION ------------------------------------------------------------ */

@ -6,15 +6,35 @@ require_once('../../lib/base.php');
OC_JSON::checkLoggedIn();
// Get the params
$dir = isset( $_GET['dir'] ) ? stripslashes($_GET['dir']) : '';
$filename = isset( $_GET['filename'] ) ? stripslashes($_GET['filename']) : '';
$content = isset( $_GET['content'] ) ? $_GET['content'] : '';
$dir = isset( $_POST['dir'] ) ? stripslashes($_POST['dir']) : '';
$filename = isset( $_POST['filename'] ) ? stripslashes($_POST['filename']) : '';
$content = isset( $_POST['content'] ) ? $_POST['content'] : '';
$source = isset( $_POST['source'] ) ? stripslashes($_POST['source']) : '';
if($filename == '') {
OC_JSON::error(array("data" => array( "message" => "Empty Filename" )));
exit();
}
if($source){
if(substr($source,0,8)!='https://' and substr($source,0,7)!='http://'){
OC_JSON::error(array("data" => array( "message" => "Not a valid source" )));
exit();
}
$sourceStream=fopen($source,'rb');
$target=$dir.'/'.$filename;
$result=OC_Filesystem::file_put_contents($target,$sourceStream);
if($result){
$mime=OC_Filesystem::getMimetype($target);
OC_JSON::success(array("data" => array('mime'=>$mime)));
exit();
}else{
OC_JSON::error(array("data" => array( "message" => "Error while downloading ".$source. ' to '.$target )));
exit();
}
}
if(OC_Files::newFile($dir, $filename, 'file')) {
if($content){
OC_Filesystem::file_put_contents($dir.'/'.$filename,$content);

@ -6,8 +6,8 @@ require_once('../../lib/base.php');
OC_JSON::checkLoggedIn();
// Get the params
$dir = isset( $_GET['dir'] ) ? stripslashes($_GET['dir']) : '';
$foldername = isset( $_GET['foldername'] ) ? stripslashes($_GET['foldername']) : '';
$dir = isset( $_POST['dir'] ) ? stripslashes($_POST['dir']) : '';
$foldername = isset( $_POST['foldername'] ) ? stripslashes($_POST['foldername']) : '';
if(trim($foldername) == '') {
OC_JSON::error(array("data" => array( "message" => "Empty Foldername" )));

@ -127,20 +127,6 @@ $(document).ready(function() {
procesSelection();
});
$('#file_newfolder_form').submit(function(event) {
event.preventDefault();
$.ajax({
url: 'ajax/newfolder.php',
data: "dir="+$('#dir').val()+"&foldername="+$('#file_newfolder_name').val(),
complete: function(data){boolOperationFinished(data, function(){
var date=new Date();
FileList.addDir($('#file_newfolder_name').val(),0,date);
$('#file_newfolder_name').val('New Folder');
$('#file_newfolder_name').blur();
});}
});
});
$('#file_newfolder_name').click(function(){
if($('#file_newfolder_name').val() == 'New Folder'){
$('#file_newfolder_name').val('');
@ -312,10 +298,10 @@ $(document).ready(function() {
var name=$(this).val();
switch(type){
case 'file':
$.ajax({
url: OC.filePath('files','ajax','newfile.php'),
data: "dir="+encodeURIComponent($('#dir').val())+"&filename="+encodeURIComponent(name)+'&content=%20%0A',
complete: function(data){boolOperationFinished(data, function(){
$.post(
OC.filePath('files','ajax','newfile.php'),
{dir:$('#dir').val(),filename:name,content:" \n"},
function(data){
var date=new Date();
FileList.addFile(name,0,date);
var tr=$('tr').filterAttr('data-file',name);
@ -323,18 +309,49 @@ $(document).ready(function() {
getMimeIcon('text/plain',function(path){
tr.find('td.filename').attr('style','background-image:url('+path+')');
});
});}
});
}
);
break;
case 'folder':
$.ajax({
url: OC.filePath('files','ajax','newfolder.php'),
data: "dir="+encodeURIComponent($('#dir').val())+"&foldername="+encodeURIComponent(name),
complete: function(data){boolOperationFinished(data, function(){
$.post(
OC.filePath('files','ajax','newfolder.php'),
{dir:$('#dir').val(),foldername:name},
function(data){
var date=new Date();
FileList.addDir(name,0,date);
});}
}
);
break;
case 'web':
if(name.substr(0,8)!='https://' && name.substr(0,7)!='http://'){
name='http://'.name;
}
var localName=name;
if(localName.substr(localName.length-1,1)=='/'){//strip /
localName=localName.substr(0,localName.length-1)
}
if(localName.indexOf('/')){//use last part of url
localName=localName.split('/').pop();
}else{//or the domain
localName=(localName.match(/:\/\/(.[^/]+)/)[1]).replace('www.','');
}
$.post(
OC.filePath('files','ajax','newfile.php'),
{dir:$('#dir').val(),source:name,filename:localName},
function(result){
if(result.status == 'success'){
var date=new Date();
FileList.addFile(localName,0,date);
var tr=$('tr').filterAttr('data-file',localName);
tr.data('mime',result.data.mime);
getMimeIcon(result.data.mime,function(path){
tr.find('td.filename').attr('style','background-image:url('+path+')');
});
}else{
}
}
);
break;
}
var li=$(this).parent();

@ -7,6 +7,7 @@
<ul class="popup popupTop">
<li style="background-image:url('<?php echo mimetype_icon('text/plain') ?>')" data-type='file'><p><?php echo $l->t('Text file');?></p></li>
<li style="background-image:url('<?php echo mimetype_icon('dir') ?>')" data-type='folder'><p><?php echo $l->t('Folder');?></p></li>
<li style="background-image:url('<?php echo image_path('core','actions/public.png') ?>')" data-type='web'><p><?php echo $l->t('From url');?></p></li>
</ul>
</div>
<div class="file_upload_wrapper svg">

Loading…
Cancel
Save