diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-02-25 13:01:23 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-02-25 13:01:23 +0100 |
commit | 673cf8d35e224fcbbc0caef5e638c08bc3914feb (patch) | |
tree | 6056bbadaf19fb8eefbf47003fed1e6bcea36c09 /Zotlabs/Module | |
parent | fed61c082c8f9d6a7673125bd365d44d4b409fa4 (diff) | |
parent | d406e2aae20f20a7df6fc77d9317323de043c0f6 (diff) | |
download | volse-hubzilla-673cf8d35e224fcbbc0caef5e638c08bc3914feb.tar.gz volse-hubzilla-673cf8d35e224fcbbc0caef5e638c08bc3914feb.tar.bz2 volse-hubzilla-673cf8d35e224fcbbc0caef5e638c08bc3914feb.zip |
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Profile_photo.php | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/Zotlabs/Module/Profile_photo.php b/Zotlabs/Module/Profile_photo.php index c772f0ed3..44b7c18c6 100644 --- a/Zotlabs/Module/Profile_photo.php +++ b/Zotlabs/Module/Profile_photo.php @@ -304,7 +304,7 @@ class Profile_photo extends \Zotlabs\Web\Controller { } $channel = \App::get_channel(); - + $pf = 0; $newuser = false; if(argc() == 2 && argv(1) === 'new') @@ -318,8 +318,8 @@ class Profile_photo extends \Zotlabs\Web\Controller { $resource_id = argv(2); - // When using an existing photo, we don't have a dialogue to offer a choice of profiles, - // so it gets attached to the default + + $pf = (($_REQUEST['pf']) ? intval($_REQUEST['pf']) : 0); $c = q("select id, is_default from profile where uid = %d", intval(local_channel()) @@ -331,6 +331,9 @@ class Profile_photo extends \Zotlabs\Web\Controller { $_REQUEST['profile'] = $c[0]['id']; $multi_profiles = false; } + else { + $_REQUEST['profile'] = $pf; + } $r = q("SELECT id, album, imgscale FROM photo WHERE uid = %d AND resource_id = '%s' ORDER BY imgscale ASC", intval(local_channel()), @@ -430,6 +433,16 @@ class Profile_photo extends \Zotlabs\Web\Controller { intval(local_channel()) ); + if($profiles) { + for($x = 0; $x < count($profiles); $x ++) { + $profiles[$x]['selected'] = false; + if($pf && $profiles[$x]['id'] == $pf) + $profiles[$x]['selected'] = true; + if((! $pf) && $profiles[$x]['is_default']) + $profiles[$x]['selected'] = true; + } + } + $importing = ((array_key_exists('importfile',\App::$data)) ? true : false); if(! x(\App::$data,'imagecrop')) { |