Initial commit
This commit is contained in:
commit
388079e6bb
1108 changed files with 330121 additions and 0 deletions
33
kirby/src/Panel/Ui/Buttons/LanguageCreateButton.php
Normal file
33
kirby/src/Panel/Ui/Buttons/LanguageCreateButton.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
namespace Kirby\Panel\Ui\Buttons;
|
||||
|
||||
use Kirby\Cms\App;
|
||||
use Kirby\Toolkit\I18n;
|
||||
|
||||
/**
|
||||
* View button to create a new language
|
||||
*
|
||||
* @package Kirby Panel
|
||||
* @author Nico Hoffmann <nico@getkirby.com>
|
||||
* @link https://getkirby.com
|
||||
* @copyright Bastian Allgeier
|
||||
* @license https://getkirby.com/license
|
||||
* @since 5.0.0
|
||||
* @unstable
|
||||
*/
|
||||
class LanguageCreateButton extends ViewButton
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$user = App::instance()->user();
|
||||
$permission = $user?->role()->permissions()->for('languages', 'create');
|
||||
|
||||
parent::__construct(
|
||||
dialog: 'languages/create',
|
||||
disabled: $permission !== true,
|
||||
icon: 'add',
|
||||
text: I18n::translate('language.create'),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue