* [DEV] New Plugin infraestructure (work in progress).

This commit is contained in:
nuxsmin
2017-01-04 15:20:58 +01:00
parent b33619c296
commit 9b8ae149fa
4 changed files with 10 additions and 2 deletions

View File

@@ -29,9 +29,11 @@ use SP\Controller\RequestControllerTrait;
use SP\Core\Exceptions\SPException;
use SP\Core\Plugin\PluginDataStore;
use SP\Core\Session as CoreSession;
use SP\Core\Session;
use SP\DataModel\PluginData;
use SP\Http\Request;
use SP\Mgmt\Plugins\Plugin;
use SP\Util\Checks;
use SP\Util\Json;
/**
@@ -94,6 +96,11 @@ class ActionController implements ItemControllerInterface
Json::returnJson($this->jsonResponse);
}
if (Checks::demoIsEnabled()) {
$this->jsonResponse->setDescription(_('Ey, esto es una DEMO!!'));
Json::returnJson($this->jsonResponse);
}
try {
$data = $this->Plugin->getData();

View File

@@ -54,7 +54,7 @@ class AuthenticatorPlugin extends PluginBase
*/
public function init()
{
if ($this->data === null) {
if (!is_array($this->data)) {
$this->data = [];
}

View File

@@ -66,7 +66,7 @@ class PreferencesController
$base = $this->Plugin->getThemeDir() . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'userpreferences';
// Datos del plugin
$pluginData = $this->Plugin->getData();
$pluginData = $this->Plugin->getData() ?: [];
// Datos del usuario de la sesión
$UserData = $this->Controller->getUserData();

View File

@@ -135,6 +135,7 @@ class Acl implements ActionsInterface
return ($curUserProfile->isMgmCategories() || $curUserProfile->isMgmCustomers());
case self::ACTION_CFG:
return ($curUserProfile->isConfigGeneral() || $curUserProfile->isConfigEncryption() || $curUserProfile->isConfigBackup() || $curUserProfile->isConfigImport());
case self::ACTION_MGM_PLUGINS:
case self::ACTION_CFG_GENERAL:
return $curUserProfile->isConfigGeneral();
case self::ACTION_CFG_IMPORT: