本文整理汇总了PHP中CUtil类的典型用法代码示例。如果您正苦于以下问题:PHP CUtil类的具体用法?PHP CUtil怎么用?PHP CUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CUtil类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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
示例2: actionUpgradeversion
/**
* Upgrade version method
*/
public function actionUpgradeversion()
{
// check is newest
$aryVersionData = $this->actionHasnew(true);
$isok = 0;
$data = array();
$msg = "";
try {
if ($aryVersionData['ISOK'] !== 1 || empty($aryVersionData['DATA']['v'])) {
throw new CModelException(CUtil::i18n('exception,version_upgrad_withoutUpgrad'));
}
// get up to version
$strVersion = $aryVersionData['DATA']['v'];
if (empty($strVersion)) {
throw new CModelException(CUtil::i18n('exception,version_upgrad_upgradFaild'));
}
if ($strVersion <= CUR_VERSION_NUM) {
throw new CModelException(CUtil::i18n('exception,version_upgrad_withoutUpgrad'));
}
// execute upgrade
$command = SUDO_COMMAND . "cd " . WEB_ROOT . ";" . SUDO_COMMAND . "wget " . MAIN_DOMAIN . "/down/v{$strVersion}.zip;" . SUDO_COMMAND . "unzip -o v{$strVersion}.zip;" . SUDO_COMMAND . "rm -rf v{$strVersion}.zip;";
exec($command);
$isok = 1;
} catch (CModelException $e) {
$msg = $e->getMessage();
} catch (CException $e) {
$msg = NBT_DEBUG ? $e->getMessage() : CUtil::i18n('exception,sys_error');
}
header('Content-Type: text/html; charset=utf-8');
echo $this->encodeAjaxData($isok, $data, $msg);
exit;
}
开发者ID:erdincay,项目名称:WIIBOX,代码行数:35,代码来源:UpgradeController.php
示例3: __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
示例4: Authorize
public function Authorize()
{
// var_dump( $skip_check_user_data);
$GLOBALS["APPLICATION"]->RestartBuffer();
if(isset($_REQUEST["vk_session"]["user"]["id"]))
{
global $skip_check_user_data;
if(self::CheckUserData($_REQUEST["vk_session"]["sig"]) || $skip_check_user_data)
{
CUtil::decodeURIComponent($_REQUEST);
$u_id = $_REQUEST["vk_session"]["user"]["id"];
$arFields = array(
'EXTERNAL_AUTH_ID' => self::ID,
'WORK_NOTES' => self::ID, //это для того, чтоб можно было избавится от EXTERNAL_AUTH_ID и разрешить авторизовываться несколькими способами одновременно
'XML_ID' => $u_id,
'LOGIN' => "id".$u_id,
'NAME'=> $_REQUEST["vk_session"]["user"]["first_name"],
'LAST_NAME'=> $_REQUEST["vk_session"]["user"]["last_name"],
);
if($this->AuthorizeUser($arFields)){
if($skip_check_user_data){
return true;
}
die("OK");
}
}
}
die("FAILURE");
}
开发者ID:nProfessor,项目名称:Mytb,代码行数:32,代码来源:vkontakte.php
示例5: getJSPrice
protected static function getJSPrice(array $prices)
{
if (empty($prices)) {
return "";
}
return '(function(value){var prices=' . \CUtil::PhpToJSObject($prices) . '; return prices[value]["PRICE"];})(this.value)';
}
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:7,代码来源:enum.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: doPostAction
protected function doPostAction($isEdit, $action)
{
/** @global CMain $APPLICATION */
global $APPLICATION;
if ($isEdit) {
$APPLICATION->RestartBuffer();
header('Content-Type: application/json', true);
echo CSecurityJsonHelper::encode($this->arResult);
die;
} else {
switch ($action) {
case 'download':
$APPLICATION->restartBuffer();
header('Content-Type: text/plain', true);
header('Content-Disposition: attachment; filename="recovery_codes.txt"');
header('Content-Transfer-Encoding: binary');
header(sprintf('Content-Length: %d', CUtil::BinStrlen($this->arResult['PLAIN_RESPONSE'])));
echo $this->arResult['PLAIN_RESPONSE'];
exit;
break;
case 'print':
$APPLICATION->restartBuffer();
$this->includeComponentTemplate(static::PRINT_PAGE);
exit;
break;
case 'view':
default:
$this->includeComponentTemplate(static::VIEW_PAGE);
break;
}
}
}
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:32,代码来源:class.php
示例8: __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
示例9: AddByChannel
public static function AddByChannel($channelId, $arParams = array())
{
global $DB;
if (!is_array($channelId)) {
$channelId = array($channelId);
}
if (strlen($arParams['module_id']) > 0 || strlen($arParams['command']) > 0) {
$arData = array('module_id' => $arParams['module_id'], 'command' => $arParams['command'], 'params' => is_array($arParams['params']) ? $arParams['params'] : array());
if (CPullOptions::GetQueueServerStatus()) {
$command = array('MESSAGE' => array($arData), 'ERROR' => '');
if (!is_array($channelId) && CPullOptions::GetQueueServerVersion() == 1) {
$command['CHANNEL_ID'] = $channelId;
}
$message = CUtil::PhpToJsObject($command);
if (!defined('BX_UTF') || !BX_UTF) {
$message = $GLOBALS['APPLICATION']->ConvertCharset($message, SITE_CHARSET, 'utf-8');
}
$res = CPullChannel::Send($channelId, str_replace("\n", " ", $message));
$result = $res ? true : false;
} else {
foreach ($channelId as $channel) {
$arParams = array('CHANNEL_ID' => $channel, 'MESSAGE' => str_replace("\n", " ", serialize($arData)), '~DATE_CREATE' => $DB->CurrentTimeFunction());
$res = IntVal($DB->Add("b_pull_stack", $arParams, array("MESSAGE")));
$result = $res ? true : false;
}
}
if (isset($arParams['push_text']) && strlen($arParams['push_text']) > 0 && isset($arParams['push_user']) && intval($arParams['push_user']) > 0) {
$CPushManager = new CPushManager();
$CPushManager->AddQueue(array('USER_ID' => $arParams['push_user'], 'MESSAGE' => str_replace("\n", " ", $arParams['push_text']), 'PARAMS' => $arParams['push_params'], 'BADGE' => isset($arParams['push_badge']) ? intval($arParams['push_badge']) : '', 'TAG' => isset($arParams['push_tag']) ? $arParams['push_tag'] : '', 'SUB_TAG' => isset($arParams['push_sub_tag']) ? $arParams['push_sub_tag'] : '', 'APP_ID' => isset($arParams['push_app_id']) ? $arParams['push_app_id'] : ''));
}
return $result;
}
return false;
}
开发者ID:rasuldev,项目名称:torino,代码行数:34,代码来源:pull_stack.php
示例10: AddByChannel
public static function AddByChannel($channelId, $arParams = array())
{
global $DB;
if (!is_array($channelId)) {
$channelId = array($channelId);
}
$result = false;
if (strlen($arParams['module_id']) > 0 || strlen($arParams['command']) > 0) {
$arData = array('module_id' => $arParams['module_id'], 'command' => $arParams['command'], 'params' => is_array($arParams['params']) ? $arParams['params'] : array());
if (CPullOptions::GetQueueServerStatus()) {
$command = array('SERVER_TIME_WEB' => time(), 'SERVER_NAME' => COption::GetOptionString('main', 'server_name', $_SERVER['SERVER_NAME']), 'MESSAGE' => array($arData), 'ERROR' => '');
if (!is_array($channelId) && CPullOptions::GetQueueServerVersion() == 1) {
$command['CHANNEL_ID'] = $channelId;
}
$message = CUtil::PhpToJsObject($command);
if (!defined('BX_UTF') || !BX_UTF) {
$message = $GLOBALS['APPLICATION']->ConvertCharset($message, SITE_CHARSET, 'utf-8');
}
$options = isset($arParams['expiry']) ? array('expiry' => intval($arParams['expiry'])) : array();
$res = CPullChannel::Send($channelId, str_replace("\n", " ", $message), $options);
$result = $res ? true : false;
} else {
foreach ($channelId as $channel) {
$arParams = array('CHANNEL_ID' => $channel, 'MESSAGE' => str_replace("\n", " ", serialize($arData)), '~DATE_CREATE' => $DB->CurrentTimeFunction());
$res = IntVal($DB->Add("b_pull_stack", $arParams, array("MESSAGE")));
$result = $res ? true : false;
}
}
return $result;
}
return false;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:32,代码来源:pull_stack.php
示例11: 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
示例12: fetchUserDetails
public function fetchUserDetails($ident, $type)
{
$search_cond = 'users.user_id = ' . $ident;
if ($type == 'code') {
$search_cond = 'users.user_code = ' . $ident;
}
$user_details = array();
$user_details['err_msg'] = '';
$user_details['own_profile'] = 'No';
$udetails = User::whereRaw($search_cond)->first(array('users.first_name', 'users.id', 'users.last_name', 'users.email', 'users.activated', 'users.activated_at'));
if (count($udetails) > 0) {
$user_details['user_code'] = CUtil::setUserCode($udetails['id']);
$user_details['email'] = $udetails['email'];
$user_details['user_id'] = $user_id = $udetails['id'];
$user_details['first_name'] = $udetails['first_name'];
$user_details['last_name'] = $udetails['last_name'];
$user_display_name = $udetails['first_name'] . ' ' . substr($udetails['last_name'], 0, 1);
$user_details['display_name'] = ucwords($user_display_name);
$user_details['activated_at'] = $udetails['activated_at'];
$user_details['activated'] = $udetails['activated'];
} else {
$user_details['err_msg'] = 'No such user found';
}
return $user_details;
}
开发者ID:agriya,项目名称:webshoppack,代码行数:25,代码来源:AdminManageShopService.php
示例13: 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
示例14: 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
示例15: GetValue
public function GetValue()
{
$result = $this->value;
if (ord($result[0]) == 0x0) {
$result = CUtil::BinSubstr($result, 1);
}
return $result;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:8,代码来源:asn.php
示例16: actionIndex
/**
* Index method
*/
public function actionIndex()
{
//检查是否登入
Nbt::app()->login->checkIsLogin();
$this->replaceSeoTitle(CUtil::i18n('controllers,monitor_index_seoTitle'));
$aryData = array();
$this->render('index', $aryData);
}
开发者ID:erdincay,项目名称:WIIBOX,代码行数:11,代码来源:MonitorController.php
示例17: InputTags
function InputTags($sName="", $sValue="", $arSites=array(), $sHTML="", $sId="")
{
if(!$sId)
$sId = GenerateUniqId($sName);
TagsShowScript();
$order = class_exists("cuseroptions")? CUserOptions::GetOption("search_tags", "order", "CNT"): "CNT";
return '<input name="'.htmlspecialcharsbx($sName).'" id="'.htmlspecialcharsbx($sId).'" type="text" autocomplete="off" value="'.htmlspecialcharsex($sValue).'" onfocus="'.htmlspecialcharsbx('window.oObject[this.id] = new JsTc(this, '.CUtil::PhpToJSObject($arSites).');').'" '.$sHTML.'/><input type="checkbox" id="ck_'.$sId.'" name="ck_'.htmlspecialcharsbx($sName).'" '.($order=="NAME"? "checked": "").' title="'.GetMessage("SEARCH_TAGS_SORTING_TIP").'">';
}
开发者ID:ASDAFF,项目名称:open_bx,代码行数:8,代码来源:tags.php
示例18: __fcParseAnswer
function __fcParseAnswer(&$output, $arParams, $arResult)
{
$GLOBALS["APPLICATION"]->RestartBuffer();
while (ob_end_clean()) {
}
echo CUtil::PhpToJSObject($arResult["OUTPUT_LIST"]["JSON"]);
die;
}
开发者ID:rasuldev,项目名称:torino,代码行数:8,代码来源:component_epilog.php
示例19: GetPathTemplateParam
public static function GetPathTemplateParam($menuType, $ID, $parameterName, $defaultValue = "", $parentID = "URL_TEMPLATES")
{
if ($menuType == "LISTS") {
return array("PARENT" => $parentID, "NAME" => $parameterName, "TYPE" => "STRING", "DEFAULT" => $defaultValue);
} else {
return array("PARENT" => $parentID, "NAME" => $parameterName, "TYPE" => "CUSTOM", "DEFAULT" => $defaultValue, "JS_FILE" => BX_ROOT . "/js/iblock/path_templates.js", "JS_EVENT" => "IBlockComponentProperties", "JS_DATA" => str_replace("\n", "", CUtil::PhpToJSObject(array("mnu_" . $ID, 5000, CListsParameters::GetPathTemplateMenuItems($menuType, "window.IBlockComponentPropertiesObj.Action", "mnu_" . $ID)))));
}
}
开发者ID:rasuldev,项目名称:torino,代码行数:8,代码来源:parameters.php
示例20: 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
注:本文中的CUtil类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论