From 87a19b68ec476b06aa2cf947da8ff6732c45b67c Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 29 Nov 2012 00:28:55 -0800 Subject: [PATCH] Fileinspector fixes - using bootstrap components now. --- e107_admin/fileinspector.php | 211 ++++++++++++++++++++++++++--------- e107_handlers/e107_class.php | 2 +- 2 files changed, 159 insertions(+), 54 deletions(-) diff --git a/e107_admin/fileinspector.php b/e107_admin/fileinspector.php index e580a6cfd..bfef5d35b 100644 --- a/e107_admin/fileinspector.php +++ b/e107_admin/fileinspector.php @@ -16,12 +16,17 @@ | $Author$ +----------------------------------------------------------------------------+ */ +ini_set('zlib.output_compression', 0); +header('Content-Encoding: none'); // turn off gzip. ob_implicit_flush(true); ob_end_flush(); -ini_set('zlib.output_compression', 0); -header('Content-Encoding: none'); // turn off gzip. + + require_once('../class2.php'); + +e107::lan('core','fileinspector', true); + if (!getperms('Y')) { header('location:'.e_BASE.'index.php'); @@ -48,19 +53,27 @@ $e_sub_cat = 'fileinspector'; if(isset($_GET['scan'])) { + session_write_close(); while (@ob_end_clean()); + - header("Content-type: text/html; charset=".CHARSET, true); - $css_file = file_exists(e_THEME.$pref['admintheme'].'/'.$pref['admincss']) ? e_THEME.$pref['admintheme'].'/'.$pref['admincss'] : e_THEME.$pref['admintheme'].'/'.$pref['admincss']; + //header("Content-type: text/html; charset=".CHARSET, true); + //$css_file = file_exists(e_THEME.$pref['admintheme'].'/'.$pref['admincss']) ? e_THEME.$pref['admintheme'].'/'.$pref['admincss'] : e_THEME.$pref['admintheme'].'/'.$pref['admincss']; $fi = new file_inspector; + + echo " Results ".$fi->headerCss()." ".headerjs()." \n"; + + + + // echo "
loading.."; @@ -78,6 +91,7 @@ if(isset($_GET['scan'])) $fi->scan_results(); } + echo ""; exit(); @@ -86,7 +100,7 @@ if(isset($_GET['scan'])) else { $fi = new file_inspector; - require_once('auth.php'); + require_once(e_ADMIN.'auth.php'); if (e_QUERY) { @@ -157,21 +171,25 @@ class file_inspector { } - function scan_config() { - global $ns, $rs, $pref; + function scan_config() + { + global $rs, $pref; + $frm = e107::getForm(); + $ns = e107::getRender(); + $text = "
- +
"; $text .= " - - "; $text .= " - - "; $text .= " - - "; $text .= " - - @@ -214,20 +232,20 @@ class file_inspector { $text .= " - - "; $text .= " - - @@ -241,37 +259,38 @@ class file_inspector { "; $text .= " - - "; $text .= " - - "; $text .= " - - "; } - $text .= " - - + $text .= "
".FC_LAN_2."
+ ".FC_LAN_3." ".FC_LAN_5.": + ".FC_LAN_4."   ".FC_LAN_6."   ".FC_LAN_12."   @@ -179,20 +197,20 @@ class file_inspector {
+ ".FC_LAN_3." ".FC_LAN_13.": + ".FC_LAN_9."   ".FC_LAN_10."  
+ ".FC_LAN_3." ".FC_LAN_7.": + ".FC_LAN_9."   ".FC_LAN_10."   Exclude Language-Files   @@ -201,10 +219,10 @@ class file_inspector {
+ ".FC_LAN_3." ".FC_LAN_21.": + ".FC_LAN_9."   ".FC_LAN_10."  
+ ".FC_LAN_8.": + ".FC_LAN_9."   ".FC_LAN_10."  
+ ".FC_LAN_14.": + ".FC_LAN_15."   ".FC_LAN_16."  
+ ".FC_LAN_18.": + ##
+ ".FC_LAN_19.": +
+ ".FC_LAN_20.": +
".$rs -> form_button('submit', 'scan', FC_LAN_11)."
+
+ ".$frm->admin_button('scan', FC_LAN_11, 'other')." +
"; @@ -676,7 +695,7 @@ class file_inspector { if ($_POST['type'] == 'tree') { $text = "
- +
"; @@ -684,31 +703,36 @@ class file_inspector { $text .= ""; $text .= " - -
".FR_LAN_2."
+
".$scan_text."
"; - } else { +
"; + } + else + { $text = "
- +
"; $text .= " -
".FR_LAN_2."
"; + "; } - $text .= ""; + $text .= "
"; - if ($_POST['type'] == 'tree') { + if ($_POST['type'] == 'tree') + { $text .= ""; - } else { + } + else + { $text .= ""; @@ -785,7 +809,7 @@ class file_inspector { if ($_POST['type'] != 'tree') { $text .= "
-
 ".FR_LAN_3." root_dir))."')\">
 ".FR_LAN_3."
+ "; if (!$this -> results && $_POST['regex']) { $text .= ""; @@ -895,20 +919,23 @@ class file_inspector { fwrite($fp, $data); } - function snapshot_interface() { + function snapshot_interface() + { global $ns, $rs; $text = ""; - if (isset($_POST['create_snapshot'])) { + + if (isset($_POST['create_snapshot'])) + { $this -> create_image($_POST['snapshot_path']); $text = "
-
".FR_LAN_23."
+
"; $text .= " - @@ -922,24 +949,24 @@ class file_inspector { $text .= "
-
Snapshot Created
+ The snapshot (".e_ADMIN."core_image.php) was successfully created.
+
- + "; $text .= " - - - - @@ -956,7 +983,8 @@ class file_inspector { } - function checksum($filename) { + function checksum($filename) + { $checksum = md5(str_replace(array(chr(13),chr(10)), "", file_get_contents($filename))); return $checksum; } @@ -1002,19 +1030,38 @@ class file_inspector { $inc = round(($rand / $total) * 100); - if($inc > 100) + if($inc == 0) { - $inc = 98; + return; } echo "
"; - + + $active = "active"; + + if($inc >= 100) + { + $inc = 100; + $active = ""; + } + + + echo '
+
+
'; + + // exit; + /* echo "
"; + */ + echo "
".$diz."
"; + + if($total > 0) { echo "
".$inc ."%
"; @@ -1039,6 +1086,62 @@ class file_inspector { function headerCss() { + $pref = e107::getPref(); + + echo "\n"; + $e_js = e107::getJs(); + + // Core CSS - XXX awaiting for path changes + if (!isset($no_core_css) || !$no_core_css) + { + //echo "\n"; + $e_js->otherCSS('{e_WEB_CSS}e107.css'); + } + + + + if (!defsettrue('e_IFRAME') && isset($pref['admincss']) && $pref['admincss']) + { + $css_file = file_exists(THEME.'admin_'.$pref['admincss']) ? 'admin_'.$pref['admincss'] : $pref['admincss']; + //echo "\n"; + $e_js->themeCSS($css_file); + } + elseif (isset($pref['themecss']) && $pref['themecss']) + { + $css_file = file_exists(THEME.'admin_'.$pref['themecss']) ? 'admin_'.$pref['themecss'] : $pref['themecss']; + //echo "\n"; + $e_js->themeCSS($css_file); + } + else + { + $css_file = file_exists(THEME.'admin_style.css') ? 'admin_style.css' : 'style.css'; + //echo "\n"; + $e_js->themeCSS($css_file); + } + + + $e_js->renderJs('other_css', false, 'css', false); + echo "\n\n"; + + // Core CSS + $e_js->renderJs('core_css', false, 'css', false); + echo "\n\n"; + + // Plugin CSS + $e_js->renderJs('plugin_css', false, 'css', false); + echo "\n\n"; + + // Theme CSS + //echo "\n"; + $e_js->renderJs('theme_css', false, 'css', false); + echo "\n\n"; + + // Inline CSS - not sure if this should stay at all! + $e_js->renderJs('inline_css', false, 'css', false); + echo "\n\n"; + + + /* echo "\n"; if (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') === FALSE && isset($pref['admincss']) && $pref['admincss'] && file_exists(THEME.$pref['admincss'])) { $css_file = file_exists(THEME.'admin_'.$pref['admincss']) ? THEME_ABS.'admin_'.$pref['admincss'] : THEME_ABS.$pref['admincss']; @@ -1058,6 +1161,8 @@ class file_inspector { if (!isset($no_core_css) || !$no_core_css) { echo "\n"; } + * */ + } diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index fe2bb1ed1..9f7340058 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -2138,7 +2138,7 @@ class e107 switch ($type) { case 'core' : - self::coreLan($name);//TODO include $options for admin. + self::coreLan($fname,$options); break; break; case 'theme' :
Create SnapshotCreate Snapshot
+ Absolute path of root directory to create image from: + root_dir)."' />
+ Create snapshot of current or deprecated core files: + Current   Deprecated