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