本文整理汇总了PHP中CBPDocument::addShowParameterInit方法的典型用法代码示例。如果您正苦于以下问题:PHP CBPDocument::addShowParameterInit方法的具体用法?PHP CBPDocument::addShowParameterInit怎么用?PHP CBPDocument::addShowParameterInit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBPDocument
的用法示例。
在下文中一共展示了CBPDocument::addShowParameterInit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBizprocData
protected function getBizprocData()
{
$userId = $this->getUser()->getID();
$currentUserGroups = $this->getUser()->getUserGroupArray();
if (!$this->lists['ELEMENT_FIELDS'] || $this->lists['ELEMENT_FIELDS']['CREATED_BY'] == $userId) {
$currentUserGroups[] = 'Author';
}
$documentType = 'iblock_' . $this->iblockId;
CBPDocument::addShowParameterInit('lists', 'only_users', $documentType);
$this->lists['BIZPROC_FIELDS'] = array();
$bizprocIndex = 0;
$documentStates = CBPDocument::getDocumentStates(array('lists', 'BizprocDocument', $documentType), null);
$runtime = CBPRuntime::getRuntime();
$runtime->startRuntime();
$documentService = $runtime->getService('DocumentService');
foreach ($documentStates as $documentState) {
$bizprocIndex++;
$viewWorkflow = CBPDocument::CanUserOperateDocumentType(CBPCanUserOperateOperation::StartWorkflow, $userId, array('lists', 'BizprocDocument', $documentType), array('sectionId' => 0, 'AllUserGroups' => $currentUserGroups, 'DocumentStates' => $documentStates, 'WorkflowId' => $documentState['ID'] > 0 ? $documentState['ID'] : $documentState['TEMPLATE_ID']));
if ($viewWorkflow) {
$templateId = intval($documentState['TEMPLATE_ID']);
$workflowParameters = $documentState['TEMPLATE_PARAMETERS'];
if (!is_array($workflowParameters)) {
$workflowParameters = array();
}
if (strlen($documentState["ID"]) <= 0 && $templateId > 0) {
$parametersValues = array();
$keys = array_keys($workflowParameters);
foreach ($keys as $key) {
$value = $workflowParameters[$key]["Default"];
if (!is_array($value)) {
$parametersValues[$key] = htmlspecialcharsbx($value);
} else {
$keys1 = array_keys($value);
foreach ($keys1 as $key1) {
$parametersValues[$key][$key1] = htmlspecialcharsbx($value[$key1]);
}
}
}
foreach ($workflowParameters as $parameterKey => $arParameter) {
$parameterKeyExt = "bizproc" . $templateId . "_" . $parameterKey;
$html = $documentService->GetFieldInputControl(array('lists', 'BizprocDocument', $documentType), $arParameter, array("Form" => "start_workflow_form1", "Field" => $parameterKeyExt), $parametersValues[$parameterKey], false, true);
$this->lists['BIZPROC_FIELDS'][$parameterKeyExt . $bizprocIndex] = array("id" => $parameterKeyExt . $bizprocIndex, "required" => $arParameter["Required"], "name" => $arParameter["Name"], "title" => $arParameter["Description"], "type" => "custom", "value" => $html, 'show' => 'Y');
}
}
}
}
}