// Foto aus PHP-Temp-Ordner einlesen $user_image_data = fread(fopen($_FILES['userfile']['tmp_name'][0], 'r'), $_FILES['userfile']['size'][0]); // Zwischenspeichern des neuen Fotos in der Session $gCurrentSession->setValue('ses_binary', $user_image_data); $gCurrentSession->save(); } //Image-Objekt löschen $user_image->delete(); if ($getItemId == $gCurrentUser->getValue('inv_id')) { $headline = $gL10n->get('PRO_EDIT_MY_PROFILE_PICTURE'); } else { $headline = $gL10n->get('PRO_EDIT_PROFILE_PIC_FROM', $inventory->getValue('FIRST_NAME'), $inventory->getValue('LAST_NAME')); } // create html page object $page = new HtmlPage($headline); $page->addJavascript('$("#btn_cancel").click(function() { self.location.href=\'' . $g_root_path . '/adm_program/modules/inventory/item_photo_edit.php?mode=dont_save&inv_id=' . $getItemId . '\'; });', true); // show form $form = new HtmlForm('show_new_profile_picture_form', $g_root_path . '/adm_program/modules/inventory/item_photo_edit.php?mode=save&inv_id=' . $getItemId, $page); $form->addCustomContent($gL10n->get('PRO_CURRENT_PICTURE'), '<img class="imageFrame" src="item_photo_show.php?inv_id=' . $getItemId . '" alt="' . $gL10n->get('PRO_CURRENT_PICTURE') . '" />'); $form->addCustomContent($gL10n->get('PRO_NEW_PICTURE'), '<img class="imageFrame" src="item_photo_show.php?inv_id=' . $getItemId . '&new_photo=1" alt="' . $gL10n->get('PRO_NEW_PICTURE') . '" />'); $form->addLine(); $form->openButtonGroup(); $form->addButton('btn_cancel', $gL10n->get('SYS_ABORT'), array('icon' => THEME_PATH . '/icons/error.png')); $form->addSubmitButton('btn_update', $gL10n->get('SYS_APPLY'), array('icon' => THEME_PATH . '/icons/database_in.png')); $form->closeButtonGroup(); // add form to html page and show page $page->addHtml($form->show(false)); $page->show(); }