User picture: Update contact's image attribute with preferences' placeholder so it can be used elsewhere

This commit is contained in:
Molkobain
2021-03-25 12:05:22 +01:00
parent 5d3a829f65
commit ba994c91fc
6 changed files with 116 additions and 8 deletions

View File

@@ -6,6 +6,7 @@
use Combodo\iTop\Controller\AjaxRenderController;
use Combodo\iTop\Controller\Base\Layout\ActivityPanelController;
use Combodo\iTop\Controller\PreferencesController;
use Combodo\iTop\Renderer\Console\ConsoleBlockRenderer;
use Combodo\iTop\Renderer\Console\ConsoleFormRenderer;
@@ -2736,6 +2737,24 @@ EOF
$oPage->add(json_encode($aResult));
break;
//--------------------------------
// Preferences
//--------------------------------
case 'preferences_set_user_picture':
$oPage = new JsonPage();
try {
$aResult = PreferencesController::SetUserPicture();
$aResult['success'] = true;
}
catch (Exception $oException) {
$aResult = [
'success' => false,
'error_message' => $oException->getMessage(),
];
}
$oPage->SetData($aResult);
break;
//--------------------------------
// Activity panel
//--------------------------------