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

Fixes #1011 - Rewritten example theme content message. Less scary :)

This commit is contained in:
Moc 2015-06-23 10:45:09 +02:00
parent 18744253c3
commit 70381959b6
2 changed files with 29 additions and 26 deletions

View File

@ -1731,45 +1731,48 @@ class themeHandler
$file = e_THEME.$name."/install/install.xml";
$frm = e107::getForm();
$tp = e107::getParser();
if(!is_readable($file))
{
return false;
}
return false;
}
$mes = e107::getMessage();
$xmlArray = e107::getXml()-> loadXMLfile($file, 'advanced');
$xmlArray = e107::getXml()->loadXMLfile($file, 'advanced');
$text = "
<form action='".e_SELF."' method='post'>
<div>This theme would like to make the following changes to your database:
<div>
<p>".TPVLAN_58."<br />
".$tp->toHTML(TPVLAN_59, true).":<br />
</p>
<ul>";
$lng = e107::getLanguage();
foreach($xmlArray['database']['dbTable'] as $key=>$val)
{
$count = count($val['item']);
$data = array('x'=> $count, 'y' => $val['@attributes']['name']);
$lan = "Replace/Overwrite [x] record(s) in your [y] table. ";
$text .= "<li>".$tp->lanVars($lan, $data)."</li>";
$data = array('x'=> $count, 'y' => $val['@attributes']['name']);
$text .= "<li>".$tp->lanVars(TPVLAN_60, $data)."</li>";
}
$text .= "</ul>
".$frm->admin_button('installContent',$name, 'warning', "Agree")."
".$frm->admin_button('dismiss',0, 'cancel', 'Dismiss')."
<p>".$tp->toHTML(TPVLAN_61, true)."</p>
".$frm->admin_button('installContent',$name, 'warning', LAN_YES)."
".$frm->admin_button('dismiss',0, 'cancel', LAN_NO)."
</div>
</form>
";
// $text .= print_a($xmlArray, true);
$mes->addWarning($text);
$mes->addInfo($text);
}
function installContent($name)
{
$mes = e107::getMessage();

View File

@ -1,8 +1,6 @@
<?php
/*
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
* $URL$
* $Id$
*
* Theme manager language file
*/
@ -72,7 +70,9 @@ define("TPVLAN_55", "Default");
define("TPVLAN_56", "Visibility Filter");
define("TPVLAN_57", "Compatibility");
define("TPVLAN_58", "This theme comes with pre-installed example content (such as pages and menus) which could be used on your website.");
define("TPVLAN_59", "Please be aware that the example content will [b]overwrite[/b] your current content with the following");
define("TPVLAN_60", "[x] record(s) in your [y] table");
define("TPVLAN_61", "Would you like to [b]replace[/b] your current content with the default example content provided by the theme?");
?>