This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This file is part of | |
* pragmaMx - Web Content Management System. | |
* Copyright by pragmaMx Developer Team - http://www.pragmamx.org | |
* | |
* pragmaMx is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function stringKuerzenMitSuffix(string $stringToCut, int $maxLength, string $suffix = '...'): string | |
{ | |
$prefixLength = max(0, $maxLength - strlen($suffix)); | |
$cutString = substr($stringToCut, 0, $prefixLength); | |
$cutSuffix = substr($suffix, 0, $maxLength - $prefixLength); | |
return $cutString . $cutSuffix; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var content = "<p>Here is first content...!</p>"; | |
var content2 = "<p>Here is second content...!</p>"; | |
var isOpen = content === content2 ? "open" : ""; | |
var html = [ | |
'<details id="msDetails" ', | |
isOpen, | |
"><summary>aaSection title</summary>", | |
content, | |
"</details>", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Diese Funktion generiert Farben und prüft dabei die Kontrastanforderungen, was sie für die meisten Anwendungsfälle geeignet macht, in denen eine gute Lesbarkeit gewährleistet werden muss. | |
* | |
* @copyright 2019-04 Sven Hedström-Lang <svenhlang@gmail.com> | |
* @param {string[]} existingColors - Array aus bereits vergebenen Farben | |
* @param {string} [textColor="#000000"] - Optional, Default: "#000000" | |
* @returns {string} - Ausgabe eines Hexcolor, das noch nicht existiert | |
* @example | |
* const existingColors = ['#fff9ed', '#e7a9c6', '#d9d7ef', '#dcdda4', '#f1b19e']; | |
* generateContrastingColor(existingColors); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Wichtig, das die beiden Tabellen, in der gleichen Reihenfolge haben | |
### Jetzt werden Beide Tabellen angezeigt ohne eine JOIN-Verknüpfung | |
SELECT | |
uname AS anzeige, | |
email AS wert | |
FROM users | |
WHERE email != '' | |
UNION | |
SELECT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var obj = { id: "1", name: "irgendwas", title: "überschrift" }; | |
var tmpObj = {}; | |
// Iteriere durch die Schlüssel des obj | |
Object.keys(obj).forEach(function (column) { | |
if (!tmpObj.hasOwnProperty(column)) { | |
tmpObj[column] = ""; | |
} | |
}); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Zum Einfügen eines neuen Objekts an einer bestimmten Position | |
* | |
* @param {object} obj | |
* @param {number} position | |
* @param {object} newEntry | |
* @returns {object} | |
*/ | |
function insertObjectAtPosition(obj, position, newEntry) { | |
var newObj = {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<!-- https://www.compart.com/de/unicode/ --> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Buttons</title> | |
<style> | |
button { | |
display: flex; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>json to html</title> | |
<script> | |
var msJsonUtility = { | |
htmlToJson: function (htmlString) { | |
const tempDiv = document.createElement("div"); | |
tempDiv.innerHTML = htmlString; | |
const element = tempDiv.firstChild; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
departments | |
FROM | |
users | |
WHERE | |
departments != '' | |
AND departments IN ( | |
SELECT | |
BN_BEREICH | |
FROM |
NewerOlder