Move segment tags for lines of tables
Called automatically within the constructor

@return void
509751
private function _moveRowSegments()
    {
        // Search all possible rows in the document
        $reg1 = "#<table:table-row[^>]*>(.*)</table:table-row>#smU";
        preg_match_all($reg1, $this->contentXml, $matches);
        for ($i = 0, $size = count($matches[0]); $i < $size; $i++) {
            // Check if the current row contains a segment row.*
            $reg2 = '#\[!--\sBEGIN\s(row.[\S]*)\s--\](.*)\[!--\sEND\s\\1\s--\]#smU';
            if (preg_match($reg2, $matches[0][$i], $matches2)) {
                $balise = str_replace('row.', '', $matches2[1]);
                // Move segment tags around the row
                $replace = array(
                    '[!-- BEGIN ' . $matches2[1] . ' --]'   => '',
                    '[!-- END ' . $matches2[1] . ' --]'     => '',
                    '<table:table-row'                          => '[!-- BEGIN ' . $balise . ' --]<table:table-row',
                    '</table:table-row>'                        => '</table:table-row>[!-- END ' . $balise . ' --]'
                );
                $replacedXML = str_replace(array_keys($replace), array_values($replace), $matches[0][$i]);
                $this->contentXml = str_replace($matches[0][$i], $replacedXML, $this->contentXml);
            }
        }
    }
1182845
protected function deleteForeverKeys()
    {
        foreach (explode('|', $this->tags->getNamespace()) as $segment) {
            $this->deleteForeverValues($segment = $this->foreverKey($segment));

            $this->store->connection()->del($segment);
        }
    }
907453
protected function moveNode()
    {
        if ($this->exists) {
            if (is_null($this->closure->ancestor)) {
                $primaryKey = $this->getKey();
                $this->closure->ancestor = $primaryKey;
                $this->closure->descendant = $primaryKey;
                $this->closure->depth = 0;
            }

            if ($this->isDirty($this->getParentIdColumn())) {
                $this->reorderSiblings(true);
                $this->closure->moveNodeTo($this->parent_id);
            }
        }
    }
1343837
public function alterTagColumnSize()
    {
        $Tags = $this->loadModel('MeCms.Tags');

        if ($Tags->getSchema()->getColumn('tag')['length'] < 255) {
            $Tags->getConnection()->execute('ALTER TABLE tags MODIFY tag varchar(255) NOT NULL');
        }
    }
660307
public function moveToRoot()
    {
        $db = Database::connection();
        $db->executeQuery('update Pages set cParentID = 0 where cID = ?', [$this->getCollectionID()]);
        $this->cParentID = 0;
        $this->rescanSystemPageStatus();
    }
707506
function moveNestedTags(child, i) {
  Object.keys(child.tags).forEach(function(tagName) {
    var tag = child.tags[tagName]
    if (isArray(tag))
      each(tag, function (t) {
        moveChildTag(t, tagName, i)
      })
    else
      moveChildTag(tag, tagName, i)
  })
}
1318611
protected function setIgnoreTags()
    {
        if (!count($this->ignore_tags)) {
            $this->ignore_tags = array_keys($this->parser->tags->all());
        }
    }
185741
public function change()
    {
        $tableName = 'language_translations';
        if (!$this->hasTable($tableName)) {
            $tableName = 'translations';
        }

        $table = $this->table($tableName);
        if ($table->hasColumn('is_active')) {
            $table->changeColumn('is_active', 'boolean', [
                'default' => true,
                'null' => true,
            ]);
        }
        $table->update();
    }
115525
private function parsing() : void
    {
        $lines = explode("\n", $this->raw);

        foreach ($lines as $line) {
            // check "at" mark
            if (false === strpos($line, '@')) {
                continue;
            }

            // check inline annotation
            if ($anp = strpos($line, '//')) {
                $line = substr($line, 0, $anp);
            }

            // trim blanks
            $line = trim(ltrim($line, ' *'));

            // analyze expr
            if (false === $fws = strpos($line, ' ')) {
                // @some-key
                $key = substr($line, 1);
                $val = true;
            } else {
                // @some-key some-val
                $key = substr($line, 1, $fws - 1);
                $val = trim(substr($line, $fws));
            }

            $this->lines[] = [$key, $val];

            $this->declares[$key][] = $val;
        }
    }
646877
protected function _place_objects() {
		//Helpers::dompdf_debug("trace", "()");

		foreach ($this->_objs as $obj=>$props) {
			//var_dump($props);

			$start = $props["start_page"];
			$where = $props["where"];

			// Place the object on this page if required
			$page_number = $this->_pdf->PageNo();
			if ($page_number >= $start &&
			(($page_number % 2 == 0 && $where == "even") ||
			($page_number % 2 == 1 && $where == "odd") ||
			($where == "all"))) {
				$data = $this->_pdf->getObject($obj);
				//Helpers::dompdf_debug("trace", "object data = " . $data['c']);
				$this->_pdf->setPageBuffer($page_number, $data['c'], true);
			}
		}

	}
856986
public function on_elements_end() {

        foreach ($this->mappings as $mapping) {
            $this->write_xml('workshopform_numerrors_map', $mapping, array('/workshopform_numerrors_map/id'));
        }

        foreach ($this->dimensions as $dimension) {
            $this->write_xml('workshopform_numerrors_dimension', $dimension, array('/workshopform_numerrors_dimension/id'));
        }
    }
1341593
protected function handleTag_ul()
    {
        if ($this->parser->isStartTag) {
            $this->stack();
            if (!$this->keepHTML && $this->lastClosedTag == $this->parser->tagName) {
                $this->out("\n" . $this->indent . '<!-- -->' . "\n" . $this->indent . "\n" . $this->indent);
            }
        } else {
            $this->unstack();
            if ($this->parent() != 'li' || preg_match('#^\s*(</li\s*>\s*<li\s*>\s*)?<(p|blockquote)\s*>#sU', $this->parser->html)) {
                // don't make Markdown add unneeded paragraphs
                $this->setLineBreaks(2);
            }
        }
    }
1327371
protected function captureTables()
	{
		unset($this->table);
		$this->tables = [];

		$this->pos = 0;
		foreach (explode("\n", $this->text) as $line)
		{
			if (strpos($line, '|') === false)
			{
				$this->endTable();
			}
			else
			{
				$this->addLine($line);
			}
			$this->pos += 1 + strlen($line);
		}
		$this->endTable();
	}
522424
private function updateSorting()
    {
        $ids = $this->getModelIds();
        // If no "next" sibling, simply increment the sorting as we are at the end of the list.
        if (!$this->marker) {
            foreach ($this->results as $model) {
                $this->position += 128;
                /** @var ModelInterface $model */
                $model->setProperty($this->getSortingProperty(), $this->position);
            }

            return;
        }

        $delta = $this->determineDelta();

        // Loop over all models and increment sorting value.
        foreach ($this->results as $model) {
            $this->position += $delta;
            /** @var ModelInterface $model */
            $model->setProperty($this->getSortingProperty(), $this->position);
        }

        // When the sorting exceeds the sorting of the "next" sibling, we need to push the remaining siblings to the
        // end of the list.
        if ($this->marker->getProperty($this->getSortingProperty()) <= $this->position) {
            do {
                // Skip models about to be pasted.
                if (\in_array($this->marker->getId(), $ids)) {
                    $this->marker = $this->siblingsCopy->shift();
                    continue;
                }

                $this->position += $delta;
                $this->marker->setProperty($this->getSortingProperty(), $this->position);
                $this->results->push($this->marker);

                $this->marker = $this->siblingsCopy->shift();
            } while ($this->marker);
        }
    }
500852
function MoveNext()
	{
		$ret = @oci_fetch_array($this->_queryID,$this->fetchMode);
		if($ret !== false) {
		global $ADODB_ANSI_PADDING_OFF;
			$this->fields = $ret;
			$this->_currentRow++;
			$this->_updatefields();

			if (!empty($ADODB_ANSI_PADDING_OFF)) {
				foreach($this->fields as $k => $v) {
					if (is_string($v)) $this->fields[$k] = rtrim($v);
				}
			}
			return true;
		}
		if (!$this->EOF) {
			$this->EOF = true;
			$this->_currentRow++;
		}
		return false;
	}
310963
public function colgroup(array $attributes = []): void
    {
        $this->tableArray[] = Tags::colgroup($this->colArray, $attributes);
        $this->colArray = [];
    }
1038875
function moveChildTag(tag, tagName, newPos) {
  var parent = tag.parent,
    tags
  // no parent no move
  if (!parent) return

  tags = parent.tags[tagName]

  if (isArray(tags))
    tags.splice(newPos, 0, tags.splice(tags.indexOf(tag), 1)[0])
  else addChildTag(tag, tagName, parent)
}