1
0
mirror of https://github.com/e107inc/e107.git synced 2025-03-14 01:19:44 +01:00

Issue #65 - regenerate prefs for global language file loading on plugin scan.

Create the 'common' language files for the download plugin
This commit is contained in:
SteveD 2012-12-28 21:19:22 +00:00
parent 4c06aa27b7
commit f268a6245a
4 changed files with 59 additions and 8 deletions

View File

@ -310,7 +310,8 @@ class e107plugin
if ($mode == 'refresh')
{
if ($this->XmlLanguageFileCheck('_log', 'lan_log_list', 'refresh', $pluginDBList[$plugin_path]['plugin_installflag'], $plugin_path)) $sp = TRUE;
if ($this->XmlLanguageFileCheck('_log', 'lan_log_list', 'refresh', $pluginDBList[$plugin_path]['plugin_installflag'], FALSE, $plugin_path)) $sp = TRUE;
if ($this->XmlLanguageFileCheck('_global', 'lan_global_list', 'refresh', $pluginDBList[$plugin_path]['plugin_installflag'], TRUE, $plugin_path)) $sp = TRUE;
}
// Check for missing plugin_category in plugin table.
@ -1597,15 +1598,20 @@ class e107plugin
* - if false, any preference is removed.
* - if TRUE, any preference is added
* - so set TRUE to add value to pref regardless
* @param string $plugin - name of plugin folder. If empty string, $this->plugFolder is used.
* @param boolean $justPath
* - if TRUE, plugin name is written to pref, as a generic string which requires a search to locate the file.
* - if FALSE, a precise path within the plugin folder, which includes '--LAN--' strings to substitute for language, is written
* @param string $plugin - name of plugin folder. If empty string, $this->plugFolder is used (may not always exist).
*
* @return boolean TRUE if pref changed
*/
public function XmlLanguageFileCheck($fileEnd, $prefName, $when, $isInstalled, $plugin = '')
public function XmlLanguageFileCheck($fileEnd, $prefName, $when, $isInstalled, $justPath = FALSE, $plugin = '')
{
$core = e107::getConfig('core');
if (trim($plugin) == '') $plugin = $this->plugFolder;
if (!$plugin) return FALSE; // No plugin name - error
if (!$isInstalled) $when = 'uninstall';
$updated = false;
@ -1616,15 +1622,15 @@ class e107plugin
if (file_exists($path_a))
{
$pathEntry = '--LAN--'.$fileEnd.'.php';
$pathEntry = $justPath ? $plugin : '--LAN--'.$fileEnd.'.php';
}
elseif (file_exists($path_b))
{
$pathEntry = '--LAN--/--LAN--'.$fileEnd.'.php';
$pathEntry = $justPath ? $plugin : '--LAN--/--LAN--'.$fileEnd.'.php';
}
$currentPref = $core->getPref($prefName.'/'.$plugin);
echo 'Path: '.$plugin.' Current: '.$currentPref.' New: '.$pathEntry.'<br />';
echo 'Path: '.$plugin.' Pref: '.$prefName.' Current: '.$currentPref.' New: '.$pathEntry.'<br />';
switch ($when)
{
case 'install':

View File

@ -0,0 +1,8 @@
<?php
define('DOWLAN_29', 'Downloads');
define('DOWLAN_30', 'Create Download');
?>

View File

@ -0,0 +1,39 @@
<?php
/*
* e107 website system
*
* Copyright (C) 2008-2013 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
* Downloads - messages for admin log titles
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/languages/English_log.php,v $
* $Revision$
* $Date$
* $Author$
*/
/**
* e107 Event calendar plugin
*
* Language file - admin log titles
*
* @package e107_plugins
* @subpackage downloads
* @version $Id$;
*/
// TODO: Some message meanings not currently known
define('LAN_AL_DOWNL_01', 'Downloads - download options changed');
define('LAN_AL_DOWNL_02', 'Downloads - upload options changed');
define('LAN_AL_DOWNL_03', 'Downloads - limit added');
define('LAN_AL_DOWNL_04', 'Downloads - log 04');
define('LAN_AL_DOWNL_05', 'Downloads - log 05');
define('LAN_AL_DOWNL_06', 'Downloads - log 06');
define('LAN_AL_DOWNL_07', 'Downloads - log 07');
define('LAN_AL_DOWNL_08', 'Downloads - log 08');
define('LAN_AL_DOWNL_09', 'Downloads - log 09');
define('LAN_AL_DOWNL_10', 'Downloads - limit updated');
define('LAN_AL_DOWNL_11', 'Downloads - limit removed');

View File

@ -50,8 +50,6 @@ define("DOWLAN_25", "Submit Download");
define("DOWLAN_26", "Uploads enabled?");
define("DOWLAN_27", "Download");
define("DOWLAN_28", "None");
define("DOWLAN_29", "Downloads"); //FIXME Use Generic
define("DOWLAN_30", "Create Download"); //FIXME Use Generic
define("DOWLAN_31", "Categories");
define("DOWLAN_32", "Downloads");
define("DOWLAN_33", "Are you sure you want to delete this download?"); //FIXME Use Generic