◆ extractFields()
ilMDCopyrightMigration::extractFields |
( |
string |
$copyright | ) |
|
|
protected |
Definition at line 83 of file class.ilMDCopyrightMigration.php.
References ilDBConstants\T_TEXT, and translatePreInstalledLinksToSVG().
Referenced by step().
91 if (preg_match(
'/<\s*img((?:.|\n)*?)\/>/i', $copyright, $img_matches)) {
92 if (preg_match(
'/src\s*=\s*(?:"|\')(.*?)(?:"|\')/i', $img_matches[1], $src_matches)) {
93 $image_link = strip_tags($src_matches[1]);
95 if (preg_match(
'/alt\s*=\s*(?:"|\')(.*?)(?:"|\')/i', $img_matches[1], $alt_matches)) {
96 $alt_text = strip_tags($alt_matches[1]);
101 if (preg_match(
'/<\s*a((?:.|\n)[^<]*?)<\s*\/a>/i', $copyright, $link_matches)) {
102 if (preg_match(
'/href\s*=\s*(?:"|\')(.*?)(?:"|\')/i', $link_matches[1], $name_matches)) {
103 $link = strip_tags($name_matches[1]);
105 if (preg_match(
'/>((?:\n|.)*)/i', $link_matches[1], $href_matches)) {
106 $full_name = strip_tags($href_matches[1]);
109 $full_name = strip_tags($copyright);
translatePreInstalledLinksToSVG(string $image_link)
◆ getDefaultAmountOfStepsPerRun()
ilMDCopyrightMigration::getDefaultAmountOfStepsPerRun |
( |
| ) |
|
◆ getLabel()
ilMDCopyrightMigration::getLabel |
( |
| ) |
|
◆ getPreconditions()
ilMDCopyrightMigration::getPreconditions |
( |
Environment |
$environment | ) |
|
◆ getRemainingAmountOfSteps()
ilMDCopyrightMigration::getRemainingAmountOfSteps |
( |
| ) |
|
Definition at line 73 of file class.ilMDCopyrightMigration.php.
References $res.
75 $res = $this->db->query(
76 'SELECT COUNT(*) AS count FROM il_md_cpr_selections WHERE migrated = 0' 79 $row = $this->db->fetchAssoc(
$res);
80 return (
int) $row[
'count'];
◆ prepare()
ilMDCopyrightMigration::prepare |
( |
Environment |
$environment | ) |
|
◆ step()
ilMDCopyrightMigration::step |
( |
Environment |
$environment | ) |
|
◆ translatePreInstalledLinksToSVG()
ilMDCopyrightMigration::translatePreInstalledLinksToSVG |
( |
string |
$image_link | ) |
|
|
protected |
Definition at line 122 of file class.ilMDCopyrightMigration.php.
Referenced by extractFields().
126 'https://i.creativecommons.org/l/by-nc-nd/4.0/88x31.png' =>
'https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-nc-nd.svg',
127 'https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png' =>
'https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-nc-sa.svg',
128 'https://i.creativecommons.org/l/by-nc/4.0/88x31.png' =>
'https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-nc.svg',
129 'https://i.creativecommons.org/l/by-nd/4.0/88x31.png' =>
'https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-nd.svg',
130 'https://i.creativecommons.org/l/by-sa/4.0/88x31.png' =>
'https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-sa.svg',
131 'https://i.creativecommons.org/l/by/4.0/88x31.png' =>
'https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by.svg',
133 'http://i.creativecommons.org/l/by-nc-nd/3.0/88x31.png' =>
'https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-nc-nd.svg',
134 'http://i.creativecommons.org/l/by-nc-sa/3.0/88x31.png' =>
'https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-nc-sa.svg',
135 'http://i.creativecommons.org/l/by-nc/3.0/88x31.png' =>
'https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-nc.svg',
136 'http://i.creativecommons.org/l/by-nd/3.0/88x31.png' =>
'https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-nd.svg',
137 'http://i.creativecommons.org/l/by-sa/3.0/88x31.png' =>
'https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-sa.svg',
138 'http://i.creativecommons.org/l/by/3.0/88x31.png' =>
'https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by.svg' 141 if (key_exists($image_link, $mapping)) {
142 return $mapping[$image_link];
◆ $db
The documentation for this class was generated from the following file: