]> git.mxchange.org Git - friendica.git/blobdiff - mod/profiles.php
Merge branch 'pull'
[friendica.git] / mod / profiles.php
index 4802f21aae51e5cbed60fc793b1892be22ab759b..b269fa30c716f9fd68abf30f629aa4fb8fdf588a 100644 (file)
@@ -130,7 +130,6 @@ function profiles_post(&$a) {
                $education = escape_tags(trim($_POST['education']));
                $hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0);
 
-
                $r = q("UPDATE `profile` 
                        SET `profile-name` = '%s',
                        `name` = '%s',
@@ -196,7 +195,7 @@ function profiles_post(&$a) {
                );
 
                if($r)
-                       notice( t('Profile updated.') . EOL);
+                       info( t('Profile updated.') . EOL);
 
 
                if($namechanged && $is_default) {
@@ -251,7 +250,7 @@ function profiles_content(&$a) {
                        intval(local_user())
                );
                if($r)
-                       notice( t('Profile deleted.') . EOL);
+                       info( t('Profile deleted.') . EOL);
 
                goaway($a->get_baseurl() . '/profiles');
                return; // NOTREACHED
@@ -286,7 +285,7 @@ function profiles_content(&$a) {
                        dbesc($name)
                );
 
-               notice( t('New profile created.') . EOL);
+               info( t('New profile created.') . EOL);
                if(count($r3) == 1)
                        goaway($a->get_baseurl() . '/profiles/' . $r3[0]['id']);
                goaway($a->get_baseurl() . '/profiles');
@@ -325,7 +324,7 @@ function profiles_content(&$a) {
                        intval(local_user()),
                        dbesc($name)
                );
-               notice( t('New profile created.') . EOL);
+               info( t('New profile created.') . EOL);
                if(count($r3) == 1)
                        goaway($a->get_baseurl() . '/profiles/' . $r3[0]['id']);
        goaway($a->get_baseurl() . '/profiles');
@@ -347,11 +346,11 @@ function profiles_content(&$a) {
 
                require_once('include/profile_selectors.php');
 
-               $tpl = load_view_file('view/profed_head.tpl');
+               $tpl = get_markup_template('profed_head.tpl');
 
-               $opt_tpl = load_view_file("view/profile-hide-friends.tpl");
+               $opt_tpl = get_markup_template("profile-hide-friends.tpl");
                $hide_friends = replace_macros($opt_tpl,array(
-                       '$desc' => t('Hide my contact/friend list from viewers of this profile?'),
+                       '$desc' => t('Hide your contact/friend list from viewers of this profile?'),
                        '$yes_str' => t('Yes'),
                        '$no_str' => t('No'),
                        '$yes_selected' => (($r[0]['hide-friends']) ? " checked=\"checked\" " : ""),
@@ -362,9 +361,12 @@ function profiles_content(&$a) {
                $a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl()));
                $a->page['htmlhead'] .= "<script type=\"text/javascript\" src=\"include/country.js\" ></script>";
 
+               $f = get_config('system','birthday_input_format');
+               if(! $f)
+                       $f = 'ymd';
 
                $is_default = (($r[0]['is-default']) ? 1 : 0);
-               $tpl = load_view_file("view/profile_edit.tpl");
+               $tpl = get_markup_template("profile_edit.tpl");
                $o .= replace_macros($tpl,array(
                        '$banner' => t('Edit Profile Details'),
                        '$submit' => t('Submit'),
@@ -376,7 +378,7 @@ function profiles_content(&$a) {
                        '$lbl_fullname' => t('Your Full Name:'),
                        '$lbl_title' => t('Title/Description:'),
                        '$lbl_gender' => t('Your Gender:'),
-                       '$lbl_bd' => t("Birthday \x28y/m/d\x29:"),
+                       '$lbl_bd' => sprintf( t("Birthday \x28%s\x29:"),datesel_format($f)),
                        '$lbl_address' => t('Street Address:'),
                        '$lbl_city' => t('Locality/City:'),
                        '$lbl_zip' => t('Postal/Zip Code:'),
@@ -451,7 +453,7 @@ function profiles_content(&$a) {
                        local_user());
                if(count($r)) {
 
-                       $tpl_header = load_view_file('view/profile_listing_header.tpl');
+                       $tpl_header = get_markup_template('profile_listing_header.tpl');
                        $o .= replace_macros($tpl_header,array(
                                '$header' => t('Profiles'),
                                '$chg_photo' => t('Change profile photo'),
@@ -459,20 +461,20 @@ function profiles_content(&$a) {
                        ));
 
 
-                       $tpl_default = load_view_file('view/profile_entry_default.tpl');
-                       $tpl = load_view_file('view/profile_entry.tpl');
+                       $tpl = get_markup_template('profile_entry.tpl');
 
                        foreach($r as $rr) {
-                               $template = (($rr['is-default']) ? $tpl_default : $tpl);
-                               $o .= replace_macros($template, array(
+                               $o .= replace_macros($tpl, array(
                                        '$photo' => $rr['thumb'],
                                        '$id' => $rr['id'],
                                        '$alt' => t('Profile Image'),
-                                       '$profile_name' => $rr['profile-name']
+                                       '$profile_name' => $rr['profile-name'],
+                                       '$visible' => (($rr['is-default']) ? '<strong>' . t('visible to everybody') . '</strong>' 
+                                               : '<a href="' . $a->get_baseurl() . '/profperm/' . $rr['id'] . '" />' . t('Edit visibility') . '</a>')
                                ));
                        }
                }
                return $o;
        }
 
-}
\ No newline at end of file
+}