|
|
@@ -10,6 +10,7 @@ namespace OpenMind\Admin;
|
|
|
use Exception;
|
|
|
use OpenMind\FindBox\FindBoxCoreSystem;
|
|
|
use OpenMind\FindBox\SmartESL;
|
|
|
+use OpenMind\System\Notifications;
|
|
|
use OpenMind\Web\Controller;
|
|
|
use Template;
|
|
|
|
|
|
@@ -17,11 +18,23 @@ class Pages extends Controller
|
|
|
{
|
|
|
private $findBoxCore = null;
|
|
|
|
|
|
+ /**
|
|
|
+ * Pages constructor.
|
|
|
+ * @param \Base $f3
|
|
|
+ */
|
|
|
public function __construct($f3)
|
|
|
{
|
|
|
parent::__construct($f3);
|
|
|
|
|
|
- $this->findBoxCore = new FindBoxCoreSystem(...array_values($f3->get('CORE.fb')));
|
|
|
+ try {
|
|
|
+ $this->findBoxCore = new FindBoxCoreSystem(...array_values($f3->get('CORE.fb')));
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ $ns = new Notifications();
|
|
|
+ $ns->notify(Notifications::FB_ADMIN, $f3->clean($e->getMessage()));
|
|
|
+ // IF can't connect to FINDBOX, reroute to OMLINK Page Settings to fast change settings
|
|
|
+ if ($f3->get('PATTERN') != '/admin/omlsettings')
|
|
|
+ $f3->reroute('/admin/omlsettings');
|
|
|
+ }
|
|
|
|
|
|
// Set Admin F3 UI folder
|
|
|
$f3->set('UI', 'ui/admin/');
|