本文整理汇总了PHP中CGroup类的典型用法代码示例。如果您正苦于以下问题:PHP CGroup类的具体用法?PHP CGroup怎么用?PHP CGroup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CGroup类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: Delete
/**
* Delete
* @param $CODE
* @return array
* @throws \Exception
*/
public static function Delete($CODE)
{
$group = new \CGroup();
$user = new \CUser();
if (!empty($CODE)) {
$by = "ID";
$order = "asc";
$dbGroup = $group->GetList($by, $order, array('STRING_ID' => $CODE));
if ($arGroup = $dbGroup->Fetch()) {
$arReturn = $arGroup;
}
} else {
throw new BimException('Empty group code');
}
if (intval($arReturn['ID']) > 0) {
$arUsers = $group->GetGroupUser($arReturn['ID']);
foreach ($arUsers as $UserID) {
$arGroup = $user->GetUserGroup($UserID);
$arGroup[] = "3";
$user->SetUserGroup($UserID, $arGroup);
}
$res = $group->Delete($arReturn['ID']);
if (is_object($res)) {
return $arReturn['ID'];
} else {
throw new BimException($group->LAST_ERROR);
}
} else {
throw new BimException('Group not found');
}
}
开发者ID:cjp2600,项目名称:bim-core,代码行数:37,代码来源:GroupIntegrate.php
示例2: getUserGroups
/**
* Получение массива групп пользователей
*
* @return array массив групп пользователей
*/
public static function getUserGroups()
{
$group = new \CGroup();
$groupOrder = array('sort' => 'asc');
$groupTmp = 'sort';
$groupQuery = $group->GetList($groupOrder, $groupTmp);
$groups = array();
for ($i = 0; $item = $groupQuery->Fetch(); $i++) {
$groups[$i] = $item;
}
return $groups;
}
开发者ID:cjp2600,项目名称:bim-core,代码行数:17,代码来源:Helper.php
示例3: updateGroupIfExists
public function updateGroupIfExists($code, $fields = array())
{
$groupId = $this->getGroupId($code);
if (!$groupId) {
return false;
}
if (empty($fields)) {
$this->throwException(__METHOD__, 'Set fields for group %s', $code);
}
$group = new \CGroup();
if ($group->Update($groupId, $fields)) {
return intval($groupId);
}
$this->throwException(__METHOD__, $group->LAST_ERROR);
}
开发者ID:andreyryabin,项目名称:sprint.migration,代码行数:15,代码来源:UserGroupHelper.php
示例4: checkParams
/**
* Абстрактный метод проверки передаваемых параметров
*
* checkParams
* @param array $groupId
* @return mixed|void
* @throws \Exception
* @internal param array $params
*/
public function checkParams($groupId)
{
$group = new \CGroup();
if (!isset($groupId) || empty($groupId)) {
throw new BimException('empty groupId param');
}
$this->ownerItemDbData = array();
$groupDbRes = $group->GetList($by = 'id', $order = 'desc', array('ID' => $groupId));
if ($groupDbRes === false || !$groupDbRes->SelectedRowsCount()) {
throw new BimException('Group with id = ' . $groupId . ' not exists');
}
$groupData = $groupDbRes->Fetch();
if (!strlen($groupData['STRING_ID'])) {
throw new BimException('Group with id = ' . $groupId . ' have empty STRING_ID!');
}
$this->ownerItemDbData = $groupData;
}
开发者ID:cjp2600,项目名称:bim-core,代码行数:26,代码来源:Group.php
示例5: BeforeUserAdd
function BeforeUserAdd(&$arFields)
{
if (strstr($_SERVER['HTTP_REFERER'], "webim")) {
$filter = array("STRING_ID" => "webim");
$by = 'c_sort';
$order = 'DESC';
$rsGroups = CGroup::GetList($by, $order, $filter);
$is_filtered = $rsGroups->is_filtered;
if ($row = $rsGroups->GetNext()) {
$arFields["GROUP_ID"][] = array("GROUP_ID" => $row["ID"]);
}
}
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:13,代码来源:class.webim.php
示例6: BeforeUserAdd
public function BeforeUserAdd(&$arFields)
{
if (strstr($_SERVER['HTTP_REFERER'], 'webim')) {
$filter = array('STRING_ID' => 'webim');
$by = 'c_sort';
$order = 'DESC';
$rsGroups = CGroup::GetList($by, $order, $filter);
$is_filtered = $rsGroups->is_filtered;
if ($row = $rsGroups->GetNext()) {
$arFields['GROUP_ID'][] = array('GROUP_ID' => $row['ID']);
}
}
}
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:13,代码来源:class.webim.php
示例7: actionCreate
public function actionCreate()
{
$model = new CGroup();
$description = new CGroupDescription();
$this->performAjaxValidation(array($model, $description), 'cgroup-form');
if (isset($_POST['CGroupDescription'])) {
//$model->setAttributes($_POST[$this->modelName]);
$description->setAttributes($_POST[$this->modelName . 'Description']);
$suc = Yii::t('info', 'CGroup was successfully created');
$err = Yii::t('info', 'Could not update CGroup');
$description->c_group_id = 0;
$description->locale_code = Yii::app()->getLanguage();
if ($model->validate() && $description->validate()) {
if ($model->save()) {
$description->c_group_id = $model->id;
$description->save();
Yii::app()->user->setFlash(TbHtml::ALERT_COLOR_SUCCESS, $suc);
if (Yii::app()->getRequest()->getIsAjaxRequest()) {
$this->renderPartial('_view', array('model' => $model, 'description' => $description), false, true);
Yii::app()->end();
} else {
$this->redirect(array('view', 'id' => $model->id));
}
} else {
Yii::app()->user->setFlash(TbHtml::ALERT_COLOR_ERROR, $err);
}
} else {
$description->validate();
}
UtilityHelper::sendToLog($model->getErrors());
UtilityHelper::sendToLog($description->getErrors());
}
if (Yii::app()->getRequest()->getIsAjaxRequest()) {
$this->renderPartial('_form', array('model' => $model, 'description' => $description), false, true);
Yii::app()->end();
}
$this->render('create', array('model' => $model, 'description' => $description));
}
开发者ID:Rudianasaja,项目名称:cycommerce,代码行数:38,代码来源:CGroupController.php
示例8: getUserGroups
/**
* @return array
*/
public function getUserGroups()
{
if ($this->groups) {
return $this->groups;
}
$ids = $this->user->GetUserGroupArray();
$res = array();
$dbRes = \CGroup::GetList($by = null, $order = null, array('ID' => implode('|', $ids)));
while ($item = $dbRes->Fetch()) {
$res[] = $item['STRING_ID'];
}
$this->groups = array_filter($res);
return $this->groups;
}
开发者ID:Under5,项目名称:bitrix-module-tools,代码行数:17,代码来源:access.php
示例9: array
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
if (!CModule::IncludeModule("iblock")) {
return;
}
$arIBlockType = array();
$rsIBlockType = CIBlockType::GetList(array("sort" => "asc"), array("ACTIVE" => "Y"));
while ($arr = $rsIBlockType->Fetch()) {
if ($ar = CIBlockType::GetByIDLang($arr["ID"], LANGUAGE_ID)) {
$arIBlockType[$arr["ID"]] = "[" . $arr["ID"] . "] " . $ar["NAME"];
}
}
$arIBlock = array();
$rsIBlock = CIBlock::GetList(array("sort" => "asc"), array("TYPE" => $arCurrentValues["IBLOCK_TYPE"], "ACTIVE" => "Y"));
while ($arr = $rsIBlock->Fetch()) {
$arIBlock[$arr["ID"]] = "[" . $arr["ID"] . "] " . $arr["NAME"];
}
$arUserGroups = array();
$dbGroups = CGroup::GetList($b = "NAME", $o = "ASC", array("ACTIVE" => "Y"));
while ($arGroup = $dbGroups->GetNext()) {
$arUserGroups[$arGroup["ID"]] = "[" . $arGroup["ID"] . "] " . $arGroup["NAME"];
}
$arComponentParameters = array("GROUPS" => array("VARIABLE_ALIASES" => array("NAME" => GetMessage("INTL_VARIABLE_ALIASES"))), "PARAMETERS" => array("IBLOCK_TYPE" => array("PARENT" => "BASE", "NAME" => GetMessage("INTL_IBLOCK_TYPE"), "TYPE" => "LIST", "VALUES" => $arIBlockType, "REFRESH" => "Y"), "IBLOCK_ID" => array("PARENT" => "BASE", "NAME" => GetMessage("INTL_IBLOCK"), "TYPE" => "LIST", "VALUES" => $arIBlock, "REFRESH" => "Y"), "PAGE_VAR" => array("NAME" => GetMessage("INTL_PAGE_VAR"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "VARIABLE_ALIASES"), "MEETING_VAR" => array("NAME" => GetMessage("INTL_MEETING_VAR"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "VARIABLE_ALIASES"), "MEETING_ID" => array("NAME" => GetMessage("INTL_MEETING_ID"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "BASE"), "ITEM_VAR" => array("NAME" => GetMessage("INTL_ITEM_VAR"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "VARIABLE_ALIASES"), "ITEM_ID" => array("NAME" => GetMessage("INTL_ITEM_ID"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "BASE"), "PATH_TO_MEETING" => array("NAME" => GetMessage("INTL_PATH_TO_MEETING"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "URL_TEMPLATES"), "PATH_TO_MEETING_LIST" => array("NAME" => GetMessage("INTL_PATH_TO_MEETING_LIST"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 25, "PARENT" => "URL_TEMPLATES"), "SET_NAVCHAIN" => array("PARENT" => "ADDITIONAL_SETTINGS", "NAME" => GetMessage("INTL_SET_NAVCHAIN"), "TYPE" => "CHECKBOX", "DEFAULT" => "Y"), "SET_TITLE" => array(), "USERGROUPS_RESERVE" => array("PARENT" => "BASE", "NAME" => GetMessage("INTL_USERGROUPS_RESERVE"), "TYPE" => "LIST", "MULTIPLE" => "Y", "VALUES" => $arUserGroups)));
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:26,代码来源:.parameters.php
示例10: htmlspecialcharsbx
<td><input type="text" name="find_name" value="<?echo htmlspecialcharsbx($find_name)?>" size="47"><?php
echo ShowFilterLogicHelp();
?>
</td>
</tr>
<tr>
<td><?echo GetMessage("MAIN_F_KEYWORDS")?></td>
<td><input type="text" name="find_keywords" value="<?echo htmlspecialcharsbx($find_keywords)?>" size="47"><?php
echo ShowFilterLogicHelp();
?>
</td>
</tr>
<tr valign="top">
<td><?echo GetMessage("F_GROUP")?><br><img src="/freetrix/images/main/mouse.gif" width="44" height="21" border="0" alt=""></td>
<td><?
$z = CGroup::GetDropDownList("AND ID!=2");
echo SelectBoxM("find_group_id[]", $z, $find_group_id, "", false, 10);
?></td>
</tr>
<input type="hidden" name="FN" value="<?echo htmlspecialcharsbx($FN)?>">
<input type="hidden" name="FC" value="<?echo htmlspecialcharsbx($FC)?>">
<input type="hidden" name="JSFUNC" value="<?echo htmlspecialcharsbx($JSFUNC)?>">
<?
$oFilter->Buttons(array("table_id"=>$sTableID, "url"=>$APPLICATION->GetCurPage(), "form"=>"find_form"));
$oFilter->End();
?>
</form>
<?
$lAdmin->DisplayList();
require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/epilog_popup_admin.php");
开发者ID:ASDAFF,项目名称:open_bx,代码行数:31,代码来源:user_search.php
示例11: date
}
print "</pre>";
}
}
if ($_GET["date_from"] || $_GET["date_to"]) {
$date_from = $_GET["date_from"];
$date_to = $_GET["date_to"];
} else {
$date_from = date('d.m.Y', time() - 3600 * 24 * 10);
$date_to = date('d.m.Y', time());
}
$APPLICATION->ShowHead();
CJSCore::Init("jquery");
$APPLICATION->ShowPanel();
$APPLICATION->SetTitle("Статистика приглашений детально");
$groupObj = CGroup::GetList();
$groups = array();
while ($group = $groupObj->Fetch()) {
if ($group["ID"] == 8 || $group["ID"] == 9) {
//Усилители / Сотрудники
$groups[$group["ID"]] = $group["NAME"];
}
}
$arFilter = array("DATE_REGISTER_1" => $date_from, "DATE_REGISTER_2" => $date_to);
$usersObj = CUser::GetList($sort = "id", $direct = "asc", $arFilter, array("SELECT" => array("UF_*"), "FIELDS" => array("*")));
$counter = array();
while ($user = $usersObj->Fetch()) {
if ($user["UF_USER_PARENT"]) {
$counter[$user["UF_USER_PARENT"]][] = $user;
}
}
开发者ID:dayAlone,项目名称:MyQube,代码行数:31,代码来源:stats_detail.php
示例12: include
<?
$module_id = "ws.projectsettings";
$CAT_RIGHT = $APPLICATION->GetGroupRight($module_id);
if ($CAT_RIGHT >= "R") :
global $MESS;
include(GetLangFileName($GLOBALS["DOCUMENT_ROOT"] . "/bitrix/modules/main/lang/", "/options.php"));
if ($REQUEST_METHOD == "GET" && strlen($RestoreDefaults) > 0 && $CAT_RIGHT == "W" && check_bitrix_sessid()) {
COption::RemoveOption("ws.projectsettings");
$z = CGroup::GetList($v1 = "id", $v2 = "asc", array("ACTIVE" => "Y", "ADMIN" => "N"));
while ($zr = $z->Fetch())
$APPLICATION->DelGroupRight($module_id, array($zr["ID"]));
LocalRedirect($APPLICATION->GetCurPage() . "?lang=" . LANG . "&mid=" . urlencode($mid));
}
$aTabs = array(
array("DIV" => "edit1", "TAB" => GetMessage("MAIN_TAB_RIGHTS"), "TITLE" => GetMessage("MAIN_TAB_TITLE_RIGHTS")),
);
$tabControl = new CAdminTabControl("tabControl", $aTabs);
$tabControl->Begin();
?>
<form method="POST" action="<? echo $APPLICATION->GetCurPage() ?>?mid=<?php
echo htmlspecialchars($mid);
?>
&lang=<? echo LANG ?>" name="ara">
<?php
echo bitrix_sessid_post();
?>
<?
$tabControl->BeginNextTab();
开发者ID:ASDAFF,项目名称:bitrix-module-project-settings,代码行数:31,代码来源:options.php
示例13: GetByID
/**
* <p>Возвращает группу пользователей по ее коду <i>ID</i> в виде объекта класса <a href="http://dev.1c-bitrix.ru/api_help/main/reference/cdbresult/index.php">CDBResult</a>.</p>
*
*
*
*
* @param int $id ID группы.</bo
*
*
*
* @param string $SHOW_USERS_AMOUNT = "N" "Y" - в выборке будет присутствовать поле ("USERS") с количеством
* пользователей в группе; "N" - в выборке не будет поля с количеством
* пользователей в группе (по умолчанию);
*
*
*
* @return CDBResult
*
*
* <h4>Example</h4>
* <pre>
* <?
* $rsGroup = <b>CGroup::GetByID</b>(2, "Y");
* $arGroup = $rsGroup->Fetch();
* echo "<pre>"; print_r($arGroup); echo "</pre>";
* ?>
* </pre>
*
*
*
* <h4>See Also</h4>
* <ul> <li> <a href="http://dev.1c-bitrix.ru/api_help/main/reference/cgroup/index.php#flds">Поля CGroup</a> </li> <li>
* <a href="http://dev.1c-bitrix.ru/api_help/main/reference/cgroup/getlist.php">CGroup::GetList</a> </li> </ul></b<a
* name="examples"></a>
*
*
* @static
* @link http://dev.1c-bitrix.ru/api_help/main/reference/cgroup/getbyid.php
* @author Bitrix
*/
public static function GetByID($ID, $SHOW_USERS_AMOUNT = "N")
{
global $DB;
$err_mess = CGroup::err_mess() . "<br>Function: GetList<br>Line: ";
$ID = intval($ID);
$strSql = "SELECT G.ID, G.ACTIVE, G.C_SORT, G.ANONYMOUS, G.NAME, G.STRING_ID, G.DESCRIPTION, " . $DB->DateToCharFunction("G.TIMESTAMP_X") . " as TIMESTAMP_X ";
if ($SHOW_USERS_AMOUNT == "Y") {
$strSql .= ", count(distinct U.USER_ID) USERS ";
} else {
$strSql .= ", G.SECURITY_POLICY ";
}
$strSql .= "FROM b_group G ";
if ($SHOW_USERS_AMOUNT == "Y") {
$strSql .= "LEFT JOIN b_user_group U ON (U.GROUP_ID=G.ID AND ((U.DATE_ACTIVE_FROM IS NULL) OR (U.DATE_ACTIVE_FROM <= " . $DB->CurrentTimeFunction() . ")) AND ((U.DATE_ACTIVE_TO IS NULL) OR (U.DATE_ACTIVE_TO >= " . $DB->CurrentTimeFunction() . "))) ";
}
$strSql .= "WHERE G.ID = " . $ID . " ";
if ($SHOW_USERS_AMOUNT == "Y") {
$strSql .= "GROUP BY G.ID, G.ACTIVE, G.C_SORT, G.TIMESTAMP_X, G.ANONYMOUS, G.NAME, G.STRING_ID, G.DESCRIPTION";
}
$z = $DB->Query($strSql, false, $err_mess . __LINE__);
return $z;
}
开发者ID:rasuldev,项目名称:torino,代码行数:62,代码来源:user.php
示例14: InstallDB
function InstallDB()
{
/** @global string $DBType */
global $DB, $DBType, $DBHost, $DBLogin, $DBPassword, $DBName, $APPLICATION;
if (!is_object($APPLICATION)) {
$APPLICATION = new CMain();
}
$DB = new CDatabase();
$DB->DebugToFile = false;
$DB->debug = true;
if (!defined("DBPersistent")) {
define("DBPersistent", false);
}
if (!$DB->Connect($DBHost, $DBName, $DBLogin, $DBPassword)) {
$APPLICATION->ThrowException(GetMessage("MAIN_INSTALL_DB_ERROR"));
return false;
}
$result = $DB->Query("SELECT * FROM b_module WHERE ID='main'", true, "", array("fixed_connection" => true));
$success = $result && $result->Fetch();
if ($success) {
return true;
}
if ($DBType == "mysql" && defined("MYSQL_TABLE_TYPE") && strlen(MYSQL_TABLE_TYPE) > 0) {
$DB->Query("SET storage_engine = '" . MYSQL_TABLE_TYPE . "'", true);
}
$errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/install/" . $DBType . "/install.sql");
if ($errors !== false) {
$APPLICATION->ThrowException(implode("", $errors));
return false;
}
$this->InstallTasks();
$group = new CGroup();
$arGroups = array(array("~ID" => 1, "ACTIVE" => "Y", "C_SORT" => 1, "NAME" => GetMessage("MAIN_ADMIN_GROUP_NAME"), "ANONYMOUS" => "N", "DESCRIPTION" => GetMessage("MAIN_ADMIN_GROUP_DESC")), array("~ID" => 2, "ACTIVE" => "Y", "C_SORT" => 2, "NAME" => GetMessage("MAIN_EVERYONE_GROUP_NAME"), "ANONYMOUS" => "Y", "DESCRIPTION" => GetMessage("MAIN_EVERYONE_GROUP_DESC")), array("~ID" => 3, "ACTIVE" => "Y", "C_SORT" => 3, "NAME" => GetMessage("MAIN_VOTE_RATING_GROUP_NAME"), "ANONYMOUS" => "N", "DESCRIPTION" => GetMessage("MAIN_VOTE_RATING_GROUP_DESC"), "STRING_ID" => "RATING_VOTE"), array("~ID" => 4, "ACTIVE" => "Y", "C_SORT" => 4, "NAME" => GetMessage("MAIN_VOTE_AUTHORITY_GROUP_NAME"), "ANONYMOUS" => "N", "DESCRIPTION" => GetMessage("MAIN_VOTE_AUTHORITY_GROUP_DESC"), "STRING_ID" => "RATING_VOTE_AUTHORITY"));
foreach ($arGroups as $arGroup) {
$rsGroup = CGroup::GetByID($arGroup["~ID"]);
if ($rsGroup->Fetch()) {
continue;
}
//mssql does not allow insert identity by default
if (strtolower($DB->type) == "mssql") {
unset($arGroup["~ID"]);
}
$success = (bool) $group->Add($arGroup);
if (!$success) {
$APPLICATION->ThrowException($group->LAST_ERROR);
return false;
}
}
self::InstallRatings();
$arLanguages = array(array("LID" => LANGUAGE_ID, "ACTIVE" => "Y", "SORT" => 1, "DEF" => "Y", "NAME" => GetMessage("MAIN_DEFAULT_LANGUAGE_NAME"), "FORMAT_DATE" => GetMessage("MAIN_DEFAULT_LANGUAGE_FORMAT_DATE"), "FORMAT_DATETIME" => GetMessage("MAIN_DEFAULT_LANGUAGE_FORMAT_DATETIME"), "FORMAT_NAME" => GetMessage("MAIN_DEFAULT_LANGUAGE_FORMAT_NAME"), "CHARSET" => defined("BX_UTF") ? "UTF-8" : GetMessage("MAIN_DEFAULT_LANGUAGE_FORMAT_CHARSET")));
if (LANGUAGE_ID != "en") {
$arLanguages[] = array("LID" => "en", "ACTIVE" => "Y", "SORT" => 2, "DEF" => "N", "NAME" => "English", "FORMAT_DATE" => "MM/DD/YYYY", "FORMAT_DATETIME" => "MM/DD/YYYY H:MI:SS T", "FORMAT_NAME" => "#NAME# #LAST_NAME#", "CHARSET" => defined("BX_UTF") ? "UTF-8" : "iso-8859-1");
}
if (LANGUAGE_ID != "de" && file_exists($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/lang/de/install/index.php')) {
$arLanguages[] = array("LID" => "de", "ACTIVE" => "Y", "SORT" => 3, "DEF" => "N", "NAME" => "German", "FORMAT_DATE" => "DD.MM.YYYY", "FORMAT_DATETIME" => "DD.MM.YYYY HH:MI:SS", "FORMAT_NAME" => "#NAME# #LAST_NAME#", "CHARSET" => defined("BX_UTF") ? "UTF-8" : "iso-8859-1");
}
if (LANGUAGE_ID != "ru" && file_exists($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/lang/ru/install/index.php')) {
$arLanguages[] = array("LID" => "ru", "ACTIVE" => "Y", "SORT" => 3, "DEF" => "N", "NAME" => "Russian", "FORMAT_DATE" => "DD.MM.YYYY", "FORMAT_DATETIME" => "DD.MM.YYYY HH:MI:SS", "FORMAT_NAME" => "#NAME# #LAST_NAME#", "CHARSET" => defined("BX_UTF") ? "UTF-8" : "windows-1251");
}
$lang = new CLanguage();
foreach ($arLanguages as $arLanguage) {
$rsLang = CLanguage::GetByID($arLanguage["LID"]);
if ($rsLang->Fetch()) {
continue;
}
$success = (bool) $lang->Add($arLanguage);
if (!$success) {
$APPLICATION->ThrowException($lang->LAST_ERROR);
return false;
}
}
$arSite = array("LID" => "s1", "ACTIVE" => "Y", "SORT" => 1, "DEF" => "Y", "NAME" => GetMessage("MAIN_DEFAULT_SITE_NAME"), "DIR" => "/", "FORMAT_DATE" => GetMessage("MAIN_DEFAULT_SITE_FORMAT_DATE"), "FORMAT_DATETIME" => GetMessage("MAIN_DEFAULT_SITE_FORMAT_DATETIME"), "FORMAT_NAME" => GetMessage("MAIN_DEFAULT_SITE_FORMAT_NAME"), "CHARSET" => defined("BX_UTF") ? "UTF-8" : GetMessage("MAIN_DEFAULT_SITE_FORMAT_CHARSET"), "LANGUAGE_ID" => LANGUAGE_ID);
$rsSites = CSite::GetByID($arSite["LID"]);
if (!$rsSites->Fetch()) {
$site = new CSite();
$success = (bool) $site->Add($arSite);
if (!$success) {
$APPLICATION->ThrowException($site->LAST_ERROR);
return false;
}
}
RegisterModule("main");
RegisterModuleDependences('iblock', 'OnIBlockPropertyBuildList', 'main', 'CIBlockPropertyUserID', 'GetUserTypeDescription', 100, '/modules/main/tools/prop_userid.php');
RegisterModuleDependences('main', 'OnUserDelete', 'main', 'CFavorites', 'OnUserDelete', 100, "/modules/main/classes/" . strtolower($GLOBALS["DB"]->type) . "/favorites.php");
RegisterModuleDependences('main', 'OnLanguageDelete', 'main', 'CFavorites', 'OnLanguageDelete', 100, "/modules/main/classes/" . strtolower($GLOBALS["DB"]->type) . "/favorites.php");
RegisterModuleDependences('main', 'OnUserDelete', 'main', 'CUserOptions', 'OnUserDelete');
RegisterModuleDependences('main', 'OnChangeFile', 'main', 'CMain', 'OnChangeFileComponent');
RegisterModuleDependences('main', 'OnUserTypeRightsCheck', 'main', 'CUser', 'UserTypeRightsCheck');
RegisterModuleDependences('main', 'OnUserLogin', 'main', 'UpdateTools', 'CheckUpdates');
RegisterModuleDependences('main', 'OnModuleUpdate', 'main', 'UpdateTools', 'SetUpdateResult');
RegisterModuleDependences('main', 'OnUpdateCheck', 'main', 'UpdateTools', 'SetUpdateError');
RegisterModuleDependences('main', 'OnPanelCreate', 'main', 'CUndo', 'CheckNotifyMessage');
RegisterModuleDependences('main', 'OnAfterAddRating', 'main', 'CRatingsComponentsMain', 'OnAfterAddRating');
RegisterModuleDependences('main', 'OnAfterUpdateRating', 'main', 'CRatingsComponentsMain', 'OnAfterUpdateRating');
RegisterModuleDependences('main', 'OnSetRatingsConfigs', 'main', 'CRatingsComponentsMain', 'OnSetRatingConfigs');
RegisterModuleDependences('main', 'OnGetRatingsConfigs', 'main', 'CRatingsComponentsMain', 'OnGetRatingConfigs');
RegisterModuleDependences('main', 'OnGetRatingsObjects', 'main', 'CRatingsComponentsMain', 'OnGetRatingObject');
RegisterModuleDependences('main', 'OnGetRatingContentOwner', 'main', 'CRatingsComponentsMain', 'OnGetRatingContentOwner');
RegisterModuleDependences('main', 'OnAfterAddRatingRule', 'main', 'CRatingRulesMain', 'OnAfterAddRatingRule');
RegisterModuleDependences('main', 'OnAfterUpdateRatingRule', 'main', 'CRatingRulesMain', 'OnAfterUpdateRatingRule');
//.........这里部分代码省略.........
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:101,代码来源:index.php
示例15: GetAllowableUserGroups
public function GetAllowableUserGroups($documentType)
{
$documentType = trim($documentType);
if (strlen($documentType) <= 0) {
return false;
}
$iblockId = intval(substr($documentType, strlen("type_")));
$arResult = array("Author" => GetMessage("BPVDX_DOCUMENT_AUTHOR"));
// $arRes = array(1);
// $arGroups = CIBlock::GetGroupPermissions($iblockId);
// foreach ($arGroups as $groupId => $perm)
// {
// if ($perm > "R")
// $arRes[] = $groupId;
// }
$dbGroupsList = CGroup::GetListEx(array("NAME" => "ASC"), array("ACTIVE" => "Y"));
//array("ID" => $arRes)
while ($arGroup = $dbGroupsList->Fetch()) {
$arResult[$arGroup["ID"]] = $arGroup["NAME"];
}
return $arResult;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:22,代码来源:virtualdocument.php
示例16: array
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
if (WIZARD_IS_RERUN) {
return;
}
if (!CModule::IncludeModule("fileman")) {
return;
}
$arAccessRights = array(WIZARD_PORTAL_ADMINISTRATION_GROUP => 'F', WIZARD_PERSONNEL_DEPARTMENT_GROUP => 'F');
$arTaskIDs = array();
$dbRes = CTask::GetList(array(), array('MODULE_ID' => 'fileman', 'SYS' => 'Y', 'LETTER' => implode('|', $arAccessRights), 'BINDING' => 'module'));
while ($arRes = $dbRes->Fetch()) {
$arTaskIDs[$arRes['LETTER']] = $arRes['ID'];
}
$arTasksForModule = array();
foreach ($arAccessRights as $group => $letter) {
$APPLICATION->SetGroupRight('fileman', $group, $letter);
$arTasksForModule[$group] = array('ID' => $arTaskIDs[$letter]);
}
CGroup::SetTasksForModule('fileman', $arTasksForModule);
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:23,代码来源:index.php
示例17: array
}
}
$arSectProperty_LNS = array();
$arUserFields = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("IBLOCK_".$arCurrentValues["IBLOCK_ID"]."_SECTION");
foreach($arUserFields as $FIELD_NAME=>$arUserField)
if($arUserField["USER_TYPE"]["BASE_TYPE"]=="string")
$arSectProperty_LNS[$FIELD_NAME] = $arUserField["LIST_COLUMN_LABEL"]? $arUserField["LIST_COLUMN_LABEL"]: $FIELD_NAME;
$arAscDesc = array(
"asc" => GetMessage("IBLOCK_SORT_ASC"),
"desc" => GetMessage("IBLOCK_SORT_DESC"),
);
$arUGroupsEx = Array();
$dbUGroups = CGroup::GetList($by = "c_sort", $order = "asc");
while($arUGroups = $dbUGroups -> Fetch())
{
$arUGroupsEx[$arUGroups["ID"]] = $arUGroups["NAME"];
}
$arComponentParameters = array(
"GROUPS" => array(
"RATING_SETTINGS" => array(
"NAME" => GetMessage("T_IBLOCK_DESC_RATING_SETTINGS"),
),
"REVIEW_SETTINGS" => array(
"NAME" => GetMessage("T_IBLOCK_DESC_REVIEW_SETTINGS"),
),
"FILTER_SETTINGS" => array(
"NAME" => GetMessage("T_IBLOCK_DESC_FILTER_SETTINGS"),
开发者ID:ASDAFF,项目名称:open_bx,代码行数:31,代码来源:.parameters.php
示例18: GetAllowableUserGroups
public function GetAllowableUserGroups($documentType)
{
$documentType = trim($documentType);
if (strlen($documentType) <= 0) {
return false;
}
$iblockId = intval(substr($documentType, strlen("iblock_")));
$arResult = array("Author" => GetMessage("IBD_DOCUMENT_AUTHOR"));
$arRes = array(1);
if (CIBlock::GetArrayByID($iblockId, "RIGHTS_MODE") === "E") {
$obRights = new CIBlockRights($iblockId);
foreach ($obRights->GetGroups() as $GROUP_CODE) {
if (preg_match("/^G(\\d+)\$/", $GROUP_CODE, $match)) {
$arRes[] = $match[1];
}
}
} else {
foreach (CIBlock::GetGroupPermissions($iblockId) as $groupId => $perm) {
if ($perm > "R") {
$arRes[] = $groupId;
}
}
}
$dbGroupsList = CGroup::GetListEx(array("NAME" => "ASC"), array("ID" => $arRes));
while ($arGroup = $dbGroupsList->Fetch()) {
$arResult[$arGroup["ID"]] = $arGroup["NAME"];
}
return $arResult;
}
开发者ID:spas-viktor,项目名称:books,代码行数:29,代码来源:iblockdocument.php
示例19: SetUserGroups
function SetUserGroups($arGroups)
{
if (!is_array($arGroups)) {
return;
}
foreach ($arGroups as $groupID) {
$groupID = intval($groupID);
$rsGroup = CGroup::GetByID($groupID);
if (!$rsGroup->Fetch()) {
continue;
}
if (!is_array($this->userGroups)) {
$this->userGroups = array();
}
$this->userGroups[] = $groupID;
}
}
开发者ID:Satariall,项目名称:izurit,代码行数:17,代码来源:csv_user_import.php
示例20: GetMessage
?>
</textarea><?php
}
?>
</td>
</tr>
<?php
}
?>
<tr>
<td><?php
echo GetMessage("FLOW_ADMIN");
?>
</td>
<td><?php
echo SelectBox("WORKFLOW_ADMIN_GROUP_ID", CGroup::GetDropDownList(""), GetMessage("MAIN_NO"), htmlspecialcharsbx($WORKFLOW_ADMIN_GROUP_ID));
?>
</td>
</tr>
<?php
$tabControl->BeginNextTab();
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/admin/group_rights.php";
$tabControl->Buttons();
?>
<input <?php
if ($WORKFLOW_RIGHT < "W") {
echo "disabled";
}
?>
type="submit" name="Update" value="<?php
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:options.php
注:本文中的CGroup类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论