本文整理汇总了PHP中CRM_Case_XMLProcessor::_xml方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Case_XMLProcessor::_xml方法的具体用法?PHP CRM_Case_XMLProcessor::_xml怎么用?PHP CRM_Case_XMLProcessor::_xml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Case_XMLProcessor
的用法示例。
在下文中一共展示了CRM_Case_XMLProcessor::_xml方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: retrieve
function retrieve($caseType)
{
require_once 'CRM/Utils/String.php';
require_once 'CRM/Utils/Array.php';
// trim all spaces from $caseType
$caseType = str_replace('_', ' ', $caseType);
$caseType = CRM_Utils_String::munge(ucwords($caseType), '', 0);
if (!CRM_Utils_Array::value($caseType, self::$_xml)) {
if (!self::$_xml) {
self::$_xml = array();
}
// first check custom templates directory
$fileName = null;
$config = CRM_Core_Config::singleton();
if (isset($config->customTemplateDir) && $config->customTemplateDir) {
// check if the file exists in the custom templates directory
$fileName = implode(DIRECTORY_SEPARATOR, array($config->customTemplateDir, 'CRM', 'Case', 'xml', 'configuration', "{$caseType}.xml"));
}
if (!$fileName || !file_exists($fileName)) {
// check if file exists locally
$fileName = implode(DIRECTORY_SEPARATOR, array(dirname(__FILE__), 'xml', 'configuration', "{$caseType}.xml"));
if (!file_exists($fileName)) {
return false;
}
}
// read xml file
$dom = DomDocument::load($fileName);
$dom->xinclude();
self::$_xml[$caseType] = simplexml_import_dom($dom);
}
return self::$_xml[$caseType];
}
示例2: retrieve
function retrieve($caseType)
{
$caseType = self::mungeCaseType($caseType);
if (!CRM_Utils_Array::value($caseType, self::$_xml)) {
if (!self::$_xml) {
self::$_xml = array();
}
// first check custom templates directory
$fileName = NULL;
$config = CRM_Core_Config::singleton();
if (isset($config->customTemplateDir) && $config->customTemplateDir) {
// check if the file exists in the custom templates directory
$fileName = implode(DIRECTORY_SEPARATOR, array($config->customTemplateDir, 'CRM', 'Case', 'xml', 'configuration', "{$caseType}.xml"));
}
if (!$fileName || !file_exists($fileName)) {
// check if file exists locally
$fileName = implode(DIRECTORY_SEPARATOR, array(dirname(__FILE__), 'xml', 'configuration', "{$caseType}.xml"));
if (!file_exists($fileName)) {
// check if file exists locally
$fileName = implode(DIRECTORY_SEPARATOR, array(dirname(__FILE__), 'xml', 'configuration.sample', "{$caseType}.xml"));
}
if (!file_exists($fileName)) {
if (self::$_hookCache === NULL) {
self::$_hookCache = array();
CRM_Utils_Hook::caseTypes(self::$_hookCache);
}
if (isset(self::$_hookCache[$caseType], self::$_hookCache[$caseType]['file'])) {
$fileName = self::$_hookCache[$caseType]['file'];
}
}
if (!file_exists($fileName)) {
return FALSE;
}
}
// read xml file
$dom = new DomDocument();
$dom->load($fileName);
$dom->xinclude();
self::$_xml[$caseType] = simplexml_import_dom($dom);
}
return self::$_xml[$caseType];
}
示例3: retrieve
function retrieve($caseType)
{
require_once 'CRM/Utils/String.php';
require_once 'CRM/Utils/Array.php';
// trim all spaces from $caseType
$caseType = str_replace('_', ' ', $caseType);
$caseType = CRM_Utils_String::munge(ucwords($caseType), '', 0);
if (!CRM_Utils_Array::value($caseType, self::$_xml)) {
if (!self::$_xml) {
self::$_xml = array();
}
// ensure that the file exists
$fileName = implode(DIRECTORY_SEPARATOR, array(dirname(__FILE__), 'xml', 'configuration', "{$caseType}.xml"));
if (!file_exists($fileName)) {
return false;
}
// read xml file
$dom = DomDocument::load($fileName);
$dom->xinclude();
self::$_xml[$caseType] = simplexml_import_dom($dom);
}
return self::$_xml[$caseType];
}