Version 5.0.0 beta 11.1

This commit is contained in:
Neo committed 2025-12-19 18:00:22 -08:00
1 parent 264eeb97e0
commit 90e8c7e903
466 files changed
+7796 -2394

No files matched your search

+38 -5
View File
@@ -14,7 +14,6 @@ class Link extends MenuItem
* @var Url|string
*/
public Url|string $url = '';
public string $extraHtml = '';
public string $identifier = '';
public string $notificationIcon = '';
public array $dataAttributes = [];
@@ -64,6 +63,40 @@ class Link extends MenuItem
*/
public function opensDialog( string $title = NULL, string $size = 'medium', bool $destruct = FALSE, string $contentSelector = NULL, bool $remoteSubmit = FALSE ): self
{
/* Check data attributes to see if they already exist, they may have been passed in the constructor */
foreach( $this->dataAttributes as $key => $value )
{
switch( $key )
{
case 'data-ipsDialog-title':
if( $title === null )
{
$title = $value;
unset( $this->dataAttributes['data-ipsDialog-title'] );
}
break;
case 'data-ipsDialog-size':
$size = $value;
unset( $this->dataAttributes['data-ipsDialog-size'] );
break;
case 'data-ipsDialog-content':
if( $contentSelector === null )
{
$contentSelector = $value;
unset( $this->dataAttributes['data-ipsDialog-content'] );
}
break;
case 'data-ipsDialog-destructOnClose':
$destruct = $value;
unset( $this->dataAttributes['data-ipsDialog-destructOnClose'] );
break;
case 'data-ipsDialog-remoteSubmit':
$remoteSubmit = $value;
unset( $this->dataAttributes['data-ipsDialog-remoteSubmit'] );
break;
}
}
$this->addAttribute( 'data-ipsDialog')
->addAttribute( 'data-ipsDialog-size', $size )
->addAttribute( 'data-ipsDialog-title', Member::loggedIn()->language()->addToStack( $title ?? $this->title ) );
@@ -103,12 +136,12 @@ class Link extends MenuItem
$this->css = $css;
$this->dataAttributes = $dataAttributes;
$this->icon = $icon;
$this->menuItem = $identifier ?: $languageString;
$this->identifier = $identifier;
$this->menuItem = $this->identifier ?: $this->title;
if( !$id )
{
$id = 'menuLink_' . md5($languageString ) . '_' . $this->identifier;
$id = 'menuLink_' . md5( $this->title ) . '_' . $this->identifier;
}
$this->id = $id;
if( $opensDialog )
@@ -116,7 +149,7 @@ class Link extends MenuItem
$this->opensDialog();
}
$this->addAttribute( 'data-menuItem', $languageString);
$this->addAttribute( 'data-menuItem', $this->menuItem );
}
/**