public static function getUserDevices($userId) { $arResult = array(); if (CModule::IncludeModule("pull")) { $dbres = CPullPush::GetList(array(), array("USER_ID" => $userId)); while ($arDb = $dbres->Fetch()) { if ($arDb["DEVICE_TYPE"] == "APPLE") { CModule::IncludeModule("mobileapp"); CMobile::Init(); /* if(CMobile::$isDev) $protocol = 1; else */ $protocol = 2; } else { $protocol = 3; } $arResult[] = $arDb["DEVICE_TOKEN"] . ":" . $protocol . ":BitrixAdmin"; } } return $arResult; }
<?php require $_SERVER["DOCUMENT_ROOT"] . "/mobile/headers.php"; define('MOBILE_TEMPLATE_CSS', "/im_styles.css"); require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/header.php"; \Bitrix\Main\Data\AppCacheManifest::getInstance()->addAdditionalParam("api_version", CMobile::getApiVersion()); \Bitrix\Main\Data\AppCacheManifest::getInstance()->addAdditionalParam("platform", CMobile::getPlatform()); \Bitrix\Main\Data\AppCacheManifest::getInstance()->addAdditionalParam("im-dialog", 'v3'); \Bitrix\Main\Data\AppCacheManifest::getInstance()->addAdditionalParam("version", "v5"); \Bitrix\Main\Data\AppCacheManifest::getInstance()->addAdditionalParam("user", $USER->GetId()); $APPLICATION->IncludeComponent("bitrix:mobile.im.dialog", ".default", array(), false, array("HIDE_ICONS" => "Y")); require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/footer.php";
<?php require_once $_SERVER["DOCUMENT_ROOT"] . '/bitrix/modules/mobileapp/include/prolog_admin_mobile_before.php'; CMobile::getInstance()->setLargeScreenSupport(false); CMobile::getInstance()->setScreenCategory('NORMAL'); IncludeModuleLangFile(__FILE__); $arParams = array("SYNC_REQUEST_PATH" => MOBILE_APP_ADMIN_PATH, "MENU_FILE_PATH" => MOBILE_APP_MENU_FILE, "BUILD_MENU_EVENT_NAME" => MOBILE_APP_BUILD_MENU_EVENT_NAME, "MENU_TITLE" => GetMessage("MOBILEAPP_MENU_TITLE")); $APPLICATION->IncludeComponent('bitrix:mobileapp.menu', '.default', $arParams, false, array('HIDE_ICONS' => 'Y')); ?> <script type="text/javascript"> var pullParams = { enable:true, pulltext:"<?php echo GetMessage("PULL_TEXT"); ?> ", downtext:"<?php echo GetMessage("DOWN_TEXT"); ?> ", loadtext:"<?php echo GetMessage("LOAD_TEXT"); ?> " }; if(app.enableInVersion(2)) pullParams.action = "RELOAD"; else pullParams.callback = function(){document.location.reload();};
echo isset($arEvent["CAN_ADD_COMMENTS"]) && $arEvent["CAN_ADD_COMMENTS"] == "Y" ? "true" : "false"; ?> ; </script><?php if ($_REQUEST["empty_get_form"] == "Y") { $APPLICATION->RestartBuffer(); } ?> <script> app.setPageID('LOG_ENTRY_<?php echo $arEvent["EVENT"]["ID"]; ?> '); </script><?php if (!$arParams["IS_LIST"] && isset($arEvent["HAS_COMMENTS"]) && $arEvent["HAS_COMMENTS"] == "Y" && isset($arEvent["CAN_ADD_COMMENTS"]) && $arEvent["CAN_ADD_COMMENTS"] == "Y") { if (CMobile::getApiVersion() >= 4) { ?> <script> commentVarSiteID = '<?php echo CUtil::JSEscape(SITE_ID); ?> '; commentVarLanguageID = '<?php echo CUtil::JSEscape(LANGUAGE_ID); ?> '; commentVarLogID = <?php echo intval($arParams["LOG_ID"]); ?> ; commentVarDateTimeFormat = '<?php
<?php define('NO_KEEP_STATISTIC', true); define('NO_AGENT_STATISTIC', true); define('NOT_CHECK_PERMISSIONS', true); require $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_admin_before.php'; CComponentUtil::__IncludeLang(dirname($_SERVER["SCRIPT_NAME"]), "/ajax.php"); $arResult = array(); if (!CModule::IncludeModule("mobileapp")) { $arResult["ERROR"] = GetMessage("MOBILEAPP_NOT_INSTALLED"); } if (!$USER->IsAuthorized() || !check_bitrix_sessid()) { $arResult["ERROR"] = GetMessage("MOBILEAPP_ACCESS_DENIED"); } if (!isset($arResult["ERROR"])) { CMobile::Init(); $action = isset($_REQUEST['action']) ? trim($_REQUEST['action']) : ''; $token = $_REQUEST["device_token"]; $arFields = array("USER_ID" => $USER->GetID(), "DEVICE_NAME" => $_REQUEST["device_name"], "DEVICE_TYPE" => $_REQUEST["device_type"], "DEVICE_ID" => $_REQUEST["uuid"], "DEVICE_TOKEN" => $token, "APP_ID" => "BitrixAdmin"); switch ($action) { case 'app_loaded': foreach (GetModuleEvents("mobileapp", "OnAdminMobileAppLoaded", true) as $arHandler) { ExecuteModuleEventEx($arHandler, $arFields); } break; case 'save_device_token': if (!$_REQUEST["device_token"]) { break; } if (!CModule::IncludeModule("pull")) { $arResult["ERROR"] = GetMessage("MOBILEAPP_PULL_NOT_INSTALLED");
<?php require $_SERVER["DOCUMENT_ROOT"] . "/eshop_app/headers.php"; require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/header.php"; CModule::IncludeModule('pull'); CJSCore::Init(array('pull')); $APPLICATION->AddHeadString(' <script type="text/javascript"> app.enableSliderMenu(true); </script> '); CMobile::getInstance()->setLargeScreenSupport(false); CMobile::getInstance()->setScreenCategory("NORMAL"); $arParams = array("MENU_FILE_PATH" => SITE_DIR . "eshop_app/.eshopapp_menu.php"); $APPLICATION->IncludeComponent('bitrix:mobileapp.menu', 'mobile', $arParams, false, array('HIDE_ICONS' => 'Y')); //$APPLICATION->IncludeComponent("bitrix:eshopapp.menu", "", array(), false, Array("HIDE_ICONS" => "Y")); // PUSH Module Event require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/footer.php";
$eventHandlerID = AddEventHandler('main', 'system.field.view.file', '__blogUFfileShowMobile'); foreach ($comment["COMMENT_PROPERTIES"]["DATA"] as $FIELD_NAME => $arPostField) { if (!empty($arPostField["VALUE"])) { $APPLICATION->IncludeComponent("bitrix:system.field.view", $arPostField["USER_TYPE"]["USER_TYPE_ID"], array("arUserField" => $arPostField, "MOBILE" => "Y"), null, array("HIDE_ICONS" => "Y")); } } if ($eventHandlerID !== false && intval($eventHandlerID) > 0) { RemoveEventHandler('main', 'system.field.view.file', $eventHandlerID); } ?> </div><?php } if (strlen($strBottomBlock) > 0) { echo $strBottomBlock; } if (CMobile::getApiVersion() >= 10) { ?> <div class="post-comment-reply"><?php ?> <div class="post-comment-reply-text" onclick="oMSL.replyToComment(<?php echo intval($comment["AUTHOR_ID"]); ?> , '<?php echo CUtil::JSEscape($nameFormatted); ?> ', event);"><?php echo GetMessage('BLOG_C_REPLY'); ?> </div><?php ?> </div><?php
CJSCore::Init('ajax'); ?> <title><?php $APPLICATION->ShowTitle(); ?> </title> </head> <?php $APPLICATION->IncludeComponent("bitrix:eshopapp.data", "", array(), false, array("HIDE_ICONS" => "Y")); ?> <body id="body" class="<?php echo $APPLICATION->ShowProperty("BodyClass"); ?> "> <?php if (!CMobile::getInstance()->getDevice()) { $APPLICATION->ShowPanel(); } ?> <script type="text/javascript"> app.pullDown({ enable:true, callback:function(){document.location.reload();}, downtext:"<?php echo GetMessage("MB_PULLDOWN_DOWN"); ?> ", pulltext:"<?php echo GetMessage("MB_PULLDOWN_PULL"); ?>
} // Footer under the table $strFooter = $count > 0 ? GetMessage('MB_CAL_EVENTS_COUNT', array("#COUNT#" => $count)) : GetMessage('MB_CAL_NO_EVENTS'); // Kill unused sections if (!$bToday && !$bTomorrow) { $use_sections = "NO"; $arSections = array(); } else { $arSections_ = array(); foreach ($arSections as $ind => $sect) { if ($sect['ID'] == 'today' && $bToday) { $arSections_[] = $sect; } if ($sect['ID'] == 'tomorrow' && $bTomorrow) { $arSections_[] = $sect; } if ($sect['ID'] == 'later' && $bLater) { $arSections_[] = $sect; } } $arSections = $arSections_; } $res = array("TABLE_SETTINGS" => array("footer" => CMobile::PrepareStrToJson($strFooter), "use_sections" => $use_sections)); if ($use_sections != "NO") { $res["data"] = array("events" => $arResult['EVENTS']); $res["sections"] = array("events" => $arSections); } else { $res["data"] = $arResult['EVENTS']; } return $res; }
$arParams["NAME_TEMPLATE_WO_NOBR"] = str_replace(array("#NOBR#", "#/NOBR#"), array("", ""), $arParams["NAME_TEMPLATE"]); $arParams["NAME_TEMPLATE"] = $arParams["NAME_TEMPLATE_WO_NOBR"]; if (!isset($arParams["SHOW_LOGIN"])) { $arParams["SHOW_LOGIN"] = $arParams["SHOW_LOGIN"] != "N" ? "Y" : "N"; } $bUseLogin = $arParams["SHOW_LOGIN"] != "N" ? true : false; $arParams["AVATAR_SIZE"] = isset($arParams["AVATAR_SIZE"]) ? intval($arParams["AVATAR_SIZE"]) : 58; $arParams["AVATAR_SIZE_COMMENT"] = isset($arParams["AVATAR_SIZE_COMMENT"]) ? intval($arParams["AVATAR_SIZE_COMMENT"]) : 58; $arResult["AJAX_CALL"] = array_key_exists("AJAX_CALL", $_REQUEST) && $_REQUEST["AJAX_CALL"] == "Y" && ($_REQUEST["RELOAD"] != "Y" || $_REQUEST["ACTION"] == "EDIT_POST"); $arResult["RELOAD"] = $_REQUEST["RELOAD"] == "Y"; $arParams["EMPTY_PAGE"] = array_key_exists("empty", $_REQUEST) && $_REQUEST["empty"] == "Y" ? "Y" : "N"; $arParams["COMMENTS_IN_EVENT"] = isset($arParams["COMMENTS_IN_EVENT"]) && intval($arParams["COMMENTS_IN_EVENT"]) > 0 ? $arParams["COMMENTS_IN_EVENT"] : "3"; $arParams["DESTINATION_LIMIT"] = isset($arParams["DESTINATION_LIMIT"]) ? intval($arParams["DESTINATION_LIMIT"]) : 100; $arParams["DESTINATION_LIMIT_SHOW"] = isset($arParams["DESTINATION_LIMIT_SHOW"]) ? intval($arParams["DESTINATION_LIMIT_SHOW"]) : 3; if (CModule::IncludeModule("mobileapp")) { $min_dimension = min(array(intval(CMobile::getInstance()->getDevicewidth()), intval(CMobile::getInstance()->getDeviceheight()))); if ($min_dimension < 650) { $min_dimension = 650; } elseif ($min_dimension < 1300) { $min_dimension = 1300; } else { $min_dimension = 2050; } $arParams["IMAGE_MAX_WIDTH"] = intval(($min_dimension - 100) / 2); } if ($_REQUEST["ACTION"] == "CONVERT" && $arParams["LOG_ID"] <= 0) { $arConvertRes = CSocNetLogTools::GetDataFromRatingEntity($_REQUEST["ENTITY_TYPE_ID"], $_REQUEST["ENTITY_ID"]); if (is_array($arConvertRes) && $arConvertRes["LOG_ID"] > 0) { $arParams["LOG_ID"] = $arConvertRes["LOG_ID"]; } }
} ?> </div> </div> <?php } ?> <?php if (is_array($arResult['DISPLAY_PROPERTIES']) && count($arResult['DISPLAY_PROPERTIES']) > 0) { $arPropertyRecommend = $arResult["DISPLAY_PROPERTIES"]["RECOMMEND"]; unset($arResult["DISPLAY_PROPERTIES"]["RECOMMEND"]); if (is_array($arResult['DISPLAY_PROPERTIES']) && count($arResult['DISPLAY_PROPERTIES']) > 0) { ?> <div class="detail_item_description info <?php if (!CMobile::getInstance()->isLarge()) { echo "close"; } ?> "> <h3 onclick="OpenClose(BX(this).parentNode)"><?php echo GetMessage("CATALOG_PROPERTIES"); ?> <span class="detail_item_arrow"></span></h3> <div class="detail_item_description_text"> <ul> <?php foreach ($arResult["DISPLAY_PROPERTIES"] as $pid => $arProperty) { ?> <li> <table>
$id = intVal($_POST['event_id']); $sectId = intVal($_POST['sect_id']); $newMeeting = $_POST['new_meeting'] == 'Y'; $from_ts = $_POST['from_ts']; $to_ts = $_POST['to_ts']; if (isset($_POST['skip_time']) && $_POST['skip_time'] == 'Y') { $from_ts = CCalendar::_fixTimestamp($from_ts); $to_ts = CCalendar::_fixTimestamp($to_ts); } $arFields = array("ID" => $id, "CAL_TYPE" => $_POST['cal_type'], "OWNER_ID" => $_POST['owner_id'], "DT_FROM_TS" => $from_ts, "DT_TO_TS" => $to_ts, "SKIP_TIME" => isset($_POST['skip_time']) && $_POST['skip_time'] == 'Y', 'NAME' => CMobile::ConvertFromUtf(trim($_POST['name'])), 'DESCRIPTION' => CMobile::ConvertFromUtf(trim($_POST['desc'])), 'SECTIONS' => array($sectId), 'ACCESSIBILITY' => $_POST['accessibility'], 'IMPORTANCE' => $_POST['importance'], 'PRIVATE_EVENT' => $_POST['private_event'] == "Y", "REMIND" => $_POST['remind'], 'LOCATION' => array(), "IS_MEETING" => !empty($_POST['attendees'])); // LOCATION if (is_array($_POST['location']) && !empty($_POST['location'])) { $arFields['LOCATION'] = $_POST['location']; $arFields['LOCATION']['CHANGED'] = $arFields['LOCATION']['CHANGED'] == 'Y'; $arFields['LOCATION']['NEW'] = CMobile::ConvertFromUtf($arFields['LOCATION']['NEW']); $arFields['LOCATION']['OLD'] = CMobile::ConvertFromUtf($arFields['LOCATION']['OLD']); if ($arFields['LOCATION']['CHANGED']) { $loc = CCalendar::UnParseTextLocation($arFields['LOCATION']['NEW']); $arFields['LOCATION']['NEW'] = $loc['NEW']; } } if (isset($_POST['rrule']) && $_POST['rrule'] == '') { $arFields['RRULE'] = ''; } if ($arFields['IS_MEETING']) { $arFields['ATTENDEES'] = $_POST['attendees']; $arFields['ATTENDEES'] = $_POST['attendees']; if ($newMeeting && !in_array($ownerId, $arFields['ATTENDEES'])) { $arFields['ATTENDEES'][] = $ownerId; } $arFields['MEETING_HOST'] = $ownerId;
echo $arParams["LOG_ID"]; ?> ', more_overlay_id: 'post_more_block_<?php echo $arParams["LOG_ID"]; ?> ', more_button_id: 'post_more_limiter_<?php echo $arParams["LOG_ID"]; ?> ' }; }); </script><?php if (!$arParams["IS_LIST"]) { if (CMobile::getApiVersion() < 4 && CMobile::getPlatform() != "android") { ?> </div><?php // post-card-wrap } // comments form block if ($arResult["GetCommentsFormOnly"]) { $APPLICATION->RestartBuffer(); } if ($arCommentsResult["CanUserComment"]) { echo $commentsFormBlock; } if ($arResult["GetCommentsFormOnly"]) { die; } }
$bExtranetInstalled = CModule::IncludeModule("extranet") && CExtranet::GetExtranetSiteID(); $arSelectParams = array("FIELDS" => array("PERSONAL_PHOTO")); if ($bExtranetInstalled) { $arSelectParams["SELECT"] = array("UF_DEPARTMENT"); } $dbuser = CUser::GetList($by = array("last_name" => "asc", "name" => "asc"), $order = false, array("ID" => $USER->GetID()), $arSelectParams); $curUser = $dbuser->Fetch(); $img_src = ""; if (intval($curUser["PERSONAL_PHOTO"]) > 0) { $arImage = CFile::ResizeImageGet($curUser["PERSONAL_PHOTO"], array("width" => 64, "height" => 64), BX_RESIZE_IMAGE_EXACT, false); if ($arImage && strlen($arImage["src"]) > 0) { $img_src = $arImage["src"]; } } $bExtranetUser = $bExtranetInstalled && intval($curUser["UF_DEPARTMENT"][0]) <= 0; if (!$bExtranetUser || CMobile::getApiVersion() >= 9 || intval($_GET["api_version"]) >= 9) { $data = array("status" => "success", "page_mark" => "<!--bitrix_mobile_app-->", "sessid_md5" => bitrix_sessid(), "target" => md5($USER->GetID() . CMain::GetServerUniqID()), "photoUrl" => $img_src, "useModernStyle" => true, "appmap" => array("main" => array("url" => $params["START_PAGE"] ? $params["START_PAGE"] : "", "bx24ModernStyle" => true), "menu" => array("url" => $params["MENU_PAGE"] ? $params["MENU_PAGE"] : ""))); if (\Bitrix\MobileApp\Mobile::getInstance()->getApiVersion() >= 10 && strlen($params["CHAT_PAGE"]) > 0) { $data["appmap"]["right"] = array("url" => $params["CHAT_PAGE"]); } if ($bExtranetUser) { $rsSites = CSite::GetByID(CExtranet::GetExtranetSiteID()); if (($arExtranetSite = $rsSites->Fetch()) && $arExtranetSite["ACTIVE"] != "N") { $data["whiteList"] = array($arExtranetSite["DIR"] . "mobile/"); $data["appmap"] = array("main" => array("url" => $arExtranetSite["DIR"] . "mobile/index.php", "bx24ModernStyle" => true), "menu" => array("url" => $arExtranetSite["DIR"] . "mobile/left.php"), "right" => array("url" => $arExtranetSite["DIR"] . "mobile/im/right.php")); if (\Bitrix\MobileApp\Mobile::getInstance()->getApiVersion() >= 10) { $data["appmap"]["right"] = array("url" => $arExtranetSite["DIR"] . "mobile/im/right.php"); } } } if (toUpper(SITE_CHARSET) != "UTF-8") {
<?php define("NOT_CHECK_FILE_PERMISSIONS", true); define("BX_MOBILE_LOG", true); require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php"; header("Content-Type: application/x-javascript"); CModule::IncludeModule("mobileapp"); $platform = strtolower(CMobile::getInstance()->getPlatform()); echo \Bitrix\MobileApp\Designer\Manager::getConfigJSON("#code#", $platform); die;
public function executeMobile($task = '') { CFactory::load('libraries', 'mobile'); $view =& $this->getView(JRequest::getCmd('view', 'frontpage')); // Fetch content ob_start(); if (!empty($task) && method_exists($this, $task)) { $this->{$task}(); } else { $this->display(); } $content = ob_get_contents(); ob_end_clean(); // Swap joomla document with // CDocumentMobile or CDocumentMobileAjax $document =& JFactory::getDocument(); if (JRequest::getCmd('section') == 'content') { $document = new CDocumentMobileAjax($document); echo $content; } else { $document = new CDocumentMobile($document); // Add our scripts & stylesheets CTemplate::addScript('script.mobile-1.0'); CTemplate::addScript('joms.ajax'); CTemplate::addStylesheet('style.mobile'); // Fetch toolbar ob_start(); $view->showToolbarMobile(); $toolbar = ob_get_contents(); ob_end_clean(); // Fetch switcher ob_start(); CMobile::showSwitcher(); $switcher = ob_get_contents(); ob_end_clean(); $tmpl = new CTemplate(); $tmpl->set('toolbar', $toolbar); $tmpl->set('content', $content); $tmpl->set('switcher', $switcher); echo $tmpl->fetch('mobile.index'); } }
/** * Gets the value of self::$apiVersion * * @param $apiVersion */ public static function setApiVersion($apiVersion) { self::$apiVersion = $apiVersion; }
public static function getDeviceResizeWidth() { $max_dimension = false; if (CMobile::getInstance()->getApiVersion() > 1) { $max_dimension = max(array(intval(CMobile::getInstance()->getDevicewidth()), intval(CMobile::getInstance()->getDeviceheight()))); if ($max_dimension < 650) { $max_dimension = 650; } elseif ($max_dimension < 1300) { $max_dimension = 1300; } else { $max_dimension = 2050; } } return $max_dimension; }
return; } global $USER; $arUser = $arResult["User"]; $userJson = CUtil::PhpToJSObject(array_change_key_case($arUser, CASE_LOWER)); ?> <script type="text/javascript"> BX.message(<?php echo CUtil::PhpToJSObject(array("SONET_MESSAGE" => GetMessage("SONET_MESSAGE"), "SONET_AUDIO_CALL" => GetMessage("SONET_AUDIO_CALL"), "SONET_VIDEO_CALL" => GetMessage("SONET_VIDEO_CALL"), "SONET_TITLE" => GetMessage("SONET_TITLE"), "MB_CALL" => GetMessage("MB_CALL"), "STATUS_ONLINE" => GetMessage("STATUS_ONLINE"), "STATUS_OFFLINE" => GetMessage("STATUS_OFFLINE"), "MB_CANCEL" => GetMessage("MB_CANCEL"), "PULL_TEXT" => GetMessage("PULL_TEXT"), "DOWN_TEXT" => GetMessage("DOWN_TEXT"), "LOAD_TEXT" => GetMessage("LOAD_TEXT"), "USER_TASKS" => GetMessage("MB_TASKS_AT_SOCNET_USER_CPT_MENU_ITEM_LIST"), "USER_FILES" => GetMessage("MB_FILES_AT_SOCNET_USER_CPT_MENU_ITEM_LIST"), "REINVITE" => GetMessage("MB_REINVITE_USER_CPT_MENU_ITEM_LIST"), "INVITE_MESSAGE" => GetMessage("MB_INVITE_MESSAGE"))); ?> ); BX.Mobile.Profile.init({ isWebRTCSupported: <?php echo CMobile::getInstance()->isWebRtcSupported() ? "true" : "false"; ?> , userPhotoUrl: <?php echo $arResult["USER_PERSONAL_PHOTO_SRC"] ? "\"" . CUtil::JSEscape($arResult["USER_PERSONAL_PHOTO_SRC"]["src"]) . "\"" : "false"; ?> , pullDown: { enable: true, pulltext: BX.message("PULL_TEXT"), downtext: BX.message("DOWN_TEXT"), loadtext: BX.message("LOAD_TEXT") }, user: <?php echo $userJson; ?>