Prechádzať zdrojové kódy

Removed dependencies, after removing the mobile version

Sergei Solovev 1 rok pred
rodič
commit
cc042e28e6

+ 0 - 1
system/distributor.php

@@ -2,7 +2,6 @@
 if (!DEFINED('EGP'))
 if (!DEFINED('EGP'))
     exit(header('Refresh: 0; URL=http://' . $_SERVER['SERVER_NAME'] . '/404'));
     exit(header('Refresh: 0; URL=http://' . $_SERVER['SERVER_NAME'] . '/404'));
 
 
-$device = '!mobile';
 // Подключение filp/whoops
 // Подключение filp/whoops
 $whoops = new \Whoops\Run;
 $whoops = new \Whoops\Run;
 $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
 $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);

+ 2 - 2
system/library/control/control.php

@@ -215,7 +215,7 @@ class ctrl
 
 
     public static function route($server, $inc, $go)
     public static function route($server, $inc, $go)
     {
     {
-        global $device, $start_point;
+        global $start_point;
 
 
         if (in_array($server['status'], array('install', 'reinstall', 'update', 'recovery'))) {
         if (in_array($server['status'], array('install', 'reinstall', 'update', 'recovery'))) {
             if ($go)
             if ($go)
@@ -232,7 +232,7 @@ class ctrl
 
 
     public static function cpulist($unit, $core, $count = false)
     public static function cpulist($unit, $core, $count = false)
     {
     {
-        global $device, $start_point;
+        global $start_point;
 
 
         include(LIB . 'ssh.php');
         include(LIB . 'ssh.php');
 
 

+ 1 - 13
system/library/html.php

@@ -56,23 +56,11 @@ class html
 
 
     public function get($name, $path = '')
     public function get($name, $path = '')
     {
     {
-        global $device, $cfg;
-
-        $path_root = $device == '!mobile' ? '' : 'megp/';
-
-        $path = $path_root . $path;
+        global $cfg;
 
 
         if ($path != '')
         if ($path != '')
             $name = str_replace('//', '/', $path . '/' . $name);
             $name = str_replace('//', '/', $path . '/' . $name);
 
 
-        if (!file_exists($this->dir . '/' . $name . '.html')) {
-            $route = explode('/', $name);
-            $namefile = end($route);
-            $dir = $this->dir . str_replace($namefile, '', $name);
-
-            die('Error: html file <u>' . $namefile . '.html</u> not found in: <u>' . $dir . '</u>');
-        }
-
         $this->template = file_get_contents($this->dir . '/' . $name . '.html');
         $this->template = file_get_contents($this->dir . '/' . $name . '.html');
         $this->select_template = $this->template;
         $this->select_template = $this->template;
 
 

+ 7 - 16
system/library/system.php

@@ -101,12 +101,7 @@ class sys
         $html->set('home', $cfg['http']);
         $html->set('home', $cfg['http']);
 
 
         if (is_array($notice)) {
         if (is_array($notice)) {
-            global $device;
-
-            if ($device == '!mobile')
-                $html->set('notice', '<div class="informer ' . $notice['color'] . ' topifon">' . $notice['text'] . '</div><div class="space"></div>');
-            else
-                $html->set('notice', '<div class="heading-style-1 container"><div class="smaller-text color-' . $notice['color'] . '-light">' . $notice['text'] . '</div><div class="heading-decoration bg-' . $notice['color'] . '-light" style="margin-top: 0px"></div></div>');
+            $html->set('notice', '<div class="informer ' . $notice['color'] . ' topifon">' . $notice['text'] . '</div><div class="space"></div>');
         } else
         } else
             $html->set('notice', '');
             $html->set('notice', '');
 
 
@@ -144,9 +139,9 @@ class sys
 
 
     public static function route($server, $inc, $go, $all = false)
     public static function route($server, $inc, $go, $all = false)
     {
     {
-        global $device, $start_point;
+        global $start_point;
 
 
-        $dir = $device == '!mobile' ? '' : 'megp/';
+        $dir = '';
         $use = true;
         $use = true;
 
 
         if (in_array($inc, array('plugins', 'ftp', 'console', 'graph', 'copy', 'web'))) {
         if (in_array($inc, array('plugins', 'ftp', 'console', 'graph', 'copy', 'web'))) {
@@ -225,12 +220,12 @@ class sys
 
 
     public static function outhtml($text, $time = 3, $url = false, $cache = false)
     public static function outhtml($text, $time = 3, $url = false, $cache = false)
     {
     {
-        global $device, $mcache, $html, $cfg;
+        global $mcache, $html, $cfg;
 
 
         if ($cache)
         if ($cache)
             $mcache->delete($cache);
             $mcache->delete($cache);
 
 
-        $tpl = $device == '!mobile' ? '' : '/megp';
+        $tpl = '';
 
 
         $html->get('out');
         $html->get('out');
 
 
@@ -451,9 +446,7 @@ class sys
             if ($go)
             if ($go)
                 sys::outjs(array('e' => sys::text('output', 'auth')));
                 sys::outjs(array('e' => sys::text('output', 'auth')));
 
 
-            global $device;
-
-            $link = $device == '!mobile' ? 'user/section/lk' : '';
+            $link = 'user/section/lk';
 
 
             exit(header('Refresh: 0; URL=' . $cfg['http'] . $link));
             exit(header('Refresh: 0; URL=' . $cfg['http'] . $link));
         }
         }
@@ -469,9 +462,7 @@ class sys
             if ($go)
             if ($go)
                 sys::outjs(array('e' => sys::text('output', 'noauth')));
                 sys::outjs(array('e' => sys::text('output', 'noauth')));
 
 
-            global $device;
-
-            $link = $device == '!mobile' ? 'user/section/auth' : 'auth';
+            $link = 'user/section/auth';
 
 
             exit(header('Refresh: 0; URL=' . $cfg['http'] . $link));
             exit(header('Refresh: 0; URL=' . $cfg['http'] . $link));
         }
         }

+ 1 - 1
system/sections/user/recovery.php

@@ -50,7 +50,7 @@ if ($go) {
 
 
     $user = $sql->get();
     $user = $sql->get();
 
 
-    $link = $device == '!mobile' ? 'user/section/recovery/confirm/' : 'recovery/confirm/';
+    $link = 'user/section/recovery/confirm/';
 
 
     // Проверка подачи запроса на восстановление
     // Проверка подачи запроса на восстановление
     $sql->query('SELECT `id`, `key` FROM `recovery` WHERE `user`="' . $user['id'] . '" LIMIT 1');
     $sql->query('SELECT `id`, `key` FROM `recovery` WHERE `user`="' . $user['id'] . '" LIMIT 1');