本文整理汇总了PHP中CRM_Core_BAO_UFGroup::formatUFFields方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_BAO_UFGroup::formatUFFields方法的具体用法?PHP CRM_Core_BAO_UFGroup::formatUFFields怎么用?PHP CRM_Core_BAO_UFGroup::formatUFFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_BAO_UFGroup
的用法示例。
在下文中一共展示了CRM_Core_BAO_UFGroup::formatUFFields方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preProcess
/**
* Pre processing work done here.
*
* gets session variables for group or field id
*
* @param
*
* @return void
*/
public function preProcess()
{
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
// CRM_Core_Controller validates qfKey for POST requests, but not necessarily
// for GET requests. Allowing GET would therefore be CSRF vulnerability.
CRM_Core_Error::fatal(ts('Preview only supports HTTP POST'));
}
// Inline forms don't get menu-level permission checks
$checkPermission = array(array('administer CiviCRM', 'manage event profiles'));
if (!CRM_Core_Permission::check($checkPermission)) {
CRM_Core_Error::fatal(ts('Permission Denied'));
}
$content = json_decode($_REQUEST['ufData'], TRUE);
foreach (array('ufGroup', 'ufFieldCollection') as $key) {
if (!is_array($content[$key])) {
CRM_Core_Error::fatal("Missing JSON parameter, {$key}");
}
}
//echo '<pre>'.htmlentities(var_export($content, TRUE)) .'</pre>';
//CRM_Utils_System::civiExit();
$fields = CRM_Core_BAO_UFGroup::formatUFFields($content['ufGroup'], $content['ufFieldCollection']);
//$fields = CRM_Core_BAO_UFGroup::getFields(1);
$this->setProfile($fields);
//echo '<pre>'.htmlentities(var_export($fields, TRUE)) .'</pre>';CRM_Utils_System::civiExit();
}