Skip to content
Snippets Groups Projects

Issue #3231972: QR Custom Logo

4 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
45 45 * Make a QR image in JPEG format.
46 46 */
47 47 public function image($content) {
48 return new QRImageResponse($content, $this->getLogoWidth(), $this->getLogoSize(), $this->getLogoMargin());
48 return new QRImageResponse($content, $this->getLogoWidth(), $this->getLogoSize(), $this->getLogoMargin(), $this->getLogoImage());
49 49 }
  • Harsh Behl
    Harsh Behl @pen started a thread on the diff
  • 107 $config = $this->config('endroid_qr_code.settings');
    57 108 $values = $form_state->getValues();
    58 $this->config('endroid_qr_code.settings')
    59 ->set('logo_width', (int) $values['logo_width'])
    109
    110
    111 $config
    60 112 ->set('set_size', (int) $values['set_size'])
    61 113 ->set('set_margin', (int) $values['set_margin'])
    114 ->set('logo_image_style', (string) $values['style'])
    115 ->set('logo_width', (int) $values['width'])
    62 116 ->save();
    117
    118
    119 // If active, then let's go ahead and update.
    120 if(!empty($form_state->getValue('logo_image'))){
  • Harsh Behl
    Harsh Behl @pen started a thread on the diff
  • 58 $this->config('endroid_qr_code.settings')
    59 ->set('logo_width', (int) $values['logo_width'])
    109
    110
    111 $config
    60 112 ->set('set_size', (int) $values['set_size'])
    61 113 ->set('set_margin', (int) $values['set_margin'])
    114 ->set('logo_image_style', (string) $values['style'])
    115 ->set('logo_width', (int) $values['width'])
    62 116 ->save();
    117
    118
    119 // If active, then let's go ahead and update.
    120 if(!empty($form_state->getValue('logo_image'))){
    121 // Get array of logo_image, get first value
    122 $fid_imagelogo = $form_state->getValue('logo_image')[0];
  • Harsh Behl
    Harsh Behl @pen started a thread on the diff
  • 118
    119 // If active, then let's go ahead and update.
    120 if(!empty($form_state->getValue('logo_image'))){
    121 // Get array of logo_image, get first value
    122 $fid_imagelogo = $form_state->getValue('logo_image')[0];
    123
    124 // If File ID is identical, go through
    125 if ($fid_imagelogo != $config->get('logo_image')) {
    126 if (!empty($fid_imagelogo)) {
    127 $file = File::load($fid_imagelogo);
    128 $file->setPermanent();
    129 $file->save;
    130 }
    131 }
    132
    133 $config->set('logo_image', $values['logo_image'][0])->save();
    Please register or sign in to reply
    Loading