本文整理汇总了PHP中Array2XML类的典型用法代码示例。如果您正苦于以下问题:PHP Array2XML类的具体用法?PHP Array2XML怎么用?PHP Array2XML使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Array2XML类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: saveXml
public function saveXml($extension_txt_id, $template_id_src)
{
$layouts = $this->getLayoutsByTemplate($template_id_src);
$xml_data = array();
foreach ($layouts as $i => $layout) {
$xml_data['layout'][$i] = array('name' => $layout['layout_name'], 'template_id' => $extension_txt_id, 'type' => $this->_getTextLayoutType($layout['layout_type']), 'pages' => array('page' => $this->_getLayoutPages4Xml($layout['layout_id'])), 'blocks' => $this->_getLayoutBlocks4Xml($layout['layout_id']));
}
$xml = Array2XML::createXML('template_layouts', $xml_data);
$xml = $xml->saveXML();
$path = DIR_EXT . $extension_txt_id . '/layout.xml';
if ($xml) {
$result = file_put_contents($path, $xml);
if ($result) {
// and put xml-import call into install.php
$import_call = "\n\$layout = new ALayoutManager();\n\$layout->loadXml(array('file' => DIR_EXT.'" . $extension_txt_id . "/layout.xml'));";
$code = file_get_contents(DIR_EXT . $extension_txt_id . '/install.php');
$code = str_replace($import_call, '', $code) . $import_call;
file_put_contents(DIR_EXT . $extension_txt_id . '/install.php', $code);
// and into uninstall.php
$import_call = "\n\$layout = new ALayoutManager('" . $extension_txt_id . "');\n\$layout->deleteTemplateLayouts();";
$code = file_get_contents(DIR_EXT . $extension_txt_id . '/uninstall.php');
$code = str_replace($import_call, '', $code) . $import_call;
file_put_contents(DIR_EXT . $extension_txt_id . '/uninstall.php', $code);
return true;
} else {
$this->error = "Can't save extension " . $path . ". Unknown cause.";
return false;
}
} else {
return false;
}
}
开发者ID:hakoobe247,项目名称:developer_tools_extension,代码行数:32,代码来源:developer_tools_layout_xml.php
示例2: get_quota_data
function get_quota_data($data)
{
$response = array("ns1_get_quota_data_response" => array("bucket" => array(array("bucket_id" => "routing", "name" => "planing", "day" => array("date" => "2014-02-04", "quota" => "456", "close_time" => "2014-02-04 13:51:00", "max_available" => "24150", "other_activities" => "175", "used" => "225", "used_quota_percent" => "49.34210526", "count" => "5", "time_slot" => array(array("label" => "08-12", "quota_percent" => "55", "min_quota" => "67", "quota" => "251", "status" => "4", "max_available" => "8400", "other_activities" => "47", "used" => "90", "used_quota_percent" => "35.85657371", "count" => "2", "category" => array(array("label" => "04", "quota_percent" => "6.81818199", "quota" => "9", "stop_booking_at" => "12", "close_time" => "2014-02-04 23:30:00", "max_available" => "5040", "used" => "45", "used_quota_percent" => "500", "count" => "1"), array("label" => "6", "quota_percent" => "93.1818161", "quota" => "123", "stop_booking_at" => "2", "max_available" => "5280", "used" => "45", "used_quota_percent" => "36.58536585", "count" => "1", "work_zone" => array("label" => "98", "status" => "1", "closed_at" => "2014-02-03 08:14:37"))), "total" => array("quota" => "132", "max_available" => "10320", "used" => "90", "count" => "2")), array("label" => "12-17", "quota_percent" => "45", "min_quota" => "567", "quota" => "567", "close_time" => "2014-02-04 16:30:00", "max_available" => "10500", "other_activities" => "89", "used" => "135", "used_quota_percent" => "23.80952381", "count" => "3", "category" => array(array("label" => "04", "quota_percent" => "91.76470947", "quota" => "234", "stop_booking_at" => "7", "max_available" => "6300", "used" => "45", "used_quota_percent" => "19.23076923", "count" => "1"), array("label" => "6", "quota_percent" => "8.23529434", "quota" => "21", "stop_booking_at" => "4", "max_available" => "6600", "used" => "90", "used_quota_percent" => "428.57142857", "count" => "2")), "total" => array("quota" => "255", "max_available" => "12900", "used" => "135", "count" => "3"))), "total" => array("quota" => "818", "max_available" => "18900", "other_activities" => "136", "used" => "225", "count" => "5"))), array("bucket_id" => "planing", "name" => "planing 1", "day" => ""))));
$xml = \Array2XML::createXML('soap', $response);
$string = $xml->saveXML();
return $string;
}
开发者ID:lcalderonc,项目名称:hdc2016,代码行数:7,代码来源:Simulador.php
示例3: generateOutput
/**
* Generate service output json format
* @param ApiResult $result
*/
public static function generateOutput($result)
{
assert('$result instanceof ApiResult');
$data = $result->convertToArray();
$xml = Array2XML::createXML('zurmoMessage', $data);
echo $xml->saveXML();
return;
}
开发者ID:youprofit,项目名称:Zurmo,代码行数:12,代码来源:ApiXmlResponse.php
示例4: nv_CreateXML_bannerPlan
/**
* nv_CreateXML_bannerPlan()
*
* @return
*/
function nv_CreateXML_bannerPlan()
{
global $db, $global_config;
$pattern = $global_config['idsite'] ? '/^site\\_' . $global_config['idsite'] . '\\_bpl\\_([0-9]+)\\.xml$/' : '/^bpl\\_([0-9]+)\\.xml$/';
$files = nv_scandir(NV_ROOTDIR . '/' . NV_DATADIR, $pattern);
if (!empty($files)) {
foreach ($files as $file) {
nv_deletefile(NV_ROOTDIR . '/' . NV_DATADIR . '/' . $file);
}
}
include NV_ROOTDIR . '/includes/class/array2xml.class.php';
$sql = 'SELECT * FROM ' . NV_BANNERS_GLOBALTABLE . '_plans WHERE act = 1';
$result = $db->query($sql);
while ($row = $result->fetch()) {
$id = intval($row['id']);
if ($global_config['idsite']) {
$xmlfile = NV_ROOTDIR . '/' . NV_DATADIR . '/site_' . $global_config['idsite'] . '_bpl_' . $id . '.xml';
} else {
$xmlfile = NV_ROOTDIR . '/' . NV_DATADIR . '/bpl_' . $id . '.xml';
}
$plan = array();
$plan['id'] = $id;
$plan['lang'] = $row['blang'];
$plan['title'] = $row['title'];
if (!empty($row['description'])) {
$plan['description'] = $row['description'];
}
$plan['form'] = $row['form'];
$plan['width'] = $row['width'];
$plan['height'] = $row['height'];
$query2 = 'SELECT * FROM ' . NV_BANNERS_GLOBALTABLE . '_rows WHERE pid = ' . $id . ' AND (exp_time > ' . NV_CURRENTTIME . ' OR exp_time = 0 ) AND act = 1';
if ($row['form'] == 'sequential') {
$query2 .= ' ORDER BY weight ASC';
}
$plan['banners'] = array();
$result2 = $db->query($query2);
while ($row2 = $result2->fetch()) {
$plan['banners'][] = array('id' => $row2['id'], 'title' => $row2['title'], 'clid' => $row2['clid'], 'file_name' => $row2['file_name'], 'imageforswf' => $row2['imageforswf'], 'file_ext' => $row2['file_ext'], 'file_mime' => $row2['file_mime'], 'file_width' => $row2['width'], 'file_height' => $row2['height'], 'file_alt' => $row2['file_alt'], 'file_click' => $row2['click_url'], 'target' => $row2['target'], 'publ_time' => $row2['publ_time'], 'exp_time' => $row2['exp_time']);
}
if (sizeof($plan['banners'])) {
$array2XML = new Array2XML();
$array2XML->saveXML($plan, 'plan', $xmlfile, $encoding = $global_config['site_charset']);
}
}
}
开发者ID:lzhao18,项目名称:nukeviet,代码行数:50,代码来源:admin.functions.php
示例5: optOut
public function optOut($email)
{
//Build request data.
$message = array('SITE_ID' => '2010003057', 'MLID' => 194503, 'DATA' => array(array('@attributes' => array('type' => 'extra', 'id' => 'password'), '@value' => $this->_password), array('@attributes' => array('type' => 'email'), '@value' => $email), array('@attributes' => array('type' => 'extra', 'id' => 'state'), '@value' => 'unsubscribed')));
//Convert to XML.
$xml = Array2XML::createXML('DATASET', $message);
$response = $this->_httpPost('record', 'update', $xml->saveXML());
return $response->TYPE == 'success' ? true : false;
}
开发者ID:mikelovely,项目名称:webhooks,代码行数:9,代码来源:Lyris.php
示例6: actionSample
/**
* Sample xml file
*/
public function actionSample()
{
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"sample.xml\"");
$productsList = array();
$productsList['product'] = array('name' => 'Мой товара', 'price' => 10, 'type' => 'Ваш тип товара', 'manufacturer' => 'Бренд', 'image' => 'http://example.com/myimage.jpg');
$xml = Array2XML::createXML('products', $productsList);
echo $xml->saveXML();
Yii::app()->end();
}
开发者ID:buildshop,项目名称:bs-common,代码行数:13,代码来源:DefaultController.php
示例7: nv_CreateXML_bannerPlan
/**
* nv_CreateXML_bannerPlan()
*
* @return
*/
function nv_CreateXML_bannerPlan()
{
global $db, $global_config;
$files = nv_scandir(NV_ROOTDIR . '/' . NV_DATADIR, "/^bpl\\_([0-9]+)\\.xml\$/");
if (!empty($files)) {
foreach ($files as $file) {
nv_deletefile(NV_ROOTDIR . '/' . NV_DATADIR . '/' . $file);
}
}
include NV_ROOTDIR . '/includes/class/array2xml.class.php';
$sql = "SELECT * FROM `" . NV_BANNERS_PLANS_GLOBALTABLE . "` WHERE `act` = 1";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$id = intval($row['id']);
$xmlfile = NV_ROOTDIR . '/' . NV_DATADIR . '/bpl_' . $id . '.xml';
$plan = array();
$plan['id'] = $id;
$plan['lang'] = $row['blang'];
$plan['title'] = $row['title'];
if (!empty($row['description'])) {
$plan['description'] = $row['description'];
}
$plan['form'] = $row['form'];
$plan['width'] = $row['width'];
$plan['height'] = $row['height'];
$query2 = "SELECT * FROM `" . NV_BANNERS_ROWS_GLOBALTABLE . "` WHERE `pid` = " . $id . " AND (`exp_time` > " . NV_CURRENTTIME . " OR `exp_time` = 0 ) AND `act` = 1";
if ($row['form'] == "sequential") {
$query2 .= " ORDER BY `weight` ASC";
}
$result2 = $db->sql_query($query2);
$numrows2 = $db->sql_numrows($result2);
if (empty($numrows2)) {
continue;
}
$plan['banners'] = array();
while ($row2 = $db->sql_fetchrow($result2)) {
$plan['banners'][] = array('id' => $row2['id'], 'title' => $row2['title'], 'clid' => $row2['clid'], 'file_name' => $row2['file_name'], 'file_ext' => $row2['file_ext'], 'file_mime' => $row2['file_mime'], 'file_width' => $row2['width'], 'file_height' => $row2['height'], 'file_alt' => $row2['file_alt'], 'file_click' => $row2['click_url']);
}
$array2XML = new Array2XML();
$array2XML->saveXML($plan, 'plan', $xmlfile, $encoding = $global_config['site_charset']);
}
}
开发者ID:atarubi,项目名称:nuke-viet,代码行数:47,代码来源:admin.functions.php
示例8: prepareData
private function prepareData()
{
require_once 'classXML2Array.php';
$xml = Array2XML::createXML('blocks', $this->blocksData);
$file = $this->sitePath . 'tmp/' . date('Y-m-d', time()) . '.xml';
ob_start();
echo $xml->saveXML();
$data = ob_get_contents();
ob_end_clean();
$fp = @fopen($file, "w");
@fwrite($fp, $data);
@fclose($fp);
}
开发者ID:rjon76,项目名称:netspotapp,代码行数:13,代码来源:classExportPages.php
示例9: setDocument
function setDocument($xml)
{
$this->document = $this->XmlToArray($xml);
unset($this->document['ClinicalDocument']['@attributes']);
Array2XML::init('1.0', 'UTF-8', true, ['xml-stylesheet' => 'type="text/xsl" href="' . URL . '/lib/CCRCDA/schema/cda2.xsl"']);
$data = ['@attributes' => ['xmlns' => 'urn:hl7-org:v3', 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation' => 'urn:hl7-org:v3 CDA.xsd']];
foreach ($this->document['ClinicalDocument'] as $i => $com) {
$data[$i] = $com;
}
// Building the document
$this->styledXml = Array2XML::createXML('ClinicalDocument', $data)->saveXML();
unset($data);
$this->index = [];
foreach ($this->document['ClinicalDocument']['component']['structuredBody']['component'] as $index => $component) {
$code = isset($component['section']['code']['@attributes']['code']) ? $component['section']['code']['@attributes']['code'] : '';
//Advance Directives ???
switch ($code) {
case '48765-2':
$this->index['allergies'] = $index;
break;
case '10160-0':
$this->index['medications'] = $index;
break;
case '11450-4':
$this->index['problems'] = $index;
break;
case '47519-4':
$this->index['procedures'] = $index;
break;
case '30954-2':
$this->index['results'] = $index;
break;
case '46240-8':
$this->index['encounters'] = $index;
break;
case '51847-2':
$this->index['assessments'] = $index;
break;
case '46239-0':
$this->index['chiefcomplaint'] = $index;
break;
default:
$tplId = isset($component['section']['templateId']['@attributes']['root']) ? $component['section']['templateId']['@attributes']['root'] : '';
if ($tplId == '2.16.840.1.113883.10.20.22.2.21.1') {
$this->index['advancedirectives'] = $index;
}
break;
}
}
}
开发者ID:igez,项目名称:gaiaehr,代码行数:50,代码来源:CCDDocumentParse.php
示例10: saveconfigAction
public function saveconfigAction()
{
require_once Mage::getBaseDir() . '/app/code/local/Etheme/Evoqueconfig/lib/Array2Xml.php';
$name = $this->getRequest()->getParam('name');
$store = $this->getRequest()->getParam('store');
$scope = $store ? 'stores' : 'default';
$sections = array('evoqueconfig', 'evoquecolors', 'evoquelayout', 'evoqueflex');
$data = array();
$data['name'] = $name;
foreach ($sections as $section) {
$data['sections'][$section] = Mage::getStoreConfig($section, $store);
}
$xml = Array2XML::createXML('config', $data);
$file = Mage::getBaseDir() . '/ev_skins/' . $data['name'] . '.xml';
$content = $xml->saveXML();
@file_put_contents($file, $content);
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('evoqueconfig')->__('New preset configuration saved successfully. You can use it from "Load preset configuration" and find in folder ' . $file));
$this->getResponse()->setRedirect($this->getUrl("*/*/"));
}
开发者ID:jacobfire,项目名称:robotics,代码行数:19,代码来源:SaveconfigController.php
示例11: array2xml
public function array2xml()
{
require_once BASEPATH . '../application/third_party/array2xml/Array2XML.php';
/*
<?xml version="1.0" encoding="UTF-8"?>
<head/>
<books type="fiction">
<book author="George Orwell">
<title>1984</title>
</book>
<book author="Isaac Asimov">
<title><![CDATA[Foundation]]></title>
<price>$15.61</price>
</book>
<book author="Robert A Heinlein">
<title><![CDATA[Stranger in a Strange Land]]></title>
<price discount="10%">$18.00</price>
</book>
</books>
*/
$books = array('@attributes' => array('type' => 'fiction'), 'book' => array(array('@attributes' => array('author' => 'George Orwell'), 'title' => '1984'), array('@attributes' => array('author' => 'Isaac Asimov'), 'title' => array('@cdata' => 'Foundation'), 'price' => '$15.61'), array('@attributes' => array('author' => 'Robert A Heinlein'), 'title' => array('@cdata' => 'Stranger in a Strange Land'), 'price' => array('@attributes' => array('discount' => '10%'), '@value' => '$18.00'))));
$xml = Array2XML::createXML('books', $books);
echo $xml->saveXML();
}
开发者ID:crodriguezn,项目名称:crossfit-milagro,代码行数:24,代码来源:test001.php
示例12: str_replace
//if( $rowSNMP[0].$rowSNMP[1].$rowSNMP[2]=="192") echo "yes"; else echo "no";
//if( substr($rowSNMP,0,9)=="192.168.1" )
//$sps=substr($rowSNMP,12);
//if( in_array(substr($rowSNMP,8,3),$_HOSTEL_NETS) && $sps!=="1" && $sps!=="0" && $sps!=="255")
//{
$rowSNMP_s = "k" . str_replace(".", "", $rowSNMP);
$ips[$rowSNMP_s] = array();
//IpAddress:
//if(!file_exists("./ipdate/".$rowSNMP.".ip")) file_put_contents("./ipdate/".$rowSNMP.".ip","{$rowSNMP} {$date}");
if (!$array2[$rowSNMP_s]['ip']) {
$ips[$rowSNMP_s]['ip'] = $rowSNMP;
} else {
$ips[$rowSNMP_s]['ip'] = $array2[$rowSNMP_s]['ip'];
}
if (!$array2[$rowSNMP_s]['fixdate']) {
$ips[$rowSNMP_s]['fixdate'] = $date;
} else {
$ips[$rowSNMP_s]['fixdate'] = $array2[$rowSNMP_s]['fixdate'];
}
$ips[$rowSNMP_s]['lastdate'] = $date;
// }
}
$result = array_merge($array2, $ips);
//print_r($result);
$converter = new Array2XML();
$xmlStr = $converter->convert($result);
file_put_contents($command['ipdatefile'], $xmlStr);
$n = count($result);
$time = microtime(true) - $start;
echo "work done ({$n} rows) []";
printf('Скрипт выполнялся %.4F сек.', $time);
开发者ID:proea,项目名称:IPManager.pro,代码行数:31,代码来源:ipdate.php
示例13: translateOneNode
//.........这里部分代码省略.........
// If yes, return the node# and alias in an array
// otherwise, $oldNodeID_ary['number'] == ''
$oldNodeID_ary = findOldTranslation($currentNodeID, $to_language);
$oldNodeID = $oldNodeID_ary['number'];
$oldNodeIDalias = $oldNodeID_ary['url_alias'];
if ($oldNodeID != "") {
echo "\nFound old node number -- old={$oldNodeID}\n";
}
if ($oldNodeIDalias != "") {
echo "\nFound old node number alias -- old={$oldNodeIDalias}\n";
}
// Update the nid and tnid fields
// For new nodes, nid=''
// and tnid = the current nid value
$XMLarray['node_export']['node']['tnid'] = $currentNodeID;
$XMLarray['node_export']['node']['nid'] = $oldNodeID;
// $XMLarray['node_export']['node']['language'] = $oldNodeID['drupal_lang_code'];
$XMLarray['node_export']['node']['language'] = $drupalLanguageCode;
// // // $XMLarray['node_export']['node']['path'] = $oldNodeID['url_alias'];
if (isset($XMLarray['node_export']['node']['xmlsitemap']['language'])) {
// $XMLarray['node_export']['node']['xmlsitemap']['language'] = $oldNodeID['drupal_lang_code'];
$XMLarray['node_export']['node']['xmlsitemap']['language'] = $drupalLanguageCode;
}
//echo "XMLARRAY = \n";
//print_r($XMLarray);
$FOO = $XMLarray['node_export']['node']['nodewords']['location']['latitude'];
$BAR = $XMLarray['node_export']['node']['nodewords']['location']['longitude'];
echo "FOO = {$FOO}\nBAR = {$BAR}\n";
// If lat or long > 8 chars, set to zero, otherwise node will not import
if (isset($XMLarray['node_export']['node']['nodewords']['location']['latitude'])) {
if (strlen($XMLarray['node_export']['node']['nodewords']['location']['latitude']) > 8) {
$XMLarray['node_export']['node']['nodewords']['location']['latitude'] = 0;
}
}
if (isset($XMLarray['node_export']['node']['nodewords']['location']['longitude'])) {
if (strlen($XMLarray['node_export']['node']['nodewords']['location']['longitude']) > 8) {
$XMLarray['node_export']['node']['nodewords']['location']['longitude'] = 0;
}
}
// Adjust the menu references
$this_plid = $XMLarray['node_export']['node']['menu']['plid'];
$this_menu_name = $XMLarray['node_export']['node']['menu']['menu_name'];
if ($this_menu_name == "primary-links") {
$mquery = "SELECT t_menuid from sovee.menus LEFT JOIN sovee.languages on sovee.menus.language_code = sovee.languages.id WHERE drupal_code = \"" . $drupalLanguageCode . "\" and Eng_menuid = \"" . $this_plid . "\"";
echo "MQ = {$mquery}\n";
$rmquery = mysql_query($mquery, $db);
$err_msg = trim(mysql_error($db));
if (strlen($err_msg) > 0) {
echo "{$mquery}\n{$err_msg}\n\n\n";
}
while ($m1 = mysql_fetch_assoc($rmquery)) {
$newPlid = $m1['t_menuid'];
$XMLarray['node_export']['node']['menu']['plid'] = $newPlid;
}
mysql_free_result($rmquery);
}
// Convert array back to XML
$encoding = "UTF-8";
$xmlVersion = "1.0";
Array2XML::init($xmlVersion, $encoding);
$xmlobj = Array2XML::createXML('DELETE_ME', $XMLarray);
// Convert a PHP array to XML, using 'DELETE_ME' as the root_node_name
$translated_xml = $xmlobj->saveXML();
// Returned object is of type DOMDocument
$translated_xml = preg_replace("/<[\\/]?DELETE_ME>[\n]/u", "", $translated_xml);
$fn = getcwd() . "/TRANSLATED_" . $drupalLanguageCode . "_" . $currentNodeID . ".XML";
echo "WRITING {$fn}\n";
$fh = fopen($fn, "w");
fwrite($fh, $translated_xml);
fclose($fh);
// If node translation was successful,
// import the translated node back into Drupal
if ($error_IncompleteNodeFlag == 0) {
$cmd = "/usr/bin/drush --root=/var/www/pressflow node-export-import --file={$fn}";
echo "COMMAND = {$cmd}\n";
$success = `{$cmd}`;
$error = "DRUSH IMPORT RESULTS: {$success}\n";
echo $error;
fwrite($error_log, $error);
$cmd = "/bin/rm {$fn}";
#$success = `$cmd`;
$q1 = "INSERT INTO sovee.progress (node, status, type, language) VALUES(\"" . $currentNodeID . "\", \"1\", \"" . $derivedContentType . "\", \"" . $to_language . "\") ON DUPLICATE KEY UPDATE status=VALUES(status)";
echo "Q1={$q1}\n";
$r1 = mysql_query($q1, $db);
} else {
$error = "Node {$currentNodeID} ({$content_type}) not completely translated. Not importing into Drupal.\n";
echo $error;
$q1 = "INSERT INTO sovee.progress (node, status, type, language) VALUES(\"" . $currentNodeID . "\", \"0\", \"" . $derivedContentType . "\", \"" . $to_language . "\") ON DUPLICATE KEY UPDATE status=VALUES(status)";
$r1 = mysql_query($q1, $db);
$err_msg = trim(mysql_error($db));
if (strlen($err_msg) > 0) {
echo "{$q1}\n{$err_msg}\n\n\n";
}
fwrite($error_log, $error);
}
echo "========== ==========\n=====================================================================================\n";
}
$translated_xml_array = array('status' => $error_IncompleteNodeFlag, 'translated_xml' => $translated_xml);
return $translated_xml_array;
}
开发者ID:nightbeacons,项目名称:translate,代码行数:101,代码来源:content.php
示例14: foreach
$metaContents = $nv_Request->get_array('metaContents', 'post');
foreach ($metaGroupsName as $key => $name) {
if ($name == 'http-equiv' or $name == 'name' or $name == 'property') {
$value = trim(strip_tags($metaGroupsValue[$key]));
$content = trim(strip_tags($metaContents[$key]));
$newArray = array('group' => $name, 'value' => $value, 'content' => $content);
if (preg_match("/^[a-zA-Z0-9\\-\\_\\.\\:]+\$/", $value) and !in_array($value, $ignore) and preg_match("/^([^\\'\"]+)\$/", $content) and !in_array($newArray, $metatags['meta'])) {
$metatags['meta'][] = $newArray;
}
}
}
if (file_exists($file_metatags)) {
nv_deletefile($file_metatags);
}
if (!empty($metatags['meta'])) {
$array2XML = new Array2XML();
$array2XML->saveXML($metatags, 'metatags', $file_metatags, $global_config['site_charset']);
}
$metaTagsOgp = (int) $nv_Request->get_bool('metaTagsOgp', 'post');
$description_length = $nv_Request->get_int('description_length', 'post');
$db->query("UPDATE " . NV_CONFIG_GLOBALTABLE . " SET config_value = '" . $metaTagsOgp . "' WHERE lang = 'sys' AND module = 'site' AND config_name = 'metaTagsOgp'");
$db->query("UPDATE " . NV_CONFIG_GLOBALTABLE . " SET config_value = '" . $description_length . "' WHERE lang = 'sys' AND module = 'site' AND config_name = 'description_length'");
nv_delete_all_cache(false);
Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&rand=' . nv_genpass());
exit;
} else {
if (!file_exists($file_metatags)) {
$file_metatags = NV_ROOTDIR . '/' . NV_DATADIR . '/metatags.xml';
}
$mt = simplexml_load_file($file_metatags);
$mt = nv_object2array($mt);
开发者ID:anhtunguyen,项目名称:vietnamguide,代码行数:31,代码来源:metatags.php
示例15: createXmlApiCall
public static function createXmlApiCall($url, $method, $headers, $data = array())
{
$xmlData = Array2XML::createXML('zurmoMessage', $data);
$data = array('data' => $xmlData->saveXML());
return ApiRestHelper::createApiCall($url, $method, $headers, $data);
}
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:6,代码来源:ApiRestTestHelper.php
示例16: beforeSet
/**
* Override in your derivative class to do functionality before the fields are set on the object
* @return boolean
*/
public function beforeSet()
{
$props = $this->getProperties();
$this->default = json_decode($props['default'], true);
unset($props['default']);
$this->unsetProperty('default');
/**
* Cleaning first
*/
$configs = array();
foreach ($props['configs'] as $k => $v) {
if ($k === 'modules') {
/**
*
*/
$checkChanges = array();
$i = 0;
foreach ($v as $modName => $vals) {
$checkChanges = array();
foreach ($vals['@attributes'] as $x => $y) {
$y = trim($y);
if ($x === 'name') {
continue;
}
if (empty($y)) {
continue;
}
$checkChanges[$x] = $y;
}
if (!empty($checkChanges)) {
$innerChanges = array();
foreach ($vals['@attributes'] as $x => $y) {
$y = trim($y);
if ($x === 'name') {
continue;
}
if (empty($y)) {
continue;
}
$checkDefaultModConfs = $this->getModuleConfigs($vals['@attributes']['name']);
if (empty($checkDefaultModConfs)) {
continue;
}
if ($checkDefaultModConfs['@attributes'][$x] === $y) {
continue;
}
$innerChanges[$x] = $y;
}
if (!empty($innerChanges)) {
if (!isset($configs['modules'])) {
$configs['modules'] = array();
}
if (!isset($configs['modules']['module'])) {
$configs['modules']['module'] = array();
}
$vals['@attributes'] = $this->mergeValues($vals['@attributes'], $checkDefaultModConfs['@attributes']);
$configs['modules']['module'][$i] = $vals;
}
}
++$i;
}
continue;
}
foreach ($v['@attributes'] as $x => $y) {
$y = trim($y);
if (empty($y)) {
continue;
}
if (isset($this->default[$k]['@attributes'][$x]) && $this->default[$k]['@attributes'][$x] === $y) {
continue;
}
$configs[$k]['@attributes'][$x] = $y;
}
}
$this->unsetProperty('configs');
if (empty($configs)) {
return $this->modx->lexicon('bbbx.config_err_no_changes');
}
require_once $this->modx->bbbx->config['corePath'] . 'vendors/array2xml/Array2XML.php';
$array2xml = Array2XML::createXML('config', $configs);
$xml = $array2xml->saveXML();
$xml = preg_replace('/>\\s+</', '><', $xml);
$xml = str_replace('<?xml version="1.0" encoding="UTF-8"?>', '', $xml);
$xml = trim($xml);
$this->setProperty('xml', $xml);
return !$this->hasErrors();
}
开发者ID:virtudraft,项目名称:bbbx,代码行数:91,代码来源:create.class.php
示例17: array
//krumo($_POST);
$destacadosArrForm = array();
$campos = array("Titulo", "Texto", "Imagen", "Enlace", "TextoEnlace");
for ($i = 1; $i < (int) ($_POST['numerocampos'] + 1); $i++) {
$nodo = array();
foreach ($campos as $x => $val) {
$nodo[$val] = $_POST[$val . "_" . $i];
}
$nodo["@attributes"] = array("id" => $_POST["id_" . $i]);
$destacadosArrForm[] = $nodo;
//krumo($nodo);
}
$Destacados = array("Destacados" => array("Destacado" => $destacadosArrForm, "@attributes" => array("noNamespaceSchemaLocation" => "Destacados.xsd")));
//krumo($Destacados);
$Array2XML = Array2XML::init('1.0', 'iso-8859-1');
$outputDestXML = Array2XML::createXML('Destacados', $Destacados);
$xmlString = $outputDestXML->saveXML();
$xmlString = utf8_encode($xmlString);
$xmlDestino2 = $_SESSION['workfolder_webdir'] . "Destacados.xml";
$fp = fopen($xmlDestino2, 'w');
fwrite($fp, $xmlString);
fclose($fp);
}
/*$xml = simplexml_load_file($xmlDestino, 'SimpleXMLElement',LIBXML_NOCDATA);
$json = json_encode($xml);
$XMLarray = json_decode($json,TRUE);
krumo($XMLarray);*/
$xml = file_get_contents($xmlDestino);
// por lo visto es mejor iconv si el texto puede contener caracteres como € que no estan en utf_decode
//$xml=iconv("UTF-8", "ISO-8859-1//TRANSLIT", $xml);
// utf8_decode para los caracteres especiales, ñ y demás
开发者ID:TahicheVivo,项目名称:CREditor,代码行数:31,代码来源:_safe_pre_draggable_CR_form2.php
示例18: foreach
$searchEngineValue = $nv_Request->get_array('searchEngineValue', 'post');
$searchEngineActive = $nv_Request->get_array('searchEngineActive', 'post');
foreach ($searchEngineName as $key => $name) {
$name = trim(strip_tags($name));
$value = trim(strip_tags($searchEngineValue[$key]));
$active = intval($searchEngineActive[$key]);
if (!empty($name) and !empty($value)) {
$searchEngines['searchEngine'][] = array('name' => $name, 'value' => $value, 'active' => $active);
}
}
if (file_exists($file_searchEngines)) {
nv_deletefile($file_searchEngines);
}
if (!empty($searchEngines['searchEngine'])) {
include NV_ROOTDIR . '/includes/class/array2xml.class.php';
$array2XML = new Array2XML();
$array2XML->saveXML($searchEngines, 'searchEngines', $file_searchEngines, $global_config['site_charset']);
}
} else {
if (file_exists($file_searchEngines)) {
$mt = simplexml_load_file($file_searchEngines);
$mt = nv_object2array($mt);
if ($mt['searchEngine_item']) {
if (isset($mt['searchEngine_item'][0])) {
$searchEngines['searchEngine'] = $mt['searchEngine_item'];
} else {
$searchEngines['searchEngine'][] = $mt['searchEngine_item'];
}
}
}
if (!empty($searchEngines['searchEngine']) and $nv_Request->isset_request('ping', 'post')) {
开发者ID:atarubi,项目名称:nuke-viet,代码行数:31,代码来源:sitemapPing.php
示例19: respond
public static function respond($rawResponse, $format, $debug)
{
global $logger, $warnings_payload;
$httpStatusCode = $rawResponse['httpStatusCode'];
$httpStatusCodeMessage = $rawResponse['httpStatusCodeMessage'];
$otherHeaders = $rawResponse['otherHeaders'];
$internalStatusCode = $rawResponse['code'];
$internalStatusMessage = $rawResponse['message'];
$warnings = $warnings_payload;
$resourceData = $rawResponse['data'];
$response = array();
if ($httpStatusCode == 500) {
$response['internal_status'] = array('code' => $httpStatusCode, 'message' => $httpStatusCodeMessage);
} else {
$response['internal_status'] = array('code' => $internalStatusCode, 'message' => $internalStatusMessage);
if (!empty($warnings)) {
$response['warnings'] = implode(', ', $warnings);
}
//TO-DO: Remove "data" key in response; directly show resource list
if (!empty($resourceData)) {
$response['data'] = $resourceData;
}
if ($debug) {
$response['logs'] = $logger->getEntries();
}
}
ob_clean();
ob_start();
$logger->debug("***** Result: " . json_encode($response));
/* Set HTTP Status header */
$statusHeader = 'HTTP/1.0 ' . $httpStatusCode . ' ' . $httpStatusCodeMessage;
header($statusHeader);
header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Credentials: true");
header('Access-Control-Allow-Headers: X-Requested-With');
header('Access-Control-Allow-Headers: Content-Type');
header('Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE, PUT');
header('Access-Control-Max-Age: 86400');
if (array_key_exists('HTTP_ACCESS_CONTROL_REQUEST_HEADERS', $_SERVER)) {
header('Access-Control-Allow-Headers: ' . $_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']);
} else {
header('Access-Control-Allow-Headers: *');
}
/* Set Other headers, if any */
if (isset($rawResponse['otherHeaders'])) {
foreach ($otherHeaders as $header) {
header($header);
}
}
if (isset($format) && $format == 'xml') {
header('Content-type:text/xml; charset=utf-8');
$xml = Array2XML::createXML('response', $response);
$result = trim($xml->saveXML());
} else {
if (isset($format) && $format == 'json') {
header('Content-type:application/json; charset=utf-8');
$result = trim(json_encode($response));
} else {
$result = serialize($response);
}
}
echo $result;
$logger->debug("Buffering: " . var_export(ob_get_status(true), true));
if (ob_get_length() > 0) {
ob_end_flush();
ob_flush();
flush();
}
return $result;
}
开发者ID:rajnishp,项目名称:bjs,代码行数:70,代码来源:ResponseHandler.class.php
-
GitbookIO/gitbook:
阅读:959|2022-08-17
-
juleswhite/mobile-cloud-asgn1
阅读:1034|2022-08-30
-
kyamagu/matlab-json: Use official API: https://mathworks.com/help/matlab/json-fo
阅读:927|2022-08-17
-
书名:墙壁眼睛膝盖 作者:温柔一刀 类别:欲望丛林,饮食男女。 簡介:Wall(我)Eye(爱)Kn
阅读:657|2022-11-06
-
sevenjay/cpp-markdown: Cpp-Markdown is a freely-available Markdown text-to-HTML
阅读:585|2022-08-18
-
第一步、准备邮箱 如果只是个人想体验一下小程序,直接用自己的QQ邮箱就行,但是这样
阅读:1024|2022-07-18
-
1.icon 图标组件,可自定义其类型、大小和颜色。
type 图标类型
size
阅读:545|2022-07-18
-
Out-of-bounds Read in GitHub repository vim/vim prior to 9.0.
阅读:685|2022-07-08
-
mathjax/MathJax-i18n: MathJax localization
阅读:389|2022-08-16
-
google/guava: Google core libraries for Java
阅读:527|2022-08-14
|
请发表评论