empty page button title improvement
This commit is contained in:
parent
95bb91dcf5
commit
35147ea78c
@ -26,6 +26,12 @@ class EmptyPage extends Component
|
||||
/** @var string */
|
||||
public $title;
|
||||
|
||||
/** @var string */
|
||||
public $createButtonTitle;
|
||||
|
||||
/** @var string */
|
||||
public $importButtonTitle;
|
||||
|
||||
/** @var string */
|
||||
public $description;
|
||||
|
||||
@ -75,9 +81,9 @@ class EmptyPage extends Component
|
||||
*/
|
||||
public function __construct(
|
||||
string $alias = '', string $group = '', string $page = '',
|
||||
string $title = '', string $description = '', string $docsCategory = 'accounting',
|
||||
string $image = '', string $imageEmptyPage = '',
|
||||
bool $checkPermissionCreate = true, string $permissionCreate = '',
|
||||
string $title = '', string $createButtonTitle = '', string $importButtonTitle = '',
|
||||
string $description = '', string $docsCategory = 'accounting', string $image = '',
|
||||
string $imageEmptyPage = '', bool $checkPermissionCreate = true, string $permissionCreate = '',
|
||||
array $buttons = [], bool $hideButtonCreate = false, bool $hideButtonImport = false,
|
||||
bool $hideDocsDescription = false, string $importRoute = '', array $importRouteParameters = []
|
||||
) {
|
||||
@ -91,6 +97,9 @@ class EmptyPage extends Component
|
||||
$this->docsCategory = $docsCategory;
|
||||
|
||||
$this->title = $this->getTitle($title);
|
||||
$this->createButtonTitle = $createButtonTitle;
|
||||
$this->importButtonTitle = $importButtonTitle;
|
||||
|
||||
$this->description = $this->getDescription($description);
|
||||
|
||||
$this->imageEmptyPage = $imageEmptyPage;
|
||||
@ -276,7 +285,11 @@ class EmptyPage extends Component
|
||||
$route = route($page . '.create');
|
||||
}
|
||||
|
||||
$title = $this->getTitle(null, 1);
|
||||
$title = $this->createButtonTitle;
|
||||
|
||||
if (! $title) {
|
||||
$title = $this->getTitle(null, 1);
|
||||
}
|
||||
|
||||
return [
|
||||
'url' => $route,
|
||||
@ -292,7 +305,11 @@ class EmptyPage extends Component
|
||||
$importRoute = $this->getImportRoute($this->importRoute);
|
||||
$importRouteParameters = $this->getImportRouteParameters($this->importRouteParameters);
|
||||
|
||||
$title = $this->getTitle();
|
||||
$title = $this->importButtonTitle;
|
||||
|
||||
if (! $title) {
|
||||
$title = $this->getTitle();
|
||||
}
|
||||
|
||||
return [
|
||||
'url' => route($importRoute, $importRouteParameters),
|
||||
|
Loading…
x
Reference in New Issue
Block a user