当前位置: 首页>>代码示例>>PHP>>正文


PHP CUtil::JSEscape方法代码示例

本文整理汇总了PHP中CUtil::JSEscape方法的典型用法代码示例。如果您正苦于以下问题:PHP CUtil::JSEscape方法的具体用法?PHP CUtil::JSEscape怎么用?PHP CUtil::JSEscape使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CUtil的用法示例。


在下文中一共展示了CUtil::JSEscape方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __CrmFieldMultiEditRenderItem

    function __CrmFieldMultiEditRenderItem($item, $mnemonic, $typeID, $referenceData, $editorID)
    {
        $itemID = isset($item['ID']) ? $item['ID'] : '';
        $itemVal = isset($item['VALUE']) ? $item['VALUE'] : '';
        ?>
<div class="bx-crm-edit-fm-item">
		<input type="text" class="bx-crm-edit-input" name="<?php 
        echo htmlspecialcharsbx($mnemonic);
        ?>
[<?php 
        echo htmlspecialcharsbx($typeID);
        ?>
][<?php 
        echo htmlspecialcharsbx($itemID);
        ?>
][VALUE]" value="<?php 
        echo htmlspecialcharsbx($itemVal);
        ?>
"><?php 
        echo SelectBoxFromArray(CUtil::JSEscape($mnemonic) . '[' . htmlspecialcharsbx($typeID) . '][' . htmlspecialcharsbx($itemID) . '][VALUE_TYPE]', $referenceData, isset($item['VALUE_TYPE']) ? $item['VALUE_TYPE'] : '', '', "class='bx-crm-edit-input bx-crm-edit-input-small'");
        ?>
<div class="delete-action" onclick="BX.CrmFieldMultiEditor.items['<?php 
        echo CUtil::addslashes($editorID);
        ?>
'].deleteItem('<?php 
        echo CUtil::addslashes($itemID);
        ?>
');" title="<?php 
        echo GetMessage('CRM_STATUS_LIST_DELETE');
        ?>
"></div>
		</div><?php 
    }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:33,代码来源:template.php

示例2: ShowPanel

	function ShowPanel()
	{
		if ($GLOBALS["USER"]->IsAdmin() && COption::GetOptionString("main", "wizard_solution", "", SITE_ID) == "eshop")
		{
			$GLOBALS["APPLICATION"]->SetAdditionalCSS("/bitrix/wizards/bitrix/eshop/css/panel.css"); 

			$arMenu = Array(
				Array(		
					"ACTION" => "jsUtils.Redirect([], '".CUtil::JSEscape("/bitrix/admin/wizard_install.php?lang=".LANGUAGE_ID."&wizardSiteID=".SITE_ID."&wizardName=bitrix:eshop&".bitrix_sessid_get())."')",
					"ICON" => "bx-popup-item-wizard-icon",
					"TITLE" => GetMessage("STOM_BUTTON_TITLE_W1"),
					"TEXT" => GetMessage("STOM_BUTTON_NAME_W1"),
				)
			);

			$GLOBALS["APPLICATION"]->AddPanelButton(array(
				"HREF" => "/bitrix/admin/wizard_install.php?lang=".LANGUAGE_ID."&wizardName=bitrix:eshop&wizardSiteID=".SITE_ID."&".bitrix_sessid_get(),
				"ID" => "eshop_wizard",
				"ICON" => "bx-panel-site-wizard-icon",
				"MAIN_SORT" => 2500,
				"TYPE" => "BIG",
				"SORT" => 10,	
				"ALT" => GetMessage("SCOM_BUTTON_DESCRIPTION"),
				"TEXT" => GetMessage("SCOM_BUTTON_NAME"),
				"MENU" => $arMenu,
			));
		}
	}
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:28,代码来源:include.php

示例3: __sbpc_bind_post_to_form

    function __sbpc_bind_post_to_form($xml_id, $form_id_get = null, $arParams)
    {
        static $form_id = null;
        if ($form_id_get !== null) {
            $form_id = $form_id_get;
            return;
        }
        ?>
<script type="text/javascript">BX.ready(function(){__blogLinkEntity({'<?php 
        echo CUtil::JSEscape($xml_id);
        ?>
' : ['BG', <?php 
        echo $arParams["ID"];
        ?>
, '<?php 
        echo $arParams["LOG_ID"];
        ?>
']}, <?php 
        if ($form_id == null) {
            ?>
 window.SBPC.form.id<?php 
        } else {
            ?>
"<?php 
            echo $form_id;
            ?>
"<?php 
        }
        ?>
);});</script><?php 
    }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:functions.php

示例4: ShowPanel

 function ShowPanel()
 {
     if ($GLOBALS["USER"]->IsAdmin() && COption::GetOptionString("main", "wizard_solution", "", SITE_ID) == "eshop") {
         $GLOBALS["APPLICATION"]->SetAdditionalCSS("/bitrix/wizards/bitrix/eshop/css/panel.css");
         $arMenu = array(array("ACTION" => "jsUtils.Redirect([], '" . CUtil::JSEscape("/bitrix/admin/wizard_install.php?lang=" . LANGUAGE_ID . "&wizardSiteID=" . SITE_ID . "&wizardName=bitrix:eshop&" . bitrix_sessid_get()) . "')", "ICON" => "bx-popup-item-wizard-icon", "TITLE" => GetMessage("STOM_BUTTON_TITLE_W1"), "TEXT" => GetMessage("STOM_BUTTON_NAME_W1")), array("ACTION" => "jsUtils.Redirect([], '" . CUtil::JSEscape("/bitrix/admin/wizard_install.php?lang=" . LANGUAGE_ID . "&site_id=" . SITE_ID . "&wizardName=bitrix:eshop.mobile&" . bitrix_sessid_get()) . "')", "ICON" => "bx-popup-item-wizard-icon", "TITLE" => GetMessage("STOM_BUTTON_TITLE_W5"), "TEXT" => GetMessage("STOM_BUTTON_NAME_W5")));
         /*if(COption::GetOptionString("bitrix.eshop", "demo_deleted", "", SITE_ID) != 'Y')
         			{
         				CModule::IncludeModule("iblock");
         				$dbr = CIBlock::GetList(Array(), Array("XML_ID"=>"furniture_".SITE_ID));
          				if($arR = $dbr->Fetch())
         				{
         					if($_REQUEST['delete_demo']=='eshop' && check_bitrix_sessid())
         					{
         				    		if(CIBlock::Delete($arR['ID']))
         				    		{
         				    			DeleteDirFilesEx(SITE_DIR.'catalog/furniture');
         								COption::GetOptionString("bitrix.eshop", "demo_deleted", "Y", SITE_ID);
         				    		}
         							unset($_SESSION["SALE_BASKET_NUM_PRODUCTS"][SITE_ID]);
         					}
         					else
         				 		$arMenu[] = Array(		
         							"ACTION" => "if(confirm('".GetMessage("STOM_BUTTON_CONFIRM_W2")."')) jsUtils.Redirect([], '".CUtil::JSEscape(SITE_DIR)."catalog/?delete_demo=eshop&".bitrix_sessid_get()."');",
         							"ICON" => "bx-popup-item-delete-icon",
         							"TITLE" => GetMessage("STOM_BUTTON_TITLE_W3"),
         							"TEXT" => GetMessage("STOM_BUTTON_NAME_W3"),
         						);
         				}
         				else
         					COption::SetOptionString("bitrix.eshop", "demo_deleted", "Y", "", SITE_ID);
         
         			}  */
         $GLOBALS["APPLICATION"]->AddPanelButton(array("HREF" => "/bitrix/admin/wizard_install.php?lang=" . LANGUAGE_ID . "&wizardName=bitrix:eshop&wizardSiteID=" . SITE_ID . "&" . bitrix_sessid_get(), "ID" => "eshop_wizard", "ICON" => "bx-panel-site-wizard-icon", "MAIN_SORT" => 2500, "TYPE" => "BIG", "SORT" => 10, "ALT" => GetMessage("SCOM_BUTTON_DESCRIPTION"), "TEXT" => GetMessage("SCOM_BUTTON_NAME"), "MENU" => $arMenu));
     }
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:35,代码来源:include.php

示例5: Authorize

	public function Authorize()
	{
		$GLOBALS["APPLICATION"]->RestartBuffer();
		$bSuccess = false;

			if(isset($_REQUEST["code"]) && $_REQUEST["code"] <> '')
			{
				if(CSocServAuthManager::CheckUniqueKey())
				{
				$redirect_uri = CSocServUtil::GetCurUrl('auth_service_id='.self::ID, array("code"));

				$appID = self::GetOption("facebook_appid");
				$appSecret = self::GetOption("facebook_appsecret");

				$fb = new CFacebookInterface($appID, $appSecret, $_REQUEST["code"]);

				if($fb->GetAccessToken($redirect_uri) !== false)
				{
					$arFBUser = $fb->GetCurrentUser();
					if(isset($arFBUser["id"]))
					{
						$arFields = array(
							'EXTERNAL_AUTH_ID' => self::ID,
							'XML_ID' => $arFBUser["id"],
							'LOGIN' => "FB_".$arFBUser["email"],
							'EMAIL' => $arFBUser["email"],
							'NAME'=> $arFBUser["first_name"],
							'LAST_NAME'=> $arFBUser["last_name"],
						);

						if(isset($arFBUser['picture']['data']['url']) && self::CheckPhotoURI($arFBUser['picture']['data']['url']))
							if ($arPic = CFile::MakeFileArray($arFBUser['picture']['data']['url']))
								$arFields["PERSONAL_PHOTO"] = $arPic;
						if(isset($arFBUser['birthday']))
							if ($date = MakeTimeStamp($arFBUser['birthday'], "MM/DD/YYYY"))
								$arFields["PERSONAL_BIRTHDAY"] = ConvertTimeStamp($date);
						if(isset($arFBUser['gender']) && $arFBUser['gender'] != '')
						{
							if ($arFBUser['gender'] == 'male')
								$arFields["PERSONAL_GENDER"] = 'M';
							elseif ($arFBUser['gender'] == 'female')
								$arFields["PERSONAL_GENDER"] = 'F';
						}
						$arFields["PERSONAL_WWW"] = "http://www.facebook.com/".$arFBUser["id"];
						$bSuccess = $this->AuthorizeUser($arFields);
					}
				}
			}
		}
		$aRemove = array("logout", "auth_service_error", "auth_service_id", "code", "error_reason", "error", "error_description", "check_key");
		$url = $GLOBALS['APPLICATION']->GetCurPageParam(($bSuccess? '':'auth_service_id='.self::ID.'&auth_service_error=1'), $aRemove);
		echo '
<script type="text/javascript">
if(window.opener)
	window.opener.location = \''.CUtil::JSEscape($url).'\';
window.close();
</script>
';
		die();
	}
开发者ID:nProfessor,项目名称:Mytb,代码行数:60,代码来源:facebook.php

示例6: getJsTitle

function getJsTitle()
{
    $title = $GLOBALS["APPLICATION"]->GetTitle("title", true);
    $title = html_entity_decode($title, ENT_QUOTES, SITE_CHARSET);
    $title = CUtil::JSEscape($title);
    return $title;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:7,代码来源:header.php

示例7: print_rrr

function print_rrr($var)
{
    if (is_array($var)) {
        if ($var == array_values($var)) {
            foreach ($var as $key => $value) {
                $var[$key] = print_rrr($value);
            }
            return "Array(" . implode(", ", $var) . ")";
        }
        $res = "\nArray(\n";
        $first = true;
        foreach ($var as $key => $value) {
            if ($first) {
                $first = false;
            } else {
                $res .= ",\n";
            }
            $res .= "'" . CUtil::JSEscape($key) . "' => " . print_rrr($value);
        }
        $res .= "\n)";
        return $res;
    } elseif (is_bool($var)) {
        if ($var === true) {
            return 'true';
        } else {
            return 'false';
        }
    } else {
        return "'" . CUtil::JSEscape($var) . "'";
    }
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:bizproc_workflow_edit.php

示例8: Authorize

    public function Authorize()
    {
        $GLOBALS["APPLICATION"]->RestartBuffer();
        $bSuccess = 1;
        if (isset($_REQUEST["code"]) && $_REQUEST["code"] != '') {
            if (CSocServAuthManager::CheckUniqueKey()) {
                if (IsModuleInstalled('bitrix24') && defined('BX24_HOST_NAME')) {
                    $redirect_uri = self::CONTROLLER_URL . "/redirect.php?redirect_to=" . urlencode(CSocServUtil::GetCurUrl('auth_service_id=' . self::ID, array("code")));
                } else {
                    $redirect_uri = CSocServUtil::GetCurUrl('auth_service_id=' . self::ID, array("code"));
                }
                $appID = trim(self::GetOption("facebook_appid"));
                $appSecret = trim(self::GetOption("facebook_appsecret"));
                $fb = new CFacebookInterface($appID, $appSecret, $_REQUEST["code"]);
                if ($fb->GetAccessToken($redirect_uri) !== false) {
                    $arFBUser = $fb->GetCurrentUser();
                    if (is_array($arFBUser) && isset($arFBUser["id"])) {
                        $email = $arFBUser["email"] != '' ? $arFBUser["email"] : '';
                        $arFields = array('EXTERNAL_AUTH_ID' => self::ID, 'XML_ID' => $arFBUser["id"], 'LOGIN' => "FB_" . $arFBUser["id"], 'EMAIL' => $email, 'NAME' => $arFBUser["first_name"], 'LAST_NAME' => $arFBUser["last_name"]);
                        if (isset($arFBUser['picture']['data']['url']) && self::CheckPhotoURI($arFBUser['picture']['data']['url'])) {
                            if ($arPic = CFile::MakeFileArray($arFBUser['picture']['data']['url'])) {
                                $arFields["PERSONAL_PHOTO"] = $arPic;
                            }
                        }
                        if (isset($arFBUser['birthday'])) {
                            if ($date = MakeTimeStamp($arFBUser['birthday'], "MM/DD/YYYY")) {
                                $arFields["PERSONAL_BIRTHDAY"] = ConvertTimeStamp($date);
                            }
                        }
                        if (isset($arFBUser['gender']) && $arFBUser['gender'] != '') {
                            if ($arFBUser['gender'] == 'male') {
                                $arFields["PERSONAL_GENDER"] = 'M';
                            } elseif ($arFBUser['gender'] == 'female') {
                                $arFields["PERSONAL_GENDER"] = 'F';
                            }
                        }
                        $arFields["PERSONAL_WWW"] = "http://www.facebook.com/" . $arFBUser["id"];
                        if (strlen(SITE_ID) > 0) {
                            $arFields["SITE_ID"] = SITE_ID;
                        }
                        $bSuccess = $this->AuthorizeUser($arFields);
                    }
                }
            }
        }
        $aRemove = array("logout", "auth_service_error", "auth_service_id", "code", "error_reason", "error", "error_description", "check_key", "current_fieldset");
        $url = $GLOBALS['APPLICATION']->GetCurPageParam($bSuccess === true ? '' : 'auth_service_id=' . self::ID . '&auth_service_error=' . $bSuccess, $aRemove);
        if (CModule::IncludeModule("socialnetwork") && strpos($url, "current_fieldset=") === false) {
            $url = preg_match("/\\?/", $url) ? $url . "&current_fieldset=SOCSERV" : $url . "?current_fieldset=SOCSERV";
        }
        echo '
<script type="text/javascript">
if(window.opener)
	window.opener.location = \'' . CUtil::JSEscape($url) . '\';
window.close();
</script>
';
        die;
    }
开发者ID:spas-viktor,项目名称:books,代码行数:59,代码来源:facebook.php

示例9: addWMVJSConfig

	function addWMVJSConfig(&$str, $key, $value, $default = false)
	{
		if (!isset($value) || $value == '' || $value === $default)
			return;
		if ($str != '{')
			$str .= ',';
		$str .= $key.': \''.CUtil::JSEscape($value).'\'';
	}
开发者ID:ASDAFF,项目名称:open_bx,代码行数:8,代码来源:component.php

示例10: GetHTML

 function GetHTML($params)
 {
     $html = '';
     $max_size = 102400;
     $max_width = 150;
     $max_height = 150;
     $url_template = '';
     $show_input = true;
     $show_info = true;
     if (is_array($params)) {
         if (isset($params['max_size'])) {
             $max_size = intval($params['max_size']);
         }
         if (isset($params['max_width'])) {
             $max_width = intval($params['max_width']);
         }
         if (isset($params['max_height'])) {
             $max_height = intval($params['max_height']);
         }
         if (isset($params['url_template'])) {
             $url_template = $params['url_template'];
         }
         if (isset($params['show_input'])) {
             $show_input = (bool) $params['show_input'];
         }
         if (isset($params['show_info'])) {
             $show_info = (bool) $params['show_info'];
         }
     }
     if ($show_input) {
         $html .= $this->_ob_file->GetInputHTML(array('show_info' => true, 'input_name' => $this->_input_name));
     } elseif ($show_info) {
         $html .= $this->_ob_file->GetInfoHTML();
     }
     if ($this->_ob_file->IsImage() && $this->_ob_file->GetSize() < $max_size) {
         $html .= '<br />';
         //Popup link
         $bPopUp = $this->_ob_file->GetWidth() > $max_width || $this->_ob_file->GetHeight() > $max_height;
         if ($bPopUp) {
             $img_src = $this->_ob_file->GetImgSrc(array('url_template' => $url_template));
             $img_onclick = "ImgShw('" . CUtil::JSEscape($img_src) . "', '" . $this->_ob_file->GetWidth() . "', '" . $this->_ob_file->GetHeight() . "', ''); return false;";
             $html .= '<a title="' . htmlspecialcharsbx($params['a_title']) . '" onclick="' . htmlspecialcharsbx($img_onclick) . '" href="' . htmlspecialcharsbx($img_src) . '" target="_blank">';
             ob_start();
             CFile::OutputJSImgShw();
             $html .= ob_get_contents();
             ob_end_clean();
         }
         //img tag
         $html .= $this->_ob_file->GetImgHtml(array('url_template' => $url_template, 'max_width' => $max_width, 'max_height' => $max_height, 'html_attributes' => array('border' => '0')));
         //Close popup link
         if ($bPopUp) {
             $html .= '</a>';
         }
     } else {
         $html .= '<br />' . $this->_ob_file->GetLinkHtml(array('url_template' => $url_template, 'download_text' => $params['download_text']));
     }
     return $html;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:58,代码来源:comp_lib.php

示例11: GetFormHtml

	public function GetFormHtml($arParams,$onclickJs)
	{
		$mailru_id = self::GetOption("mailru_id");
		$mailru_private_key = self::GetOption("mailru_private_key");

		$aRemove = array("logout", "auth_service_error", "auth_service_id");
		$url_err = $GLOBALS['APPLICATION']->GetCurPageParam('auth_service_id='.self::ID.'&auth_service_error=1', $aRemove);
		$url_ok = $GLOBALS['APPLICATION']->GetCurPageParam('', $aRemove);

		$script = '
<script type="text/javascript" src="//cdn.connect.mail.ru/js/loader.js"></script>
<script type="text/javascript">
if(typeof(mailru) != "undefined"){
BX.ready(function(){mailru.loader.require("api", 
	function() 
	{
		mailru.connect.init(\''.CUtil::JSEscape($mailru_id).'\', \''.CUtil::JSEscape($mailru_private_key).'\');
		mailru.events.listen(mailru.connect.events.login, function(sess){mailru.common.users.getInfo(function(res){BxMailRuAuthInfo(sess, res);});});
	}
);});
}

function BxMailRuAuthInfo(sess, response) 
{
	var url_err = \''.CUtil::JSEscape($url_err).'\';
	if(sess && response && response[0]) 
	{
		var url_post = \''.CUtil::JSEscape($arParams["~AUTH_URL"]).'\';
		var url_ok = \''.CUtil::JSEscape($url_ok).'\';
		var data = {
			"auth_service_id": "'.self::ID.'",
			"mailru_user": response[0],
			"mailru_sess": sess
		};
		BX.ajax.post(url_post, data, function(res){window.location = (res == "OK"? url_ok : url_err);});
	} 
	else 
	{
		window.location = url_err;
	}
}
</script>
';
		CUtil::InitJSCore(array("ajax"));
		$GLOBALS['APPLICATION']->AddHeadString($script, true);
		if($onclickJs) {
			$s = 'mailru.connect.login();';
		} else {
			if($arParams['NO_TEXT'] == 'Y'){
				$s = '<a href="javascript:void(0)" onclick="mailru.connect.login();" class="bx-ss-button mymailru-button"></a>';	
			}else{
				$s = '<a href="javascript:void(0)" onclick="mailru.connect.login();" class="bx-ss-button mymailru-button"></a><span class="bx-spacer"></span><span>'.GetMessage("socserv_mailru_note").'</span>';
			}
			
		}
		return $s;
	}
开发者ID:nProfessor,项目名称:Mytb,代码行数:57,代码来源:mailru.php

示例12: Authorize

    public function Authorize()
    {
        $GLOBALS["APPLICATION"]->RestartBuffer();
        $bSuccess = 1;
        $appID = trim(self::GetOption("twitter_key"));
        $appSecret = trim(self::GetOption("twitter_secret"));
        if (!isset($_REQUEST["oauth_token"]) || $_REQUEST["oauth_token"] == '') {
            $tw = new CTwitterInterface($appID, $appSecret);
            $callback = CSocServUtil::GetCurUrl('auth_service_id=' . self::ID);
            //$callback = 'http://algerman.sam:6448/script.php?auth_service_id='.self::ID;
            if ($tw->GetRequestToken($callback)) {
                $tw->RedirectAuthUrl();
            }
        } elseif (CSocServAuthManager::CheckUniqueKey()) {
            $tw = new CTwitterInterface($appID, $appSecret, $_REQUEST["oauth_token"], $_REQUEST["oauth_verifier"]);
            if (($arResult = $tw->GetAccessToken()) !== false && $arResult["user_id"] != '') {
                $twUser = $tw->GetUserInfo($arResult["user_id"]);
                $first_name = $last_name = "";
                if ($twUser["name"] != '') {
                    $aName = explode(" ", $twUser["name"]);
                    $first_name = $aName[0];
                    if (isset($aName[1])) {
                        $last_name = $aName[1];
                    }
                }
                $arFields = array('EXTERNAL_AUTH_ID' => self::ID, 'XML_ID' => $arResult["user_id"], 'LOGIN' => $arResult["screen_name"], 'NAME' => $first_name, 'LAST_NAME' => $last_name);
                if (isset($twUser["profile_image_url"]) && self::CheckPhotoURI($twUser["profile_image_url"])) {
                    if ($arPic = CFile::MakeFileArray($twUser["profile_image_url"])) {
                        $arFields["PERSONAL_PHOTO"] = $arPic;
                    }
                }
                $arFields["PERSONAL_WWW"] = "https://twitter.com/" . $arResult["screen_name"];
                if (strlen(SITE_ID) > 0) {
                    $arFields["SITE_ID"] = SITE_ID;
                }
                if (COption::GetOptionString('socialservices', 'last_twit_id', '1') == 1) {
                    if (isset($twUser["status"]["id_str"])) {
                        COption::SetOptionString('socialservices', 'last_twit_id', $twUser["status"]["id_str"]);
                    }
                }
                $bSuccess = $this->AuthorizeUser($arFields);
            }
        }
        $aRemove = array("logout", "auth_service_error", "auth_service_id", "oauth_token", "oauth_verifier", "check_key", "current_fieldset");
        $url = $GLOBALS['APPLICATION']->GetCurPageParam($bSuccess === true ? '' : 'auth_service_id=' . self::ID . '&auth_service_error=' . $bSuccess, $aRemove);
        if (CModule::IncludeModule("socialnetwork")) {
            $url = preg_match("/\\?/", $url) ? $url . "&current_fieldset=SOCSERV" : $url . "?current_fieldset=SOCSERV";
        }
        echo '
<script type="text/javascript">
if(window.opener)
	window.opener.location = \'' . CUtil::JSEscape($url) . '\';
window.close();
</script>
';
        die;
    }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:57,代码来源:twitter.php

示例13: Authorize

	public function Authorize()
	{
		$GLOBALS["APPLICATION"]->RestartBuffer();
		$bSuccess = false;

		$appID = self::GetOption("twitter_key");
		$appSecret = self::GetOption("twitter_secret");

		if(!isset($_REQUEST["oauth_token"]) || $_REQUEST["oauth_token"] == '')
		{
			$tw = new CTwitterInterface($appID, $appSecret);
			$callback = CSocServUtil::GetCurUrl('auth_service_id='.self::ID);
			if($tw->GetRequestToken($callback))
				$tw->RedirectAuthUrl();
		}
		elseif(CSocServAuthManager::CheckUniqueKey())
		{
			$tw = new CTwitterInterface($appID, $appSecret, $_REQUEST["oauth_token"], $_REQUEST["oauth_verifier"]);
			if(($arResult = $tw->GetAccessToken()) !== false && $arResult["user_id"] <> '')
			{
				$twUser = $tw->GetUserInfo($arResult["user_id"]);

				$first_name = $last_name = "";
				if($twUser["name"] <> '')
				{
					$aName = explode(" ", $twUser["name"]);
					$first_name = $aName[0];
					if(isset($aName[1]))
						$last_name = $aName[1];
				}

				$arFields = array(
					'EXTERNAL_AUTH_ID' => self::ID,
					'XML_ID' => $arResult["user_id"],
					'LOGIN' => $arResult["screen_name"],
					'NAME'=> $first_name,
					'LAST_NAME'=> $last_name,
				);
				$arFields["PERSONAL_WWW"] = "https://twitter.com/".$twUser["screen_name"];

				$bSuccess = $this->AuthorizeUser($arFields);
			}
		}

		$aRemove = array("logout", "auth_service_error", "auth_service_id", "oauth_token", "oauth_verifier", "check_key");
		$url = $GLOBALS['APPLICATION']->GetCurPageParam(($bSuccess? '':'auth_service_id='.self::ID.'&auth_service_error=1'), $aRemove);
		echo '
<script type="text/javascript">
if(window.opener)
	window.opener.location = \''.CUtil::JSEscape($url).'\';
window.close();
</script>
';
		die();
	}
开发者ID:nProfessor,项目名称:Mytb,代码行数:55,代码来源:twitter.php

示例14: injectDataParams

 private static function injectDataParams()
 {
     $result = "";
     foreach (static::$data as $index => $arItem) {
         foreach ($arItem as $key => $value) {
             $jsValue = is_array($value) ? \CUtil::PhpToJSObject($value) : \CUtil::JSEscape($value);
             $result .= '_ba.push(["ad[' . $index . '][' . \CUtil::JSEscape($key) . ']", "' . $jsValue . '"]);';
         }
     }
     return $result;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:11,代码来源:counter.php

示例15: GetPropertyFieldHtml

 function GetPropertyFieldHtml($arProperty, $value, $strHTMLControlName)
 {
     $ar_res = false;
     if (strlen($value["VALUE"])) {
         $db_res = CIBlockElement::GetList(array(), array("=XML_ID" => $value["VALUE"], "SHOW_HISTORY" => "Y"), false, false, array("ID", "IBLOCK_ID", "NAME"));
         $ar_res = $db_res->GetNext();
     }
     if (!$ar_res) {
         $ar_res = array("NAME" => "");
     }
     return '<input name="' . htmlspecialcharsbx($strHTMLControlName["VALUE"]) . '" id="' . htmlspecialcharsbx($strHTMLControlName["VALUE"]) . '" value="' . htmlspecialcharsex($value["VALUE"]) . '" size="20" type="text">' . '<input type="button" value="..." onClick="jsUtils.OpenWindow(\'' . CUtil::JSEscape('/bitrix/admin/iblock_element_search.php?lang=' . LANG . '&n=' . urlencode($strHTMLControlName["VALUE"]) . '&get_xml_id=Y&a=b') . '\', 600, 500);">' . '&nbsp;<span id="sp_' . htmlspecialcharsbx($strHTMLControlName["VALUE"]) . '" >' . $ar_res['NAME'] . '</span>';
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:12,代码来源:prop_xmlid.php


注:本文中的CUtil::JSEscape方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。