本文整理汇总了PHP中CSite类的典型用法代码示例。如果您正苦于以下问题:PHP CSite类的具体用法?PHP CSite怎么用?PHP CSite使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CSite类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: InstallFiles
function InstallFiles()
{
CopyDirFiles($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/mobile/public/mobile/", $_SERVER["DOCUMENT_ROOT"] . "/mobile/", True, True);
CopyDirFiles($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/mobile/install/templates/", $_SERVER["DOCUMENT_ROOT"] . "/bitrix/templates/", True, True);
CopyDirFiles($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/mobile/install/components/", $_SERVER["DOCUMENT_ROOT"] . "/bitrix/components", true, true);
$default_site_id = CSite::GetDefSite();
if ($default_site_id) {
$arAppTempalate = array("SORT" => 1, "CONDITION" => "CSite::InDir('/mobile/')", "TEMPLATE" => "mobile_app");
$arFields = array("TEMPLATE" => array());
$dbTemplates = CSite::GetTemplateList($default_site_id);
$mobileAppFound = false;
while ($template = $dbTemplates->Fetch()) {
if ($template["TEMPLATE"] == "mobile_app") {
$mobileAppFound = true;
$template = $arAppTempalate;
}
$arFields["TEMPLATE"][] = array("TEMPLATE" => $template['TEMPLATE'], "SORT" => $template['SORT'], "CONDITION" => $template['CONDITION']);
}
if (!$mobileAppFound) {
$arFields["TEMPLATE"][] = $arAppTempalate;
}
$obSite = new CSite();
$arFields["LID"] = $default_site_id;
$obSite->Update($default_site_id, $arFields);
}
CUrlRewriter::ReindexFile("/mobile/webdav/index.php");
CUrlRewriter::ReindexFile("/mobile/disk/index.php");
CUrlRewriter::Add(array("CONDITION" => "#^/mobile/disk/(?<hash>[0-9]+)/download#", "RULE" => "download=1&objectId=\$1", "ID" => "bitrix:mobile.disk.file.detail", "PATH" => "/mobile/disk/index.php"));
return true;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:30,代码来源:index.php
示例2: InstallFiles
function InstallFiles($site_dir = "/", $default_site_id = false)
{
CopyDirFiles($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/eshopapp/install/components", $_SERVER["DOCUMENT_ROOT"] . "/bitrix/components", true, true);
CopyDirFiles($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/eshopapp/install/templates/", $_SERVER["DOCUMENT_ROOT"] . "/bitrix/templates/", true, true);
if (!$default_site_id) {
$default_site_id = CSite::GetDefSite();
}
if ($default_site_id) {
$arAppTempalate = array("SORT" => 1, "CONDITION" => "CSite::InDir('" . $site_dir . "eshop_app/')", "TEMPLATE" => "eshop_app");
$arFields = array("TEMPLATE" => array());
$dbTemplates = CSite::GetTemplateList($default_site_id);
$eshopAppFound = false;
while ($template = $dbTemplates->Fetch()) {
if ($template["TEMPLATE"] == "eshop_app") {
$eshopAppFound = true;
$template = $arAppTempalate;
}
$arFields["TEMPLATE"][] = array("TEMPLATE" => $template['TEMPLATE'], "SORT" => $template['SORT'], "CONDITION" => $template['CONDITION']);
}
if (!$eshopAppFound) {
$arFields["TEMPLATE"][] = $arAppTempalate;
}
$obSite = new CSite();
$arFields["LID"] = $default_site_id;
$obSite->Update($default_site_id, $arFields);
}
return true;
}
开发者ID:Satariall,项目名称:izurit,代码行数:28,代码来源:index.php
示例3: ShowPanel
function ShowPanel()
{
global $USER, $APPLICATION;
if (defined("ADMIN_SECTION") && ADMIN_SECTION == true) {
return;
}
if ($USER->IsAdmin()) {
if ($_REQUEST['add_new_site_sol'] == 'sol' && check_bitrix_sessid()) {
$dbrSites = CSite::GetList($by, $ord);
$arSitesID = array();
$arSitesPath = array();
$siteCnt = 0;
while ($arSite = $dbrSites->Fetch()) {
if ($arSite["ACTIVE"] == "Y") {
$siteCnt++;
}
$arSitesID[] = strtolower($arSite["ID"]);
$arSitesPath[] = strtolower($arSite["PATH"]);
}
$newSiteID = "";
while (true) {
$newSiteID = chr(rand(ord("a"), ord("z"))) . chr(rand(ord("a"), ord("z")));
if (!in_array($newSiteID, $arSitesID) && !in_array("/site" . $newSiteID . "/", $arSitesPath) && !file_exists($_SERVER['DOCUMENT_ROOT'] . "/site" . $newSiteID)) {
break;
}
}
$culture = CultureTable::getRow(array('filter' => array("=FORMAT_DATE" => FORMAT_DATE, "=FORMAT_DATETIME" => FORMAT_DATETIME, "=FORMAT_NAME" => CSite::GetDefaultNameFormat(), "=CHARSET" => SITE_CHARSET)));
if ($culture) {
$cultureId = $culture["ID"];
} else {
$addResult = CultureTable::add(array("NAME" => $newSiteID, "CODE" => $newSiteID, "FORMAT_DATE" => FORMAT_DATE, "FORMAT_DATETIME" => FORMAT_DATETIME, "FORMAT_NAME" => CSite::GetDefaultNameFormat(), "CHARSET" => SITE_CHARSET));
$cultureId = $addResult->getId();
}
$arFields = array("LID" => $newSiteID, "ACTIVE" => "Y", "SORT" => 100, "DEF" => "N", "NAME" => $newSiteID, "DIR" => "/site_" . $newSiteID . "/", "SITE_NAME" => $newSiteID, "SERVER_NAME" => $_SERVER["SERVER_NAME"], "EMAIL" => COption::GetOptionString("main", "email_from"), "LANGUAGE_ID" => LANGUAGE_ID, "DOC_ROOT" => "", "CULTURE_ID" => $cultureId);
$obSite = new CSite();
$result = $obSite->Add($arFields);
if ($result) {
LocalRedirect("/bitrix/admin/wizard_install.php?lang=" . LANGUAGE_ID . "&wizardName=bitrix:portal&wizardSiteID=" . $newSiteID . "&" . bitrix_sessid_get());
} else {
echo $obSite->LAST_ERROR;
}
}
$arMenu = array(array("ACTION" => "jsUtils.Redirect([], '" . CUtil::JSEscape(SITE_DIR) . "?add_new_site_sol=sol&" . bitrix_sessid_get() . "')", "TEXT" => "<b>" . GetMessage("SOL_BUTTON_TEST_TEXT", array("#BR#" => " ")) . "</b>", "TITLE" => GetMessage("SOL_BUTTON_TEST_TITLE")));
$arSites = array();
$dbrSites = CSite::GetList($by, $ord, array("ACTIVE" => "Y"));
while ($arSite = $dbrSites->GetNext()) {
$arSites[] = array("ACTION" => "jsUtils.Redirect([], '" . CUtil::JSEscape($arSite["DIR"]) . "');", "ICON" => $arSite["LID"] == SITE_ID ? "checked" : "", "TEXT" => $arSite["NAME"], "TITLE" => GetMessage("SOL_BUTTON_GOTOSITE") . " " . $arSite["NAME"]);
}
$arMenu[] = array("SEPARATOR" => true);
$arMenu[] = array("TEXT" => GetMessage("SOL_BUTTON_GOTOSITE"), "MENU" => $arSites);
$APPLICATION->AddPanelButton(array("HREF" => SITE_DIR . "?add_new_site_sol=sol&" . bitrix_sessid_get(), "ID" => "solutions_wizard", "ICON" => "bx-panel-install-solution-icon", "TYPE" => "BIG", "ALT" => GetMessage("SOL_BUTTON_TEST_TITLE"), "TEXT" => GetMessage("SOL_BUTTON_TEST_TEXT"), "MAIN_SORT" => 2520, "SORT" => 20, "MENU" => $arMenu, 'HINT' => array('TITLE' => str_replace('#BR#', ' ', GetMessage("SOL_BUTTON_TEST_TEXT")), 'TEXT' => GetMessage('SOL_BUTTON_TEST_TEXT_HINT')), 'HINT_MENU' => array('TITLE' => str_replace('#BR#', ' ', GetMessage("SOL_BUTTON_TEST_TEXT")), 'TEXT' => GetMessage('SOL_BUTTON_TEST_MENU_HINT'))));
}
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:53,代码来源:panel_button.php
示例4: Delete
/**
* Delete
* @param $ID
* @return mixed
* @throws \Exception
*/
public static function Delete($ID)
{
$obSite = new \CSite();
$dbSite = $obSite->GetList($by = "sort", $order = "desc", array('ID' => $ID));
if ($arSite = $dbSite->Fetch()) {
$res = $obSite->Delete($ID);
if ($res) {
return $ID;
} else {
throw new BimException($obSite->LAST_ERROR);
}
}
}
开发者ID:cjp2600,项目名称:bim-core,代码行数:19,代码来源:SiteIntegrate.php
示例5: getDefaultSiteID
private static function getDefaultSiteID()
{
if (self::$defaultSiteID !== null) {
return self::$defaultSiteID;
}
$siteEntity = new \CSite();
$dbSites = $siteEntity->GetList($by = 'sort', $order = 'desc', array('DEFAULT' => 'Y', 'ACTIVE' => 'Y'));
$defaultSite = is_object($dbSites) ? $dbSites->Fetch() : null;
if (is_array($defaultSite)) {
return self::$defaultSiteID = $defaultSite['LID'];
}
return self::$defaultSiteID = 's1';
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:13,代码来源:diskmanager.php
示例6: getNearestEntities
public static function getNearestEntities($entityID, $currentDate, $startDate = '', $responsibleID = 0, $intervalInDays = 7, $checkPermissions = true, $limit = 5)
{
if (!is_string($startDate) || $startDate === '') {
$startDate = $currentDate;
}
$site = new \CSite();
$dateFormat = $site->GetDateFormat('SHORT');
$curretTime = $currentDate !== '' ? MakeTimeStamp($currentDate, $dateFormat) : false;
$startTime = $startDate !== '' ? MakeTimeStamp($startDate, $dateFormat) : false;
if ($startTime === false) {
return array();
}
$dt = new \DateTime();
$dt->setTimestamp($startTime);
$dt->add(new \DateInterval("P{$intervalInDays}D"));
$endTime = $dt->getTimeStamp();
$currentSorting = self::internalPrepareSorting($curretTime);
$startSorting = self::internalPrepareSorting($startTime);
$endSorting = self::internalPrepareSorting($endTime);
$result = array();
if ($entityID === \CCrmOwnerType::Lead) {
$filter = array('>=BIRTHDAY_SORT' => $startSorting, '<=BIRTHDAY_SORT' => $endSorting, 'CHECK_PERMISSIONS' => $checkPermissions ? 'Y' : 'N');
if ($responsibleID > 0) {
$filter['=ASSIGNED_BY_ID'] = $responsibleID;
}
$dbResult = \CCrmLead::GetListEx(array(), $filter, false, array('nTopCount' => $limit), array('ID', 'BIRTHDATE', 'BIRTHDAY_SORT', 'HONORIFIC', 'NAME', 'SECOND_NAME', 'LAST_NAME'));
while ($fields = $dbResult->Fetch()) {
$fields['ENTITY_TYPE_ID'] = \CCrmOwnerType::Lead;
$fields['IMAGE_ID'] = 0;
$sorting = isset($fields['BIRTHDAY_SORT']) ? (int) $fields['BIRTHDAY_SORT'] : 512;
$fields['IS_BIRTHDAY'] = $sorting === $currentSorting;
$result[] = $fields;
}
} elseif ($entityID === \CCrmOwnerType::Contact) {
$filter = array('>=BIRTHDAY_SORT' => $startSorting, '<=BIRTHDAY_SORT' => $endSorting, 'CHECK_PERMISSIONS' => $checkPermissions ? 'Y' : 'N');
if ($responsibleID > 0) {
$filter['=ASSIGNED_BY_ID'] = $responsibleID;
}
$dbResult = \CCrmContact::GetListEx(array(), $filter, false, array('nTopCount' => $limit), array('ID', 'BIRTHDATE', 'BIRTHDAY_SORT', 'HONORIFIC', 'NAME', 'SECOND_NAME', 'LAST_NAME', 'PHOTO'));
while ($fields = $dbResult->Fetch()) {
$fields['ENTITY_TYPE_ID'] = \CCrmOwnerType::Contact;
$fields['IMAGE_ID'] = isset($fields['PHOTO']) ? (int) $fields['PHOTO'] : 0;
$sorting = isset($fields['BIRTHDAY_SORT']) ? (int) $fields['BIRTHDAY_SORT'] : 512;
$fields['IS_BIRTHDAY'] = $sorting === $currentSorting;
$result[] = $fields;
}
}
return $result;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:49,代码来源:birthdayreminder.php
示例7: getConfiguredDomains
public function getConfiguredDomains()
{
$result = array();
$converter = CBXPunycode::GetConverter();
$domainName = COption::GetOptionString("main", "server_name", "");
if ($domainName != "") {
$result[$domainName] = $domainName;
}
$by = "";
$order = "";
$siteList = CSite::GetList($by, $order, array("ACTIVE" => "Y"));
while ($site = $siteList->Fetch()) {
$domains = explode("\r\n", $site["DOMAINS"]);
foreach ($domains as $domainName) {
if ($domainName != "") {
$punyName = $converter->Encode($domainName);
if ($punyName !== false) {
$result[$punyName] = $domainName;
}
}
}
}
ksort($result);
return $result;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:25,代码来源:monitoring.php
示例8: Add
public static function Add($settings)
{
global $DB, $USER;
$name = $settings['title'];
$description = $settings['description'];
$owner = $settings['owner'];
unset($settings['title']);
unset($settings['description']);
unset($settings['owner']);
$fields = array('TITLE' => $name, 'DESCRIPTION' => $description, 'OWNER_ID' => $owner, 'CREATED_DATE' => date($DB->DateFormatToPHP(CSite::GetDateFormat("FULL")), time() + CTimeZone::GetOffset()), 'CREATED_BY' => $USER->GetID());
if (isset($settings['mark_default'])) {
$fields['MARK_DEFAULT'] = $settings['mark_default'];
unset($settings['mark_default']);
}
$fields['SETTINGS'] = serialize($settings);
// pre-events
foreach (GetModuleEvents("report", "OnBeforeReportAdd", true) as $arEvent) {
if (ExecuteModuleEventEx($arEvent, array(&$fields)) === false) {
return false;
}
}
// save data
$ID = $DB->Add("b_report", $fields, array("SETTINGS", "DESCRIPTION"), "report");
// clear view params
self::clearViewParams($ID);
// post-events
foreach (GetModuleEvents("report", "OnBeforeReportAdd", true) as $arEvent) {
ExecuteModuleEventEx($arEvent, array($ID, &$fields));
}
return $ID;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:report.php
示例9: OrderBasket
/**
*
* return array() BasketList - experation - Send Order
**/
public static function OrderBasket($experation = NULL,$sort = array("ID" => "ASC"), $limit = NULL){
global $DB;
$arItems = array();
if(! $experation){
$experation = 30*24*60*60;
}
$time = date($DB->DateFormatToPHP(CSite::GetDateFormat("FULL", SITE_ID)), time() - $experation);
$arPages = false;
if(! empty($limit)){
$arPages = array('nTopCount' => $limit);
}
$arFilter = array('>=DATE_UPDATE' => $time,
"ORDER_ID" => true,
"CAN_BUY" => "Y");
$arSelect = array("ID", "USER_ID", "PRODUCT_ID", "CAN_BUY", "DELAY", "SUBSCRIBE", "QUANTITY","DATE_UPDATE","DETAIL_PAGE_URL");
$dbBasketList = CSaleBasket::GetList(
$sort,
$arFilter,
false,
$arPages,
$arSelect
);
while($_arItems = $dbBasketList->Fetch()){
$arItems[] = $_arItems;
}
return $arItems;
}
开发者ID:Kulkow,项目名称:ipdesign.k1785,代码行数:31,代码来源:basket.php
示例10: init
function init()
{
$this->username = CSalePaySystemAction::GetParamValue("USER");
$this->pwd = CSalePaySystemAction::GetParamValue("PWD");
$this->signature = CSalePaySystemAction::GetParamValue("SIGNATURE");
$this->currency = CSalePaySystemAction::GetParamValue("CURRENCY");
$this->testMode = CSalePaySystemAction::GetParamValue("TEST") == "Y";
if ($this->testMode) {
$this->domain = "sandbox.";
}
if (strlen($_REQUEST["token"]) > 0) {
$this->token = $_REQUEST["token"];
}
if (strlen($_REQUEST["PayerID"]) > 0) {
$this->payerId = $_REQUEST["PayerID"];
}
$this->version = "98.0";
$dbSite = CSite::GetByID(SITE_ID);
$arSite = $dbSite->Fetch();
$this->serverName = $arSite["SERVER_NAME"];
if (strLen($this->serverName) <= 0) {
if (defined("SITE_SERVER_NAME") && strlen(SITE_SERVER_NAME) > 0) {
$this->serverName = SITE_SERVER_NAME;
} else {
$this->serverName = COption::GetOptionString("main", "server_name", "www.bitrixsoft.com");
}
}
$this->serverName = (CMain::IsHTTPS() ? "https" : "http") . "://" . $this->serverName;
if (strlen($this->username) <= 0 || strlen($this->username) <= 0 || strlen($this->username) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException("CSalePaySystempaypal: init error", "CSalePaySystempaypal_init_error");
return false;
}
return true;
}
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:34,代码来源:pre_payment.php
示例11: fetchSites
private function fetchSites()
{
if (!isset($this->sites)) {
$res = \CSite::GetList();
self::$sites = $res->arResult;
}
}
开发者ID:ASDAFF,项目名称:bitrix_lib,代码行数:7,代码来源:MultilangFields.trait.php
示例12: CheckFields
public static function CheckFields($ACTION, &$arFields, $ID = 0)
{
global $DB;
if ($ACTION != "ADD" && IntVal($ID) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException("System error 870164", "ERROR");
return false;
}
if ((is_set($arFields, "SITE_ID") || $ACTION == "ADD") && (is_array($arFields["SITE_ID"]) && count($arFields["SITE_ID"]) <= 0 || !is_array($arFields["SITE_ID"]) && strlen($arFields["SITE_ID"]) <= 0)) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_GS_EMPTY_SITE_ID"), "EMPTY_SITE_ID");
return false;
} elseif (is_set($arFields, "SITE_ID")) {
if (!is_array($arFields["SITE_ID"])) {
$arFields["SITE_ID"] = array($arFields["SITE_ID"]);
}
foreach ($arFields["SITE_ID"] as $v) {
$dbResult = CSite::GetByID($v);
if (!$dbResult->Fetch()) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $v, GetMessage("SONET_GS_ERROR_NO_SITE")), "ERROR_NO_SITE");
return false;
}
}
}
if ((is_set($arFields, "NAME") || $ACTION == "ADD") && strlen($arFields["NAME"]) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_GS_EMPTY_NAME"), "EMPTY_NAME");
return false;
}
if (is_set($arFields, "SORT") || $ACTION == "ADD") {
$arFields["SORT"] = intVal($arFields["SORT"]) > 0 ? intVal($arFields["SORT"]) : 100;
}
return True;
}
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:31,代码来源:group_subject.php
示例13: Fetch
function Fetch()
{
static $arSite = array();
$r = parent::Fetch();
if ($r) {
$site_id = $r["SITE_ID"];
if (!isset($arSite[$site_id])) {
$rsSite = CSite::GetList($b, $o, array("ID" => $site_id));
$arSite[$site_id] = $rsSite->Fetch();
}
$r["DIR"] = $arSite[$site_id]["DIR"];
$r["SERVER_NAME"] = $arSite[$site_id]["SERVER_NAME"];
if (strlen($r["SITE_URL"]) > 0) {
$r["URL"] = $r["SITE_URL"];
}
if (substr($r["URL"], 0, 1) == "=") {
foreach (GetModuleEvents("search", "OnSearchGetURL", true) as $arEvent) {
$r["URL"] = ExecuteModuleEventEx($arEvent, array($r));
}
}
$r["URL"] = str_replace(array("#LANG#", "#SITE_DIR#", "#SERVER_NAME#"), array($r["DIR"], $r["DIR"], $r["SERVER_NAME"]), $r["URL"]);
$r["URL"] = preg_replace("'(?<!:)/+'s", "/", $r["URL"]);
unset($r["SITE_URL"]);
}
return $r;
}
开发者ID:rasuldev,项目名称:torino,代码行数:26,代码来源:item.php
示例14: GetFormatedUserName
public static function GetFormatedUserName($userId)
{
static $userCache = array();
$userId = IntVal($userId);
if($userId > 0)
{
if (!isset($userCache[$userId]) || !is_array($userCache[$userId]))
{
$dbUser = CUser::GetByID($userId);
if ($arUser = $dbUser->Fetch())
{
$userCache[$userId] = CUser::FormatName(
CSite::GetNameFormat(false),
array(
"NAME" => $arUser["NAME"],
"LAST_NAME" => $arUser["LAST_NAME"],
"SECOND_NAME" => $arUser["SECOND_NAME"],
"LOGIN" => $arUser["LOGIN"]
),
true
);
}
}
}
return $userCache[$userId];
}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:29,代码来源:mobile_order.php
示例15: DoInstall
function DoInstall()
{
global $APPLICATION, $USER, $step, $arSitesList;
if ($USER->IsAdmin()) {
$arSitesList = array();
$rsSites = CSite::GetList($by = "sort", $order = "desc", array());
while ($arSite = $rsSites->Fetch()) {
$arSitesList[$arSite['ID']] = $arSite['NAME'];
}
$step = IntVal($step);
if ($step < 2) {
$APPLICATION->IncludeAdminFile(GetMessage("CONTENT_INCLUDER_MODULE_INSTALL_TITLE") . $this->MODULE_ID, $this->sModuleInstallFullPath . "step1.php");
} elseif ($step == 2) {
RegisterModule($this->MODULE_ID);
RegisterModuleDependences("main", "OnEndBufferContent", $this->MODULE_ID, '\\Bit\\Includer\\Handlers', "OnEndBufferContentHandler");
RegisterModuleDependences("fileman", "OnIncludeHTMLEditorScript", $this->MODULE_ID, '\\Bit\\Includer\\Handlers', "OnIncludeHTMLEditorScriptHandler");
$this->InstallFiles();
$sSiteId = array_key_exists($_REQUEST['site_id'], $arSitesList) ? $_REQUEST['site_id'] : SITE_ID;
if ($_REQUEST['install_sample_iblock'] === "Y") {
$this->createSampleIblock($sSiteId);
}
if ($_REQUEST['disable_new_editor'] === "Y") {
COption::setOptionString("fileman", "use_editor_3", "");
}
COption::SetOptionString("bit.includer", "include_jquery", $_REQUEST['include_jquery_for_component'] === "Y" ? "Y" : "N");
$APPLICATION->IncludeAdminFile(GetMessage("CONTENT_INCLUDER_MODULE_INSTALL_TITLE"), $this->sModuleInstallFullPath . "step2.php");
}
}
}
开发者ID:ASDAFF,项目名称:bit.includer,代码行数:29,代码来源:index.php
示例16: CreateWizardIndex
function CreateWizardIndex($wizardName, &$errorMessage)
{
$indexContent = '<' . '?' . 'define("WIZARD_DEFAULT_SITE_ID", "' . (defined("WIZARD_DEFAULT_SITE_ID") ? WIZARD_DEFAULT_SITE_ID : "s1") . '");' . 'require(' . '$' . '_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");' . 'require_once(' . '$' . '_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/classes/general/wizard.php");' . '$' . 'wizard = new CWizard("' . $wizardName . '");' . '$' . 'wizard->Install();' . 'require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_after.php");' . '?' . '>';
$p = $_SERVER["DOCUMENT_ROOT"] . "/index.php";
if (defined("WIZARD_DEFAULT_SITE_ID")) {
$rsSite = CSite::GetList($by = "sort", $order = "asc", array("ID" => WIZARD_DEFAULT_SITE_ID));
$arSite = $rsSite->GetNext();
$p = CSite::GetSiteDocRoot($arSite["LID"]) . $arSite["DIR"] . "/index.php";
}
$handler = @fopen($p, "wb");
if (!$handler) {
$errorMessage = InstallGetMessage("INST_WIZARD_INDEX_ACCESS_ERROR");
return false;
}
$success = @fwrite($handler, $indexContent);
if (!$success) {
$errorMessage = InstallGetMessage("INST_WIZARD_INDEX_ACCESS_ERROR");
return false;
}
if (defined("BX_FILE_PERMISSIONS")) {
@chmod($_SERVER["DOCUMENT_ROOT"] . "/index.php", BX_FILE_PERMISSIONS);
}
fclose($handler);
return true;
}
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:25,代码来源:utils.php
示例17: UnInstallDB
function UnInstallDB($arParams = array())
{
global $DB, $APPLICATION;
$this->errors = false;
if (!array_key_exists("savedata", $arParams) || $arParams["savedata"] != "Y") {
$this->errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/meeting/install/db/" . strtolower($DB->type) . "/uninstall.sql");
if ($this->errors === false && CModule::IncludeModule('forum')) {
$dbRes = CSite::GetList($by = 'sort', $order = 'asc', array());
while ($arSite = $dbRes->Fetch()) {
$forumId = COption::GetOptionInt('meeting', 'comments_forum_id', 0, $arSite['ID']);
if ($forumId > 0) {
CForumNew::Delete($forumId);
}
}
}
}
UnRegisterModuleDependences("calendar", "OnAfterCalendarConvert", "meeting", "CMeetingEventHandlers", "OnAfterCalendarConvert");
UnRegisterModuleDependences("tasks", "OnTaskDelete", "meeting", "CMeetingEventHandlers", "OnTaskDelete");
UnRegisterModule("meeting");
if ($this->errors !== false) {
$APPLICATION->ThrowException(implode("<br>", $this->errors));
return false;
}
return true;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:25,代码来源:index.php
示例18: Load
public function Load()
{
global $USER;
if (!isset($_SESSION["SESS_AUTH"]["USER_ID"]) || !$_SESSION["SESS_AUTH"]["USER_ID"]) {
$USER = new CUser();
}
$this->isLogged = true;
$defaultSite = CSite::GetList($by = "def", $order = "desc", array())->Fetch();
$this->encodingDefault = $defaultSite["CHARSET"];
$this->PrepareSettings();
$this->fp = $this->PrepareFile($this->filename . '.tmp');
if ($this->isLogged) {
$this->fpLog = $this->PrepareFile($this->logFile);
$this->WriteLog("Start Loading");
}
$this->PreWriteCatalog();
$categories = $this->GetCategories();
$this->WriteCategories($categories);
$this->PreWriteOffers();
$this->BuildOffers($categories);
$this->PostWriteOffers();
$this->PostWriteCatalog();
if ($this->isLogged) {
$this->WriteLog("Loading was ended successfully (peek memory usage: " . memory_get_peak_usage() . ")");
}
$this->CloseFile($this->fp);
$this->CloseFile($this->fpLog);
unlink($_SERVER["DOCUMENT_ROOT"] . $this->filename);
rename($_SERVER["DOCUMENT_ROOT"] . $this->filename . '.tmp', $_SERVER["DOCUMENT_ROOT"] . $this->filename);
return true;
}
开发者ID:Ksenobyte,项目名称:bitrix-module,代码行数:31,代码来源:ICMLLoader.php
示例19: prepareParams
private function prepareParams(&$arParams)
{
if (strlen($arParams["FORM_ID"]) <= 0) {
$arParams["FORM_ID"] = "POST_FORM_" . RandString(3);
}
$arParams['NAME_TEMPLATE'] = empty($arParams['NAME_TEMPLATE']) ? \CSite::GetNameFormat(false) : str_replace(array("#NOBR#", "#/NOBR#"), "", $arParams["NAME_TEMPLATE"]);
}
开发者ID:webgksupport,项目名称:alpina,代码行数:7,代码来源:class.php
示例20: fillFilterReferenceColumn
public static function fillFilterReferenceColumn(&$filterElement, Entity\ReferenceField $field)
{
if ($field->GetDataType() == 'Bitrix\\Main\\User') {
// USER
if ($filterElement['value']) {
$res = CUser::GetByID($filterElement['value']);
$user = $res->fetch();
if ($user) {
$username = CUser::FormatName(CSite::GetNameFormat(false), $user, true);
$filterElement['value'] = array('id' => $user['ID'], 'name' => $username);
} else {
$filterElement['value'] = array('id' => $filterElement['value'], 'name' => GetMessage('REPORT_USER_NOT_FOUND'));
}
} else {
$filterElement['value'] = array('id' => '');
}
} else {
if ($field->GetDataType() == 'Bitrix\\Socialnetwork\\Workgroup') {
// GROUP
if ($filterElement['value']) {
$group = CSocNetGroup::GetByID($filterElement['value']);
if ($group) {
$filterElement['value'] = array(array('id' => $group['ID'], 'title' => $group['NAME']));
} else {
$filterElement['value'] = array(array('id' => $filterElement['value'], 'title' => GetMessage('REPORT_PROJECT_NOT_FOUND')));
}
} else {
$filterElement['value'] = array(array('id' => ''));
}
}
}
}
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:32,代码来源:report_helper.php
注:本文中的CSite类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论