Skip to content

Commit

Permalink
w-i-p
Browse files Browse the repository at this point in the history
  • Loading branch information
AzGasim committed Aug 28, 2024
1 parent b470eae commit 2795523
Show file tree
Hide file tree
Showing 10 changed files with 430 additions and 281 deletions.
13 changes: 10 additions & 3 deletions config/filesystems.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
'throw' => false,
// 'url' => env('APP_URL').'/storage',
// 'visibility' => 'public',
// 'throw' => false,
],

's3' => [
Expand All @@ -56,6 +56,13 @@
'throw' => false,
],

'press' => [
'driver' => 'local',
'root' => public_path('wp/wp-content/uploads/2024/08'),
'url' => env('APP_URL').'/wp/wp-content/uploads/2024/08',
'visibility' => 'public',
],

],

/*
Expand Down
40 changes: 20 additions & 20 deletions config/press.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
| Tabs
|--------------------------------------------------------------------------
|
| Define the tabs for the Resource table. They are optional, but
| Define the tabs for the Expiry table. They are optional, but
| pretty awesome to filter the table by certain values.
| You may simply do a 'tabs' => [], to disable them.
|
Expand Down Expand Up @@ -93,7 +93,7 @@
| Tabs
|--------------------------------------------------------------------------
|
| Define the tabs for the Resource table. They are optional, but
| Define the tabs for the Expiry table. They are optional, but
| pretty awesome to filter the table by certain values.
| You may simply do a 'tabs' => [], to disable them.
|
Expand Down Expand Up @@ -140,7 +140,7 @@
| Tabs
|--------------------------------------------------------------------------
|
| Define the tabs for the Resource table. They are optional, but
| Define the tabs for the Expiry table. They are optional, but
| pretty awesome to filter the table by certain values.
| You may simply do a 'tabs' => [], to disable them.
|
Expand Down Expand Up @@ -187,7 +187,7 @@
| Tabs
|--------------------------------------------------------------------------
|
| Define the tabs for the Resource table. They are optional, but
| Define the tabs for the Expiry table. They are optional, but
| pretty awesome to filter the table by certain values.
| You may simply do a 'tabs' => [], to disable them.
|
Expand Down Expand Up @@ -234,7 +234,7 @@
| Tabs
|--------------------------------------------------------------------------
|
| Define the tabs for the Resource table. They are optional, but
| Define the tabs for the Expiry table. They are optional, but
| pretty awesome to filter the table by certain values.
| You may simply do a 'tabs' => [], to disable them.
|
Expand Down Expand Up @@ -281,7 +281,7 @@
| Tabs
|--------------------------------------------------------------------------
|
| Define the tabs for the Resource table. They are optional, but
| Define the tabs for the Expiry table. They are optional, but
| pretty awesome to filter the table by certain values.
| You may simply do a 'tabs' => [], to disable them.
|
Expand Down Expand Up @@ -344,7 +344,7 @@
| Tabs
|--------------------------------------------------------------------------
|
| Define the tabs for the Resource table. They are optional, but
| Define the tabs for the Expiry table. They are optional, but
| pretty awesome to filter the table by certain values.
| You may simply do a 'tabs' => [], to disable them.
|
Expand Down Expand Up @@ -391,7 +391,7 @@
| Tabs
|--------------------------------------------------------------------------
|
| Define the tabs for the Resource table. They are optional, but
| Define the tabs for the Expiry table. They are optional, but
| pretty awesome to filter the table by certain values.
| You may simply do a 'tabs' => [], to disable them.
|
Expand Down Expand Up @@ -478,7 +478,7 @@
| Tabs
|--------------------------------------------------------------------------
|
| Define the tabs for the Resource table. They are optional, but
| Define the tabs for the Expiry table. They are optional, but
| pretty awesome to filter the table by certain values.
| You may simply do a 'tabs' => [], to disable them.
|
Expand Down Expand Up @@ -525,7 +525,7 @@
| Tabs
|--------------------------------------------------------------------------
|
| Define the tabs for the Resource table. They are optional, but
| Define the tabs for the Expiry table. They are optional, but
| pretty awesome to filter the table by certain values.
| You may simply do a 'tabs' => [], to disable them.
|
Expand Down Expand Up @@ -572,7 +572,7 @@
| Tabs
|--------------------------------------------------------------------------
|
| Define the tabs for the Resource table. They are optional, but
| Define the tabs for the Expiry table. They are optional, but
| pretty awesome to filter the table by certain values.
| You may simply do a 'tabs' => [], to disable them.
|
Expand Down Expand Up @@ -619,7 +619,7 @@
| Tabs
|--------------------------------------------------------------------------
|
| Define the tabs for the Resource table. They are optional, but
| Define the tabs for the Expiry table. They are optional, but
| pretty awesome to filter the table by certain values.
| You may simply do a 'tabs' => [], to disable them.
|
Expand Down Expand Up @@ -666,7 +666,7 @@
| Tabs
|--------------------------------------------------------------------------
|
| Define the tabs for the Resource table. They are optional, but
| Define the tabs for the Expiry table. They are optional, but
| pretty awesome to filter the table by certain values.
| You may simply do a 'tabs' => [], to disable them.
|
Expand Down Expand Up @@ -713,7 +713,7 @@
| Tabs
|--------------------------------------------------------------------------
|
| Define the tabs for the Resource table. They are optional, but
| Define the tabs for the Expiry table. They are optional, but
| pretty awesome to filter the table by certain values.
| You may simply do a 'tabs' => [], to disable them.
|
Expand Down Expand Up @@ -760,7 +760,7 @@
| Tabs
|--------------------------------------------------------------------------
|
| Define the tabs for the Resource table. They are optional, but
| Define the tabs for the Expiry table. They are optional, but
| pretty awesome to filter the table by certain values.
| You may simply do a 'tabs' => [], to disable them.
|
Expand Down Expand Up @@ -807,7 +807,7 @@
| Tabs
|--------------------------------------------------------------------------
|
| Define the tabs for the Resource table. They are optional, but
| Define the tabs for the Expiry table. They are optional, but
| pretty awesome to filter the table by certain values.
| You may simply do a 'tabs' => [], to disable them.
|
Expand Down Expand Up @@ -854,7 +854,7 @@
| Tabs
|--------------------------------------------------------------------------
|
| Define the tabs for the Resource table. They are optional, but
| Define the tabs for the Expiry table. They are optional, but
| pretty awesome to filter the table by certain values.
| You may simply do a 'tabs' => [], to disable them.
|
Expand Down Expand Up @@ -901,7 +901,7 @@
| Tabs
|--------------------------------------------------------------------------
|
| Define the tabs for the Resource table. They are optional, but
| Define the tabs for the Expiry table. They are optional, but
| pretty awesome to filter the table by certain values.
| You may simply do a 'tabs' => [], to disable them.
|
Expand Down Expand Up @@ -948,7 +948,7 @@
| Tabs
|--------------------------------------------------------------------------
|
| Define the tabs for the Resource table. They are optional, but
| Define the tabs for the Expiry table. They are optional, but
| pretty awesome to filter the table by certain values.
| You may simply do a 'tabs' => [], to disable them.
|
Expand Down Expand Up @@ -1127,6 +1127,7 @@
'Author' => serialize(['author' => true]),
'Contributor' => serialize(['contributor' => true]),
'Subscriber' => serialize(['subscriber' => true]),
'No role for this site' => serialize(['' => true]),
],

'wp_user_levels' => [
Expand Down Expand Up @@ -1174,7 +1175,6 @@
'mm_sua_attachment_id' => '',

// locale
// comment_shortcuts
// syntax_highlighting

],
Expand Down
8 changes: 5 additions & 3 deletions packages/core/resources/lang/de/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'user_type' => 'User Model',
'username' => 'Benutzername',
'profile_photo_path' => 'Profilfotopfad',
'avatar_url' => 'Avatar Url',
'avatar' => 'Avatar',
'password' => 'Password',
'language_id' => 'Language ID',
'user_updated' => 'Benutzer aktualisiert',
Expand All @@ -27,9 +27,11 @@
'user_pass' => 'User Pass',
'display_name' => 'Anzeigename',
'roles' => 'Roles',
'role' => 'Rolle',
'gender' => 'Gender',
'first_name' => 'First Name',
'last_name' => 'Last Name',
'first_name' => 'Vorname',
'last_name' => 'Nachname',
'name' => 'Name',
'email' => 'Email',
'email_verified_at' => 'Email verified at',
'website' => 'Website',
Expand Down
4 changes: 3 additions & 1 deletion packages/core/resources/lang/en/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
'user_type' => 'User Model',
'username' => 'Username',
'profile_photo_path' => 'Profile Photo Path',
'avatar_url' => 'Avatar Url',
'avatar' => 'Avatar',
'password' => 'Password',
'language_id' => 'Language ID',
'user_updated' => 'User updated',
Expand All @@ -28,9 +28,11 @@
'user_pass' => 'User Pass',
'display_name' => 'Display Name',
'roles' => 'Roles',
'role' => 'Role',
'gender' => 'Gender',
'first_name' => 'First Name',
'last_name' => 'Last Name',
'name' => 'Name',
'email' => 'Email',
'email_verified_at' => 'Email verified at',
'website' => 'Website',
Expand Down
8 changes: 4 additions & 4 deletions packages/press/config/press.php
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@
*/

'default_user_meta' => [
'nickname' => $user_login ?? '',
'nickname' => '',
'first_name' => '',
'last_name' => '',
'description' => '',
Expand All @@ -1149,12 +1149,12 @@
'admin_color' => 'fresh',
'use_ssl' => '0',
'show_admin_bar_front' => 'true',
env('WP_PREFIX', 'wp_').'_capabilities' => serialize([
env('WP_PREFIX', 'wp_').'capabilities' => serialize([
'subscriber' => true,
]),
env('WP_PREFIX', 'wp_').'_user_level' => '0',
env('WP_PREFIX', 'wp_').'user_level' => '0',
'dismissed_wp_pointers' => '',
env('WP_PREFIX', 'wp_').'_dashboard_quick_press_last_post_id' => '0',
env('WP_PREFIX', 'wp_').'dashboard_quick_press_last_post_id' => '0',
'mm_sua_attachment_id' => '',

// locale
Expand Down
15 changes: 14 additions & 1 deletion packages/press/src/Models/WpUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Filament\Panel;
use Illuminate\Contracts\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
Expand Down Expand Up @@ -70,6 +71,13 @@ protected static function boot()
$model->addOrUpdateMeta('created_at', now()->toDateTimeString());
});

static::saving(function ($post) {
// Überprüfe, ob das Datum ungültig ist, und setze es auf NULL oder ein Standarddatum
if ($post->post_modified == '0000-00-00 00:00:00') {
$post->post_modified = null; // oder ein anderes gültiges Datum wie '1970-01-01 00:00:00'
}
});

static::updated(function ($model) {
$model->addOrUpdateMeta('updated_at', now()->toDateTimeString());
});
Expand Down Expand Up @@ -174,11 +182,16 @@ public function userMeta(): HasMany
return $this->hasMany(WpUserMeta::class, 'user_id', 'ID');
}

public function attachment()
public function attachment(): BelongsTo
{
return $this->belongsTo(WpPost::class, 'mm_sua_attachment_id', 'ID');
}

public function postmeta(): BelongsTo
{
return $this->belongsTo(WpPostMeta::class, 'mm_sua_attachment_id', 'post_id');
}

protected function newBaseQueryBuilder()
{
$connection = $this->getConnection();
Expand Down
Loading

0 comments on commit 2795523

Please sign in to comment.