本文整理汇总了PHP中Tag::ToXMLString方法的典型用法代码示例。如果您正苦于以下问题:PHP Tag::ToXMLString方法的具体用法?PHP Tag::ToXMLString怎么用?PHP Tag::ToXMLString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tag
的用法示例。
在下文中一共展示了Tag::ToXMLString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
}
#-----------------------------------------------------------------------------
$Array = array();
#-----------------------------------------------------------------------------
foreach ($Colomns as $Colomn) {
#---------------------------------------------------------------------------
$ColumnNode = new Tag('node', array('TEXT' => $Colomn['Field']));
#---------------------------------------------------------------------------
$ColumnNode->AddChild(new Tag('hook', array('NAME' => 'accessories/plugins/NodeNote.properties'), new Tag('text', $Colomn['Type'])));
#---------------------------------------------------------------------------
$TableNode->AddChild($ColumnNode);
}
#-----------------------------------------------------------------------------
${$Table['Engine'] ? 'Node1' : 'Node2'}->AddChild($TableNode);
}
#-------------------------------------------------------------------------------
$MainNode->AddChild($Node1);
$MainNode->AddChild($Node2);
#-------------------------------------------------------------------------------
$Map = new Tag('map', array('version' => '0.8.0'), $MainNode);
#-------------------------------------------------------------------------------
$Out = $Map->ToXMLString();
#-------------------------------------------------------------------------------
$Length = StrLen($Out);
#-------------------------------------------------------------------------------
Header('Content-Type: application/mm; charset=utf-8');
Header(SPrintF('Content-Length: %u', $Length));
Header('Content-Disposition: attachment; filename="DBMap.mm";');
#-------------------------------------------------------------------------------
return $Out;
#-------------------------------------------------------------------------------
示例2: Plesk_Password_Change
function Plesk_Password_Change($Settings, $Login, $Password, $Params)
{
/****************************************************************************/
$__args_types = array('array', 'string', 'string', 'array');
#-----------------------------------------------------------------------------
$__args__ = Func_Get_Args();
eval(FUNCTION_INIT);
/****************************************************************************/
$packet = new Tag('packet', array('version' => '1.4.2.0'));
#-----------------------------------------------------------------------------
$set = new Tag('set', new Tag('filter', new Tag('login', $Login)), new Tag('values', new Tag('gen_info', new Tag('passwd', $Password))));
#-----------------------------------------------------------------------------
$packet->AddChild(new Tag('client', $set));
#-----------------------------------------------------------------------------
$Request = SPrintF("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>\n%s", $packet->ToXMLString());
#-----------------------------------------------------------------------------
$Headers = array('Content-Type: text/xml', SPrintF('HTTP_AUTH_LOGIN: %s', $Settings['Login']), SPrintF('HTTP_AUTH_PASSWD: %s', $Settings['Password']));
#-----------------------------------------------------------------------------
$HTTP = array('Address' => $Settings['IP'], 'Port' => $Settings['Port'], 'Host' => $Settings['Address'], 'Protocol' => $Settings['Protocol'], 'Hidden' => $Settings['Password'], 'IsLogging' => $Settings['Params']['IsLogging']);
#-----------------------------------------------------------------------------
$Response = HTTP_Send('/enterprise/control/agent.php', $HTTP, array(), $Request, $Headers);
if (Is_Error($Response)) {
return ERROR | @Trigger_Error('[Plesk_Password_Change]: не удалось соедениться с сервером');
}
#-----------------------------------------------------------------------------
$Response = Trim($Response['Body']);
#-----------------------------------------------------------------------------
$XML = String_XML_Parse($Response);
if (Is_Exception($XML)) {
return new gException('WRONG_SERVER_ANSWER', $Response, $XML);
}
#-----------------------------------------------------------------------------
$XML = $XML->ToArray();
#-----------------------------------------------------------------------------
$Result = $XML['packet']['client']['set']['result'];
#-----------------------------------------------------------------------------
switch ($Result['status']) {
case 'ok':
return TRUE;
case 'error':
#--------------------------------------------------------------------------
Debug(SPrintF('[%u]=(%s)', $Result['errcode'], $Result['errtext']));
#--------------------------------------------------------------------------
return new gException('SERVER_ERROR', Trim($Result['errtext']));
default:
return new gException('WRONG_ANSWER', 'Неизвестный ответ');
}
}
示例3: Tag
$Prefix = $Item['IsActive'] ? 'Active' : 'UnActive';
#-------------------------------------------------------------------------------
$A = new Tag('A', array('href' => $Item['Href']), $Item['Text']);
#-----------------------------------------------------------------------------
if (isset($Item['Prompt'])) {
#---------------------------------------------------------------------------
$LinkID = UniqID('ID');
#---------------------------------------------------------------------------
$Links =& Links();
#---------------------------------------------------------------------------
$Links[$LinkID] =& $A;
#---------------------------------------------------------------------------
$Comp = Comp_Load('Form/Prompt', $LinkID, $Item['Prompt']);
if (Is_Error($Comp)) {
return ERROR | @Trigger_Error(500);
}
#---------------------------------------------------------------------------
unset($Links[$LinkID]);
}
#-----------------------------------------------------------------------------
$Td->AddHTML(TemplateReplace('Tab.Table2', array('Prefix' => $Prefix, 'Href' => $A->ToXMLString())));
#-----------------------------------------------------------------------------
$Tr->AddChild($Td);
}
#-------------------------------------------------------------------------------
$Tr->AddChild(new Tag('TD', array('width' => '10px')));
#-------------------------------------------------------------------------------
$DOM->AddChild('TabMenu', $Tr);
#-------------------------------------------------------------------------------
return $DOM->Object;
#-------------------------------------------------------------------------------
示例4: Started_Contract_Register
function Started_Contract_Register($Settings, $PepsonID, $Person, $DomainZone)
{
/****************************************************************************/
$__args_types = array('array', 'string', 'array', 'string');
#-----------------------------------------------------------------------------
$__args__ = Func_Get_Args();
eval(FUNCTION_INIT);
/****************************************************************************/
$HTTP = array('Protocol' => $Settings['Protocol'], 'Port' => $Settings['Port'], 'Address' => $Settings['Address'], 'Host' => $Settings['Address'], 'IsLogging' => $Settings['Params']['IsLogging']);
#-----------------------------------------------------------------------------
$Reseller = new Tag('reseller');
$Reseller->AddChild(new Tag('login', $Settings['Login']));
$Reseller->AddChild(new Tag('password', $Settings['Password']));
#-----------------------------------------------------------------------------
$Tmp = System_Element('tmp');
if (Is_Error($Tmp)) {
return ERROR | @Trigger_Error(500);
}
#-----------------------------------------------------------------------------
$pCountry = isset($Person['PasportCountry']) ? $Person['PasportCountry'] : $Person['pCountry'];
#-----------------------------------------------------------------------------
$Path = SPrintF('%s/started/states[%s].json', $Tmp, $pCountry);
#-----------------------------------------------------------------------------
if (File_Exists($Path)) {
#---------------------------------------------------------------------------
$States = IO_Read($Path);
if (Is_Error($States)) {
return ERROR | @Trigger_Error(500);
}
#---------------------------------------------------------------------------
$States = JSON_Decode($States, TRUE);
if (!$States) {
return ERROR | @Trigger_Error(500);
}
} else {
#---------------------------------------------------------------------------
$Request = new Tag('RequestBody', $Reseller);
#---------------------------------------------------------------------------
$objCountry = new Tag('objCountry');
$objCountry->AddChild(new Tag('method', 'getRegions'));
$objCountry->AddChild(new Tag('country', $pCountry));
#---------------------------------------------------------------------------
$Request->AddChild($objCountry);
#---------------------------------------------------------------------------
$Post = SprintF("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n%s", $Request->ToXMLString());
#---------------------------------------------------------------------------
$Responce = HTTP_Send('/', $HTTP, array(), $Post, array('Content-type: text/xml'));
if (Is_Error($Responce)) {
return ERROR | @Trigger_Error(500);
}
#---------------------------------------------------------------------------
$Response = Trim($Responce['Body']);
#---------------------------------------------------------------------------
$Answer = String_XML_Parse($Response);
if (Is_Exception($Answer)) {
return new gException('WRONG_ANSWER', $Response, $Answer);
}
#---------------------------------------------------------------------------
$States = Current($States->ToArray('item'));
#---------------------------------------------------------------------------
$IsWrite = IO_Write($Path, JSON_Encode($States), TRUE);
if (Is_Error($IsWrite)) {
return ERROR | @Trigger_Error(500);
}
}
#-----------------------------------------------------------------------------
$objUser = new Tag('objUser');
$objUser->AddChild(new Tag('method', 'create'));
#-----------------------------------------------------------------------------
$objUser->AddChild(new Tag('email', $Person['Email']));
$objUser->AddChild(new Tag('password', SubStr(Md5(UniqID()), -8)));
#-----------------------------------------------------------------------------
$IsRussian = In_Array(isset($Person['PasportCountry']) ? $Person['PasportCountry'] : $Person['pCountry'], array('RU', 'BY', 'UA'));
#-----------------------------------------------------------------------------
switch ($PepsonID) {
case 'Natural':
#-------------------------------------------------------------------------
$pStateID = 0;
#-------------------------------------------------------------------------
$pState = $Person['pState'];
#-------------------------------------------------------------------------
foreach ($States as $State) {
#-----------------------------------------------------------------------
if (Preg_Match(SPrintF('/%s/', StrToLower($State['title'])), StrToLower($pState))) {
#---------------------------------------------------------------------
$pStateID = $State['id'];
#---------------------------------------------------------------------
Debug(SPrintF('Найдена область: %s', $pStateID));
#---------------------------------------------------------------------
break;
}
}
#-------------------------------------------------------------------------
if (!$pStateID) {
#-----------------------------------------------------------------------
Debug(SPrintF('Область не найдена, проверьте название области (%s)', $pState));
#-----------------------------------------------------------------------
return new gException('POST_REGION_NOT_FOUND', 'Область почтового адреса не найдена');
}
#-------------------------------------------------------------------------
//.........这里部分代码省略.........
示例5: isset
$Span->AddChild($UserLinks);
#-------------------------------------------------------------------------------
break;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
case 'true':
break;
default:
return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
$Params['Links'] = isset($Span) ? $Span->ToXMLString() : '-';
#-------------------------------------------------------------------------------
$Table = new Tag('TABLE', array('class' => 'EdeskMessage', 'cellspacing' => 5, 'height' => '100%', 'width' => '100%'));
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# JBS-1177 а код в подписи-то выполняется ...
#$Params['User']['Sign'] = Nl2Br(HtmlSpecialChars($Params['User']['Sign']));
$Params['User']['Sign'] = Comp_Load('Edesks/Text', array('String' => $Params['User']['Sign'], 'IsLockText' => $OwnerID != @$GLOBALS['__USER']['ID']));
if (Is_Error($Text)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
# JBS-1178 да и в имени пользователя - тоже
$Params['User']['Name'] = Nl2Br(HtmlSpecialChars($Params['User']['Name']));
#-------------------------------------------------------------------------------
$Table->AddHTML(TemplateReplace(SPrintF('Edesks.Message.TABLE.%s', $__USER['Params']['Settings']['EdesksDisplay'] == 'Left' ? 'Left' : 'Right'), $Params));
示例6: SUM
#-----------------------------------------------------------------------------
$Result = $Link->Query(SPrintF("SELECT SUM(`bonus`) as `Balance` FROM `partner` WHERE `userid` = %u", $dUser['ID']));
if (Is_Error($Result)) {
return $Link->GetError();
}
#-----------------------------------------------------------------------------
$dBonuses = MySQL::Result($Result);
if (Is_Error($dBonuses)) {
return ERROR | @Trigger_Error(500);
}
#-----------------------------------------------------------------------------
$dBonuse = Current($dBonuses);
#-----------------------------------------------------------------------------
$Contract->AddChild(new Tag('Balance', Round($Result['Balance'] * $Course)));
#-----------------------------------------------------------------------------
$Contracts->AddChild($Contract);
#-----------------------------------------------------------------------------
$User->AddChild($Contracts);
#-----------------------------------------------------------------------------
$Users->AddChild($User);
}
#-------------------------------------------------------------------------------
$Dump = $Users->ToXMLString();
#-------------------------------------------------------------------------------
$IsWrite = IO_Write('/work/ClientExec.xml.gz', GzEncode($Dump), TRUE);
if (Is_Error($IsWrite)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
return 'Ok';
#-------------------------------------------------------------------------------
示例7: Tag
$Channel = new Tag('channel');
$Channel->AddChild(new Tag('title', SPrintF('Новости компании %s', $Profile['Name'])));
$Channel->AddChild(new Tag('link', SPrintF('http://%s', HOST_ID)));
$Channel->AddChild(new Tag('description', SPrintF('Новости компании %s', $Profile['Name'])));
$Channel->AddChild(new Tag('copyright', HOST_ID));
$Channel->AddChild(new Tag('language', 'ru'));
$Channel->AddChild(new Tag('ttl', 5));
$Channel->AddChild(new Tag('managingEditor', $Email = SPrintF('rss@%s', HOST_ID)));
#-------------------------------------------------------------------------------
$Versions = DB_Select('Clauses', array('ID', 'PublicDate', 'Title', 'Text'), array('Limits' => array(0, 20), 'Where' => array('`GroupID` = 2', '`IsPublish` = "yes"'), 'SortOn' => 'PublicDate', 'IsDesc' => TRUE));
#-------------------------------------------------------------------------------
switch (ValueOf($Versions)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
return $Rss->ToXMLString();
case 'array':
break;
default:
return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
foreach ($Versions as $Version) {
#-------------------------------------------------------------------------------
$Link = SPrintF('http://%s/Rss/New?NewID=%u', HOST_ID, $Version['ID']);
#-------------------------------------------------------------------------------
$Text = Strip_Tags($Version['Text']);
#-------------------------------------------------------------------------------
if (Mb_StrLen($Text) > 120) {
$Text = SPrintF('%s...', Mb_SubStr($Text, 0, 120));
}