示例#1
0
 public function fetch(\Bitrix\Main\Text\Converter $converter = null)
 {
     if ($this->trackerQuery != null) {
         $this->trackerQuery->restartQuery();
     }
     $dataTmp = $this->fetchRowInternal();
     if ($this->trackerQuery != null) {
         $this->trackerQuery->refinishQuery();
     }
     if (!$dataTmp) {
         return false;
     }
     $resultFields = $this->getResultFields();
     if ($resultFields !== null) {
         $data = array();
         foreach ($dataTmp as $key => $value) {
             $data[$resultFields[$key]["name"]] = $this->convertDataFromDb($value, $resultFields[$key]["type"]);
         }
     } else {
         $data = $dataTmp;
     }
     if (!empty($this->arSerializedFields)) {
         foreach ($this->arSerializedFields as $field) {
             if (isset($data[$field])) {
                 $data[$field] = unserialize($data[$field]);
             }
         }
     }
     if (!empty($this->arReplacedAliases)) {
         foreach ($this->arReplacedAliases as $tech => $human) {
             $data[$human] = $data[$tech];
             unset($data[$tech]);
         }
     }
     if ($this->fetchDataModifier != null) {
         $c = $this->fetchDataModifier;
         $data = $c($data);
     }
     if ($converter != null) {
         foreach ($data as $key => $val) {
             $data[$key] = $converter->encode($val, isset($data[$key . "_TYPE"]) ? $data[$key . "_TYPE"] : \Bitrix\Main\Text\Converter::TEXT);
         }
     }
     return $data;
 }
 public static function showProgress($text, $title, $v)
 {
     $v = $v >= 0 ? $v : 0;
     if ($v < 100) {
         $msg = new \CAdminMessage(array("TYPE" => "PROGRESS", "HTML" => true, "MESSAGE" => $title, "DETAILS" => "#PROGRESS_BAR#<div style=\"width: " . self::PROGRESS_WIDTH . "px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 20px;\">" . Converter::getHtmlConverter()->encode($text) . "</div>", "PROGRESS_TOTAL" => 100, "PROGRESS_VALUE" => $v, "PROGRESS_TEMPLATE" => '#PROGRESS_PERCENT#', "PROGRESS_WIDTH" => self::PROGRESS_WIDTH));
     } else {
         $msg = new \CAdminMessage(array("TYPE" => "OK", "MESSAGE" => $title, "DETAILS" => $text));
     }
     return $msg->show();
 }
 public function appendEntry($entry)
 {
     if ($this->isSplitNeeded()) {
         $this->split();
         $this->appendEntry($entry);
     } else {
         if (!$this->partChanged) {
             $this->addHeader();
         }
         $fd = $this->open('r+');
         fseek($fd, $this->getSize() - strlen(self::FILE_FOOTER));
         fwrite($fd, sprintf(self::ENTRY_TPL, Converter::getXmlConverter()->encode($entry['XML_LOC']), Converter::getXmlConverter()->encode($entry['XML_LASTMOD']), Converter::getXmlConverter()->encode($entry['XML_PRIORITY'])) . self::FILE_FOOTER);
         fclose($fd);
     }
 }
示例#4
0
 public function appendIndexEntry($file)
 {
     if ($this->isExists()) {
         $fileUrlEnc = Converter::getXmlConverter()->encode($this->settings['PROTOCOL'] . '://' . \CBXPunycode::toASCII($this->settings['DOMAIN'], $e = null) . $this->getFileUrl($file));
         $contents = $this->getContents();
         $reg = "/" . sprintf(preg_quote(self::ENTRY_TPL, "/"), preg_quote($fileUrlEnc, "/"), "[^<]*") . "/";
         $newEntry = sprintf(self::ENTRY_TPL, $fileUrlEnc, date(c, $file->getModificationTime($file)));
         $count = 0;
         $contents = preg_replace($reg, $newEntry, $contents, 1, $count);
         if ($count <= 0) {
             $contents = substr($contents, 0, -strlen(self::FILE_FOOTER)) . $newEntry . self::FILE_FOOTER;
         }
         $this->putContents($contents);
     } else {
         $this->createIndex(array($file));
     }
 }
示例#5
0
	/**
	 * Searches and removes entry to the existing and finished sitemap file
	 *
	 * Entry array keys
	 * XML_LOC - loc field value
	 * XML_LASTMOD - lastmod field value
	 *
	 * @param string $url Entry URL.
	 *
	 * @return void
	 */
	public function removeEntry($url)
	{
		$url = $this->settings['PROTOCOL'].'://'.\CBXPunycode::toASCII($this->settings['DOMAIN'], $e = null).$url;
		$pattern = sprintf(self::ENTRY_TPL_SEARCH, $url);

		while($this->isExists())
		{
			$c = $this->getContents();
			$p = strpos($c, $pattern);
			unset($c);

			if($p !== false)
			{
				$fd = $this->open('r+');

				fseek($fd, intval($p));
				fwrite($fd, str_repeat(" ", strlen(sprintf(
					self::ENTRY_TPL,
					Converter::getXmlConverter()->encode($url),
					Converter::getXmlConverter()->encode(date('c'))
				))));
				fclose($fd);
				break;
			}

			if(!$this->isSplitNeeded())
			{
				break;
			}
			else
			{
				$this->part++;

				$fileName = $this->partFile;
				$fileName = substr($fileName, 0, -strlen(self::FILE_EXT)).self::FILE_PART_SUFFIX.$this->part.substr($fileName, -strlen(self::FILE_EXT));

				$this->reInit($fileName);
			}
		}
	}
		</tr>
<?php 
    } else {
        ?>
		<tr>
			<td>
				<?php 
        echo BeginNote();
        ?>
				<span id="ss_network_profile"><?php 
        echo Loc::getMessage("SS_USERTAB_LINKED_PROFILE");
        ?>
: <a href="<?php 
        echo Converter::getHtmlConverter()->encode($profileInfo["PERSONAL_WWW"]);
        ?>
" target="_blank"><?php 
        echo Converter::getHtmlConverter()->encode($profileInfo["NAME"] . " " . $profileInfo["LAST_NAME"] . " (" . $profileInfo["EMAIL"] . ")");
        ?>
</a></span><br /><br /><input type="checkbox" name="SS_REMOVE_NETWORK" id="ss_remove_network" value="Y" onclick="BX('ss_network_profile').style.textDecoration = this.checked ? 'line-through' : 'none'"> <label for="ss_remove_network"><?php 
        echo Loc::getMessage("SS_USERTAB_DELETE_LINK");
        ?>
</label>

				<?php 
        echo EndNote();
        ?>
			</td>
		</tr>
<?php 
    }
}
 /*
 	if($bOwner)
 	{
 		$row->AddField("ONLINE", '<div class="lamp-green"></div>');
 	}
 	else
 	{
 		$row->AddField("ONLINE", '<div class="lamp-red" onmouseover="BX.hint(this, \''.Converter::getHtmlConverter()->encode(CUtil::JSEscape(Loc::getMessage('SEO_CAMPAIGN_WRONG_OWNER', array("#USERINFO#" => "(".$campaign["OWNER_ID"].") ".$campaign["OWNER_NAME"])))).'\');"></div>');
 	}
 */
 $row->AddField("UPDATE", '<input type="button" ' . ($bOwner ? '' : 'disabled="disabled"') . ' class="adm-btn-save" value="' . Converter::getHtmlConverter()->encode(Loc::getMessage('SEO_CAMPAIGN_UPDATE')) . '" onclick="updateCampaign(this, ' . $campaign['ID'] . ')" name="save" id="campaign_update_button_' . $campaign['ID'] . '"' . ($bNeedAuth ? ' disabled="disabled"' : '') . ' />');
 $row->AddViewField('XML_ID', '<a href="https://direct.yandex.ru/registered/main.pl?cmd=editCamp&cid=' . $campaign['XML_ID'] . '" target="_blank" title="' . Converter::getHtmlConverter()->encode(Loc::getMessage('SEO_CAMPAIGN_EDIT_EXTERNAL')) . '">' . Loc::getMessage('SEO_YANDEX_DIRECT_LINK_TPL', array('#XML_ID#' => $campaign['XML_ID'])) . '</a>');
 if ($campaign['SETTINGS']['StatusArchive'] == Engine\YandexDirect::BOOL_YES) {
     $row->AddViewField('BANNER_CNT', '<a href="seo_search_yandex_direct_banner.php?lang=' . LANGUAGE_ID . '&amp;campaign=' . $campaign['ID'] . '&amp;archive=1" title="' . Converter::getHtmlConverter()->encode(Loc::getMessage('SEO_CAMPAIGN_BANNER_CNT_TITLE')) . '">' . $bannerCnt . '</a>');
 } else {
     $row->AddViewField('BANNER_CNT', '<a href="seo_search_yandex_direct_banner.php?lang=' . LANGUAGE_ID . '&amp;campaign=' . $campaign['ID'] . '" title="' . Converter::getHtmlConverter()->encode(Loc::getMessage('SEO_CAMPAIGN_BANNER_CNT_TITLE')) . '">' . $bannerCnt . '</a>' . ($bStrategySupported ? ' [<a href="seo_search_yandex_direct_banner_edit.php?lang=' . LANGUAGE_ID . '&amp;campaign=' . $campaign['ID'] . '" title="' . Converter::getHtmlConverter()->encode(Loc::getMessage('SEO_CAMPAIGN_BANNER_ADD_TITLE')) . '">+</a>]' : ''));
 }
 if (!$bNeedAuth) {
     $actionsList = array(array("ICON" => $bOwner && $bStrategySupported ? "edit" : 'view', "TEXT" => Loc::getMessage($bOwner && $bStrategySupported ? "SEO_CAMPAIGN_EDIT" : "SEO_BANNER_VIEW"), "ACTION" => $adminList->ActionRedirect($editUrl), "DEFAULT" => true));
     if ($bOwner) {
         $actionsList[] = array("ICON" => "move", "TEXT" => Loc::getMessage("SEO_CAMPAIGN_UPDATE"), "ACTION" => 'updateCampaign(BX(\'campaign_update_button_' . $campaign['ID'] . '\'), ' . $campaign['ID'] . ');');
     }
     $actionsList[] = array("ICON" => "list", "TEXT" => Loc::getMessage("SEO_CAMPAIGN_BANNER_CNT"), "ACTION" => $adminList->ActionRedirect('seo_search_yandex_direct_banner.php?lang=' . LANGUAGE_ID . '&amp;campaign=' . $campaign['ID'] . ($archive ? '&amp;archive=1' : '')));
     if ($bOwner) {
         if ($campaign['SETTINGS']['StatusArchive'] == Engine\YandexDirect::BOOL_NO) {
             if ($campaign['SETTINGS']['StatusShow'] == Engine\YandexDirect::BOOL_YES) {
                 $actionsList[] = array("ICON" => "stop", "TEXT" => Loc::getMessage("SEO_BANNER_STOP"), "ACTION" => $adminList->ActionDoGroup($campaign['ID'], 'stop'));
             } else {
                 $actionsList[] = array("ICON" => "resume", "TEXT" => Loc::getMessage("SEO_BANNER_RESUME"), "ACTION" => $adminList->ActionDoGroup($campaign['ID'], 'resume'));
             }
         }
		<tbody id="adv_banner_selector">
		<tr>
			<td width="40%"><?=Loc::getMessage("SEO_CAMPAIGN_CHOOSE")?>:</td>
			<td width="60%">
				<select id="seo_adv_campaign" style="width:400px" onchange="updateNewBannerLink()">
					<option value="0"><?=Loc::getMessage("SEO_CAMPAIGN_CHOOSE_OPTION")?></option>
					<?
					foreach($campaignList as $campaign)
					{
						$canAdd = in_array(
							$campaign["SETTINGS"]['Strategy']['StrategyName'],
							Adv\YandexCampaignTable::$supportedStrategy
						);
						?>
						<option value="<?=$campaign["ID"]?>"
							data-add="<?=$canAdd ? 1 : 0?>"><?=Converter::getHtmlConverter()->encode($campaign["NAME"])?></option>
					<?
					}
					?>
				</select>&nbsp;&nbsp;<a
					href="/bitrix/admin/seo_search_yandex_direct_edit.php?lang=<?=LANGUAGE_ID?>&back_url=<?=urlencode($APPLICATION->GetCurPageParam('form_element_'.$iblockElementInfo["IBLOCK"]["ID"].'_active_tab=seo_adv_seo_adv', array('form_element_'.$iblockElementInfo["IBLOCK"]["ID"].'_active_tab')))?>"><?=Loc::getMessage("SEO_CREATE_NEW_CAMPAIGN")?></a>
			</td>
		</tr>
		<tr>
			<td><?=Loc::getMessage("SEO_BANNER_CHOOSE")?>:</td>
			<td>
				<select id="seo_adv_banner" style="width:400px" disabled="disabled"
					onchange="BX('seo_adv_link_btn').disabled=this.value<=0">
					<option value="0"><?=Loc::getMessage("SEO_CAMPAIGN_CHOOSE_OPTION")?></option>
				</select>&nbsp;&nbsp;<a id="adv_banner_link"
					href="/bitrix/admin/seo_search_yandex_direct_banner_edit.php?lang=<?=LANGUAGE_ID?>&element=<?=$iblockElementInfo['ID']?>&back_url=<?=urlencode($APPLICATION->GetCurPageParam('form_element_'.$iblockElementInfo["IBLOCK"]["ID"].'_active_tab=seo_adv_seo_adv', array('form_element_'.$iblockElementInfo["IBLOCK"]["ID"].'_active_tab')));?>" style="display: none;"><?=Loc::getMessage('SEO_CREATE_NEW_BANNER')?></a>
示例#9
0
function seo_getIblock($iblockId, $sectionId, $sectionChecked, $elementChecked, $arSectionChecked = array(), $arElementChecked = array())
{
    $dbIblock = \CIBlock::GetByID($iblockId);
    $arIBlock = $dbIblock->Fetch();
    if (is_array($arIBlock)) {
        $bSection = strlen($arIBlock['SECTION_PAGE_URL']) > 0;
        $bElement = strlen($arIBlock['DETAIL_PAGE_URL']) > 0;
        $dbRes = \CIBlockSection::GetList(array('SORT' => 'ASC', 'NAME' => 'ASC'), array('IBLOCK_ID' => $iblockId, 'SECTION_ID' => $sectionId, 'ACTIVE' => 'Y', 'CHECK_PERMISSIONS' => 'Y'));
        $bFound = false;
        while ($arRes = $dbRes->Fetch()) {
            $r = RandString(8);
            $d = $arRes['ID'];
            $bSectionChecked = $bSection && ($arSectionChecked[$d] === 'Y' || $sectionChecked && $arSectionChecked[$d] !== 'N');
            $bElementChecked = $bElement && ($arElementChecked[$d] === 'Y' || $elementChecked && $arElementChecked[$d] !== 'N');
            if (!$bFound) {
                $bFound = true;
                ?>
<table class="internal" style="width: 100%;">
	<tr class="heading">
		<td colspan="2"><?php 
                echo Loc::getMessage('SEO_SITEMAP_IBLOCK_SECTION_NAME');
                ?>
</td>
		<td width="100"><?php 
                echo Loc::getMessage('SEO_SITEMAP_IBLOCK_SECTION_SECTION');
                ?>
</td>
		<td width="100"><?php 
                echo Loc::getMessage('SEO_SITEMAP_IBLOCK_SECTION_ELEMENTS');
                ?>
</td>
	</tr>
<?php 
            }
            ?>
	<tr>
		<td width="20"><span onclick="loadIblock(this, '<?php 
            echo $arRes['IBLOCK_ID'];
            ?>
', '<?php 
            echo $d;
            ?>
', '<?php 
            echo $r;
            ?>
', BX('IBLOCK_SECTION_SECTION_<?php 
            echo $d;
            ?>
').checked, BX('IBLOCK_SECTION_ELEMENT_<?php 
            echo $d;
            ?>
').checked);" class="sitemap-tree-icon-iblock"></span></td>
		<td><a href="iblock_list_admin.php?lang=<?php 
            echo LANGUAGE_ID;
            ?>
&amp;IBLOCK_ID=<?php 
            echo $arRes['IBLOCK_ID'];
            ?>
&amp;find_section_section=<?php 
            echo $d;
            ?>
"><?php 
            echo Converter::getHtmlConverter()->encode($arRes['NAME']);
            ?>
</a></td>
		<td align="center"><input type="hidden" name="IBLOCK_SECTION_SECTION[<?php 
            echo $iblockId;
            ?>
][<?php 
            echo $d;
            ?>
]" value="N" /><input type="checkbox" name="IBLOCK_SECTION_SECTION[<?php 
            echo $iblockId;
            ?>
][<?php 
            echo $d;
            ?>
]" id="IBLOCK_SECTION_SECTION_<?php 
            echo $d;
            ?>
" value="Y"<?php 
            echo $bSection ? '' : ' disabled="disabled"';
            echo $bSectionChecked ? ' checked="checked"' : '';
            ?>
 data-type="section" onclick="checkAllSection('<?php 
            echo $r;
            ?>
', this.checked);" />&nbsp;<label for="IBLOCK_SECTION_SECTION_<?php 
            echo $d;
            ?>
"><?php 
            echo Loc::getMessage('MAIN_YES');
            ?>
</label></td>
		<td align="center"><input type="hidden" name="IBLOCK_SECTION_ELEMENT[<?php 
            echo $iblockId;
            ?>
][<?php 
            echo $d;
            ?>
]" value="N" /><input type="checkbox" name="IBLOCK_SECTION_ELEMENT[<?php 
            echo $iblockId;
            ?>
][<?php 
            echo $d;
            ?>
]" id="IBLOCK_SECTION_ELEMENT_<?php 
            echo $d;
            ?>
" value="Y"<?php 
            echo $bElement ? '' : ' disabled="disabled"';
            echo $bElementChecked ? ' checked="checked"' : '';
            ?>
 data-type="element" onclick="checkAllElement('<?php 
            echo $r;
            ?>
', this.checked);" />&nbsp;<label for="IBLOCK_SECTION_ELEMENT_<?php 
            echo $d;
            ?>
"><?php 
            echo Loc::getMessage('MAIN_YES');
            ?>
</label></td>
	</tr>
	<tr style="display: none" id="subdirs_row_<?php 
            echo $r;
            ?>
">
		<td colspan="4" id="subdirs_<?php 
            echo $r;
            ?>
" align="center"></td>
	</tr>
<?php 
        }
        if (!$bFound) {
            echo Loc::getMessage('SEO_SITEMAP_NO_DIRS_FOUND');
        }
    }
}
<?php 
}
if (!is_array($bannerInfo)) {
    $bannerInfo = array('SETTINGS' => array('Title' => Loc::getMessage('SEO_BANNER_DATA_TITLE'), 'Text' => Loc::getMessage('SEO_BANNER_DATA_TEXT'), 'Href' => ($request->isHttps() ? 'http' : 'https') . '://' . $request->getHttpHost() . "/"));
}
$host = parse_url($bannerInfo['SETTINGS']['Href'], PHP_URL_HOST);
?>
<div class="yandex-adv-block">
	<h2 class="yandex-title"><a href="/" class="yandex-title-link" id="yandex_link"><b id="yandex_title_content"><?php 
echo Converter::getHtmlConverter()->encode($bannerInfo['SETTINGS']['Title']);
?>
</b> / <font id="yandex_link_content"><?php 
echo Converter::getHtmlConverter()->encode($host);
?>
</font></a></h2>
<div class="yandex-adv"><div class="yandex-adv-note"><?php 
echo Loc::getMessage('SEO_BANNER_ADV_MARK');
?>
</div><a class="yandex-adv-link" href="<?php 
echo Converter::getHtmlConverter()->encode($bannerInfo['SETTINGS']['Href']);
?>
" id="yandex_link_content_link"><?php 
echo Converter::getHtmlConverter()->encode($host);
?>
</a></div>
<div class="yandex-text" id="yandex_text_content"><?php 
echo preg_replace("/\\n+/", ' ', Converter::getHtmlConverter()->encode($bannerInfo['SETTINGS']['Text']));
?>
</div>
</div>
示例#11
0
 /**
  * Fetches one row of the query result and returns it in the associative array of converted data or false on empty data.
  *
  * @param \Bitrix\Main\Text\Converter $converter Optional converter to encode data on fetching.
  *
  * @return array|false
  */
 public function fetch(\Bitrix\Main\Text\Converter $converter = null)
 {
     $data = $this->fetchRaw();
     if (!$data) {
         return false;
     }
     if ($this->converters) {
         foreach ($this->converters as $field => $convertDataModifier) {
             $data[$field] = call_user_func_array($convertDataModifier, array($data[$field]));
         }
     }
     if ($this->serializedFields) {
         foreach ($this->serializedFields as $field) {
             if (isset($data[$field])) {
                 $data[$field] = unserialize($data[$field]);
             }
         }
     }
     if ($this->replacedAliases) {
         foreach ($this->replacedAliases as $tech => $human) {
             $data[$human] = $data[$tech];
             unset($data[$tech]);
         }
     }
     if ($this->fetchDataModifiers) {
         foreach ($this->fetchDataModifiers as $fetchDataModifier) {
             $result = call_user_func_array($fetchDataModifier, array(&$data));
             if (is_array($result)) {
                 $data = $result;
             }
         }
     }
     if ($converter != null) {
         foreach ($data as $key => $val) {
             $data[$key] = $converter->encode($val, isset($data[$key . "_TYPE"]) ? $data[$key . "_TYPE"] : \Bitrix\Main\Text\Converter::TEXT);
         }
     }
     return $data;
 }
示例#12
0
                }
            }
            if (count($arDomains) <= 0) {
                $msg = new CAdminMessage(array('MESSAGE' => Loc::getMessage('SEO_YANDEX_ERROR'), 'HTML' => 'Y'));
                echo $msg->Show();
            } else {
                ?>
<div id="seo_original_text_form_form">
<form name="seo_original_text_form" style="padding:0;margin: 0;">
	<b><?php 
                echo Loc::getMessage('SEO_YANDEX_DOMAIN');
                ?>
: </b><select name="domain">
<?php 
                foreach ($arDomains as $domain) {
                    $domainEnc = Converter::getHtmlConverter()->encode($domain['DOMAIN']);
                    ?>
		<option value="<?php 
                    echo $domainEnc;
                    ?>
"><?php 
                    echo $domainEnc;
                    ?>
</option>
<?php 
                }
                ?>
	</select><br /><br />
	<textarea style="width: 700px; height: 450px;" name="original_text"></textarea>
</form>
</div><div id="seo_original_text_form_ok" style="display: none;">
	<b><?=Loc::getMessage('SEO_YANDEX_DIRECT_BANNER_LINKS')?></b>
<?
		foreach($arBanners as $campaignId => $campaignBanners)
		{
			if(isset($campaignList[$campaignId]))
			{
?>
	<div class="adv-campaign-item">
		<a href="/bitrix/admin/seo_search_yandex_direct_edit.php?lang=<?=LANGUAGE_ID?>&ID=<?=$campaignId?>&back_url=<?=Converter::getHtmlConverter()->encode(urlencode($APPLICATION->GetCurPageParam('form_element_'.$iblockElementInfo["IBLOCK"]["ID"].'_active_tab=seo_adv_seo_adv', array('form_element_'.$iblockElementInfo["IBLOCK"]["ID"].'_active_tab'))))?>" class="adv-campaign-link"><?=Converter::getHtmlConverter()->encode($campaignList[$campaignId]['NAME']);?></a>
		<div class="adv-campaign-list">
<?
				foreach($campaignBanners as $banner)
				{
?>
			<div class="adv-banner-item">
				<a href="/bitrix/admin/seo_search_yandex_direct_banner_edit.php?lang=<?=LANGUAGE_ID?>&ID=<?=$banner['BANNER_ID']?>&element=<?=$iblockElementInfo['ID']?>&back_url=<?=Converter::getHtmlConverter()->encode(urlencode($APPLICATION->GetCurPageParam('form_element_'.$iblockElementInfo["IBLOCK"]["ID"].'_active_tab=seo_adv_seo_adv', array('form_element_'.$iblockElementInfo["IBLOCK"]["ID"].'_active_tab'))))?>" class="adv-banner-link"><?=Loc::getMessage('SEO_YANDEX_DIRECT_BANNER_LINK_TPL', array(
							"#XML_ID#" => $banner['BANNER_XML_ID'],
							'#NAME#' => $banner['BANNER_NAME'],
						))?></a>&nbsp;<span class="yandex-delete" onclick="deleteLink('<?=$banner['BANNER_ID']?>', this)"></span>
			</div>
<?
				}
?>
	</div></div>
<?
			}
		}
?>
</div>
<?
    echo Loc::getMessage('SEO_GOOGLE_GEOLOCATION');
    ?>
:</td>
		<td id="geolocation_row">
			<div class="seo-view-field">
				<span id="geolocation_view"><?php 
    echo Converter::getHtmlConverter()->encode($arSiteInfo[$domain]['geolocation']);
    ?>
</span>
				<span class="seo-edit-link" onclick="BX.addClass(this.parentNode.parentNode, 'seo-edit');"><?php 
    echo Loc::getMessage('SEO_EDIT_FIELD_VALUE');
    ?>
</span>
			</div>
			<div class="seo-edit-field"><input type="text" style="width: 22px" value="<?php 
    echo Converter::getHtmlConverter()->encode($arSiteInfo[$domain]['geolocation']);
    ?>
" maxlength="2" id="geolocation_edit"><span class="seo-save-link"onclick="saveParam('geolocation')"><?php 
    echo Loc::getMessage('SEO_EDIT_FIELD_VALUE_SAVE');
    ?>
</span><span class="seo-cancel-link" onclick="BX.removeClass(this.parentNode.parentNode, 'seo-edit')"><?php 
    echo Loc::getMessage('SEO_EDIT_FIELD_VALUE_CANCEL');
    ?>
</span><span class="seo-loading-message"><?php 
    echo Loc::getMessage('SEO_EDIT_FIELD_VALUE_LOADING');
    ?>
</span></div>
		</td>
	</tr>
	<tr>
		<td><?php 
示例#15
0
    ?>
</td>
</tr>

<?php 
}
$tabControl->BeginNextTab();
?>
<tr>
	<td colspan="2">
		<b><?php 
echo $robotsFile->getPath();
?>
</b><br /><br />
		<textarea style="width: 100%" rows="30" id="robots_text" name="ROBOTS[TEXT]"><?php 
echo Converter::getHtmlConverter()->encode($fileContent);
?>
</textarea>
	</td>
</tr>
<tr>
	<td colspan="2"><?php 
echo BeginNote() . Loc::getMessage('SEO_ROBOTS_HINT' . (!$bVendor ? '' : '_1C')) . EndNote();
?>
</td>
</tr>

<?php 
$tabControl->Buttons(array('btnApply' => false));
echo bitrix_sessid_post();
$tabControl->End();
示例#16
0
unset($map['SETTINGS']);
$sitemapList = SitemapTable::getList(array('order' => array($by => $order), "select" => array_keys($map)));
$data = new CAdminResult($sitemapList, $tableID);
$data->NavStart();
$arHeaders = array(array("id" => "ID", "content" => Loc::getMessage("SITEMAP_ID"), "sort" => "ID", "default" => true), array("id" => "TIMESTAMP_X", "content" => Loc::getMessage('SITEMAP_TIMESTAMP_X'), "sort" => "TIMESTAMP_X", "default" => true), array("id" => "NAME", "content" => Loc::getMessage('SITEMAP_NAME'), "sort" => "NAME", "default" => true), array("id" => "SITE_ID", "content" => Loc::getMessage('SITEMAP_SITE_ID'), "sort" => "SITE_ID", "default" => true), array("id" => "DATE_RUN", "content" => Loc::getMessage('SITEMAP_DATE_RUN'), "sort" => "DATE_RUN", "default" => true), array("id" => "RUN", "content" => "", "default" => true));
$adminList->AddHeaders($arHeaders);
$adminList->NavText($data->GetNavPrint(Loc::getMessage("PAGES")));
while ($sitemap = $data->NavNext()) {
    $id = intval($sitemap['ID']);
    $row =& $adminList->AddRow($sitemap["ID"], $sitemap, "seo_sitemap_pro_edit.php?ID=" . $sitemap["ID"] . "&lang=" . LANGUAGE_ID, Loc::getMessage("SITEMAP_EDIT_TITLE"));
    $row->AddViewField("ID", $sitemap['ID']);
    $row->AddViewField('TIMESTAMP_X', $sitemap['TIMESTAMP_X']);
    $row->AddViewField('DATE_RUN', $sitemap['DATE_RUN'] ? $sitemap['DATE_RUN'] : Loc::getMessage('SITEMAP_DATE_RUN_NEVER'));
    $row->AddViewField('SITE_ID', '<a href="site_edit.php?lang=' . LANGUAGE_ID . '&amp;LID=' . $sitemap['SITE_ID'] . '">[' . $sitemap['SITE_ID'] . '] ' . $arSites[$sitemap['SITE_ID']]['NAME'] . '</a>');
    $row->AddField("NAME", '<a href="seo_sitemap_pro_edit.php?ID=' . $sitemap["ID"] . '&amp;lang=' . LANGUAGE_ID . '" title="' . Loc::getMessage("SITEMAP_EDIT_TITLE") . '">' . Converter::getHtmlConverter()->encode($sitemap['NAME']) . '</a>');
    $row->AddField("RUN", '<input type="button" class="adm-btn-save" value="' . Converter::getHtmlConverter()->encode(Loc::getMessage('SITEMAP_RUN')) . '" onclick="generateSitemap(' . $sitemap['ID'] . ')" name="save" id="sitemap_run_button_' . $sitemap['ID'] . '" />');
    //$row->AddInputField("NAME");
    //$row->AddCheckField("ACTIVE");
    $row->AddActions(array(array("ICON" => "edit", "TEXT" => Loc::getMessage("SITEMAP_EDIT"), "ACTION" => $adminList->ActionRedirect("seo_sitemap_pro_edit.php?ID=" . $sitemap["ID"] . "&lang=" . LANGUAGE_ID), "DEFAULT" => true), array("ICON" => "move", "TEXT" => Loc::getMessage("SITEMAP_RUN"), "ACTION" => 'generateSitemap(' . $sitemap['ID'] . ');'), array("ICON" => "delete", "TEXT" => Loc::getMessage("SITEMAP_DELETE"), "ACTION" => "if(confirm('" . \CUtil::JSEscape(Loc::getMessage('SITEMAP_DELETE_CONFIRM')) . "')) " . $adminList->ActionDoGroup($id, "delete"))));
}
$arDDMenu = array();
$arDDMenu[] = array("TEXT" => "<b>" . Loc::getMessage("SEO_ADD_SITEMAP_CHOOSE_SITE") . "</b>", "ACTION" => false);
foreach ($arSites as $arRes) {
    $arDDMenu[] = array("TEXT" => "[" . $arRes["LID"] . "] " . $arRes["NAME"], "LINK" => "seo_sitemap_pro_edit.php?lang=" . LANGUAGE_ID . "&site_id=" . $arRes['LID']);
}
$aContext = array();
$aContext[] = array("TEXT" => Loc::getMessage("SEO_ADD_SITEMAP"), "TITLE" => Loc::getMessage("SEO_ADD_SITEMAP_TITLE"), "ICON" => "btn_new", "MENU" => $arDDMenu);
$adminList->AddAdminContextMenu($aContext);
$adminList->AddGroupActionTable(array("delete" => GetMessage("MAIN_ADMIN_LIST_DELETE")));
$adminList->CheckListMode();
$APPLICATION->SetTitle(Loc::getMessage("SEO_SITEMAP_TITLE"));
示例#17
0
:</b><div style="width: 300px; padding: 10px 0 0 0;">
<?php 
        if ($currentUser['picture']) {
            ?>
		<img src="<?php 
            echo Converter::getHtmlConverter()->encode($currentUser['picture']);
            ?>
" style="float: left; margin: 0 13px 0 0; max-width: 55px;" />
<?php 
        }
        ?>
		<a href="<?php 
        echo Converter::getHtmlConverter()->encode($currentUser['profile']);
        ?>
" target="_blank"><?php 
        echo Converter::getHtmlConverter()->encode($currentUser['name']);
        ?>
</a><br /><br />
		<a href="javascript:void(0)" onclick="makeNewAuth()"><?php 
        echo Loc::getMessage('SEO_AUTH_CANCEL');
        ?>
</a>
		<div style="clear: both;"></div>
	</div>
</div>
<?php 
    }
    ?>
<script type="text/javascript">updateInfo();</script>
<?php 
}
示例#18
0
    public function addSite($domain, $dir = '/')
    {
        $str = <<<EOT
<atom:entry xmlns:atom='http://www.w3.org/2005/Atom'><atom:content src="%s" /></atom:entry>
EOT;
        $queryResult = $this->queryXml(self::SCOPE_BASE . self::SCOPE_FEED_SITES, "POST", sprintf($str, Converter::getXmlConverter()->encode(self::SCOPE_DOMAIN_PROTOCOL . $domain . $dir)));
        if ($queryResult->status == self::HTTP_STATUS_CREATED && strlen($queryResult->result) > 0) {
            return $this->processResult($queryResult->result);
        } else {
            throw new \Exception('Query error! ' . $queryResult->status . ': ' . $queryResult->result);
        }
    }
use \Bitrix\Main\Text\Converter;
use \Bitrix\Seo\Adv;

Loc::loadMessages(dirname(__FILE__).'/../seo_adv.php');

$bAllowDelete = $ID > 0;

if(count($arLinks) > 0)
{
	foreach($arLinks as $link)
	{
		switch($link['LINK_TYPE'])
		{
			case Adv\LinkTable::TYPE_IBLOCK_ELEMENT:

				echo '<div><a href="/bitrix/admin/iblock_element_edit.php?IBLOCK_ID='.$link['ELEMENT_IBLOCK_ID'].'&type='.Converter::getHtmlConverter()->encode($link['ELEMENT_IBLOCK_TYPE_ID']).'&ID='.$link['LINK_ID'].'&lang='.LANGUAGE_ID.'&find_section_section='.$link['ELEMENT_IBLOCK_SECTION_ID'].'" style="display: inline-block; height: 20px; vertical-align: top; margin-top: 2px;">'.Converter::getHtmlConverter()->encode($link['ELEMENT_NAME']).'</a>'.($bAllowDelete ? '&nbsp;<span class="yandex-delete" onclick="deleteLink(\''.$link['LINK_ID'].'\', \''.$link['LINK_TYPE'].'\', this)"></span>' : '').'</div>';

				break;
		}
	}
}
else
{
	echo Loc::getMessage('MAIN_NO');
}

?>
<script>
	function deleteLink(linkId, linkType, el)
	{
		if(!el._loading)
			<div class="adv-banner-item">
				<input type="hidden" name="seo_yandex_banner_id[]" value="<?php 
                    echo $banner['BANNER_ID'];
                    ?>
" />
				<a href="/bitrix/admin/seo_search_yandex_direct_banner_edit.php?lang=<?php 
                    echo LANGUAGE_ID;
                    ?>
&ID=<?php 
                    echo $banner['BANNER_ID'];
                    ?>
&element=<?php 
                    echo $iblockElementInfo['ID'];
                    ?>
&back_url=<?php 
                    echo Converter::getHtmlConverter()->encode(urlencode($APPLICATION->GetCurPageParam('form_element_' . $iblockElementInfo["IBLOCK"]["ID"] . '_active_tab=seo_adv_seo_adv', array('form_element_' . $iblockElementInfo["IBLOCK"]["ID"] . '_active_tab'))));
                    ?>
" class="adv-banner-link"><?php 
                    echo Loc::getMessage('SEO_YANDEX_DIRECT_BANNER_LINK_TPL', array("#XML_ID#" => $banner['BANNER_XML_ID'], '#NAME#' => $banner['BANNER_NAME']));
                    ?>
</a>&nbsp;<span class="yandex-delete" onclick="deleteLink('<?php 
                    echo $banner['BANNER_ID'];
                    ?>
', this)"></span>
			</div>
<?php 
                }
                ?>
	</div></div>
<?php 
            }
				$active_title = Loc::getMessage('SEO_ISACTIVE_NO');
			}
		}
	}

	$row->AddField("ISACTIVE", '<div style="white-space:nowrap;"><div class="lamp-'.$active.'" style="display:inline-block;"></div>&nbsp;'.$active_title.'</div>'/*.'<pre>'.print_r(array(
		'IsActive' => $banner['SETTINGS']['IsActive'],
		'StatusShow' => $banner['SETTINGS']['StatusShow'],
		'StatusBannerModerate' => $banner['SETTINGS']['StatusBannerModerate'],
		'StatusActivating' => $banner['SETTINGS']['StatusActivating'],
		'StatusPhrasesModerate' => $banner['SETTINGS']['StatusPhrasesModerate'],
	), 1).'</pre>'*/);

	$row->AddField("UPDATE", '<input type="button" '.($bAllowSimpleActions ? '' : 'disabled="disabled"').' class="adm-btn-save" value="'.Converter::getHtmlConverter()->encode(Loc::getMessage('SEO_CAMPAIGN_UPDATE')).'" onclick="updateBanner(this, '.$banner['ID'].')" name="save" id="banner_update_button_'.$banner['ID'].'" />');

	$row->AddViewField('XML_ID', '<a href="https://direct.yandex.ru/registered/main.pl?cmd=showCampMultiEdit&bids='.$banner['XML_ID'].'&cid='.$campaign['XML_ID'].'" target="_blank" title="'.Converter::getHtmlConverter()->encode(Loc::getMessage('SEO_CAMPAIGN_EDIT_EXTERNAL')).'">'.Loc::getMessage('SEO_YANDEX_DIRECT_LINK_TPL', array('#XML_ID#' => $banner['XML_ID'])).'</a>');

	$row->AddViewField('MODERATE', Loc::getMessage('SEO_YANDEX_STATUS_'.$banner['SETTINGS']['StatusBannerModerate']));
	$row->AddViewField('PHRASES_MODERATE', Loc::getMessage('SEO_YANDEX_STATUS_'.$banner['SETTINGS']['StatusPhrasesModerate']));
	$row->AddViewField('SHOW', Loc::getMessage('SEO_YANDEX_STATUS_'.$banner['SETTINGS']['StatusShow']));

	if($bAllowSimpleActions)
	{
		$rowActions = array(
			array(
				"ICON" => "edit",
				"TEXT" => Loc::getMessage("SEO_BANNER_EDIT"),
				"ACTION" => $adminList->ActionRedirect($editUrl),
				"DEFAULT" => true,
			),
			array(
    ?>
	</td>
</tr>
<?php 
}
$tabControl->EndTab();
if (!$bReadOnly) {
    $tabControl->Buttons(array("back_url" => $back_url ? $back_url : "seo_search_yandex_direct_banner.php?lang=" . LANGUAGE_ID));
}
$tabControl->End();
if (!$bReadOnly) {
    echo bitrix_sessid_post();
    if ($back_url != '') {
        ?>
	<input type="hidden" name="back_url" value="<?php 
        echo Converter::getHtmlConverter()->encode($back_url);
        ?>
">
<?php 
    }
    ?>

	<input type="hidden" name="campaign" value="<?php 
    echo $campaignId;
    ?>
">
	<input type="hidden" name="element" value="<?php 
    echo $elementId;
    ?>
">
	<input type="hidden" name="ID" value="<?php 
    echo Loc::getMessage("SEO_CAMPAIGN_CHOOSE_OPTION");
    ?>
</option>
				<?php 
    foreach ($campaignList as $campaign) {
        $canAdd = in_array($campaign["SETTINGS"]['Strategy']['StrategyName'], Adv\YandexCampaignTable::$supportedStrategy);
        ?>
					<option value="<?php 
        echo $campaign["ID"];
        ?>
"
						data-add="<?php 
        echo $canAdd ? 1 : 0;
        ?>
"><?php 
        echo Converter::getHtmlConverter()->encode($campaign["NAME"]);
        ?>
</option>
				<?php 
    }
    ?>
			</select>&nbsp;&nbsp;<a
				href="/bitrix/admin/seo_search_yandex_direct_edit.php?lang=<?php 
    echo LANGUAGE_ID;
    ?>
&back_url=<?php 
    echo urlencode($APPLICATION->GetCurPageParam('form_element_' . $iblockElementInfo["IBLOCK"]["ID"] . '_active_tab=seo_adv_seo_adv', array('form_element_' . $iblockElementInfo["IBLOCK"]["ID"] . '_active_tab')));
    ?>
"><?php 
    echo Loc::getMessage("SEO_CREATE_NEW_CAMPAIGN");
    ?>
示例#24
0
?>
: <input type="text" name="CODE" style="width: 200px" /> <input type="submit" name="send_code" value="<?php 
echo Loc::getMessage('SEO_AUTH_CODE_SUBMIT');
?>
"></form></div>
<?php 
if (!$bNeedAuth) {
    if (is_array($currentUser)) {
        ?>
<div id="auth_result" class="seo-auth-result">
	<b><?php 
        echo Loc::getMessage('SEO_AUTH_CURRENT');
        ?>
:</b><div style="width: 300px; padding: 10px 0 0 0;">
		<?php 
        echo Converter::getHtmlConverter()->encode($currentUser['real_name'] . ' (' . $currentUser['display_name'] . ')');
        ?>
<br />
		<a href="javascript:void(0)" onclick="makeNewAuth()"><?php 
        echo Loc::getMessage('SEO_AUTH_CANCEL');
        ?>
</a>
		<div style="clear: both;"></div>
	</div>
</div>
<?php 
    }
    ?>
<script type="text/javascript">updateInfo();</script>
<?php 
}
示例#25
0
    public function addSite($domain, $dir = '/')
    {
        $domain = ToLower($domain);
        $queryDomain = Context::getCurrent()->getRequest()->isHttps() ? 'https://' . $domain : $domain;
        if (!isset($this->arServiceList[self::HOSTS_SERVICE])) {
            $this->getServiceDocument();
        }
        if (isset($this->arServiceList[self::HOSTS_SERVICE])) {
            $str = <<<EOT
<host><name>%s</name></host>
EOT;
            $queryResult = $this->queryOld($this->arServiceList[self::HOSTS_SERVICE], "POST", sprintf($str, Converter::getXmlConverter()->encode($queryDomain)));
            if ($queryResult->status == self::HTTP_STATUS_CREATED && strlen($queryResult->result) > 0) {
                return array($domain => true);
            } else {
                throw new Engine\YandexException($queryResult);
            }
        }
    }
    ShowError($e->getMessage());
    require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php";
}
$bSiteVerified = $arSiteInfo[$domain]['verification'] == Engine\Yandex::VERIFIED_STATE_VERIFIED;
$aTabs = array(array("DIV" => "seo_info1", "TAB" => Loc::getMessage('SEO_DETAIL_INFO'), "ICON" => "main_settings", "TITLE" => Loc::getMessage('SEO_DETAIL_INFO_TITLE', array('#DOMAIN#' => $siteDomainEncView))), array("DIV" => "seo_info2", "TAB" => Loc::getMessage('SEO_DETAIL_TOP_QUERIES'), "ICON" => "main_settings", "TITLE" => Loc::getMessage('SEO_DETAIL_TOP_QUERIES_TITLE', array('#DOMAIN#' => $siteDomainEncView)), 'ONSELECT' => 'window.BXLoadInfo(\'top-queries\')'), array("DIV" => "seo_info3", "TAB" => Loc::getMessage('SEO_DETAIL_CRAWLING'), "ICON" => "main_settings", "TITLE" => Loc::getMessage('SEO_DETAIL_CRAWLING_TITLE', array('#DOMAIN#' => $siteDomainEncView)), 'ONSELECT' => 'window.BXLoadInfo(\'crawling\')'), array("DIV" => "seo_info4", "TAB" => Loc::getMessage('SEO_DETAIL_ORIGINAL'), "ICON" => "main_settings", "TITLE" => Loc::getMessage('SEO_DETAIL_ORIGINAL_TITLE', array('#DOMAIN#' => $siteDomainEncView)), 'ONSELECT' => 'window.BXLoadInfo(\'original_texts\')'));
$tabControl = new CAdminTabControl("seoYandexTabControl", $aTabs, true, true);
$APPLICATION->SetTitle(Loc::getMessage("SEO_YANDEX_TITLE"));
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
$aMenu = array();
$aMenu[] = array("TEXT" => Loc::getMessage("SEO_DOMAIN_LIST"), "LINK" => "/bitrix/admin/seo_search_yandex.php?lang=" . LANGUAGE_ID, "ICON" => "btn_list");
$context = new CAdminContextMenu($aMenu);
$context->Show();
$tabControl->Begin();
$tabControl->BeginNextTab();
$siteIdEnc = Converter::getHtmlConverter()->encode($arDomain['LID']);
$siteNameEnc = Converter::getHtmlConverter()->encode($arDomain['SITE_NAME']);
?>
	<tr class="adm-detail-required-field">
		<td width="40%"><?php 
echo Loc::getMessage('SEO_DOMAIN');
?>
:</td>
		<td width="60%"><?php 
echo $siteDomainEncView;
?>
</td>
	</tr>
	<tr>
		<td><?php 
echo Loc::getMessage('SEO_SITE');
?>
示例#27
0
            if (count($arDomains) <= 0) {
                $msg = new CAdminMessage(array('MESSAGE' => Loc::getMessage('SEO_YANDEX_ERROR'), 'HTML' => 'Y'));
                echo $msg->Show();
            } else {
                ?>
<div id="seo_original_text_form_form">
<form name="seo_original_text_form" style="padding:0;margin: 0;">
	<b><?php 
                echo Loc::getMessage('SEO_YANDEX_DOMAIN');
                ?>
: </b><select name="domain">
<?php 
                foreach ($arDomains as $domain) {
                    $domainView = \CBXPunycode::ToUnicode($domain['DOMAIN'], $errors = null);
                    $domainEnc = Converter::getHtmlConverter()->encode($domain['DOMAIN']);
                    $domainViewEnc = Converter::getHtmlConverter()->encode($domainView);
                    ?>
		<option value="<?php 
                    echo $domainEnc;
                    ?>
"><?php 
                    echo $domainViewEnc;
                    ?>
</option>
<?php 
                }
                ?>
	</select><br /><br />
	<textarea style="width: 700px; height: 450px;" name="original_text"></textarea>
</form>
</div><div id="seo_original_text_form_ok" style="display: none;">
示例#28
0
                            $arReferers[$arUrl['host']]['URL_FROM'][$arRes['URL_FROM']] = $arRes['QUANTITY'];
                        }
                    }
                }
            }
            if ($total > 0) {
                $cnt = count($arReferers);
                ?>
<table width="100%">
	<tr>
		<td colspan="2" align="center"><table class="referers-table">
<?php 
                $color = null;
                foreach ($arReferers as $domain => $arData) {
                    $percent = number_format($arData['PERCENT'], 2);
                    $domainEnc = \Bitrix\Main\Text\Converter::getHtmlConverter()->encode($domain);
                    ?>
		<tr>
			<td width="30%" align="left"><a href="javascript:void(0)" onclick="BXToggle('bx_referer_ex_<?php 
                    echo CUtil::JSEscape($domainEnc);
                    ?>
'); return false;" title="<?php 
                    echo GetMessage('SEO_PAGE_REFERERS_SEO_PAGE_REFERERS_ALT');
                    ?>
"><?php 
                    echo $domainEnc;
                    ?>
</td>
			<td width="70%">
				<div style="height: 15px; border: solid 1px #<?php 
                    echo $color = GetNextRGB($color, $cnt);
$tabControl->EndTab();
if(!$bReadOnly)
{
	$tabControl->Buttons(array(
		"back_url" => $back_url ? $back_url : "seo_search_yandex_direct_banner.php?lang=".LANGUAGE_ID,
	));
}
$tabControl->End();

if(!$bReadOnly):
?>
<?=bitrix_sessid_post();?>
<?
	if($back_url!=''):
?>
	<input type="hidden" name="back_url" value="<?echo Converter::getHtmlConverter()->encode($back_url)?>">
<?
	endif;
?>

	<input type="hidden" name="campaign" value="<?=$campaignId?>">
	<input type="hidden" name="element" value="<?=$elementId?>">
	<input type="hidden" name="ID" value="<?=$ID?>">


<?
endif;
?>
</form>
<?
require($_SERVER["DOCUMENT_ROOT"].BX_ROOT."/modules/main/include/epilog_admin.php");
示例#30
0
    public function verifySite($domain, $dir)
    {
        $str = <<<EOT
<atom:entry xmlns:atom='http://www.w3.org/2005/Atom' xmlns:wt="http://schemas.google.com/webmasters/tools/2007"><atom:id>%s</atom:id><wt:verification-method type="htmlpage" in-use="true"/></atom:entry>
EOT;
        $queryResult = $this->query($this->getSiteId($domain, $dir), "PUT", sprintf($str, Converter::getXmlConverter()->encode(self::SCOPE_DOMAIN_PROTOCOL . $domain . $dir)));
        if ($queryResult->status == self::HTTP_STATUS_OK && strlen($queryResult->result) > 0) {
            return $this->processResult($queryResult->result);
        } else {
            throw new \Exception('Query error! ' . $queryResult->status . ': ' . $queryResult->result);
        }
    }