diff --git a/src/.editorconfig b/.editorconfig
similarity index 100%
rename from src/.editorconfig
rename to .editorconfig
diff --git a/.gitignore b/.gitignore
index dbd3b9a15..a63be0781 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,4 +28,4 @@ npm-debug.log
.history/
### friendsofphp/php-cs-fixer ###
-src/.php-cs-fixer.cache
+.php-cs-fixer.cache
diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php
new file mode 100644
index 000000000..fa4bcebc2
--- /dev/null
+++ b/.php-cs-fixer.dist.php
@@ -0,0 +1,53 @@
+setRules([
+ '@PHP74Migration' => true,
+ '@Symfony' => true,
+ 'header_comment' => ['header' => $fileHeaderComment, 'comment_type' => 'PHPDoc'],
+ 'concat_space' => ['spacing' => 'one'],
+ 'protected_to_private' => false,
+ 'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => false],
+ ])
+ ->setRiskyAllowed(false)
+ ->setFinder(
+ (new PhpCsFixer\Finder())
+ ->in(__DIR__ . '/src')
+ ->exclude([
+ 'bb-data',
+ 'bb-library',
+ 'bb-locale',
+ 'bb-themes',
+ 'bb-vendor',
+ 'install',
+ 'bb-modules/Wysiwyg',
+ ])
+ ->notPath('rb.php')
+ )
+;
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a37149a9d..e12e3e4be 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,7 @@ Master
------------------------------------------------------------------------------
**General:**
+* Templates extensions .phtml ranamed to .html.twig
* Updated bb-themes/bootstrap to Bootstrap 5
Release 4.22-beta.1.1
diff --git a/src/.php-cs-fixer.dist.php b/src/.php-cs-fixer.dist.php
deleted file mode 100644
index 47366a954..000000000
--- a/src/.php-cs-fixer.dist.php
+++ /dev/null
@@ -1,26 +0,0 @@
-setRules([
- '@PHP71Migration' => true,
- '@Symfony' => true,
- 'protected_to_private' => false,
- 'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => false],
- 'phpdoc_to_comment' => false,
- ])
- ->setRiskyAllowed(false)
- ->setFinder(
- (new PhpCsFixer\Finder())
- ->in(__DIR__)
- ->exclude([
- 'bb-data',
- 'bb-library',
- 'bb-locale',
- 'bb-themes',
- 'bb-vendor',
- 'install',
- 'bb-modules/Wysiwyg'
- ])
- ->notPath('rb.php')
- )
-;
diff --git a/src/bb-library/Box/App.php b/src/bb-library/Box/App.php
index 67ffa7b5e..153f8a8c5 100644
--- a/src/bb-library/Box/App.php
+++ b/src/bb-library/Box/App.php
@@ -1,6 +1,7 @@
options = new ArrayObject($options);
}
@@ -44,20 +44,20 @@ class Box_App {
protected function registerModule()
{
- //bind module urls and process
- //determine module and bind urls
+ // bind module urls and process
+ // determine module and bind urls
$requestUri = $this->url;
- if(empty($requestUri)) {
+ if (empty($requestUri)) {
$requestUri = '/';
}
- if($requestUri == '/') {
+ if ('/' == $requestUri) {
$mod = 'index';
} else {
$requestUri = trim($requestUri, '/');
- if(strpos($requestUri, '/') === false) {
+ if (false === strpos($requestUri, '/')) {
$mod = $requestUri;
} else {
- list($mod) = explode('/',$requestUri);
+ [$mod] = explode('/', $requestUri);
}
}
$mod = filter_var($mod, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);
@@ -66,12 +66,16 @@ class Box_App {
$this->uri = $requestUri;
}
- protected function init(){}
+ protected function init()
+ {
+ }
- public function show404(Exception $e) {
+ public function show404(Exception $e)
+ {
error_log($e->getMessage());
- header("HTTP/1.0 404 Not Found");
- return $this->render('404', array('exception'=>$e));
+ header('HTTP/1.0 404 Not Found');
+
+ return $this->render('404', ['exception' => $e]);
}
/**
@@ -79,8 +83,9 @@ class Box_App {
* @param string $methodName
* @param string $class
*/
- public function get($url, $methodName, $conditions = array(), $class = null) {
- $this->event('get', $url, $methodName, $conditions, $class);
+ public function get($url, $methodName, $conditions = [], $class = null)
+ {
+ $this->event('get', $url, $methodName, $conditions, $class);
}
/**
@@ -88,48 +93,55 @@ class Box_App {
* @param string $methodName
* @param string $class
*/
- public function post($url, $methodName, $conditions = array(), $class = null) {
- $this->event('post', $url, $methodName, $conditions, $class);
+ public function post($url, $methodName, $conditions = [], $class = null)
+ {
+ $this->event('post', $url, $methodName, $conditions, $class);
}
- public function put($url, $methodName, $conditions = array(), $class = null) {
- $this->event('put', $url, $methodName, $conditions, $class);
+ public function put($url, $methodName, $conditions = [], $class = null)
+ {
+ $this->event('put', $url, $methodName, $conditions, $class);
}
- public function delete($url, $methodName, $conditions = array(), $class = null) {
- $this->event('delete', $url, $methodName, $conditions, $class);
+ public function delete($url, $methodName, $conditions = [], $class = null)
+ {
+ $this->event('delete', $url, $methodName, $conditions, $class);
}
- public function before($methodName, $filterName) {
+ public function before($methodName, $filterName)
+ {
$this->push_filter($this->before_filters, $methodName, $filterName);
}
- public function after($methodName, $filterName) {
+ public function after($methodName, $filterName)
+ {
$this->push_filter($this->after_filters, $methodName, $filterName);
}
- protected function push_filter(&$arr_filter, $methodName, $filterName) {
+ protected function push_filter(&$arr_filter, $methodName, $filterName)
+ {
if (!is_array($methodName)) {
$methodName = explode('|', $methodName);
}
$counted = count($methodName);
- for ($i = 0; $i < $counted; $i++) {
+ for ($i = 0; $i < $counted; ++$i) {
$method = $methodName[$i];
if (!isset($arr_filter[$method])) {
- $arr_filter[$method] = array();
+ $arr_filter[$method] = [];
}
array_push($arr_filter[$method], $filterName);
}
}
- protected function run_filter($arr_filter, $methodName) {
- if(isset($arr_filter[$methodName])) {
+ protected function run_filter($arr_filter, $methodName)
+ {
+ if (isset($arr_filter[$methodName])) {
$counted = count($arr_filter[$methodName]);
- for ($i=0; $i < $counted; $i++) {
- $return = call_user_func(array($this, $arr_filter[$methodName][$i]));
+ for ($i = 0; $i < $counted; ++$i) {
+ $return = call_user_func([$this, $arr_filter[$methodName][$i]]);
- if(!is_null($return)) {
+ if (!is_null($return)) {
return $return;
}
}
@@ -140,6 +152,7 @@ class Box_App {
{
$this->registerModule();
$this->init();
+
return $this->processRequest();
}
@@ -156,42 +169,45 @@ class Box_App {
/**
* @param string $fileName
*/
- public function render($fileName, $variableArray = array())
+ public function render($fileName, $variableArray = [])
{
- print 'Rendering '.$fileName;
+ echo 'Rendering ' . $fileName;
}
- public function sendFile($filename, $contentType, $path) {
+ public function sendFile($filename, $contentType, $path)
+ {
header("Content-type: $contentType");
header("Content-Disposition: attachment; filename=$filename");
+
return readfile($path);
}
- public function sendDownload($filename, $path) {
- header("Content-Type: application/force-download");
- header("Content-Type: application/octet-stream");
- header("Content-Type: application/download");
- header("Content-Description: File Transfer");
- header("Content-Disposition: attachment; filename=$filename".";");
- header("Content-Transfer-Encoding: binary");
+ public function sendDownload($filename, $path)
+ {
+ header('Content-Type: application/force-download');
+ header('Content-Type: application/octet-stream');
+ header('Content-Type: application/download');
+ header('Content-Description: File Transfer');
+ header("Content-Disposition: attachment; filename=$filename" . ';');
+ header('Content-Transfer-Encoding: binary');
+
return readfile($path);
}
protected function executeShared($classname, $methodName, $params)
{
$class = new $classname();
- if($class instanceof InjectionAwareInterface) {
+ if ($class instanceof InjectionAwareInterface) {
$class->setDi($this->di);
}
$reflection = new ReflectionMethod(get_class($class), $methodName);
- $args = array();
+ $args = [];
$args[] = $this; // first param always app instance
- foreach($reflection->getParameters() as $param) {
- if(isset($params[$param->name])) {
+ foreach ($reflection->getParameters() as $param) {
+ if (isset($params[$param->name])) {
$args[$param->name] = $params[$param->name];
- }
- else if($param->isDefaultValueAvailable()) {
+ } elseif ($param->isDefaultValueAvailable()) {
$args[$param->name] = $param->getDefaultValue();
}
}
@@ -199,20 +215,20 @@ class Box_App {
return $reflection->invokeArgs($class, $args);
}
- protected function execute($methodName, $params, $classname = null) {
+ protected function execute($methodName, $params, $classname = null)
+ {
$return = $this->run_filter($this->before_filters, $methodName);
if (!is_null($return)) {
- return $return;
+ return $return;
}
$reflection = new ReflectionMethod(get_class($this), $methodName);
- $args = array();
+ $args = [];
- foreach($reflection->getParameters() as $param) {
- if(isset($params[$param->name])) {
+ foreach ($reflection->getParameters() as $param) {
+ if (isset($params[$param->name])) {
$args[$param->name] = $params[$param->name];
- }
- else if($param->isDefaultValueAvailable()) {
+ } elseif ($param->isDefaultValueAvailable()) {
$args[$param->name] = $param->getDefaultValue();
}
}
@@ -221,7 +237,7 @@ class Box_App {
$return = $this->run_filter($this->after_filters, $methodName);
if (!is_null($return)) {
- return $return;
+ return $return;
}
return $response;
@@ -230,18 +246,19 @@ class Box_App {
/**
* @param string $httpMethod
*/
- protected function event($httpMethod, $url, $methodName, $conditions=array(), $classname = null) {
+ protected function event($httpMethod, $url, $methodName, $conditions = [], $classname = null)
+ {
if (method_exists($this, $methodName)) {
- array_push($this->mappings, array($httpMethod, $url, $methodName, $conditions));
+ array_push($this->mappings, [$httpMethod, $url, $methodName, $conditions]);
}
if (null !== $classname) {
- array_push($this->shared, array($httpMethod, $url, $methodName, $conditions, $classname));
+ array_push($this->shared, [$httpMethod, $url, $methodName, $conditions, $classname]);
}
}
/**
* Check if the requested URL is in the allowlist.
- *
+ *
* @since 4.22.0
*/
protected function checkAllowedURLs()
@@ -249,54 +266,57 @@ class Box_App {
$REQUEST_URI = $this->di['request']->getServer('REQUEST_URI');
$allowedURLs = $this->di['config']['maintenance_mode']['allowed_urls'];
$rootUrl = $this->di['config']['url'];
-
+
// Allow access to the staff panel all the time
$adminApiPrefixes = [
- "/api/guest/staff/login",
- "/api/admin",
+ '/api/guest/staff/login',
+ '/api/admin',
];
- foreach ($adminApiPrefixes as $adminApiPrefix){
- $realAdminApiUrl = $rootUrl [-1] === '/' ? substr($rootUrl, 0 ,-1).$adminApiPrefix : $rootUrl.$adminApiPrefix;
+ foreach ($adminApiPrefixes as $adminApiPrefix) {
+ $realAdminApiUrl = '/' === $rootUrl[-1] ? substr($rootUrl, 0, -1) . $adminApiPrefix : $rootUrl . $adminApiPrefix;
$allowedURLs[] = parse_url($realAdminApiUrl)['path'];
}
- foreach ($allowedURLs as $url){
- if (preg_match('/^'.str_replace('/','\/', $url).'(.*)/', $REQUEST_URI) !== 0){
+ foreach ($allowedURLs as $url) {
+ if (0 !== preg_match('/^' . str_replace('/', '\/', $url) . '(.*)/', $REQUEST_URI)) {
return false;
}
}
+
return true;
}
/**
* Check if the visitor IP is in the allowlist.
- *
+ *
* @since 4.22.0
*/
protected function checkAllowedIPs()
{
- $allowedIPs = $this->di['config']['maintenance_mode']['allowed_ips'];
+ $allowedIPs = $this->di['config']['maintenance_mode']['allowed_ips'];
$visitorIP = $this->di['request']->getClientAddress();
// Check if the visitor is in using of the allowed IPs/networks
- foreach ($allowedIPs as $network)
- {
- if(strpos($network, '/') == false){$network .= '/32';}
- list($network, $netmask) = explode('/', $network, 2);
+ foreach ($allowedIPs as $network) {
+ if (false == strpos($network, '/')) {
+ $network .= '/32';
+ }
+ [$network, $netmask] = explode('/', $network, 2);
$network_decimal = ip2long($network);
$ip_decimal = ip2long($visitorIP);
$wildcard_decimal = pow(2, (32 - $netmask)) - 1;
- $netmask_decimal = ~ $wildcard_decimal;
- if(($ip_decimal & $netmask_decimal) == ($network_decimal & $netmask_decimal)){
+ $netmask_decimal = ~$wildcard_decimal;
+ if (($ip_decimal & $netmask_decimal) == ($network_decimal & $netmask_decimal)) {
return false;
}
}
+
return true;
}
/**
* Check if the requested URL is a part of the admin area.
- *
+ *
* @since 4.22.0
*/
protected function checkAdminPrefix()
@@ -305,12 +325,13 @@ class Box_App {
$adminPrefix = $this->di['config']['admin_area_prefix'];
$rootUrl = $this->di['config']['url'];
- $realAdminUrl = $rootUrl[-1] === '/' ? substr($rootUrl, 0 ,-1).$adminPrefix : $rootUrl.$adminPrefix;
+ $realAdminUrl = '/' === $rootUrl[-1] ? substr($rootUrl, 0, -1) . $adminPrefix : $rootUrl . $adminPrefix;
$realAdminPath = parse_url($realAdminUrl)['path'];
-
- if (preg_match('/^'.str_replace('/','\/', $realAdminPath).'(.*)/', $REQUEST_URI) !== 0) {
+
+ if (0 !== preg_match('/^' . str_replace('/', '\/', $realAdminPath) . '(.*)/', $REQUEST_URI)) {
return false;
}
+
return true;
}
@@ -319,18 +340,18 @@ class Box_App {
/**
* Block requests if the system is undergoing maintenance.
* It will respect any URL/IP whitelisting under the configuration file.
- *
+ *
* @since 4.22.0
*/
- if($this->di['config']['maintenance_mode']['enabled'] === true)
- {
+ if (true === $this->di['config']['maintenance_mode']['enabled']) {
// Check the allowlists
- if($this->checkAdminPrefix() && $this->checkAllowedURLs() && $this->checkAllowedIPs()) {
+ if ($this->checkAdminPrefix() && $this->checkAllowedURLs() && $this->checkAllowedIPs()) {
// Set response code to 503.
- header("HTTP/1.0 503 Service Unavailable");
+ header('HTTP/1.0 503 Service Unavailable');
- if($this->mod == "api") {
+ if ('api' == $this->mod) {
$exc = new \Box_Exception('The system is undergoing maintenance. Please try again later.', [], 503);
+
return (new \Box\Mod\Api\Controller\Client())->renderJson(null, $exc);
} else {
return $this->render('mod_system_maintenance');
@@ -339,25 +360,26 @@ class Box_App {
}
$sharedCount = count($this->shared);
- for($i = 0; $i < $sharedCount; $i++) {
+ for ($i = 0; $i < $sharedCount; ++$i) {
$mapping = $this->shared[$i];
$url = new Box_UrlHelper($mapping[0], $mapping[1], $mapping[3], $this->url);
- if($url->match) {
+ if ($url->match) {
return $this->executeShared($mapping[4], $mapping[2], $url->params);
}
}
// this class mappings
$mappingsCount = count($this->mappings);
- for($i = 0; $i < $mappingsCount; $i++) {
+ for ($i = 0; $i < $mappingsCount; ++$i) {
$mapping = $this->mappings[$i];
$url = new Box_UrlHelper($mapping[0], $mapping[1], $mapping[3], $this->url);
- if($url->match) {
+ if ($url->match) {
return $this->execute($mapping[2], $url->params);
}
}
- $e = new \Box_Exception('Page :url not found', array(':url'=>$this->url), 404);
+ $e = new \Box_Exception('Page :url not found', [':url' => $this->url], 404);
+
return $this->show404($e);
}
@@ -384,4 +406,4 @@ class Box_App {
{
return $this->di['api_guest'];
}
-}
\ No newline at end of file
+}
diff --git a/src/bb-library/Box/AppAdmin.php b/src/bb-library/Box/AppAdmin.php
index 429d371c3..f205ff5a5 100644
--- a/src/bb-library/Box/AppAdmin.php
+++ b/src/bb-library/Box/AppAdmin.php
@@ -1,6 +1,7 @@
register($this);
}
- public function render($fileName, $variableArray = array())
+ public function render($fileName, $variableArray = [])
{
- $template = $this->getTwig()->load($fileName.'.phtml');
+ $template = $this->getTwig()->load($fileName . '.html.twig');
+
return $template->render($variableArray);
}
@@ -38,11 +39,11 @@ class Box_AppAdmin extends Box_App
$service = $this->di['mod_service']('theme');
$theme = $service->getCurrentAdminAreaTheme();
- $loader = new Box_TwigLoader(array(
- "mods" => BB_PATH_MODS,
- "theme" => BB_PATH_THEMES . DIRECTORY_SEPARATOR . $theme['code'],
- "type" => "admin"
- )
+ $loader = new Box_TwigLoader([
+ 'mods' => BB_PATH_MODS,
+ 'theme' => BB_PATH_THEMES . DIRECTORY_SEPARATOR . $theme['code'],
+ 'type' => 'admin',
+ ]
);
$twig = $this->di['twig'];
@@ -50,10 +51,10 @@ class Box_AppAdmin extends Box_App
$twig->addGlobal('theme', $theme);
- if($this->di['auth']->isAdminLoggedIn()) {
+ if ($this->di['auth']->isAdminLoggedIn()) {
$twig->addGlobal('admin', $this->di['api_admin']);
}
return $twig;
}
-}
\ No newline at end of file
+}
diff --git a/src/bb-library/Box/AppClient.php b/src/bb-library/Box/AppClient.php
index 7f9ad077d..04aa2c2df 100644
--- a/src/bb-library/Box/AppClient.php
+++ b/src/bb-library/Box/AppClient.php
@@ -1,6 +1,7 @@
di['mod']($this->mod);
$m->registerClientRoutes($this);
- if($this->mod == 'api') {
- define ('BB_MODE_API', TRUE);
+ if ('api' == $this->mod) {
+ define('BB_MODE_API', true);
} else {
$extensionService = $this->di['mod_service']('extension');
if ($extensionService->isExtensionActive('mod', 'redirect')) {
@@ -27,14 +27,13 @@ class Box_AppClient extends Box_App
$m->registerClientRoutes($this);
}
- //init index module manually
+ // init index module manually
$this->get('', 'get_index');
$this->get('/', 'get_index');
-
- //init custom methods for undefined pages
- $this->get('/:page', 'get_custom_page', array('page' => '[a-z0-9-/.//]+'));
- $this->post('/:page', 'get_custom_page', array('page' => '[a-z0-9-/.//]+'));
+ // init custom methods for undefined pages
+ $this->get('/:page', 'get_custom_page', ['page' => '[a-z0-9-/.//]+']);
+ $this->post('/:page', 'get_custom_page', ['page' => '[a-z0-9-/.//]+']);
}
}
@@ -46,38 +45,40 @@ class Box_AppClient extends Box_App
public function get_custom_page($page)
{
$ext = $this->ext;
- if(strpos($page, '.') !== false) {
- $ext = substr($page, strpos($page, '.')+1);
+ if (false !== strpos($page, '.')) {
+ $ext = substr($page, strpos($page, '.') + 1);
$page = substr($page, 0, strpos($page, '.'));
}
$page = str_replace('/', '_', $page);
- $tpl = 'mod_page_'.$page;
+ $tpl = 'mod_page_' . $page;
try {
- return $this->render($tpl, array('post'=>$_POST), $ext);
- } catch(Exception $e) {
- if(BB_DEBUG){
+ return $this->render($tpl, ['post' => $_POST], $ext);
+ } catch (Exception $e) {
+ if (BB_DEBUG) {
error_log($e);
}
}
- // throw new \Box_Exception('Page :url not found', array(':url'=>$page), 404);
- $e = new \Box_Exception('Page :url not found', array(':url'=>$this->url), 404);
-
- error_log($e->getMessage());
- header("HTTP/1.0 404 Not Found");
- return $this->render('404', array('exception'=>$e));
+ // throw new \Box_Exception('Page :url not found', array(':url'=>$page), 404);
+ $e = new \Box_Exception('Page :url not found', [':url' => $this->url], 404);
+
+ error_log($e->getMessage());
+ header('HTTP/1.0 404 Not Found');
+
+ return $this->render('404', ['exception' => $e]);
}
/**
* @param string $fileName
*/
- public function render($fileName, $variableArray = array(), $ext = 'phtml')
+ public function render($fileName, $variableArray = [], $ext = 'html.twig')
{
try {
- $template = $this->getTwig()->load($fileName.'.'.$ext);
+ $template = $this->getTwig()->load($fileName . '.' . $ext);
} catch (Twig\Error\LoaderError $e) {
error_log($e->getMessage());
throw new \Box_Exception('Page not found', null, 404);
}
+
return $template->render($variableArray);
}
@@ -88,11 +89,11 @@ class Box_AppClient extends Box_App
$theme = $service->getTheme($code);
$settings = $service->getThemeSettings($theme);
- $loader = new Box_TwigLoader(array(
- "mods" => BB_PATH_MODS,
- "theme" => BB_PATH_THEMES.DIRECTORY_SEPARATOR.$code,
- "type" => "client"
- )
+ $loader = new Box_TwigLoader([
+ 'mods' => BB_PATH_MODS,
+ 'theme' => BB_PATH_THEMES . DIRECTORY_SEPARATOR . $code,
+ 'type' => 'client',
+ ]
);
$twig = $this->di['twig'];
@@ -101,14 +102,14 @@ class Box_AppClient extends Box_App
$twig->addGlobal('current_theme', $code);
$twig->addGlobal('settings', $settings);
- if($this->di['auth']->isClientLoggedIn()) {
+ if ($this->di['auth']->isClientLoggedIn()) {
$twig->addGlobal('client', $this->di['api_client']);
}
- if($this->di['auth']->isAdminLoggedIn()) {
+ if ($this->di['auth']->isAdminLoggedIn()) {
$twig->addGlobal('admin', $this->di['api_admin']);
}
return $twig;
}
-}
\ No newline at end of file
+}
diff --git a/src/bb-library/Box/Mod.php b/src/bb-library/Box/Mod.php
index 0e69f40ea..a23525832 100644
--- a/src/bb-library/Box/Mod.php
+++ b/src/bb-library/Box/Mod.php
@@ -1,4 +1,5 @@
_getModPath() . 'manifest.json');
}
-
+
public function getManifest()
{
if(!$this->hasManifest()) {
@@ -100,7 +100,7 @@ class Box_Mod
"minimum_boxbilling_version" => NULL,
"maximum_boxbilling_version" => NULL,
);
-
+
$info = array_merge($info, $json);
$info['id'] = $this->mod;
$info['type'] = 'mod';
@@ -111,7 +111,7 @@ class Box_Mod
return $info;
}
-
+
public function hasService($sub = '')
{
$filename = sprintf('Service%s.php', ucfirst($sub));
@@ -130,12 +130,12 @@ class Box_Mod
}
return $service;
}
-
+
public function hasClientController()
{
return file_exists($this->_getModPath() . 'Controller/Client.php');
}
-
+
public function getClientController()
{
if(!$this->hasClientController()) {
@@ -152,14 +152,14 @@ class Box_Mod
public function hasSettingsPage()
{
- return file_exists($this->_getModPath() . 'html_admin/mod_'.$this->mod.'_settings.phtml');
+ return file_exists($this->_getModPath() . 'html_admin/mod_'.$this->mod.'_settings.html.twig');
}
public function hasAdminController()
{
return file_exists($this->_getModPath() . 'Controller/Admin.php');
}
-
+
public function getAdminController()
{
if(!$this->hasAdminController()) {
@@ -189,7 +189,7 @@ class Box_Mod
return false;
}
-
+
public function uninstall()
{
if($this->isCore()) {
@@ -205,13 +205,13 @@ class Box_Mod
}
return false;
}
-
+
public function update()
{
if($this->isCore()) {
throw new \Box_Exception('Core module can not be updated');
}
-
+
if($this->hasService()) {
$s = $this->getService();
if(method_exists($s, 'update')) {
@@ -222,17 +222,17 @@ class Box_Mod
}
return false;
}
-
+
public function getCoreModules()
{
return $this->core;
}
-
+
public function isCore()
{
return in_array($this->mod, $this->core);
}
-
+
public function getConfig()
{
$db = $this->di['db'];
diff --git a/src/bb-modules/Client/html_admin/mod_client_settings.phtml b/src/bb-modules/Client/html_admin/mod_client_settings.html.twig
similarity index 98%
rename from src/bb-modules/Client/html_admin/mod_client_settings.phtml
rename to src/bb-modules/Client/html_admin/mod_client_settings.html.twig
index 6a1372f80..2b76af54f 100644
--- a/src/bb-modules/Client/html_admin/mod_client_settings.phtml
+++ b/src/bb-modules/Client/html_admin/mod_client_settings.html.twig
@@ -1,6 +1,6 @@
-{% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %}
+{% extends request.ajax ? "layout_blank.html.twig" : "layout_default.html.twig" %}
-{% import "macro_functions.phtml" as mf %}
+{% import "macro_functions.html.twig" as mf %}
{% block meta_title %}Client settings{% endblock %}
diff --git a/src/bb-modules/Client/html_client/mod_client_balance.phtml b/src/bb-modules/Client/html_client/mod_client_balance.html.twig
similarity index 93%
rename from src/bb-modules/Client/html_client/mod_client_balance.phtml
rename to src/bb-modules/Client/html_client/mod_client_balance.html.twig
index 29862e37b..5316c0099 100644
--- a/src/bb-modules/Client/html_client/mod_client_balance.phtml
+++ b/src/bb-modules/Client/html_client/mod_client_balance.html.twig
@@ -1,6 +1,6 @@
-{% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %}
+{% extends request.ajax ? "layout_blank.html.twig" : "layout_default.html.twig" %}
-{% import "macro_functions.phtml" as mf %}
+{% import "macro_functions.html.twig" as mf %}
{% block meta_title %}{{ 'Payments history'|trans }}{% endblock %}
{% block breadcrumb %}
{{ 'Payments history'|trans }}
{% endblock %}
@@ -47,7 +47,7 @@
- {% include "partial_pagination.phtml" with { 'list': transactions } %}
+ {% include "partial_pagination.html.twig" with { 'list': transactions } %}
diff --git a/src/bb-modules/Client/html_client/mod_client_profile.phtml b/src/bb-modules/Client/html_client/mod_client_profile.html.twig
similarity index 99%
rename from src/bb-modules/Client/html_client/mod_client_profile.phtml
rename to src/bb-modules/Client/html_client/mod_client_profile.html.twig
index 31832ab2d..8c3b00590 100644
--- a/src/bb-modules/Client/html_client/mod_client_profile.phtml
+++ b/src/bb-modules/Client/html_client/mod_client_profile.html.twig
@@ -1,4 +1,4 @@
-{% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %}
+{% extends request.ajax ? "layout_blank.html.twig" : "layout_default.html.twig" %}
{% block meta_title %}{{ 'Profile details'|trans }}{% endblock %}
{% block page_header %}{{ 'User profile settings'|trans }}{% endblock %}
diff --git a/src/bb-modules/Client/html_email/mod_client_confirm.phtml b/src/bb-modules/Client/html_email/mod_client_confirm.html.twig
similarity index 100%
rename from src/bb-modules/Client/html_email/mod_client_confirm.phtml
rename to src/bb-modules/Client/html_email/mod_client_confirm.html.twig
diff --git a/src/bb-modules/Client/html_email/mod_client_password_reset_approve.phtml b/src/bb-modules/Client/html_email/mod_client_password_reset_approve.html.twig
similarity index 100%
rename from src/bb-modules/Client/html_email/mod_client_password_reset_approve.phtml
rename to src/bb-modules/Client/html_email/mod_client_password_reset_approve.html.twig
diff --git a/src/bb-modules/Client/html_email/mod_client_password_reset_request.phtml b/src/bb-modules/Client/html_email/mod_client_password_reset_request.html.twig
similarity index 100%
rename from src/bb-modules/Client/html_email/mod_client_password_reset_request.phtml
rename to src/bb-modules/Client/html_email/mod_client_password_reset_request.html.twig
diff --git a/src/bb-modules/Client/html_email/mod_client_signup.phtml b/src/bb-modules/Client/html_email/mod_client_signup.html.twig
similarity index 100%
rename from src/bb-modules/Client/html_email/mod_client_signup.phtml
rename to src/bb-modules/Client/html_email/mod_client_signup.html.twig
diff --git a/src/bb-modules/Cookieconsent/html_admin/mod_cookieconsent_index.phtml b/src/bb-modules/Cookieconsent/html_admin/mod_cookieconsent_index.html.twig
similarity index 91%
rename from src/bb-modules/Cookieconsent/html_admin/mod_cookieconsent_index.phtml
rename to src/bb-modules/Cookieconsent/html_admin/mod_cookieconsent_index.html.twig
index c326dcdbe..583917c1d 100644
--- a/src/bb-modules/Cookieconsent/html_admin/mod_cookieconsent_index.phtml
+++ b/src/bb-modules/Cookieconsent/html_admin/mod_cookieconsent_index.html.twig
@@ -1,6 +1,6 @@
-{% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %}
+{% extends request.ajax ? "layout_blank.html.twig" : "layout_default.html.twig" %}
-{% import "macro_functions.phtml" as mf %}
+{% import "macro_functions.html.twig" as mf %}
{% block meta_title %}Cookie consent settings{% endblock %}
@@ -13,7 +13,7 @@
{{ 'Here you can specify message which will be shown to user. It will be shown until user will click Close × button, however it will not be intrusive and will not disturb to perform any actions.'|trans }}
-
{{ 'If there is a need to change the way notification looks or is being displayed, you can do it by editing'|trans }} src/bb-modules/Cookieconsent/html_client/mod_cookieconsent_index.phtml
+
{{ 'If there is a need to change the way notification looks or is being displayed, you can do it by editing'|trans }} src/bb-modules/Cookieconsent/html_client/mod_cookieconsent_index.html.twig
{% set params = admin.extension_config_get({"ext":"mod_cookieconsent"}) %}
diff --git a/src/bb-modules/Cookieconsent/html_client/mod_cookieconsent_index.phtml b/src/bb-modules/Cookieconsent/html_client/mod_cookieconsent_index.html.twig
similarity index 100%
rename from src/bb-modules/Cookieconsent/html_client/mod_cookieconsent_index.phtml
rename to src/bb-modules/Cookieconsent/html_client/mod_cookieconsent_index.html.twig
diff --git a/src/bb-modules/Cron/html_admin/mod_cron_settings.phtml b/src/bb-modules/Cron/html_admin/mod_cron_settings.html.twig
similarity index 95%
rename from src/bb-modules/Cron/html_admin/mod_cron_settings.phtml
rename to src/bb-modules/Cron/html_admin/mod_cron_settings.html.twig
index 14ca3f610..95395f492 100644
--- a/src/bb-modules/Cron/html_admin/mod_cron_settings.phtml
+++ b/src/bb-modules/Cron/html_admin/mod_cron_settings.html.twig
@@ -1,6 +1,6 @@
-{% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %}
+{% extends request.ajax ? "layout_blank.html.twig" : "layout_default.html.twig" %}
-{% import "macro_functions.phtml" as mf %}
+{% import "macro_functions.html.twig" as mf %}
{% block meta_title %}{{ 'Cron settings'|trans }}{% endblock %}
diff --git a/src/bb-modules/Cron/html_client/mod_cron_check.phtml b/src/bb-modules/Cron/html_client/mod_cron_check.html.twig
similarity index 100%
rename from src/bb-modules/Cron/html_client/mod_cron_check.phtml
rename to src/bb-modules/Cron/html_client/mod_cron_check.html.twig
diff --git a/src/bb-modules/Currency/html_admin/mod_currency_manage.phtml b/src/bb-modules/Currency/html_admin/mod_currency_manage.html.twig
similarity index 95%
rename from src/bb-modules/Currency/html_admin/mod_currency_manage.phtml
rename to src/bb-modules/Currency/html_admin/mod_currency_manage.html.twig
index b6fbdfac6..acf8e0ade 100644
--- a/src/bb-modules/Currency/html_admin/mod_currency_manage.phtml
+++ b/src/bb-modules/Currency/html_admin/mod_currency_manage.html.twig
@@ -1,6 +1,6 @@
-{% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %}
+{% extends request.ajax ? "layout_blank.html.twig" : "layout_default.html.twig" %}
-{% import "macro_functions.phtml" as mf %}
+{% import "macro_functions.html.twig" as mf %}
{% set active_menu = 'system' %}
diff --git a/src/bb-modules/Currency/html_admin/mod_currency_settings.phtml b/src/bb-modules/Currency/html_admin/mod_currency_settings.html.twig
similarity index 98%
rename from src/bb-modules/Currency/html_admin/mod_currency_settings.phtml
rename to src/bb-modules/Currency/html_admin/mod_currency_settings.html.twig
index 101e40dff..811a18038 100644
--- a/src/bb-modules/Currency/html_admin/mod_currency_settings.phtml
+++ b/src/bb-modules/Currency/html_admin/mod_currency_settings.html.twig
@@ -1,6 +1,6 @@
-{% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %}
+{% extends request.ajax ? "layout_blank.html.twig" : "layout_default.html.twig" %}
-{% import "macro_functions.phtml" as mf %}
+{% import "macro_functions.html.twig" as mf %}
{% set active_menu = 'system' %}
{% block meta_title %}{{ 'Currency settings'|trans }}{% endblock %}
diff --git a/src/bb-modules/Custompages/html_admin/mod_custompages_index.phtml b/src/bb-modules/Custompages/html_admin/mod_custompages_index.html.twig
similarity index 94%
rename from src/bb-modules/Custompages/html_admin/mod_custompages_index.phtml
rename to src/bb-modules/Custompages/html_admin/mod_custompages_index.html.twig
index 12b92b606..b48b94a47 100644
--- a/src/bb-modules/Custompages/html_admin/mod_custompages_index.phtml
+++ b/src/bb-modules/Custompages/html_admin/mod_custompages_index.html.twig
@@ -1,5 +1,5 @@
-{% import "macro_functions.phtml" as mf %}
-{% extends "layout_default.phtml" %}
+{% import "macro_functions.html.twig" as mf %}
+{% extends "layout_default.html.twig" %}
{% set active_menu = 'extensions' %}
{% block meta_title %}{{ 'Custom Pages'|trans }}{% endblock %}
@@ -49,8 +49,8 @@
- {% include "partial_batch_delete.phtml" with {'action' : 'admin/custompages/batch_delete'} %}
- {% include "partial_pagination.phtml" with {'list': pages, 'url':'custompages'} %}
+ {% include "partial_batch_delete.html.twig" with {'action' : 'admin/custompages/batch_delete'} %}
+ {% include "partial_pagination.html.twig" with {'list': pages, 'url':'custompages'} %}