adds an endnote

@param string                $noteText
@param PHPRtfLite_Font       $font
@param PHPRtfLite_ParFormat  $parFormat

@return PHPRtfLite_Endnote
435207
public function addEndnote($noteText, PHPRtfLite_Font $font = null, PHPRtfLite_ParFormat $parFormat = null)
    {
        $endnote = new PHPRtfLite_Endnote($this->_rtf, $noteText, $font, $parFormat);
        $this->_elements[] = $endnote;
        return $endnote;
    }
1076315
public function addFontStyle($styleName, $styleFont, $styleParagraph = null) {
		PHPWord_Style::addFontStyle($styleName, $styleFont, $styleParagraph);
	}
253867
public function addText(string $t)
    {
        $t          = trim($t, "\r\n\t");
        $t          = str_replace([
            '<br>',
            '&nbsp;',
        ], [
            "\n",
            ' ',
        ], $t);
        $t          = strip_tags($t);
        $t          = htmlspecialchars_decode($t);
        $this->text .= $t;
    }
325693
function insertFrontpage( $params, $text )
    {
        $this->saveState();
        $closeObject = false;
        if ( $this->FrontpageID == null )
        {
            $this->ezInsertMode(1,1,'before');
            $this->ezNewPage();
            $this->FrontpageID = $this->currentPage;
        }
        else if( $this->currentPage != $this->FrontpageID )
        {
            $this->reopenObject( $this->FrontpageID );
            $closeObject = true;
        }

        $fontSize = $this->fontSize();

        $text = $this->fixWhitespace( $text );
        $this->setXOffset( 0 );

        Cezpdf::ezText( $text, $params['size'], array( 'justification' => $params['justification'],
                                                       'top_margin' => $params['top_margin'] ) );

        $this->setFontSize( $fontSize );

        if ( $closeObject )
        {
            $this->closeObject();
        }
        $this->restoreState();
    }
824071
public function addDropdown(PHPRtfLite_Font $font = null, PHPRtfLite_ParFormat $parFormat = null)
    {
        $dropdown = new PHPRtfLite_FormField_Dropdown($this->_rtf, $font, $parFormat);
        $this->_elements[] = $dropdown;
        return $dropdown;
    }
895868
public function setText($text, $markdown = false)
    {
        $this->data['text'] = $text;
        $this->markdownInText = $markdown;

        return $this;
    }
616269
public function addText($text) {
		$content = new HtmlString();
		$content->htmlString = $text;
		$this->children[] = $content;
		return $this;
	}
1223995
public function addAfter(string $content, bool $text = true): self
    {
        $this->after[] = [
            'content' => $content,
            'text'    => $text
        ];

        return $this;
    }
180349
public function addEmptyParagraph(PHPRtfLite_Font $font = null, PHPRtfLite_ParFormat $parFormat = null)
    {
        if ($parFormat === null) {
            $parFormat = new PHPRtfLite_ParFormat();
        }
        $element = new PHPRtfLite_Element($this->_rtf, '\\par', $font, $parFormat);
        $element->setIsRtfCode();
        $this->_elements[] = $element;

        return  $element;
    }
465592
function endnoteShortcode( $atts, $content = null ) {

		global $id; // This is the Post ID, [@see WP_Query::setup_postdata, preProcessBookContents, ...]

		if ( ! $content ) {
			return '';
		}

		$this->endnotes[ $id ][] = trim( $content );

		return '<sup class="endnote">' . count( $this->endnotes[ $id ] ) . '</sup>';
	}
699910
public static function addFontStyle($styleName, $styleFont, $styleParagraph = null) {
		if(!array_key_exists($styleName, self::$_styleElements)) {
			$font = new PHPWord_Style_Font('text', $styleParagraph);
			foreach($styleFont as $key => $value) {
				if(substr($key, 0, 1) != '_') {
					$key = '_'.$key;
				}
				$font->setStyleValue($key, $value);
			}
			self::$_styleElements[$styleName] = $font;
		}
	}
179087
public static function addNote(
        int $object_id, string $title, string $note): Note
    {

        return Note::create([
            'object_type' => __CLASS__,
            'object_id'   => $object_id,
            'title'       => $title,
            'note'        => $note,
        ]);

    }
474856
public function addHelpText(string $text, string $link = null, $critical = false)
    {
        if(!$link) {
            $this->help_texts[] = $text;
        }else{
            $this->help_texts[] = [$text, $link];
        }
        if($critical)
            $this->critical_help_texts = true;

        return $this;
    }
1195390
protected function _addAction(&$text)
    {
        // All: Add the action if left empty
        if (preg_match_all('#<\s*form[^>]+action=""#si', $text, $matches, PREG_SET_ORDER))
        {
            $action = $this->getTemplate()->route();

            foreach ($matches as $match)
            {
                $str = str_replace('action=""', 'action="' . $action . '"', $match[0]);
                $text = str_replace($match[0], $str, $text);
            }
        }

        return $this;
    }
105880
public function addTextByDirection($text, $direction = self::Top, $fontSize = 16, $color = '#000', $fontFamily = 5) {
		list($x, $y) = $this->getPointByDirection($direction);
		return $this->addText($text, $x, $y, $fontSize, $color, $fontFamily);
	}
223454
function _enddoc()
	{
		// @log Writing Headers & Footers

		$this->_puthtmlheaders();

		// @log Writing Pages

		// Remove references to unused fonts (usually default font)
		foreach ($this->fonts as $fk => $font) {
			if (isset($font['type']) && $font['type'] == 'TTF' && !$font['used']) {
				if ($font['sip'] || $font['smp']) {
					foreach ($font['subsetfontids'] as $k => $fid) {
						foreach ($this->pages as $pn => $page) {
							$this->pages[$pn] = preg_replace('/\s\/F' . $fid . ' \d[\d.]* Tf\s/is', ' ', $this->pages[$pn]);
						}
					}
				} else {
					foreach ($this->pages as $pn => $page) {
						$this->pages[$pn] = preg_replace('/\s\/F' . $font['i'] . ' \d[\d.]* Tf\s/is', ' ', $this->pages[$pn]);
					}
				}
			}
		}

		if (count($this->layers)) {
			foreach ($this->pages as $pn => $page) {
				preg_match_all('/\/OCZ-index \/ZI(\d+) BDC(.*?)(EMCZ)-index/is', $this->pages[$pn], $m1);
				preg_match_all('/\/OCBZ-index \/ZI(\d+) BDC(.*?)(EMCBZ)-index/is', $this->pages[$pn], $m2);
				preg_match_all('/\/OCGZ-index \/ZI(\d+) BDC(.*?)(EMCGZ)-index/is', $this->pages[$pn], $m3);
				$m = [];
				for ($i = 0; $i < 4; $i++) {
					$m[$i] = array_merge($m1[$i], $m2[$i], $m3[$i]);
				}
				if (count($m[0])) {
					$sortarr = [];
					for ($i = 0; $i < count($m[0]); $i++) {
						$key = $m[1][$i] * 2;
						if ($m[3][$i] == 'EMCZ') {
							$key +=2; // background first then gradient then normal
						} elseif ($m[3][$i] == 'EMCGZ') {
							$key +=1;
						}
						$sortarr[$i] = $key;
					}
					asort($sortarr);
					foreach ($sortarr as $i => $k) {
						$this->pages[$pn] = str_replace($m[0][$i], '', $this->pages[$pn]);
						$this->pages[$pn] .= "\n" . $m[0][$i] . "\n";
					}
					$this->pages[$pn] = preg_replace('/\/OC[BG]{0,1}Z-index \/ZI(\d+) BDC/is', '/OC /ZI\\1 BDC ', $this->pages[$pn]);
					$this->pages[$pn] = preg_replace('/EMC[BG]{0,1}Z-index/is', 'EMC', $this->pages[$pn]);
				}
			}
		}

		$this->pageWriter->writePages();

		// @log Writing document resources

		$this->resourceWriter->writeResources();

		// Info
		$this->writer->object();
		$this->InfoRoot = $this->n;
		$this->writer->write('<<');

		// @log Writing document info
		$this->metadataWriter->writeInfo();

		$this->writer->write('>>');
		$this->writer->write('endobj');

		// METADATA
		if ($this->PDFA || $this->PDFX) {
			$this->metadataWriter->writeMetadata();
		}

		// OUTPUTINTENT
		if ($this->PDFA || $this->PDFX || $this->ICCProfile) {
			$this->metadataWriter->writeOutputIntent();
		}

		// Associated files
		if ($this->associatedFiles) {
			$this->metadataWriter->writeAssociatedFiles();
		}

		// Catalog
		$this->writer->object();
		$this->writer->write('<<');

		// @log Writing document catalog

		$this->metadataWriter->writeCatalog();

		$this->writer->write('>>');
		$this->writer->write('endobj');

		// Cross-ref
		$o = strlen($this->buffer);
		$this->writer->write('xref');
		$this->writer->write('0 ' . ($this->n + 1));
		$this->writer->write('0000000000 65535 f ');

		for ($i = 1; $i <= $this->n; $i++) {
			$this->writer->write(sprintf('%010d 00000 n ', $this->offsets[$i]));
		}

		// Trailer
		$this->writer->write('trailer');
		$this->writer->write('<<');

		$this->metadataWriter->writeTrailer();

		$this->writer->write('>>');
		$this->writer->write('startxref');
		$this->writer->write($o);

		$this->buffer .= '%%EOF';
		$this->state = 3;
	}
58340
public function add($content, $format = FORMAT_MOODLE) {
        global $CFG, $DB, $USER, $OUTPUT;
        if (!$this->can_post()) {
            throw new comment_exception('nopermissiontocomment');
        }
        $now = time();
        $newcmt = new stdClass;
        $newcmt->contextid    = $this->contextid;
        $newcmt->commentarea  = $this->commentarea;
        $newcmt->itemid       = $this->itemid;
        $newcmt->component    = !empty($this->component) ? $this->component : null;
        $newcmt->content      = $content;
        $newcmt->format       = $format;
        $newcmt->userid       = $USER->id;
        $newcmt->timecreated  = $now;

        // This callback allow module to modify the content of comment, such as filter or replacement
        plugin_callback($this->plugintype, $this->pluginname, 'comment', 'add', array(&$newcmt, $this->comment_param));

        $cmt_id = $DB->insert_record('comments', $newcmt);
        if (!empty($cmt_id)) {
            $newcmt->id = $cmt_id;
            $newcmt->strftimeformat = get_string('strftimerecentfull', 'langconfig');
            $newcmt->fullname = fullname($USER);
            $url = new moodle_url('/user/view.php', array('id' => $USER->id, 'course' => $this->courseid));
            $newcmt->profileurl = $url->out();
            $formatoptions = array('overflowdiv' => true, 'blanktarget' => true);
            $newcmt->content = format_text($newcmt->content, $newcmt->format, $formatoptions);
            $newcmt->avatar = $OUTPUT->user_picture($USER, array('size'=>16));

            $commentlist = array($newcmt);

            if (!empty($this->plugintype)) {
                // Call the display callback to allow the plugin to format the newly added comment.
                $commentlist = plugin_callback($this->plugintype,
                                               $this->pluginname,
                                               'comment',
                                               'display',
                                               array($commentlist, $this->comment_param),
                                               $commentlist);
                $newcmt = $commentlist[0];
            }
            $newcmt->time = userdate($newcmt->timecreated, $newcmt->strftimeformat);

            // Trigger comment created event.
            if (core_component::is_core_subsystem($this->component)) {
                $eventclassname = '\\core\\event\\' . $this->component . '_comment_created';
            } else {
                $eventclassname = '\\' . $this->component . '\\event\comment_created';
            }
            if (class_exists($eventclassname)) {
                $event = $eventclassname::create(
                        array(
                            'context' => $this->context,
                            'objectid' => $newcmt->id,
                            'other' => array(
                                'itemid' => $this->itemid
                                )
                            ));
                $event->trigger();
            }

            return $newcmt;
        } else {
            throw new comment_exception('dbupdatefailed');
        }
    }