本文整理汇总了PHP中IPSLib::fetchNonDefaultGroupFields方法的典型用法代码示例。如果您正苦于以下问题:PHP IPSLib::fetchNonDefaultGroupFields方法的具体用法?PHP IPSLib::fetchNonDefaultGroupFields怎么用?PHP IPSLib::fetchNonDefaultGroupFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPSLib
的用法示例。
在下文中一共展示了IPSLib::fetchNonDefaultGroupFields方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: masterXMLExport
/**
* Exports the groups to a master XML file for distribution
*
* @return @e void [Outputs to screen]
*/
public function masterXMLExport()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$entry = array();
$skip = IPSLib::fetchNonDefaultGroupFields();
//-----------------------------------------
// Get xml class
//-----------------------------------------
require_once IPS_KERNEL_PATH . 'classXML.php';
/*noLibHook*/
$xml = new classXML(IPS_DOC_CHAR_SET);
$xml->newXMLDocument();
$xml->addElement('export');
$xml->addElement('group', 'export');
//-----------------------------------------
// Grab our default 6 groups
//-----------------------------------------
$this->DB->build(array('select' => '*', 'from' => 'groups', 'order' => 'g_id ASC', 'limit' => array(0, 6)));
$this->DB->execute();
while ($r = $this->DB->fetch()) {
$content = array();
$r['g_icon'] = '';
if (is_array($skip) and count($skip)) {
foreach ($skip as $_kk) {
unset($r[$_kk]);
}
}
$xml->addElementAsRecord('group', 'row', $r);
}
//-----------------------------------------
// Print to browser
//-----------------------------------------
$this->registry->output->showDownload($xml->fetchDocument(), 'groups.xml', '', 0);
}
示例2: masterXMLExport
/**
* Exports the groups to a master XML file for distribution
*
* @access public
* @return void [Outputs to screen]
*/
public function masterXMLExport()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$entry = array();
$skip = IPSLib::fetchNonDefaultGroupFields();
//-----------------------------------------
// Get XML class
//-----------------------------------------
require_once IPS_KERNEL_PATH . 'class_xml.php';
$xml = new class_xml();
$xml->doc_type = IPS_DOC_CHAR_SET;
$xml->xml_set_root('export', array('exported' => time()));
//-----------------------------------------
// Set group
//-----------------------------------------
$xml->xml_add_group('group');
//-----------------------------------------
// Grab our default 6 groups
//-----------------------------------------
$this->DB->build(array('select' => '*', 'from' => 'groups', 'order' => 'g_id ASC', 'limit' => array(0, 6)));
$this->DB->execute();
while ($r = $this->DB->fetch()) {
$content = array();
$r['g_icon'] = '';
//-----------------------------------------
// Sort the fields...
//-----------------------------------------
foreach ($r as $k => $v) {
if (!in_array($k, $skip)) {
$content[] = $xml->xml_build_simple_tag($k, $v);
}
}
$entry[] = $xml->xml_build_entry('row', $content);
}
$xml->xml_add_entry_to_group('group', $entry);
$xml->xml_format_document();
//-----------------------------------------
// Print to browser
//-----------------------------------------
$this->registry->output->showDownload($xml->xml_document, 'groups.xml', '', 0);
}