Merge branch 'master' into trinidad

This commit is contained in:
friendica
2014-12-30 15:25:06 -08:00
1036 changed files with 499153 additions and 534 deletions

View File

@@ -342,6 +342,7 @@ class RedBrowser extends DAV\Browser\Plugin {
'application/octet-stream' => 'icon-file-alt',
//Text
'text/plain' => 'icon-file-text-alt',
'application/msword' => 'icon-file-text-alt',
'application/pdf' => 'icon-file-text-alt',
'application/vnd.oasis.opendocument.text' => 'icon-file-text-alt',
@@ -365,6 +366,11 @@ class RedBrowser extends DAV\Browser\Plugin {
'audio/mpeg' => 'icon-music',
'audio/wav' => 'icon-music',
'application/ogg' => 'icon-music',
//Video
'video/quicktime' => 'icon-film',
);
$iconFromType = 'icon-file-alt';

View File

@@ -717,7 +717,7 @@ function attach_change_permissions($channel_id, $resource, $allow_cid, $allow_gi
);
if($r) {
foreach($r as $rr) {
attach_change_permissions($channel_id, $resource, $allow_cid, $allow_gid, $deny_cid, $deny_gid, $recurse);
attach_change_permissions($channel_id, $rr['hash'], $allow_cid, $allow_gid, $deny_cid, $deny_gid, $recurse);
}
}
}

View File

@@ -357,9 +357,21 @@ function notification($params) {
// create notification entry in DB
$seen = 0;
$r = q("insert into notify (hash,name,url,photo,date,aid,uid,link,parent,type,verb,otype)
values('%s','%s','%s','%s','%s',%d,%d,'%s','%s',%d,'%s','%s')",
// Mark some notifications as seen right away
// Note! The notification have to be created, because they are used to send emails
// So easiest solution to hide them from Notices is to mark them as seen right away.
// Another option would be to not add them to the DB, and change how emails are handled (probably would be better that way)
$always_show_in_notices = get_pconfig($recip['channel_id'],'system','always_show_in_notices');
if(!$always_show_in_notices) {
if(($params['type'] == NOTIFY_WALL) || ($params['type'] == NOTIFY_MAIL) || ($params['type'] == NOTIFY_INTRO)) {
$seen = 1;
}
}
$r = q("insert into notify (hash,name,url,photo,date,aid,uid,link,parent,seen,type,verb,otype)
values('%s','%s','%s','%s','%s',%d,%d,'%s','%s',%d,%d,'%s','%s')",
dbesc($datarray['hash']),
dbesc($datarray['name']),
dbesc($datarray['url']),
@@ -369,6 +381,7 @@ function notification($params) {
intval($datarray['uid']),
dbesc($datarray['link']),
dbesc($datarray['parent']),
intval($seen),
intval($datarray['type']),
dbesc($datarray['verb']),
dbesc($datarray['otype'])

View File

@@ -856,7 +856,8 @@ function profile_sidebar($profile, $block = 0, $show_connect = true) {
);
if(feature_enabled(local_user(),'multi_profiles')) {
$multi_profiles = feature_enabled(local_user(), 'multi_profiles');
if($multi_profiles) {
$profile['edit'] = array($a->get_baseurl(). '/profiles', t('Profiles'),"", t('Manage/edit profiles'));
$profile['menu']['cr_new'] = t('Create New Profile');
}
@@ -869,6 +870,8 @@ function profile_sidebar($profile, $block = 0, $show_connect = true) {
if($r) {
foreach($r as $rr) {
if(!($multi_profiles || $rr['is_default']))
continue;
$profile['menu']['entries'][] = array(
'photo' => $rr['thumb'],
'id' => $rr['id'],

View File

@@ -250,8 +250,7 @@ function detect_language($s) {
* By default we use the localized language name. You can switch the result
* to any language with the optional 2nd parameter $l.
*
* $s and $l can be in any format that PHP's Locale understands. We will mostly
* use the 2-letter ISO 639-1 (en, de, fr) format.
* $s and $l should be in 2-letter ISO 639-1 format
*
* If nothing could be looked up it returns $s.
*
@@ -259,11 +258,30 @@ function detect_language($s) {
* @param $l (optional) In which language to return the name
* @return string with the language name, or $s if unrecognized
*/
require_once(__DIR__ . '/../library/intl/vendor/autoload.php');
use CommerceGuys\Intl\Language\LanguageRepository;
function get_language_name($s, $l = null) {
if($l === null)
$l = $s;
// get() expects the second part to be in upper case
if(strpos($s,'-') !== false) $s = substr($s,0,2) . strtoupper(substr($s,2));
if($l !== null && strpos($l,'-') !== false) $l = substr($l,0,2) . strtoupper(substr($l,2));
logger('get_language_name: for ' . $s . ' in ' . $l . ' returns: ' . Locale::getDisplayLanguage($s, $l), LOGGER_DEBUG);
return Locale::getDisplayLanguage($s, $l);
$languageRepository = new LanguageRepository;
// Sometimes intl doesn't like the second part at all ...
try {
$language = $languageRepository->get($s, $l);
}
catch(CommerceGuys\Intl\Exception\UnknownLanguageException $e) {
$s = substr($s,0,2);
if($l !== null) $l = substr($s,0,2);
try {
$language = $languageRepository->get($s, $l);
}
catch(CommerceGuys\Intl\Exception\UnknownLanguageException $e) {
return $s; // Give up
}
}
return $language->getName();
}

View File

@@ -1629,7 +1629,7 @@ function lang_selector() {
$ll = substr($l,5);
$ll = substr($ll,0,strrpos($ll,'/'));
$selected = (($ll === $a->language && (x($_SESSION, 'language'))) ? $ll : $selected);
$lang_options[$ll]=$ll;
$lang_options[$ll] = get_language_name($ll, $ll) . " ($ll)";
}
}