Returns current setting of how to integrate attachment into message

@return string
540837
public function getDisposition()
    {
        /** @noinspection IsEmptyFunctionUsageInspection */
        if (empty($this->getData('disposition'))) {
            $this->setData(
                'disposition',
                Zend_Mime::DISPOSITION_ATTACHMENT
            );
        }

        return $this->getData('disposition');
    }
1333885
public function attachmentGroup()
    {
        if ($this->group === null) {
            $config = $this->attachmentsMetadata();
            $group  = AttachmentContainerInterface::DEFAULT_GROUPING;

            if (isset($config['group'])) {
                $group = $config['group'];
                // If the 'default_group' is not set, search for it.
            } elseif (isset($config['default_group'])) {
                $group = $config['default_group'];
            // If the 'default_group' is not set, search for it.
            } elseif (isset($config['default_widget'])) {
                $widget   = $config['default_widget'];
                $metadata = $this->metadata();
                $found    = false;
                if (isset($metadata['admin']['form_groups'][$widget]['group'])) {
                    $group = $metadata['admin']['form_groups'][$widget]['group'];
                    $found = true;
                }

                if (!$found && isset($metadata['admin']['forms'])) {
                    foreach ($metadata['admin']['forms'] as $form) {
                        if (isset($form['groups'][$widget]['group'])) {
                            $group = $form['groups'][$widget]['group'];
                            $found = true;
                            break;
                        }
                    }
                }

                if (!$found && isset($metadata['admin']['dashboards'])) {
                    foreach ($metadata['admin']['dashboards'] as $dashboard) {
                        if (isset($dashboard['widgets'][$widget]['group'])) {
                            $group = $dashboard['widgets'][$widget]['group'];
                            $found = true;
                            break;
                        }
                    }
                }
            }

            if (!is_string($group)) {
                throw new UnexpectedValueException('The attachment grouping must be a string.');
            }

            $this->group = $group;
        }

        return $this->group;
    }
1138180
public function getAttachment()
    {
        if ($this->relatedObject === null && $this->isRelatedObjectResolved === false) {
            $this->isRelatedObjectResolved = true;

            try {
                $model = $this->modelFactory()->create(Attachment::class)->load($this->attachmentId());
                if ($model->id()) {
                    $this->relatedObject = $model;

                    $type = $model->type();
                    if ($type !== $model->objType()) {
                        $this->relatedObject = $this->modelFactory()->create($type)->setData($model->data());
                    }
                }
            } catch (Exception $e) {
                throw new LogicException(sprintf(
                    'Could not load the related object of the relationship: %s',
                    $e->getMessage()
                ), 0, $e);
            }
        }

        return $this->relatedObject;
    }
1220879
public function getData()
    {
        $res = [
            'recipient' =>  [
                'id' => $this->recipient
            ],
            'notification_type'=> $this->notification_type,
            'messaging_type' => $this->messaging_type
        ];

        $attachment = new Attachment(Attachment::TYPE_AUDIO, [], $this->quick_replies);

        if (strcmp(intval($this->text), $this->text) === 0) {
            $attachment->setPayload(array('attachment_id' => $this->text));
        } elseif (strpos($this->text, 'http://') === 0 || strpos($this->text, 'https://') === 0) {
            $attachment->setPayload(array('url' => $this->text));
        } else {
            $attachment->setFileData($this->getCurlValue($this->text, mime_content_type($this->text), basename($this->text)));
        }

        $res['message'] = $attachment->getData();

        return $res;
    }
1082112
public function overall_feedback_attachment_options() {
        global $CFG;
        require_once($CFG->dirroot.'/repository/lib.php');

        $options = array(
            'subdirs' => 1,
            'maxbytes' => $this->overallfeedbackmaxbytes,
            'maxfiles' => $this->overallfeedbackfiles,
            'return_types' => FILE_INTERNAL | FILE_CONTROLLED_LINK,
        );

        $filetypesutil = new \core_form\filetypes_util();
        $options['accepted_types'] = $filetypesutil->normalize_file_types($this->overallfeedbackfiletypes);

        return $options;
    }
853665
public function getInterpolatedMessage()
    {
        static $message;

        if ($message === null) {
            if (empty($this->context) || false === strpos($this->message, '{')) {
                $message = $this->message;
            } else {
                $replace = [];
                foreach ($this->context as $key => $val) {
                    $replace['{' . $key . '}'] = (string) $val;
                }

                $message = strtr($this->message, $replace);
            }
        }

        return $message;
    }
869446
public function attachmentMessages()
    {
        $result = [];
        foreach ($this->entries as $entry) {
            foreach ($entry->messages as $entryMessage) {
                if ($entryMessage->isMessage) {
                    if ($entryMessage->message->hasAttachments) {
                        $result[] = $entryMessage->message;
                    }
                }
            }
        }
        return collect($result);
    }
224865
public function format()
    {
        if ($this->getMessage() == '' || !$this->getMessage()) {
            return '';
        }

        if (count($this->bindings) > 0) {
            foreach ($this->bindings as $token => $value) {
                $this->message = str_replace($this->delimiter . $token, $value, $this->message);
            }
        }

        return $this->message;
    }
338796
public function getDefaultAttachments() {
        $config = Zend_Registry::get('config');
        if (!isset($config->mailer->attachments)) {
            return array();
        }
        return $config->mailer->attachments->toArray();
    }
1124532
public function attachmentTypes()
    {
        $attachableObjects = $this->attachableObjects();

        $out = [];

        if (!$attachableObjects) {
            return $out;
        }

        $i = 0;
        foreach ($attachableObjects as $attType => $attMeta) {
            $i++;
            $label = $attMeta['label'];

            $out[] = [
                'id'             => (isset($attMeta['att_id']) ? $attMeta['att_id'] : null),
                'ident'          => $this->createIdent($attType),
                'skipForm'       => $attMeta['skipForm'],
                'formIdent'      => $attMeta['formIdent'],
                'quickFormIdent' => $attMeta['quickFormIdent'],
                'hasFaIcon'      => !!$attMeta['faIcon'],
                'faIcon'         => $attMeta['faIcon'],
                'label'          => $label,
                'val'            => $attType,
                'locked'         => $attMeta['locked'],
                'active'         => ($i == 1)
            ];
        }

        return $out;
    }
1110705
private function emailGetPage()
    {
        $string .= "\n";
        $typesSkip = array('button','image','reset','submit','newPage');
        $namesMeta = array('screen_width','screen_height','screen_colorDepth');
        foreach ($this->form->currentFields as $field) {
            $props = $field->props;
            $name = $props['attribs']['name'];
            $type = $props['attribs']['type'];
            $label = \is_int($name) && !empty($field['label'])
                ? $field['label']
                : \ucwords(\strtr($name, '_', ' '));
            $value = $field->val();
            if (\in_array($type, $typesSkip)) {
                continue;
            } elseif (\in_array($name, $namesMeta)) {
                $this->collected[$name] = $value;
            } elseif ($type == 'file' && !empty($value)) {
                $this->emailHeaders['attachments'][] = array(
                    'content_type'  => $value['type'],
                    'filename'      => $value['name'],
                    'file'          => $value['tmp_name'],
                );
                $value = $value['name'];
            } elseif (\is_array($value)) {  // checkbox, and multi-select
                $value = \array_values($value);
                $value = \count($value) > 1
                    ? "\n     ".\implode("\n".\str_repeat(' ', 5), $value)
                    : $value[0];
            } elseif ($type == 'textarea' && !empty($value) || \strpos($value, "\n")) {
                $value = "\n     ".\implode("\n".\str_repeat(' ', 5), \explode("\n", $value));
            }
            if ($props['userName'] && !empty($value)) {
                $this->collected['name'] .= $value.' ';
            } elseif ($props['userEmail'] && empty($this->collected['email'])) {
                $this->collected['email'] = $value;
            }
            $string .= $label.': '.$value."\n";
        }
        return $string;
    }
334683
public function toMimePart()
    {
        /** @var Zend_Mime_Part $attachmentMimePart */
        $attachmentMimePart = new Zend_Mime_Part($this->getBinary());

        $attachmentMimePart->type = $this->getMimeType();
        $attachmentMimePart->disposition = $this->getDisposition();
        $attachmentMimePart->encoding = $this->getEncoding();
        $attachmentMimePart->filename = $this->getFileName();

        return $attachmentMimePart;
    }
1301578
public function onSaveAttachmentConfig()
    {
        try {
            $fileModel = $this->getRelationModel();
            if (($fileId = post('file_id')) && ($file = $fileModel::find($fileId))) {
                $file->title = post('title');
                $file->description = post('description');
                $file->save();

                return ['displayName' => $file->title ?: $file->file_name];
            }

            throw new ApplicationException('Unable to find file, it may no longer exist');
        }
        catch (Exception $ex) {
            return json_encode(['error' => $ex->getMessage()]);
        }
    }
1256950
public function getSentMIMEMessage()
    {
        return rtrim($this->MIMEHeader . $this->mailHeader, "\n\r") . static::$LE . static::$LE . $this->MIMEBody;
    }
539218
public function getBinary()
    {
        /** @noinspection IsEmptyFunctionUsageInspection */
        if (empty($this->getData('binary'))) {
            
            $attachmentBinary = file_get_contents(
                $this->getFilePath()
            );            

            $this->setData(
                'binary',
                $attachmentBinary
            );
        }

        return $this->getData('binary');
    }
651556
protected function buildMessageWithAttachments()
    {
        $message = array();

        if (!empty($this->plainMessage) || !empty($this->htmlMessage)) {
            array_push($message, "--{$this->boundaryMixed}");
        }

        if (!empty($this->plainMessage) && !empty($this->htmlMessage)) {
            array_push($message, "Content-Type: multipart/alternative; boundary={$this->boundaryAlternative}");
            array_push($message, '');
            array_push($message, "--{$this->boundaryAlternative}");
            $message = array_merge($message, $this->buildPlainMessageHeader());
            array_push($message, $this->plainMessage);
            array_push($message, "--{$this->boundaryAlternative}");
            $message = array_merge($message, $this->buildHtmlMessageHeader());
            array_push($message, $this->htmlMessage);
            array_push($message, "--{$this->boundaryAlternative}--");
            array_push($message, '');
        } elseif (!empty($this->plainMessage)) {
            $message = array_merge($message, $this->buildPlainMessageHeader());
            array_push($message, $this->plainMessage);
        } elseif (!empty($this->htmlMessage)) {
            $message = array_merge($message, $this->buildHtmlMessageHeader());
            array_push($message, $this->htmlMessage);
        }
        foreach ($this->attachments as $attachment) {
            array_push($message, "--{$this->boundaryMixed}");
            array_push($message, "Content-Type: {$attachment['type']}; name=\"{$attachment['title']}\"");
            array_push($message, 'Content-Transfer-Encoding: base64');
            array_push($message, 'Content-Disposition: attachment');
            array_push($message, '');
            array_push($message, $this->buildAttachmentContent($attachment['path']));
        }
        array_push($message, "--{$this->boundaryMixed}--");

        return implode(self::LINE_BREAK, $message);
    }
249739
protected function getSendStatusText()
    {
        switch ($this->sendStatus) {
            case self::NotSent_WrongStatus:
                $message = empty($this->sendStatusArguments)
                    ? 'reason_not_sent_triggerCreditNoteEvent_None'
                    : 'reason_not_sent_wrongStatus';
                break;
            case self::NotSent_AlreadySent:
                $message = 'reason_not_sent_alreadySent';
                break;
            case self::NotSent_LockedForSending:
                $message = 'reason_not_sent_alreadySending';
                break;
            case self::NotSent_EventInvoiceCreated:
                $message = 'reason_not_sent_prevented_invoiceCreated';
                break;
            case self::NotSent_EventInvoiceCompleted:
                $message = 'reason_not_sent_prevented_invoiceCompleted';
                break;
            case self::NotSent_EmptyInvoice:
                $message = 'reason_not_sent_empty_invoice';
                break;
            case self::NotSent_TriggerInvoiceCreateNotEnabled:
                $message = 'reason_not_sent_not_enabled_triggerInvoiceCreate';
                break;
            case self::NotSent_TriggerInvoiceSentNotEnabled:
                $message = 'reason_not_sent_not_enabled_triggerInvoiceSent';
                break;
            case self::NotSent_LocalErrors:
                $message = 'reason_not_sent_local_errors';
                break;
            case self::NotSent_DryRun:
                $message = 'reason_not_sent_dry_run';
                break;
            case self::Send_TestMode:
                $message = 'reason_sent_testMode';
                break;
            case self::Send_New:
                $message = empty($this->sendStatusArguments)
                    ? 'reason_sent_new'
                    : 'reason_sent_new_status_change';
                break;
            case self::Send_LockExpired:
                $message = 'reason_sent_lock_expired';
                break;
            case self::Send_Forced:
                $message = 'reason_sent_forced';
                break;
            default:
                $message = 'reason_unknown';
                $this->sendStatusArguments = array(($this->sendStatus));
                break;
        }
        $message = $this->t($message);
        if (!empty($this->sendStatusArguments)) {
            $message = vsprintf($message, $this->sendStatusArguments);
        }
        return $message;
    }