当前位置: 首页>>代码示例>>PHP>>正文


PHP COperation::GetIDByName方法代码示例

本文整理汇总了PHP中COperation::GetIDByName方法的典型用法代码示例。如果您正苦于以下问题:PHP COperation::GetIDByName方法的具体用法?PHP COperation::GetIDByName怎么用?PHP COperation::GetIDByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在COperation的用法示例。


在下文中一共展示了COperation::GetIDByName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: GeneratePHPInstall

	public static function GeneratePHPInstall($arValues)
	{
		$str = '';
		$arDefValues = $arValues["default"]["options"];
		$arInfo = CControllerGroupSettings::GetData();

		if(isset($arValues["default"]["modules"]))
		{
			$vArr = '';
			foreach($arInfo as $module_id=>$arProp)
			{
				if($module_id == 'main')
					continue;

				if(in_array($module_id, $arValues["default"]["modules"]))
					$vArr .= '"'.$module_id.'"=>"Y", ';
				else
					$vArr .= '"'.$module_id.'"=>"N", ';
			}
			$str .= 'CControllerClient::SetModules(Array('.$vArr.'));'."\r\n";
		}
		else
			$str .= 'CControllerClient::RestoreModules();'."\r\n";

		foreach($arInfo as $mname=>$arProp)
		{
				if(!is_array($arProp["options"]) || count($arProp["options"])<=0)
					continue;
				$arOptions = $arProp["options"];
				foreach($arOptions as $id=>$arOptionParams)
				{
					if(isset($arDefValues[$mname][$id]))
						$str .= 'CControllerClient::SetOptionString("'.EscapePHPString($mname).'", "'.EscapePHPString($id).'", "'.EscapePHPString($arDefValues[$mname][$id]).'");'."\r\n";
					elseif(substr($id, 0, 2)!='__')
						$str .= 'CControllerClient::RestoreOption("'.EscapePHPString($mname).'", "'.EscapePHPString($id).'");'."\r\n";
				}
		}

		$arSecurity = $arValues["default"]["security"];
		if($arSecurity["limit_admin"] == "Y")
			$str .= 'CControllerClient::SetOptionString("main", "~controller_limited_admin", "Y");'."\r\n";
		else
			$str .= 'CControllerClient::SetOptionString("main", "~controller_limited_admin", "N");'."\r\n";

		$subordinate_id = COperation::GetIDByName('edit_subordinate_users');

		$arGroups = Array();
		$arUniqTasks = Array();
		if(is_array($arSecurity["groups"]))
		{
			foreach($arSecurity["groups"] as $group_id=>$arPermissions)
			{
				$arDefinedPermissions = Array();
				$arUnDefinedPermissions = Array();
				$bSubOrdGroups = false;
				foreach($arInfo as $module_id=>$arProp)
				{
					if(isset($arPermissions[$module_id]))
					{
						$arDefinedPermissions[$module_id] = $arPermissions[$module_id];

						$task_id = $arPermissions[$module_id];

						if(strlen($task_id)>1 && (!is_array($arUniqTasks[$module_id]) || !in_array($task_id, $arUniqTasks[$module_id])))
						{
							$arUniqTasks[$module_id][] = $task_id;
							$dbr_task = CTask::GetList(Array(), Array('NAME'=>$task_id, 'MODULE_ID'=>$module_id, "BINDING" => 'module'));
							if($ar_task = $dbr_task->Fetch())
							{
								if($module_id == 'main' || $ar_task['SYS']!='Y')
								{
									$arOperations = CTask::GetOperations($ar_task["ID"], true);

									if($ar_task['SYS']!='Y')
									{
										$str .= 'CControllerClient::SetTaskSecurity('.CControllerGroupSettings::__PHPToString($task_id).', '.CControllerGroupSettings::__PHPToString($module_id).', '.CControllerGroupSettings::__PHPToString($arOperations).', '.CControllerGroupSettings::__PHPToString($ar_task["LETTER"]).');'."\r\n";
									}

									if($module_id == 'main' && in_array('edit_subordinate_users', $arOperations))
									{
										$bSubOrdGroups = true;
									}
								}
							}
						}
					}
					else
						$arUnDefinedPermissions[] = $module_id;
				}

				$str .= 'CControllerClient::RestoreGroupSecurity('.CControllerGroupSettings::__PHPToString($group_id).', '.CControllerGroupSettings::__PHPToString($arUnDefinedPermissions).');'."\r\n";

				if($bSubOrdGroups)
				{
					$arSGroupsTmp = preg_split("/[\r\n,;]+/", $arSecurity["subord_groups"][$group_id]);
					$arSGroups = array();
					foreach($arSGroupsTmp as $sGroupTmp)
					{
						$sGroupTmp = trim($sGroupTmp);
						if ($sGroupTmp != '')
//.........这里部分代码省略.........
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:101,代码来源:controllergroup.php

示例2: GetMessage

	$GROUP_DEFAULT_RIGHT = COption::GetOptionString($module_id, "GROUP_DEFAULT_RIGHT", "D");
	$GROUP_DEFAULT_TASK = CTask::GetIdByLetter($GROUP_DEFAULT_RIGHT,$module_id,'module');
	if ($GROUP_DEFAULT_TASK)
		COption::SetOptionString($module_id, "GROUP_DEFAULT_TASK", $GROUP_DEFAULT_TASK);
}
?>
	<tr>
		<td width="50%"><b><?php 
echo GetMessage("MAIN_BY_DEFAULT");
?>
</b></td>
		<td width="50%">
		<script>var arSubordTasks = [];</script>
		<?
		$arTasksInModule = CTask::GetTasksInModules(true,$module_id,'module');
		$nID = COperation::GetIDByName('edit_subordinate_users');
		$arTasks = $arTasksInModule['main'];
		echo SelectBoxFromArray("GROUP_DEFAULT_TASK", $arTasks, htmlspecialcharsbx($GROUP_DEFAULT_TASK));

		$show_subord = false;
		$arTaskIds = $arTasks['reference_id'];
		$arSubordTasks = Array();
		$l = count($arTaskIds);
		for ($i=0;$i<$l;$i++)
		{
			$arOpInTask = CTask::GetOperations($arTaskIds[$i]);
			if (in_array($nID,$arOpInTask))
			{
				$arSubordTasks[] = $arTaskIds[$i];
				?><script>
				arSubordTasks.push(<?php 
开发者ID:ASDAFF,项目名称:open_bx,代码行数:31,代码来源:options.php

示例3: GetMessage

    ?>
	<?php 
    $tabControl->BeginNextTab();
    ?>
	<tr>
		<td width="40%"><?php 
    echo GetMessage("KERNEL");
    ?>
</td>
		<td width="60%">
			<script>var arSubordTasks = [];</script>
			<?php 
    $arTasksModules = CTask::GetTasksInModules(true, false, 'module');
    $arTasks = CGroup::GetTasks($ID, true);
    $nID = COperation::GetIDByName('edit_subordinate_users');
    $nID2 = COperation::GetIDByName('view_subordinate_users');
    if ($strError != '') {
        $v = $_REQUEST["TASKS_main"];
    } else {
        $v = isset($arTasks['main']) ? $arTasks['main'] : false;
    }
    echo SelectBoxFromArray("TASKS_main", $arTasksModules['main'], $v, GetMessage("DEFAULT"));
    $show_subord = false;
    $arTaskIds = $arTasksModules['main']['reference_id'];
    $l = count($arTaskIds);
    for ($i = 0; $i < $l; $i++) {
        $arOpInTask = CTask::GetOperations($arTaskIds[$i]);
        if (in_array($nID, $arOpInTask) || in_array($nID2, $arOpInTask)) {
            ?>
<script>
					arSubordTasks.push(<?php 
开发者ID:spas-viktor,项目名称:books,代码行数:31,代码来源:group_edit.php


注:本文中的COperation::GetIDByName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。