Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Show html
- public static function Build($Params)
- {
- global $APPLICATION;
- $id = $Params['id'];
- $Tabs = array(
- array('name' => GetMessage('EC_TAB_MONTH'), 'title' => GetMessage('EC_TAB_MONTH_TITLE'), 'id' => $id."_tab_month"),
- array('name' => GetMessage('EC_TAB_WEEK'), 'title' => GetMessage('EC_TAB_WEEK_TITLE'), 'id' => $id."_tab_week"),
- array('name' => GetMessage('EC_TAB_DAY'), 'title' => GetMessage('EC_TAB_DAY_TITLE'), 'id' => $id."_tab_day")
- );
- $bCalDAV = CCalendar::IsCalDAVEnabled() && $Params['type'] == 'user';
- // Here can be added user's dialogs, scripts, html
- $db_events = GetModuleEvents("calendar", "OnBeforeBuildSceleton");
- while($arEvent = $db_events->Fetch())
- ExecuteModuleEventEx($arEvent);
- $days = self::GetWeekDaysEx();
- ?>
- <script>
- /* Event handler for user control*/
- function bxcUserSelectorOnchange(arUsers){BX.onCustomEvent(window, 'onUserSelectorOnChange', [arUsers]);}
- </script>
- <?if ($Params['bShowSections'] || $Params['bShowSuperpose'] || $Params['bShowBanner']):?>
- <div class="bxec-sect-cont" id="<?=$id?>_sect_cont">
- <b class="r2"></b><b class="r1"></b><b class="r0"></b>
- <?if ($Params['bShowSections']):?>
- <span class="bxec-sect-cont-wrap" id="<?=$id?>sections">
- <b class="r-2"></b><b class="r-1"></b><b class="r-0"></b>
- <div class="bxec-sect-cont-inner">
- <div class="bxec-sect-title"><span class="bxec-spr bxec-flip"></span><span class="bxec-sect-title-text"><?=GetMessage('EC_T_CALENDARS')?></span>
- <a id="<?=$id?>-add-section" class="bxec-sect-top-action" href="javascript:void(0);" title="<?=GetMessage('EC_ADD_CAL_TITLE')?>" hidefocus="true" style="visibility:hidden;"><?= strtolower(GetMessage('EC_T_ADD'))?></a>
- </div>
- <div class="bxec-sect-cont-white">
- <div id="<?=$id?>sections-cont"></div>
- <?if($Params['bShowTasks']):?>
- <div id="<?=$id?>tasks-sections-cont"></div>
- <?endif;?>
- <div id="<?=$id?>caldav-sections-cont"></div>
- </div>
- </div>
- <i class="r-0"></i><i class="r-1"></i><i class="r-2"></i>
- </span>
- <?endif; /*bShowSections*/ ?>
- <?if ($Params['bShowSuperpose']):?>
- <span class="bxec-sect-cont-wrap" id="<?=$id?>sp-sections">
- <b class="r-2"></b><b class="r-1"></b><b class="r-0"></b>
- <div class="bxec-sect-cont-inner bxec-sect-superpose">
- <div class="bxec-sect-title"><span class="bxec-spr bxec-flip"></span><span class="bxec-sect-title-text"><?=GetMessage('EC_T_SP_CALENDARS')?></span>
- <a id="<?=$id?>-manage-superpose" class="bxec-sect-top-action" href="javascript:void(0);" title="<?=GetMessage('EC_ADD_EX_CAL_TITLE')?>" hidefocus="true" style="visibility:hidden;"><?= strtolower(GetMessage('EC_ADD_EX_CAL'))?></a>
- </div>
- <div class="bxec-sect-cont-white" id="<?=$id?>sp-sections-cont"></div>
- </div>
- <i class="r-0"></i><i class="r-1"></i><i class="r-2"></i>
- </span>
- <?endif; /*bShowSuperpose*/ ?>
- <?if ($Params['bShowBanner']):?>
- <span class="bxec-sect-cont-wrap" id="<?=$id?>banner">
- <div class="bxec-sect-cont-inner bxec-sect-banner">
- <div class="bxec-banner">
- <?if ($Params['bOutlook']):?>
- <div class="bxec-banner-elem bxec-ban-outlook">
- <i></i>
- <span class="bxec-banner-text" id="<?=$id?>_outl_sel"><span><?= GetMessage('EC_BAN_CONNECT_OUTL')?></span><b class="bxec-ban-arrow"></b></span>
- </div>
- <?endif;?>
- <?if ($Params['bCalDAV']):?>
- <div class="bxec-banner-elem bxec-ban-mobile">
- <i></i>
- <span class="bxec-banner-text" id="<?=$id?>_mob_sel" <?if (strlen(GetMessage('EC_BAN_CONNECT_MOBI')) < 30) {echo 'style="margin-top:9px!important;"';}?>><span><?= GetMessage('EC_BAN_CONNECT_MOBI')?></span><b class="bxec-ban-arrow"></b></span>
- </div>
- <?endif;?>
- <?if ($Params['bExchange']):?>
- <div class="bxec-banner-elem bxec-ban-exch<?if ($Params['bExchangeConnected']) {echo ' bxec-ban-exch-connected';}?>" title="<?= ($Params['bExchangeConnected'] ? GetMessage('EC_BAN_CONNECT_EXCH_TITLE') : GetMessage('EC_BAN_NOT_CONNECT_EXCH_TITLE'))?>">
- <i></i>
- <span class="bxec-banner-text">
- <span class="bxec-banner-text-ok">
- <?= GetMessage('EC_BAN_CONNECT_EXCH')?>
- <a href="javascript:void('');" id="<?=$id?>_exch_sync" title="<?= GetMessage('EC_BAN_EXCH_SYNC_TITLE')?>"><?= GetMessage('EC_BAN_EXCH_SYNC')?></a>
- </span>
- <span class="bxec-banner-text-warn">
- <?= GetMessage('EC_BAN_NOT_CONNECT_EXCH')?>
- </span>
- </span>
- <span class="bxec-banner-status"></span>
- </div>
- <?endif;?>
- <a href="javascript:void('');" class="bxec-close" id="<?=$id?>_ban_close" title="<?= GetMessage('EC_T_CLOSE')?>"></a>
- </div>
- </div>
- </span>
- <?endif; /*bShowBanner*/ ?>
- <i class="r0"></i><i class="r1"></i><i class="r2"></i>
- </div>
- <?endif; /* bShowSections || bShowSuperpose || bShowBanner*/?>
- <div class="bxcal-loading" id="<?=$id?>_bxcal" style="">
- <div class="bxcal-wait"></div>
- <div class="bxec-tabs-cnt">
- <div class="bxec-tabs-div">
- <?foreach($Tabs as $tab):?>
- <div class="bxec-tab-div" title="<?=$tab['title']?>" id="<?=$tab['id']?>">
- <b></b><div class="bxec-tab-c"><span><?=$tab['name']?></span></div><i></i>
- </div>
- <?endforeach;?>
- </div>
- <div class="bxec-bot-bg"></div>
- <div class="bxec-view-selector-cont">
- <div id="<?=$id?>_selector" class="bxec-selector-cont">
- <a class="bxec-sel-left" id="<?=$id?>selector-prev"></a>
- <span class="bxec-sel-cont">
- <a class="bxec-sel-but" id="<?=$id?>selector-cont"><b></b><span class="bxec-sel-but-inner" id="<?=$id?>selector-cont-inner"><span class="bxec-sel-but-arr"></span></span><i></i></a>
- </span>
- <a class="bxec-sel-right" id="<?=$id?>selector-next"></a>
- </div>
- <div id="bxec_month_win_<?=$id?>" class="bxec-month-dialog">
- <div class="bxec-md-year-selector">
- <a class="bxec-sel-left" id="<?=$id?>md-selector-prev"></a>
- <span class="bxec-md-year-text"><span class="bxec-md-year-text-inner" id="<?=$id?>md-year"></span></span>
- <a class="bxec-sel-right" id="<?=$id?>md-selector-next"></a>
- </div>
- <div class="bxec-md-month-list" id="<?=$id?>md-month-list"></div>
- </div>
- </div>
- <div id="<?=$id?>_buttons_cont" class="bxec-buttons-cont"></div>
- </div>
- <div>
- <table class="BXEC-Calendar" cellPadding="0" cellSpacing="0" id="<?=$id?>_scel_table_month" style="display:none;">
- <tr class="bxec-days-title"><td>
- <!--Don't insert spases inside DOM layout!-->
- <div id="<?=$id?>_days_title" class="bxc-month-title"><?foreach($days as $day):?><b id="<?=$id.'_'.$day['2']?>" title="<?= $day['0']?>"><i><?= $day['1']?></i></b><?endforeach;?></div>
- </td></tr>
- <tr><td class="bxec-days-grid-td"><div id="<?=$id?>_days_grid" class="bxec-days-grid-cont"></div>
- </td></tr>
- </table>
- <table class="BXEC-Calendar-week" id="<?=$id?>_scel_table_week" cellPadding="0" cellSpacing="0" style="display:none;">
- <tr class="bxec-days-tbl-title"><td class="bxec-pad"><div class="bxec-day-t-event-holder"></div><img src="/bitrix/images/1.gif" width="40" height="1"/></td><td class="bxec-pad2"><img src="/bitrix/images/1.gif" width="16" height="1"/></td></tr>
- <tr class="bxec-days-tbl-more-ev"><td class="bxec-pad"></td><td class="bxec-pad2"></td></tr>
- <tr class="bxec-days-tbl-grid"><td class="bxec-cont"><div class="bxec-timeline-div"></div></td></tr>
- </table>
- <table class="BXEC-Calendar-week" id="<?=$id?>_scel_table_day" cellPadding="0" cellSpacing="0" style="display:none;">
- <tr class="bxec-days-tbl-title"><td class="bxec-pad"><div class="bxec-day-t-event-holder"></div><img src="/bitrix/images/1.gif" width="40" height="1" /></td><td class="bxec-pad2"><img src="/bitrix/images/1.gif" width="16" height="1" /></td></tr>
- <tr class="bxec-days-tbl-more-ev"><td class="bxec-pad"></td><td class="bxec-pad2"></td></tr>
- <tr class="bxec-days-tbl-grid"><td class="bxec-cont"><div class="bxec-timeline-div"></div></td></tr>
- </table>
- </div>
- </div>
- <?
- self::BuildDialogs($Params);
- if($Params['bShowTasks'])
- {
- ?>
- <script>
- // Js event handlers which will be captured in calendar's js
- function onPopupTaskAdded(arTask){BX.onCustomEvent(window, 'onCalendarPopupTaskAdded', [arTask]);}
- function onPopupTaskChanged(arTask){BX.onCustomEvent(window, 'onCalendarPopupTaskChanged', [arTask]);}
- function onPopupTaskDeleted(taskId){BX.onCustomEvent(window, 'onCalendarPopupTaskDeleted', [taskId]);}
- </script>
- <?
- $APPLICATION->IncludeComponent(
- "bitrix:tasks.iframe.popup",
- "",
- array(
- "ON_TASK_ADDED" => "onPopupTaskAdded",
- "ON_TASK_CHANGED" => "onPopupTaskChanged",
- "ON_TASK_DELETED" => "onPopupTaskDeleted",
- "TASKS_LIST" => $Params['arTaskIds']
- ),
- null,
- array("HIDE_ICONS" => "Y")
- );
- }
- //CCalendar::GetUserfieldsEditHtml(0);
- // Here can be added user's dialogs, scripts, html
- $db_events = GetModuleEvents("calendar", "OnAfterBuildSceleton");
- while($arEvent = $db_events->Fetch())
- ExecuteModuleEventEx($arEvent);
- }
Advertisement
Add Comment
Please, Sign In to add comment