admin_functions.php
Добавил новую функцию
info_com($sel), единую для всех ссылок "Инфо"
Спойлер (Показать)function info_com($tipe,$path)
{
global $cid,$lm_updates;
$preview_path = 'images/stories/blank.png';
$table_req = array ( 'name'=>'name','title'=>'title','author'=>'author','version'=>'version','authorEmail'=>'authorEmail','authorUrl'=>'authorUrl',"desc"=>"Description");
if ($path)
{
switch ($tipe)
{
case 'templates' :
$xml_file=$lm_updates."templates/".$cid[0]."/templateDetails.xml";
$preview_path=$lm_updates."templates/".$cid[0]."/template_thumbnail.png";
$header = _TEMPLATES_INFO;
break;
case 'lang' :
$xml_file=$lm_updates."lang/".$cid[0]."/".$cid[0].".xml";
$preview_path=$lm_updates."lang/".$cid[0]."/".$cid[0].".png";
$header = _LANG_INFO_HEAD;
break;
case 'components' :
$xml_file=$lm_updates."components/".$cid[0]."/".$cid[0].".xml";
$header = _COMPONENTS_PARAMS;
break;
case 'modules' :
$xml_file=$lm_updates."modules/".$cid[0]."/mod_".$cid[0].".xml";
$header = _MODULES_EDIT_HEAD;
break;
case 'limbots' :
$xml_file=$lm_updates."limbots/".$cid[0]."/".$cid[0].".xml";
$header = _LIMBOTS_INSTALL_HEAD;
break;
case 'hacks' :
$xml_file=$lm_updates."hacks/".$cid[0]."/".$cid[0].".xml";
$header = _HACKS;
break;
default :
break;
}
$info=read_urlfile_xml($xml_file,$table_req);
}
else
{
switch ($tipe)
{
case 'templates' :
$xml_file="templates/".$cid[0]."/templateDetails.xml";
$preview_path="templates/".$cid[0]."/template_thumbnail.png";
$header = _TEMPLATES_INFO;
break;
case 'lang' :
$xml_file="lang/".$cid[0]."/".$cid[0].".xml";
$preview_path="lang/".$cid[0]."/".$cid[0].".png";
$header = _LANG_INFO_HEAD;
break;
default :
break;
}
$info=read_file_xml($xml_file,$table_req);
}
if($info <> false)
{
$gui=new admin_interface();
$gui->add("form","adminform","","admin.php?com_option=templates");
$gui->add("com_header",$header);
$gui->add("tab_head");
$gui->add("tab_simple","",$header);
$gui->add("html","","","<tr><td width = 20% ><img src=\"$preview_path\"></td><td valign=\"top\">");
$gui->add("table","","","","cellpadding='5' cellspacing='2' ");
$gui->add("form_text","",_CMN_NAME,$info['title']);
$gui->add("form_text","",_CMN_VER,$info['version']);
$gui->add("form_text","",_CMN_AUTHOR,$info['author']);
$gui->add("form_text","",_CMN_EMAIL,$info['authorEmail']);
$gui->add("form_text","",_CMN_WEBSITE,$info['authorUrl']);
$gui->add("form_text","",_CMN_DESC,$info['desc']);
$gui->add("end_table");
$gui->add("html","","","</td></tr>");
$gui->add("tab_end");
$gui->add("tab_tail");
$gui->add("end_form");
$gui->generate();
}
else
{echo '<div align="center">'._CMN_INFO_ERROR.'</div>';}
}