Skip to content

Commit

Permalink
Merge pull request #391 from codepress/release/4.7
Browse files Browse the repository at this point in the history
Release/4.7
  • Loading branch information
DGStefan authored Dec 6, 2023
2 parents 96cd94a + 83825b9 commit e847d8b
Show file tree
Hide file tree
Showing 232 changed files with 6,633 additions and 5,017 deletions.
2 changes: 1 addition & 1 deletion assets/css/acui.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/css/admin-general.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/admin-page-columns.css

Large diffs are not rendered by default.

162 changes: 161 additions & 1 deletion assets/css/components/value-modal.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/css/table.css

Large diffs are not rendered by default.

Binary file modified assets/fonts/cpac_icons.woff
Binary file not shown.
Binary file modified assets/fonts/cpac_icons.woff2
Binary file not shown.
2 changes: 1 addition & 1 deletion assets/js/admin-general.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/admin-page-addons.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/admin-page-columns.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/admin-page-settings.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/table.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions classes/Admin/Asset/Columns.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public function register(): void
'original_columns' => [],
'uninitialized_list_screens' => [],
'i18n' => [
'value' => __('Value', 'codepress-admin-columns'),
'label' => __('Label', 'codepress-admin-columns'),
'clone' => __('%s column is already present and can not be duplicated.', 'codepress-admin-columns'),
'error' => __('Invalid response.', 'codepress-admin-columns'),
'errors' => [
Expand Down
8 changes: 6 additions & 2 deletions classes/Admin/Page/Columns.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ public function render(): string
$classes[] = 'show-list-screen-type';
}

$list_id = $this->list_screen->has_id()
? (string)$this->list_screen->get_id()
: '';

ob_start();
?>
<h1 class="screen-reader-text"><?= __('Columns', 'codepress-admin-columns'); ?></h1>
Expand Down Expand Up @@ -212,7 +216,7 @@ public function render(): string
'label_main' => $label_main,
'label_second' => $label_second,
'list_screen_key' => $this->list_screen->get_key(),
'list_screen_id' => $this->list_screen->get_layout_id(),
'list_screen_id' => $list_id,
'delete_confirmation_message' => $delete_confirmation_message,
]);

Expand Down Expand Up @@ -281,7 +285,7 @@ public function render(): string
$columns = new View([
'class' => implode(' ', $classes),
'list_screen' => $this->list_screen->get_key(),
'list_screen_id' => $this->list_screen->get_layout_id(),
'list_screen_id' => $list_id,
'title' => $this->list_screen->get_title(),
'columns' => $this->list_screen->get_columns(),
'show_actions' => ! $this->list_screen->is_read_only(),
Expand Down
39 changes: 39 additions & 0 deletions classes/Admin/ScreenOption/ListScreenSource.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

namespace AC\Admin\ScreenOption;

use AC\Admin\Preference;
use AC\Admin\ScreenOption;

class ListScreenSource extends ScreenOption
{

private const KEY = 'show_tools_list_screen_source';

private $preference;

public function __construct(Preference\ScreenOptions $preference)
{
$this->preference = $preference;
}

public function is_active(): bool
{
return 1 === $this->preference->get(self::KEY);
}

public function render(): string
{
ob_start();
?>

<label for="ac-list-screen-source" data-ac-screen-option="<?= self::KEY ?>">
<input id="ac-list-screen-source" type="checkbox" <?php
checked($this->is_active()); ?>>
<?= __('List Screen Source', 'codepress-admin-columns') ?>
</label>
<?php
return ob_get_clean();
}

}
Loading

0 comments on commit e847d8b

Please sign in to comment.