Skip to content

Commit

Permalink
Fixed calls to dialog wrapper in plugin manager.
Browse files Browse the repository at this point in the history
  • Loading branch information
feuzeu committed Apr 29, 2019
1 parent 328428a commit d9d608b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
20 changes: 10 additions & 10 deletions src/Dialog/Dialog.php
Expand Up @@ -20,28 +20,28 @@ class Dialog
/**
* Javascript confirm function
*
* @var Jaxon\Dialog\Interfaces\Confirm
* @var Interfaces\Confirm
*/
private $xConfirm;

/**
* Default javascript confirm function
*
* @var Jaxon\Dialog\Confirm
* @var Confirm
*/
private $xDefaultConfirm;

/**
* Javascript alert function
*
* @var Jaxon\Dialog\Interfaces\Alert
* @var Interfaces\Alert
*/
private $xAlert;

/**
* Default javascript alert function
*
* @var Jaxon\Dialog\Alert
* @var Alert
*/
private $xDefaultAlert;

Expand All @@ -62,7 +62,7 @@ public function __construct()
/**
* Set the javascript confirm function
*
* @param Jaxon\Dialog\Interfaces\Confirm $xConfirm The javascript confirm function
* @param Interfaces\Confirm $xConfirm The javascript confirm function
*
* @return void
*/
Expand All @@ -74,7 +74,7 @@ public function setConfirm(Interfaces\Confirm $xConfirm)
/**
* Get the javascript confirm function
*
* @return Jaxon\Dialog\Interfaces\Confirm
* @return Interfaces\Confirm
*/
public function getConfirm()
{
Expand All @@ -84,7 +84,7 @@ public function getConfirm()
/**
* Get the default javascript confirm function
*
* @return Jaxon\Dialog\Confirm
* @return Confirm
*/
public function getDefaultConfirm()
{
Expand All @@ -94,7 +94,7 @@ public function getDefaultConfirm()
/**
* Set the javascript alert function
*
* @param Jaxon\Dialog\Interfaces\Alert $xAlert The javascript alert function
* @param Interfaces\Alert $xAlert The javascript alert function
*
* @return void
*/
Expand All @@ -106,7 +106,7 @@ public function setAlert(Interfaces\Alert $xAlert)
/**
* Get the javascript alert function
*
* @return Jaxon\Dialog\Interfaces\Alert
* @return Interfaces\Alert
*/
public function getAlert()
{
Expand All @@ -116,7 +116,7 @@ public function getAlert()
/**
* Get the default javascript alert function
*
* @return Jaxon\Dialog\Alert
* @return Alert
*/
public function getDefaultAlert()
{
Expand Down
10 changes: 5 additions & 5 deletions src/Plugin/Manager.php
Expand Up @@ -130,8 +130,8 @@ private function setPluginPriority(Plugin $xPlugin, $nPriority)
*/
public function registerPlugin(Plugin $xPlugin, $nPriority = 1000)
{
$bIsAlert = ($xPlugin instanceof Dialogs\Interfaces\Alert);
$bIsConfirm = ($xPlugin instanceof Dialogs\Interfaces\Confirm);
$bIsAlert = ($xPlugin instanceof \Jaxon\Dialog\Interfaces\Alert);
$bIsConfirm = ($xPlugin instanceof \Jaxon\Dialog\Interfaces\Confirm);
if($xPlugin instanceof Request)
{
// The name of a request plugin is used as key in the plugin table
Expand All @@ -144,17 +144,17 @@ public function registerPlugin(Plugin $xPlugin, $nPriority = 1000)
}
elseif(!$bIsConfirm && !$bIsAlert)
{
throw new \Jaxon\Exception\Error($this->trans('errors.register.invalid', array('name' => get_class($xPlugin))));
throw new \Jaxon\Exception\Error($this->trans('errors.register.invalid', ['name' => get_class($xPlugin)]));
}
// This plugin implements the Alert interface
if($bIsAlert)
{
$this->setAlert($xPlugin);
jaxon()->dialog()->setAlert($xPlugin);
}
// This plugin implements the Confirm interface
if($bIsConfirm)
{
$this->setConfirm($xPlugin);
jaxon()->dialog()->setConfirm($xPlugin);
}
// Register the plugin as an event listener
if($xPlugin instanceof \Jaxon\Utils\Interfaces\EventListener)
Expand Down

0 comments on commit d9d608b

Please sign in to comment.