Your IP : 3.140.253.240
<?php
/**
* Bitrix Framework
* @package bitrix
* @subpackage main
* @copyright 2001-2013 Bitrix
*/
/**
* Bitrix vars
* @global CUser $USER
* @global CMain $APPLICATION
* @param array $arParams
* @param array $arGadget
* @param string $id
*/
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
global $USER, $APPLICATION;
$rnd = rand();
if (!in_array($arParams["MODE"], array("SU", "SG")) || $USER->IsAdmin())
{
$bCanUseCustomCode = true;
}
if(LANGUAGE_ID=='ru')
{
$arGG = Array(
Array("CODE"=>'<script src="http://www.gmodules.com/ig/ifr?url=http://www.gstatic.com/ig/modules/dictionary/dictionary_v2.xml&up_sl=en&up_tl=ru&up_default_text=&synd=open&w=320&h=200&title=%D0%9F%D0%B5%D1%80%D0%B5%D0%B2%D0%BE%D0%B4%D1%87%D0%B8%D0%BA+Google&lang=ru&country=ALL&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>'),
Array("CODE"=>'<script src="http://www.gmodules.com/ig/ifr?url=http://gadgets.sterno.ru/2day/2day.xml&synd=open&w=320&h=310&title=%D0%AD%D1%82%D0%BE%D1%82+%D0%B4%D0%B5%D0%BD%D1%8C+%D0%B2+%D0%B8%D1%81%D1%82%D0%BE%D1%80%D0%B8%D0%B8&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>'),
Array("CODE"=>'<script src="http://www.gmodules.com/ig/ifr?url=http://www.labpixies.com/campaigns/converter/converter.xml&up_recents=%5B%5D&synd=open&w=320&h=226&title=%D0%9A%D0%BE%D0%BD%D0%B2%D0%B5%D1%80%D1%82%D0%B0%D1%86%D0%B8%D1%8F+%D0%B8%D0%B7%D0%BC%D0%B5%D1%80%D0%B5%D0%BD%D0%B8%D0%B9&lang=ru&country=ALL&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>'),
Array("CODE"=>'<script src="http://www.gmodules.com/ig/ifr?url=http://gadgets.sterno.ru/domodedovo/domodedovo.xml&synd=open&w=320&h=350&title=%D0%9E%D0%BD%D0%BB%D0%B0%D0%B9%D0%BD+%D1%82%D0%B0%D0%B1%D0%BB%D0%BE+%D0%94%D0%BE%D0%BC%D0%BE%D0%B4%D0%B5%D0%B4%D0%BE%D0%B2%D0%BE&lang=ru&country=ALL&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>'),
Array("CODE"=>'<script src="http://www.gmodules.com/ig/ifr?url=http://www.google.com/ig/modules/colorjunction.xml&up_difficulty=4&up_size=15&up_bestScores=00%3A20%7C00%3A35%7C01%3A00%7C00%3A35%7C01%3A15%7C02%3A00%7C01%3A00%7C02%3A00%7C03%3A15&up_boardStyle=1&up_lastScores=00%3A00%7C00%3A00%7C00%3A00%7C00%3A00%7C00%3A00%7C00%3A00%7C00%3A00%7C00%3A00%7C00%3A00&synd=open&w=264&h=287&title=ColorJunction&lang=ru&country=ALL&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>'),
Array("CODE"=>'<script src="http://www.gmodules.com/ig/ifr?url=http://www.labpixies.com/campaigns/blackjack/blackjack.xml&up_balance=1000&up_loans=0&up_highest=1000&up_lowest=1000&up_bank_rounds=0&up_wins=0&up_games=0&up_total_bets=0&up_highest_hand=0&up_default_bet=10&synd=open&w=320&h=280&title=BlackJack&lang=ru&country=ALL&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>'),
Array("CODE"=>'<script src="http://www.gmodules.com/ig/ifr?url=http://www.labpixies.com/campaigns/videopoker/videopoker.xml&synd=open&w=320&h=260&title=%D0%9F%D0%BE%D0%BA%D0%B5%D1%80&lang=all&country=ALL&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>'),
Array("CODE"=>'<script src="http://www.gmodules.com/ig/ifr?url=http://www.labpixies.com/campaigns/minesweeper/minesweeper.xml&up_Sscores=%7B%7D&up_Mscores=%7B%7D&up_Lscores=%7B%7D&up_rank=0&up_rank_counter=0&up_last_board=small&synd=open&w=280&h=360&title=C%D0%B0%D0%BF%D0%B5%D1%80&lang=ru&country=ALL&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>'),
Array("CODE"=>'<script src="http://www.gmodules.com/ig/ifr?url=http://avc-cbrf-gadget.googlecode.com/svn/trunk/cbr_chart_igoogle.xml&synd=open&w=242&h=111&title=%D0%9A%D1%83%D1%80%D1%81+%D0%B2%D0%B0%D0%BB%D1%8E%D1%82+%D0%A6%D0%91+%D0%A0%D0%A4&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>'),
Array("CODE"=>'<script src="http://www.gmodules.com/ig/ifr?url=http://aruljohn.com/gadget/ip.xml&synd=open&w=320&h=150&title=%D0%92%D0%B0%D1%88+IP+%D0%B0%D0%B4%D1%80%D0%B5%D1%81&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>'),
);
}
else
{
$arGG = Array(
Array("CODE"=>'<script src="http://www.gmodules.com/ig/ifr?url=http://hosting.gmodules.com/ig/gadgets/file/109974367101812108674/CNN.xml&synd=open&w=470&h=440&title=CNN+NEWS&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>'),
Array("CODE"=>'<script src="http://www.gmodules.com/ig/ifr?url=http://humanmaze.googlepages.com/espn-sports-rss-feeds.xml&up_entries=4&up_summaries=100&up_extrafeed=http%3A%2F%2Fsoccernet.espn.go.com%2Frss%2Fnews&up_extratitle=Soccer&up_subject=ESPN&up_selectedTab=&synd=open&w=320&h=300&title=ESPN&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>'),
Array("CODE"=>'<script src="http://www.gmodules.com/ig/ifr?url=http://www.google.com/ig/modules/colorjunction.xml&up_difficulty=4&up_size=15&up_bestScores=00%3A20%7C00%3A35%7C01%3A00%7C00%3A35%7C01%3A15%7C02%3A00%7C01%3A00%7C02%3A00%7C03%3A15&up_boardStyle=1&up_lastScores=00%3A00%7C00%3A00%7C00%3A00%7C00%3A00%7C00%3A00%7C00%3A00%7C00%3A00%7C00%3A00%7C00%3A00&synd=open&w=264&h=287&title=ColorJunction&lang=en&country=ALL&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>'),
Array("CODE"=>'<script src="http://www.gmodules.com/ig/ifr?url=http://www.labpixies.com/campaigns/blackjack/blackjack.xml&up_balance=1000&up_loans=0&up_highest=1000&up_lowest=1000&up_bank_rounds=0&up_wins=0&up_games=0&up_total_bets=0&up_highest_hand=0&up_default_bet=10&synd=open&w=320&h=280&title=BlackJack&lang=en&country=ALL&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>'),
Array("CODE"=>'<script src="http://www.gmodules.com/ig/ifr?url=http://www.labpixies.com/campaigns/videopoker/videopoker.xml&synd=open&w=320&h=260&title=Poker&lang=all&country=ALL&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>'),
Array("CODE"=>'<script src="http://www.gmodules.com/ig/ifr?url=http://www.labpixies.com/campaigns/minesweeper/minesweeper.xml&up_Sscores=%7B%7D&up_Mscores=%7B%7D&up_Lscores=%7B%7D&up_rank=0&up_rank_counter=0&up_last_board=small&synd=open&w=280&h=360&title=Minesweeper&lang=en&country=ALL&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>'),
Array("CODE"=>'<script src="http://www.gmodules.com/ig/ifr?url=http://aruljohn.com/gadget/ip.xml&synd=open&w=320&h=150&title=Your+IP+Address&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>'),
);
}
if($_SERVER['REQUEST_METHOD']=='POST' && $_REQUEST['gdggform']=='Y' && $_REQUEST['gdgg']==$id && $arParams["PERMISSION"]>"R" && check_bitrix_sessid())
{
$content = str_replace(array("|script", "|/script"), array("<script", "</script"), $_POST["content"]);
// check if the value is from predifined values
if (!$bCanUseCustomCode)
{
foreach ($arGG as $arGGTmp)
{
if ($content == $arGGTmp["CODE"])
{
$arGadget["USERDATA"] = Array("content"=>$content);
break;
}
}
}
else
$arGadget["USERDATA"] = Array("content"=>$content);
$arGadget["FORCE_REDIRECT"] = true;
}
$arData = $arGadget["USERDATA"];
$content = $arData["content"];
if(strlen($content)>0):
if(preg_match('#;title=([^&]+)&#', $content, $regs))
{
$str = $APPLICATION->ConvertCharset(urldecode($regs[1]), "utf-8", SITE_CHARSET);
if (
!array_key_exists("SETTINGS", $arGadget)
|| !is_array($arGadget["SETTINGS"])
|| !array_key_exists("TITLE_STD", $arGadget["SETTINGS"])
|| strlen($arGadget["SETTINGS"]["TITLE_STD"]) <= 0
)
$arGadget["TITLE"] = $str;
}
?>
<div id="X<?=$rnd?>">
<?=$content;?>
</div>
<script>
function XX<?=$rnd?>()
{
var dd = document.getElementById('X<?=$rnd?>');
if(!dd)
return;
var Ee = dd.childNodes;
for(var ei in Ee)
{
var e = Ee[ei];
if(e.nodeType==1 && e.tagName.toUpperCase() == 'TABLE')
{
//alert(e.rows[0].cells[0].childNodes[0].innerHTML);
e.rows[0].cells[0].style.display = 'none';
//alert(e.rows[0].cells[0].innerHTML);
}
}
}
<?echo 'setTimeout("XX'.$rnd.'()", 0);'?>
</script>
<?
elseif($arParams["PERMISSION"]>"R"):
?>
<script>
function Ch<?=$rnd?>(b)
{
var Dd = document.getElementById('Dd<?=$rnd?>');
if(b)
{
Dd.style.display = 'block';
//alert('');
//window.open('http://www.google.com/ig/directory?synd=open&cat=all', '', '');
}
else
Dd.style.display = 'none';
}
</script>
<form action="?gdgg=<?=$id?>" method="post" id="gdggf<?=$id?>">
<?=bitrix_sessid_post()?>
<input type="hidden" name="gdggform" value="Y">
<?
if ($arParams["MULTIPLE"] == "Y"):
?><input type="hidden" name="dt_page" value="<?=$arParams["DESKTOP_PAGE"]?>"><?
endif;
?>
<select name="gdgglist" id="gdgglist_<?=$id?>" style="width: 100%;" onchange="if(this.value=='-')Ch<?=$rnd?>(true);else Ch<?=$rnd?>(false);">
<option value=""><?=GetMessage("GD_GOOGLE_GADGETS_SELECT")?></option>
<?foreach($arGG as $v):
if(preg_match('#;title=([^&]+)&#', $v["CODE"], $regs))
$title = $APPLICATION->ConvertCharset(urldecode($regs[1]), "utf-8", SITE_CHARSET);
else
$title = GetMessage("GD_GOOGLE_GADGETS_GADGET");
?>
<option value="<?=htmlspecialcharsbx(str_replace(array("<script", "</script"), array("|script", "|/script"), $v["CODE"]));?>"><?=htmlspecialcharsbx($title)?></option>
<?endforeach?>
<?if ($bCanUseCustomCode):?>
<option value="-"><?=GetMessage("GD_GOOGLE_GADGETS_MORE")?></option>
<?endif;?>
</select>
<div id="Dd<?=$rnd?>" style="display:none">
<?if ($bCanUseCustomCode):?>
<p><?=GetMessage("GD_GOOGLE_GADGETS_LINK")?></p>
<?=GetMessage("GD_GOOGLE_GADGETS_HELP")?>
<p><?=GetMessage("GD_GOOGLE_GADGETS_CODE")?></p>
<textarea style="width:100%;" id="gdggcontentu"></textarea>
<?endif;?>
</div>
<input type="hidden" name="content" id="gdggcontent_<?=$id?>" value="">
<br>
<a href="javascript:void(0);" onclick="return gdggsave('<?=$id?>');"><?=GetMessage("GD_GOOGLE_GADGETS_SAVE")?></a>
</form>
<script>
function gdggsave(id)
{
var str = document.getElementById("gdgglist_" + id).value;
if(str == '')
{
alert('<?=GetMessage("GD_GOOGLE_GADGETS_WARN1")?>');
return false;
}
if(str == '-')
str = document.getElementById("gdggcontentu").value;
if(str == '')
{
alert('<?=GetMessage("GD_GOOGLE_GADGETS_WARN2")?>');
return false;
}
str = str.replace('<script', '|script');
str = str.replace('<'+'/script', '|/script');
document.getElementById("gdggcontent_" + id).value = str;
document.getElementById("gdggf" + id).submit();
return false;
}
</script>
<?
endif;
?>