]> gitweb.hamatoma.de Git - gadeku.git/commitdiff
V 0.4.3 Page-Export
authorHamatoma <author@hamatoma.de>
Tue, 11 Jun 2024 20:28:03 +0000 (22:28 +0200)
committerHamatoma <author@hamatoma.de>
Tue, 11 Jun 2024 20:28:43 +0000 (22:28 +0200)
- PageController:
  - neue Syntax in Exportdatei

CHANGELOG.md
app/Http/Controllers/PageController.php
composer.lock
lang/de_DE.json
public/temp [new symlink]

index 2a5e90e4030570a86a47fbb66acc77887c410174..8a6ee473a0af7343a08fff9d96cf3432e26cba50 100644 (file)
@@ -1,3 +1,9 @@
+# V 0.4.3 Page-Export
+
+# Changed
+- PageController:
+  - neue Syntax in Exportdatei
+
 # V 0.4.2 Modul Export, Refaktorierung Seeders
 
 ## Added
index 384060725c73eec6e5b319bdc52e5d7f29e68e64..55e926f9ebc6199f763227d54d4004fb513913ba 100644 (file)
@@ -5,7 +5,6 @@ namespace App\Http\Controllers;
 use App\Models\File;
 use App\Models\Page;
 use App\Models\Module;
-use App\Helpers\Helper;
 use App\Helpers\DbHelper;
 use App\Models\SProperty;
 use App\Helpers\MediaWiki;
@@ -16,7 +15,6 @@ use Illuminate\Http\Request;
 use App\Helpers\StringHelper;
 use App\Helpers\TextProcessor;
 use App\Helpers\ContextLaraKnife;
-use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Route;
 use Illuminate\Support\Facades\Validator;
 
@@ -69,25 +67,40 @@ class PageController extends Controller
         $fn = FileHelper::buildExportName('page-export', '.txt');
         $sep = '~' . StringHelper::randomString(StringHelper::$charSetAlphaNumeric, 3) . '%';
         $count = count($records);
-        $contents = "!Meta LaraKnife-Export
-separator=$sep
-records=$count
- ";
+        $host = env('APP_URL');
+        $date = (new \DateTime('now'))->format('Y-m-d H:i');
+        $contents = ":LaraKnife-Export
+:host=$host
+:exported=$date
+:separator=$sep
+:records=$count
+";
         $recordNo = 0;
         foreach ($records as &$record) {
             $recordNo++;
-            $contents .= "action=insert
-table=pages
-primary=page$recordNo
+            $contents .= ":action=insert
+:table=pages
+!id=page$recordNo
+!reference_id=$record->reference_id
+!audio_id=$record->audio_id
+!owner_id=$record->owner_id
+!previous_id=$record->previous_id
+!next_id=$record->next_id
+!up_id=$record->up_id
 title=$record->title
 name=$record->name
-contents=<<
-$record->contents
+pagetype_scope=$record->pagetype_scope
+markup_scope=$record->markup_scope
+order=$record->order
+language_scope=$record->language_scope
+~contents=$record->contents
+$sep
+~info=$record->info
 $sep
 ";
         }
         file_put_contents($fn, $contents);
-        $rc = redirect('/exported');
+        $rc = redirect('/export-index');
         return $rc;
     }
     /**
@@ -157,8 +170,9 @@ $sep
      */
     public function index(Request $request)
     {
+        $rc = null;
         if ($request->btnSubmit === 'btnNew') {
-            return redirect('/page-create');
+            $rc = redirect('/page-create');
         } else {
             $sql = "
 SELECT t0.*,
@@ -199,20 +213,23 @@ LEFT JOIN sproperties t4 ON t4.id=t0.owner_id
             if ($request->btnSubmit === 'btnExport') {
                 $rc = $this->export($records);
             }
-            $optionsPagetype = SProperty::optionsByScope('pagetype', $fields['pagetype'], 'all');
-            $optionsMarkup = SProperty::optionsByScope('markup', $fields['markup'], 'all');
-            $optionsLanguage = SProperty::optionsByScope('localization', $fields['markup'], 'all');
-            $optionsOwner = DbHelper::comboboxDataOfTable('users', 'name', 'id', $fields['owner']);
-            $context = new ContextLaraKnife($request, $fields);
-            return view('page.index', [
-                'context' => $context,
-                'records' => $records,
-                'optionsPagetype' => $optionsPagetype,
-                'optionsMarkup' => $optionsMarkup,
-                'optionsLanguage' => $optionsLanguage,
-                'optionsOwner' => $optionsOwner,
-                'pagination' => $pagination
-            ]);
+            if ($rc == null) {
+                $optionsPagetype = SProperty::optionsByScope('pagetype', $fields['pagetype'], 'all');
+                $optionsMarkup = SProperty::optionsByScope('markup', $fields['markup'], 'all');
+                $optionsLanguage = SProperty::optionsByScope('localization', $fields['markup'], 'all');
+                $optionsOwner = DbHelper::comboboxDataOfTable('users', 'name', 'id', $fields['owner']);
+                $context = new ContextLaraKnife($request, $fields);
+                $rc = view('page.index', [
+                    'context' => $context,
+                    'records' => $records,
+                    'optionsPagetype' => $optionsPagetype,
+                    'optionsMarkup' => $optionsMarkup,
+                    'optionsLanguage' => $optionsLanguage,
+                    'optionsOwner' => $optionsOwner,
+                    'pagination' => $pagination
+                ]);
+            }
+            return $rc;
         }
     }
     /**
index fc4b471115cc5ff5d8c9dcf984f60cb9927d2465..57bb023d319600099f1189f6207176d5e053d671 100644 (file)
             "dist": {
                 "type": "path",
                 "url": "../laraknife",
-                "reference": "5571c586612a4a51475ac95ef30ac1bf91b8d115"
+                "reference": "31c805ca6f97201252f11b8bdd36192fc6fe7951"
             },
             "require-dev": {
                 "phpunit/phpunit": "11.0.x-dev"
         },
         {
             "name": "psy/psysh",
-            "version": "v0.12.3",
+            "version": "v0.12.4",
             "source": {
                 "type": "git",
                 "url": "https://github.com/bobthecow/psysh.git",
-                "reference": "b6b6cce7d3ee8fbf31843edce5e8f5a72eff4a73"
+                "reference": "2fd717afa05341b4f8152547f142cd2f130f6818"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/bobthecow/psysh/zipball/b6b6cce7d3ee8fbf31843edce5e8f5a72eff4a73",
-                "reference": "b6b6cce7d3ee8fbf31843edce5e8f5a72eff4a73",
+                "url": "https://api.github.com/repos/bobthecow/psysh/zipball/2fd717afa05341b4f8152547f142cd2f130f6818",
+                "reference": "2fd717afa05341b4f8152547f142cd2f130f6818",
                 "shasum": ""
             },
             "require": {
             ],
             "support": {
                 "issues": "https://github.com/bobthecow/psysh/issues",
-                "source": "https://github.com/bobthecow/psysh/tree/v0.12.3"
+                "source": "https://github.com/bobthecow/psysh/tree/v0.12.4"
             },
-            "time": "2024-04-02T15:57:53+00:00"
+            "time": "2024-06-10T01:18:23+00:00"
         },
         {
             "name": "ralouphie/getallheaders",
index 541cd2ecc3f41bc9a847c0888333a1d3f411632f..281f4d2aa457a03c6d77cb199f23dc6365ceda29 100644 (file)
@@ -12,6 +12,7 @@
     "Administrator": "Administrator",
     "All": "Alle",
     "Amount": "Betrag",
+    "Analysis": "Analyse",
     "Assign Roles": "Rollen zuordnen",
     "Back": "Zur\u00fcck",
     "Body": "Info",
@@ -92,6 +93,7 @@
     "Hello": "Hallo",
     "I found :n error(s)": "Ich habe :n Fehler gefunden",
     "Id": "Id",
+    "Import": "Import",
     "Imprint": "Impressum",
     "Info": "Info",
     "Insert Position": "Einf\u00fcgeposition",
     "Wordtype": "Wortart",
     "ZZZ-last": "",
     "ZZZZZ_last": "",
+    "action|actions": "Aktion|Aktionen",
     "active": "aktiv",
     "chapter": "Kapitel",
     "closed": "geschlossen",
     "section": "Bereich",
     "snaketext": "Schlangentext",
     "standard": "Standard",
+    "table|tables": "Tabelle|Tabellen",
     "task": "Aufgabe",
     "work": "Arbeit"
 }
\ No newline at end of file
diff --git a/public/temp b/public/temp
new file mode 120000 (symlink)
index 0000000..c381ab9
--- /dev/null
@@ -0,0 +1 @@
+../storage/app/public/temp/
\ No newline at end of file