From 2fef44272edce5baa2a353b1e8a867b882a93090 Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 22 Jan 2015 22:05:25 -0800 Subject: [PATCH] Downloads plugin language file cleanup --- e107_admin/language.php | 8 ++--- e107_plugins/download/download.php | 2 +- e107_plugins/download/download_shortcodes.php | 6 ++-- .../download/handlers/download_class.php | 30 +++++++++---------- .../{download.php => English_front.php} | 11 ++++--- e107_plugins/download/request.php | 8 ++--- .../download/templates/download_template.php | 4 +-- 7 files changed, 34 insertions(+), 35 deletions(-) rename e107_plugins/download/languages/English/{download.php => English_front.php} (92%) diff --git a/e107_admin/language.php b/e107_admin/language.php index 49f3cc7d9..0353baada 100644 --- a/e107_admin/language.php +++ b/e107_admin/language.php @@ -672,7 +672,7 @@ function multilang_prefs() "; - if(isset($_SERVER['E_DEV_LANGUAGE']) && $_SERVER['E_DEV_LANGUAGE'] === 'true') + // if(isset($_SERVER['E_DEV_LANGUAGE']) && $_SERVER['E_DEV_LANGUAGE'] === 'true') { $text .= " @@ -1071,7 +1071,7 @@ function show_tools() show_packs(); - if(vartrue($_SERVER['E_DEV'])) + if(!vartrue($_SERVER['E_DEV'])) { return; } @@ -1668,8 +1668,8 @@ function unused($lanfile,$script,$reverse=false) - - +// print_a($compare); +// print_a($lanDefines); if(!$compare) { diff --git a/e107_plugins/download/download.php b/e107_plugins/download/download.php index db5563d9a..202e1b3e4 100644 --- a/e107_plugins/download/download.php +++ b/e107_plugins/download/download.php @@ -18,7 +18,7 @@ if (!e107::isInstalled('download')) header("location:".e_BASE."index.php"); } - e107::lan('download','download'); // Loads e_PLUGIN.'download/languages/'.e_LANGUAGE.'/download.php' + e107::lan('download',false, true); // Loads e_PLUGIN.'download/languages/'.e_LANGUAGE.'/English_front.php' require_once(e_PLUGIN.'download/handlers/download_class.php'); require_once(e_PLUGIN.'download/handlers/category_class.php'); diff --git a/e107_plugins/download/download_shortcodes.php b/e107_plugins/download/download_shortcodes.php index 74eea0e42..2f206d7f8 100644 --- a/e107_plugins/download/download_shortcodes.php +++ b/e107_plugins/download/download_shortcodes.php @@ -46,18 +46,18 @@ class download_shortcodes extends e_shortcode switch ($this->qry['action']) { case 'mirror': - $breadcrumb[] = array('text' => LAN_dl_18, 'url' => $url->create('download/index')); + $breadcrumb[] = array('text' => LAN_PLUGIN_DOWNLOAD_NAME, 'url' => $url->create('download/index')); $breadcrumb[] = array('text' => $this->var['download_category_name'], 'url' => $url->create('download/list/category', array('id'=>$this->var['download_category_id'],'name'=>$this->var['download_category_sef']))); // e_SELF."?action=list&id=".$this->var['download_category_id']); $breadcrumb[] = array('text' => $this->var['download_name'], 'url' => $url->create('download/view/item', array('id'=>$this->var['download_id'], 'name'=>$this->var['download_sef']))); // e_SELF."?action=view&id=".$this->var['download_id']); $breadcrumb[] = array('text' => LAN_dl_67, 'url' => null); break; case 'maincats': - $breadcrumb[] = array('text' => LAN_dl_18, 'url' => $url->create('download/index')); + $breadcrumb[] = array('text' => LAN_PLUGIN_DOWNLOAD_NAME, 'url' => $url->create('download/index')); break; default: - $breadcrumb[] = array('text' => LAN_dl_18, 'url' => $url->create('download/index')); + $breadcrumb[] = array('text' => LAN_PLUGIN_DOWNLOAD_NAME, 'url' => $url->create('download/index')); $breadcrumb[] = array('text' => $this->var['download_category_name'], 'url' => ($this->var['download_category_id']) ? $url->create('download/list/category', array('id'=>$this->var['download_category_id'],'name'=>$this->var['download_category_sef'])) : null); $breadcrumb[] = array('text' => $this->var['download_name'], 'url' => null); break; diff --git a/e107_plugins/download/handlers/download_class.php b/e107_plugins/download/handlers/download_class.php index 35cb4d59a..9e105cfed 100644 --- a/e107_plugins/download/handlers/download_class.php +++ b/e107_plugins/download/handlers/download_class.php @@ -208,7 +208,7 @@ class download if ($dlcat->down_count == 0) { - return $ns->tablerender(LAN_dl_18, "
".LAN_dl_2."
",'download-categories',true); + return $ns->tablerender(LAN_PLUGIN_DOWNLOAD_NAME, "
".LAN_dl_2."
",'download-categories',true); } $download_cat_table_string = ""; @@ -237,7 +237,7 @@ class download $dl_text .= $download_cat_table_string; $dl_text .= $tp->parseTemplate($DOWNLOAD_CAT_TABLE_END, TRUE, $sc); - $caption = varset($DOWNLOAD_CAT_CAPTION) ? $tp->parseTemplate($DOWNLOAD_CAT_CAPTION, TRUE, $sc) : LAN_dl_18; + $caption = varset($DOWNLOAD_CAT_CAPTION) ? $tp->parseTemplate($DOWNLOAD_CAT_CAPTION, TRUE, $sc) : LAN_PLUGIN_DOWNLOAD_NAME; //ob_start(); @@ -321,7 +321,7 @@ class download if(!$sql->gen($query)) { //require_once(HEADERF); - return $ns->tablerender(LAN_dl_18, "
".LAN_dl_3."
", 'download-view', true); + return $ns->tablerender(LAN_PLUGIN_DOWNLOAD_NAME, "
".LAN_dl_3."
", 'download-view', true); //require_once(FOOTERF); //exit; } @@ -336,7 +336,7 @@ class download if(!isset($DL_VIEW_PAGETITLE)) { - $DL_VIEW_PAGETITLE = PAGE_NAME." / {DOWNLOAD_CATEGORY} / {DOWNLOAD_VIEW_NAME}"; + $DL_VIEW_PAGETITLE = LAN_PLUGIN_DOWNLOAD_NAME." / {DOWNLOAD_CATEGORY} / {DOWNLOAD_VIEW_NAME}"; } $DL_TITLE = $tp->parseTemplate($DL_VIEW_PAGETITLE, TRUE, $sc); @@ -465,12 +465,12 @@ class download $this->qry['name'] = $dlrow['download_category_sef']; - define("e_PAGETITLE", PAGE_NAME." / ".$dlrow['download_category_name']); + define("e_PAGETITLE", LAN_PLUGIN_DOWNLOAD_NAME." / ".$dlrow['download_category_name']); } else { // No access to this category - define("e_PAGETITLE", PAGE_NAME); - return $ns->tablerender(LAN_dl_18, "
".LAN_dl_3."
",'download-list',true); + define("e_PAGETITLE", LAN_PLUGIN_DOWNLOAD_NAME); + return $ns->tablerender(LAN_PLUGIN_DOWNLOAD_NAME, "
".LAN_dl_3."
",'download-list',true); } if ($dlrow['download_category_parent'] == 0) // It's a main category - change the listing type required @@ -541,7 +541,7 @@ class download { - $ns->tablerender(LAN_dl_18, " + $ns->tablerender(LAN_PLUGIN_DOWNLOAD_NAME, "
" . LAN_dl_3 . "
"); @@ -605,7 +605,7 @@ class download $dl_text .= $tp->parseTemplate($this->templateFooter, TRUE, $sc); - $text .= $ns->tablerender(LAN_dl_18, $dl_text, 'download-list', true); + $text .= $ns->tablerender(LAN_PLUGIN_DOWNLOAD_NAME, $dl_text, 'download-list', true); } if(!isset($DOWNLOAD_LIST_NEXTPREV)) @@ -697,21 +697,21 @@ class download $sql->insert('generic', "0, 'Broken Download', ".time().",'".USERID."', '{$download_name}', {$id}, '{$report_add}'"); - define("e_PAGETITLE", PAGE_NAME." / ".LAN_dl_47); + define("e_PAGETITLE", LAN_PLUGIN_DOWNLOAD_NAME." / ".LAN_dl_47); $text = LAN_dl_48."

".LAN_dl_49.""; - return $ns->tablerender(LAN_dl_18, $text, 'download-report', true); + return $ns->tablerender(LAN_PLUGIN_DOWNLOAD_NAME, $text, 'download-report', true); } else { - define("e_PAGETITLE", PAGE_NAME." / ".LAN_dl_51." ".$download_name); + define("e_PAGETITLE", LAN_PLUGIN_DOWNLOAD_NAME." / ".LAN_dl_51." ".$download_name); // require_once(HEADERF); $breadcrumb = array(); - $breadcrumb[] = array('text' => LAN_dl_18, 'url' => e_SELF); + $breadcrumb[] = array('text' => LAN_PLUGIN_DOWNLOAD_NAME, 'url' => e_SELF); $breadcrumb[] = array('text' => $dlrow['download_category_name'], 'url' => e_SELF."?action=list&id=".$dlrow['download_category_id']); $breadcrumb[] = array('text' => $dlrow['download_name'], 'url' => e_SELF."?action=view&id=".$dlrow['download_id']); $breadcrumb[] = array('text' => LAN_dl_50, 'url' => null); @@ -729,7 +729,7 @@ class download "; - return $ns->tablerender(LAN_dl_18, $text, 'download-report', true); + return $ns->tablerender(LAN_PLUGIN_DOWNLOAD_NAME, $text, 'download-report', true); } } @@ -847,7 +847,7 @@ class download $dl_text .= $tp->parseTemplate($this->templateFooter, TRUE, $sc); - return $ns->tablerender(LAN_dl_18, $dl_text, 'download-mirror', true); + return $ns->tablerender(LAN_PLUGIN_DOWNLOAD_NAME, $dl_text, 'download-mirror', true); } diff --git a/e107_plugins/download/languages/English/download.php b/e107_plugins/download/languages/English/English_front.php similarity index 92% rename from e107_plugins/download/languages/English/download.php rename to e107_plugins/download/languages/English/English_front.php index f30bf015b..2ff38e5c6 100644 --- a/e107_plugins/download/languages/English/download.php +++ b/e107_plugins/download/languages/English/English_front.php @@ -5,7 +5,6 @@ * Language file - download plugin * */ -define("PAGE_NAME", "Downloads"); //FIXME use term from English_global.php define("LAN_dl_1", "(Restricted)"); define("LAN_dl_2", "No downloads yet, please check back soon"); @@ -24,7 +23,7 @@ define("LAN_dl_14", "Rate this download"); define("LAN_dl_15", "Thanks for rating"); define("LAN_dl_16", "download(s) from"); define("LAN_dl_17", "files"); -define("LAN_dl_18", "Downloads"); //FIXME use term from English_global.php +// define("LAN_dl_18", "Downloads"); define("LAN_dl_19", "Category"); //FIXME Use Generic define("LAN_dl_20", "Files"); define("LAN_dl_21", "Size"); @@ -33,14 +32,14 @@ define("LAN_dl_23", "Filename"); define("LAN_dl_24", "Author"); //FIXME Use Generic define("LAN_dl_25", "Ascending"); define("LAN_dl_26", "Descending"); -define("LAN_dl_27", "Go"); //FIXME Use Generic +// define("LAN_dl_27", "Go"); define("LAN_dl_28", "Name"); //FIXME Use Generic define("LAN_dl_29", "DL's"); define("LAN_dl_30", "Author email"); define("LAN_dl_31", "Author website"); define("LAN_dl_32", "Download"); -define("LAN_dl_33", "Previous"); -define("LAN_dl_34", "Next"); //FIXME Use Generic +// define("LAN_dl_33", "Previous"); +// define("LAN_dl_34", "Next"); define("LAN_dl_35", "Back to list"); //FIXME Use Generic define("LAN_dl_36", "New downloads"); @@ -75,7 +74,7 @@ define("LAN_dl_60", "Broken download report from"); define("LAN_dl_61", "Download Error"); define("LAN_dl_62", "You have been prevented from downloading this file; you have exceeded your download quota"); define("LAN_dl_63", "You do not have the correct permissions to download this file."); -define("LAN_dl_64", "Back"); +// define("LAN_dl_64", "Back"); define("LAN_dl_65", "File Not Found"); define("LAN_dl_66", "Select download mirror"); diff --git a/e107_plugins/download/request.php b/e107_plugins/download/request.php index ccfaa578b..5f8360e51 100644 --- a/e107_plugins/download/request.php +++ b/e107_plugins/download/request.php @@ -122,7 +122,7 @@ if (preg_match("#.*\.[a-z,A-Z]{3,4}#", e_QUERY)) $log->addError("Line".__LINE__.": Couldn't find ".e_DOWNLOAD.e_QUERY); $log->toFile('download_requests','Download Requests', true); // Create a log file and add the log messages require_once(HEADERF); - $ns->tablerender(LAN_dl_61, "
".LAN_dl_65."\n

\n".LAN_dl_64."
"); + $ns->tablerender(LAN_dl_61, "
".LAN_dl_65."\n

\n".LAN_BACK."
"); require_once(FOOTERF); exit(); } @@ -275,7 +275,7 @@ if ($type == "file") $log->addError("Line".__LINE__.": Couldn't find ".e_DOWNLOAD.e_QUERY); $log->toFile('download_requests','Download Requests', true); // Create a log file and add the log messages require_once(HEADERF); - $ns -> tablerender(LAN_dl_61, "
".LAN_dl_65."

".LAN_dl_64."
"); + $ns -> tablerender(LAN_dl_61, "
".LAN_dl_65."

".LAN_BACK."
"); require_once(FOOTERF); exit(); } @@ -324,7 +324,7 @@ else $image = $tp->replaceConstants($image); $disp = "
"; } - $disp .= "
".LAN_dl_64."
"; + $disp .= "
".LAN_BACK."
"; $ns->tablerender($imagecaption, $disp); require_once(FOOTERF); @@ -341,7 +341,7 @@ else else { require_once(HEADERF); - $ns->tablerender(LAN_dl_61, "
".LAN_dl_65."

".LAN_dl_64."
"); + $ns->tablerender(LAN_dl_61, "
".LAN_dl_65."

".LAN_BACK."
"); require_once(FOOTERF); exit; } diff --git a/e107_plugins/download/templates/download_template.php b/e107_plugins/download/templates/download_template.php index 422642bb8..8a7c57fde 100644 --- a/e107_plugins/download/templates/download_template.php +++ b/e107_plugins/download/templates/download_template.php @@ -195,7 +195,7 @@ if(!isset($DOWNLOAD_LIST_TABLE_END)) \n"; } // ##### VIEW TABLE ------------------------------------------------------------------------------- -$DL_VIEW_PAGETITLE = PAGE_NAME." / {DOWNLOAD_CATEGORY} / {DOWNLOAD_VIEW_NAME}"; +$DL_VIEW_PAGETITLE = LAN_PLUGIN_DOWNLOAD_NAME." / {DOWNLOAD_CATEGORY} / {DOWNLOAD_VIEW_NAME}"; $DL_VIEW_NEXTPREV = "
@@ -437,7 +437,7 @@ $DOWNLOAD_WRAPPER['view']['DOWNLOAD_VIEW_AUTHORWEBSITE'] = "