From: Hamatoma Date: Sun, 5 May 2024 15:27:54 +0000 (+0200) Subject: 0.2.6 MediaWiki X-Git-Url: https://gitweb.hamatoma.de/?a=commitdiff_plain;h=d1c1ee73927ee416894fa8317dcb150121eb8d43;p=gadeku.git 0.2.6 MediaWiki - MediaWiki: - verbesserte RegEx-Ausdrücke in expandStarItems() - Korrekturen in specialMacrosToHtml() --- diff --git a/CHANGELOG.md b/CHANGELOG.md index f7f8de0..2aab876 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,16 @@ -# V 0.2.6 Word umgebaut, verbImperfect +# V 0.2.7 Pages + +## Added +- Neue Attribute für Seitenverlinkung: previous_id, up_id, next_id + +# V 0.2.6 MediaWiki + +## Changed +- MediaWiki: + - verbesserte RegEx-Ausdrücke in expandStarItems() + - Korrekturen in specialMacrosToHtml() + +# V 0.2.7 Word umgebaut, verbImperfect ## Changed - Module Verb und Noun entfallen, Word arbeitet mit strukturiertem Attribut options diff --git a/app/Helpers/MediaWiki.php b/app/Helpers/MediaWiki.php index e752d05..f9afb28 100644 --- a/app/Helpers/MediaWiki.php +++ b/app/Helpers/MediaWiki.php @@ -9,16 +9,18 @@ class MediaWiki extends MediaWikiBase { $rc = preg_replace( [ - '/\*(\w[^*]+\w)\*/', + '/\*(\w.*?\w)\*/', '/\*<(.+?)>\*/', - '/\*-(\w[^*]+\w)-\*/', - '/\*\+(\w[^*]+\w)\+\*/' + '/\*-(\w.*?\w)-\*/', + '/\*\+(\w.*?\w)\+\*/', + '/\*(\w)\*/' ], [ '%trans($1)%', '%field($1)%', '%del($1)%', - '%add($1)%' + '%add($1)%', + '%trans($1)%', ], $text ); @@ -38,14 +40,14 @@ class MediaWiki extends MediaWikiBase break; case 'trans': $text = $matches[2]; - $info = count($matches) > 3 ? $text : substr($matches[3], 1); + $info = count($matches) <= 3 ? $text : substr($matches[3], 1); $rc = "$text"; break; case 'mark': $rc = '' . $matches[2] . ''; break; case 'add': - $rc = '' . (count($matches) == 4 ? ($matches[2] . $matches[3]) : $matches[2]) . ''; + $rc = '' . (count($matches) >= 4 ? ($matches[2] . $matches[3]) : $matches[2]) . ''; break; case 'del': $rc = '' . (count($matches) == 4 ? ($matches[2] . $matches[3]) : $matches[2]) . ''; @@ -69,12 +71,6 @@ class MediaWiki extends MediaWikiBase $class = $size == 0 ? '' : "lkn-icon-$size"; $rc = ""; break; - case 'image': - $name = $matches[2]; - $size = count($matches) < 4 ? null : $matches[3]; - $class = $size == 0 ? '' : "lkn-icon-$size"; - $rc = ""; - break; default: $rc = $matches[0]; break; diff --git a/app/Http/Controllers/PageController.php b/app/Http/Controllers/PageController.php index 9580a7b..e8ff792 100644 --- a/app/Http/Controllers/PageController.php +++ b/app/Http/Controllers/PageController.php @@ -97,7 +97,10 @@ class PageController extends Controller 'markup_scope' => $page->markup_scope, 'language_scope' => $page->language_scope, 'order' => $page->order ?? '0', - 'audio_id' => $page->audio_id + 'audio_id' => $page->audio_id, + 'previous_id' => $page->previous_id, + 'next_id' => $page->next_id, + 'up_id' => $page->up_id ]; } else { $fields['pagetype_scope'] = $page->pagetype_scope; @@ -285,6 +288,15 @@ LEFT JOIN sproperties t4 ON t4.id=t0.owner_id $view = 'page.text-col2'; } } + if ($page->previous_id != null){ + $params['prev'] = "/page-showpretty/$page->previous_id"; + } + if ($page->next_id != null){ + $params['next'] = "/page-showpretty/$page->next_id"; + } + if ($page->up_id != null){ + $params['up'] = "/page-showpretty/$page->up_id"; + } $context = new ContextLaraKnife($request, $params, $page); $rc = view($view, ['context' => $context]); } @@ -358,6 +370,15 @@ LEFT JOIN sproperties t4 ON t4.id=t0.owner_id if ($fields['reference_id'] != null){ $rules['reference_id'] = 'exists:pages,id'; } + if ($fields['previous_id'] != null){ + $rules['previous_id'] = 'exists:pages,id'; + } + if ($fields['up_id'] != null){ + $rules['up_id'] = 'exists:pages,id'; + } + if ($fields['next_id'] != null){ + $rules['next_id'] = 'exists:pages,id'; + } $validator = Validator::make($fields, $rules); if ($validator->fails()) { $errors = $validator->errors(); diff --git a/app/Models/Page.php b/app/Models/Page.php index 39cdb7e..96fffa5 100644 --- a/app/Models/Page.php +++ b/app/Models/Page.php @@ -24,6 +24,9 @@ class Page extends Model 'columns', 'audio_id', 'reference_id', + 'previous_id', + 'up_id', + 'next_id', 'owner_id' ]; } diff --git a/composer.lock b/composer.lock index 5ef73e4..297b6e5 100644 --- a/composer.lock +++ b/composer.lock @@ -1056,7 +1056,7 @@ "dist": { "type": "path", "url": "../laraknife", - "reference": "fdc1af63b7d821c111b630663be1f0bcbba93fa5" + "reference": "646e4764a06caa8ed60766fd98c8ce6882479d9c" }, "require-dev": { "phpunit/phpunit": "11.0.x-dev" diff --git a/database/migrations/2024_05_05_161051_alter_pages_table.php b/database/migrations/2024_05_05_161051_alter_pages_table.php new file mode 100644 index 0000000..4796c07 --- /dev/null +++ b/database/migrations/2024_05_05_161051_alter_pages_table.php @@ -0,0 +1,28 @@ +foreignId('previous_id')->nullable()->references('id')->on('pages'); + $table->foreignId('next_id')->nullable()->references('id')->on('pages'); + $table->foreignId('up_id')->nullable()->references('id')->on('pages'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + // + } +}; diff --git a/lang/de_DE.json b/lang/de_DE.json index b0f2071..dff3349 100644 --- a/lang/de_DE.json +++ b/lang/de_DE.json @@ -10,6 +10,7 @@ "Administrator": "Administrator", "All": "Alle", "Assign Roles": "Rollen zuordnen", + "Back": "Zur\u00fcck", "Body": "Info", "Cancel": "Abbrechen", "Category": "Kategorie", @@ -87,6 +88,7 @@ "Markup": "Sprachtyp", "Name": "Name", "New": "Neu", + "Next": "Weiter", "Not Assigned Menu Items": "Nicht zugeordnete Men\u00fceintr\u00e4ge", "Not verified": "Nicht \u00fcberpr\u00fcft", "Notes": "Notizen", diff --git a/resources/views/chapter/showpretty.blade.php b/resources/views/chapter/showpretty.blade.php index 15c8853..c36bac5 100644 --- a/resources/views/chapter/showpretty.blade.php +++ b/resources/views/chapter/showpretty.blade.php @@ -3,7 +3,8 @@ @section('content')
@csrf - +
{!! $context->valueOf('text') !!}
diff --git a/resources/views/page/edit.blade.php b/resources/views/page/edit.blade.php index ec0c163..236a15f 100644 --- a/resources/views/page/edit.blade.php +++ b/resources/views/page/edit.blade.php @@ -24,9 +24,16 @@ value="{{ $context->valueOf('contents') }}" width2="10" rows="10" /> - - + + + + @if (!empty($context->valueOf('preview'))) diff --git a/resources/views/page/show-col1.blade.php b/resources/views/page/show-col1.blade.php index ad3f0be..7658825 100644 --- a/resources/views/page/show-col1.blade.php +++ b/resources/views/page/show-col1.blade.php @@ -3,15 +3,11 @@ @section('content') @csrf - +
{!! $context->valueOf('text1') !!}
- @if ($context->valueof('audio') != null) -
- -
- @endif @endsection