function get_event_strings() {
// First day of the week (0 = Sunday).
- $firstDay = PConfig::get(local_user(), 'system', 'first_day_of_week');
- if ($firstDay === false) {
- $firstDay = 0;
- }
+ $firstDay = PConfig::get(local_user(), 'system', 'first_day_of_week', 0);
$i18n = array(
"firstDay" => $firstDay,
$o = '';
$a = get_app();
- $shown = PConfig::get($a->profile['uid'],'system','display_friend_count');
- if ($shown === false) {
- $shown = 24;
- }
+ $shown = PConfig::get($a->profile['uid'],'system','display_friend_count', 24);
if ($shown == 0) {
return;
}
// $file_old - categories previously associated with an item
// $file_new - new list of categories for an item
- if (! intval($uid))
+ if (!intval($uid)) {
return false;
-
- if ($file_old == $file_new)
+ }
+ if ($file_old == $file_new) {
return true;
+ }
$saved = PConfig::get($uid,'system','filetags');
if (strlen($saved)) {
$lbracket = '[';
$rbracket = ']';
$termtype = TERM_FILE;
- }
- else {
+ } else {
$lbracket = '<';
$rbracket = '>';
$termtype = TERM_CATEGORY;
if (DBM::is_result($r)) {
unset($deleted_tags[$key]);
- }
- else {
+ } else {
$filetags_updated = str_replace($lbracket . file_tag_encode($tag) . $rbracket,'',$filetags_updated);
}
}
PConfig::set($uid, 'system', 'filetags', $filetags_updated);
}
return true;
+ } elseif (strlen($file_new)) {
+ PConfig::set($uid, 'system', 'filetags', $file_new);
}
- else
- if (strlen($file_new)) {
- PConfig::set($uid, 'system', 'filetags', $file_new);
- }
- return true;
+ return true;
}
function file_tag_save_file($uid, $item, $file) {