Guest User

Untitled

a guest
Aug 20th, 2012
745
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     // Show html
  2.     public static function Build($Params)
  3.     {
  4.         global $APPLICATION;
  5.         $id = $Params['id'];
  6.  
  7.         $Tabs = array(
  8.             array('name' => GetMessage('EC_TAB_MONTH'), 'title' => GetMessage('EC_TAB_MONTH_TITLE'), 'id' => $id."_tab_month"),
  9.             array('name' => GetMessage('EC_TAB_WEEK'), 'title' => GetMessage('EC_TAB_WEEK_TITLE'), 'id' => $id."_tab_week"),
  10.             array('name' => GetMessage('EC_TAB_DAY'), 'title' => GetMessage('EC_TAB_DAY_TITLE'), 'id' => $id."_tab_day")
  11.         );
  12.  
  13.         $bCalDAV = CCalendar::IsCalDAVEnabled() && $Params['type'] == 'user';
  14.  
  15.         // Here can be added user's dialogs, scripts, html
  16.         $db_events = GetModuleEvents("calendar", "OnBeforeBuildSceleton");
  17.         while($arEvent = $db_events->Fetch())
  18.             ExecuteModuleEventEx($arEvent);
  19.  
  20.         $days = self::GetWeekDaysEx();
  21.         ?>
  22. <script>
  23. /* Event handler for user control*/
  24. function bxcUserSelectorOnchange(arUsers){BX.onCustomEvent(window, 'onUserSelectorOnChange', [arUsers]);}
  25. </script>
  26.         <?if ($Params['bShowSections'] || $Params['bShowSuperpose'] || $Params['bShowBanner']):?>
  27. <div class="bxec-sect-cont" id="<?=$id?>_sect_cont">
  28.     <b class="r2"></b><b class="r1"></b><b class="r0"></b>
  29.         <?if ($Params['bShowSections']):?>
  30.         <span class="bxec-sect-cont-wrap" id="<?=$id?>sections">
  31.             <b class="r-2"></b><b class="r-1"></b><b class="r-0"></b>
  32.             <div class="bxec-sect-cont-inner">
  33.                 <div class="bxec-sect-title"><span class="bxec-spr bxec-flip"></span><span class="bxec-sect-title-text"><?=GetMessage('EC_T_CALENDARS')?></span>
  34.                 <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>
  35.                 </div>
  36.                 <div class="bxec-sect-cont-white">
  37.                     <div id="<?=$id?>sections-cont"></div>
  38.                     <?if($Params['bShowTasks']):?>
  39.                     <div id="<?=$id?>tasks-sections-cont"></div>
  40.                     <?endif;?>
  41.                     <div id="<?=$id?>caldav-sections-cont"></div>
  42.                 </div>
  43.             </div>
  44.             <i class="r-0"></i><i class="r-1"></i><i class="r-2"></i>
  45.         </span>
  46.         <?endif; /*bShowSections*/ ?>
  47.  
  48.         <?if ($Params['bShowSuperpose']):?>
  49.         <span class="bxec-sect-cont-wrap" id="<?=$id?>sp-sections">
  50.             <b class="r-2"></b><b class="r-1"></b><b class="r-0"></b>
  51.             <div class="bxec-sect-cont-inner bxec-sect-superpose">
  52.                 <div class="bxec-sect-title"><span class="bxec-spr bxec-flip"></span><span class="bxec-sect-title-text"><?=GetMessage('EC_T_SP_CALENDARS')?></span>
  53.                 <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>
  54.                 </div>
  55.                 <div class="bxec-sect-cont-white"  id="<?=$id?>sp-sections-cont"></div>
  56.             </div>
  57.             <i class="r-0"></i><i class="r-1"></i><i class="r-2"></i>
  58.         </span>
  59.         <?endif; /*bShowSuperpose*/ ?>
  60.  
  61.         <?if ($Params['bShowBanner']):?>
  62.         <span class="bxec-sect-cont-wrap" id="<?=$id?>banner">
  63.             <div class="bxec-sect-cont-inner bxec-sect-banner">
  64.                 <div class="bxec-banner">
  65.                     <?if ($Params['bOutlook']):?>
  66.                     <div class="bxec-banner-elem bxec-ban-outlook">
  67.                         <i></i>
  68.                         <span class="bxec-banner-text" id="<?=$id?>_outl_sel"><span><?= GetMessage('EC_BAN_CONNECT_OUTL')?></span><b class="bxec-ban-arrow"></b></span>
  69.                     </div>
  70.                     <?endif;?>
  71.                     <?if ($Params['bCalDAV']):?>
  72.                     <div class="bxec-banner-elem bxec-ban-mobile">
  73.                         <i></i>
  74.                         <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>
  75.                     </div>
  76.                     <?endif;?>
  77.  
  78.                     <?if ($Params['bExchange']):?>
  79.                     <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'))?>">
  80.                         <i></i>
  81.                         <span class="bxec-banner-text">
  82.                         <span class="bxec-banner-text-ok">
  83.                             <?= GetMessage('EC_BAN_CONNECT_EXCH')?>
  84.                             <a href="javascript:void('');"  id="<?=$id?>_exch_sync" title="<?= GetMessage('EC_BAN_EXCH_SYNC_TITLE')?>"><?= GetMessage('EC_BAN_EXCH_SYNC')?></a>
  85.                         </span>
  86.                         <span class="bxec-banner-text-warn">
  87.                             <?= GetMessage('EC_BAN_NOT_CONNECT_EXCH')?>
  88.                         </span>
  89.                         </span>
  90.                         <span class="bxec-banner-status"></span>
  91.                     </div>
  92.                     <?endif;?>
  93.                     <a href="javascript:void('');" class="bxec-close"  id="<?=$id?>_ban_close" title="<?= GetMessage('EC_T_CLOSE')?>"></a>
  94.                 </div>
  95.             </div>
  96.         </span>
  97.         <?endif; /*bShowBanner*/ ?>
  98.     <i class="r0"></i><i class="r1"></i><i class="r2"></i>
  99. </div>
  100.         <?endif; /* bShowSections || bShowSuperpose || bShowBanner*/?>
  101.  
  102. <div class="bxcal-loading" id="<?=$id?>_bxcal" style="">
  103. <div class="bxcal-wait"></div>
  104. <div class="bxec-tabs-cnt">
  105.     <div class="bxec-tabs-div">
  106.         <?foreach($Tabs as $tab):?>
  107.         <div class="bxec-tab-div" title="<?=$tab['title']?>" id="<?=$tab['id']?>">
  108.             <b></b><div class="bxec-tab-c"><span><?=$tab['name']?></span></div><i></i>
  109.         </div>
  110.         <?endforeach;?>
  111.     </div>
  112.     <div class="bxec-bot-bg"></div>
  113.  
  114.     <div class="bxec-view-selector-cont">
  115.         <div id="<?=$id?>_selector" class="bxec-selector-cont">
  116.         <a class="bxec-sel-left"  id="<?=$id?>selector-prev"></a>
  117.         <span class="bxec-sel-cont">
  118.             <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>
  119.         </span>
  120.         <a class="bxec-sel-right" id="<?=$id?>selector-next"></a>
  121.         </div>
  122.         <div id="bxec_month_win_<?=$id?>" class="bxec-month-dialog">
  123.             <div class="bxec-md-year-selector">
  124.                 <a class="bxec-sel-left"  id="<?=$id?>md-selector-prev"></a>
  125.                 <span class="bxec-md-year-text"><span class="bxec-md-year-text-inner" id="<?=$id?>md-year"></span></span>
  126.                 <a class="bxec-sel-right" id="<?=$id?>md-selector-next"></a>
  127.             </div>
  128.             <div class="bxec-md-month-list"  id="<?=$id?>md-month-list"></div>
  129.         </div>
  130.     </div>
  131.     <div id="<?=$id?>_buttons_cont" class="bxec-buttons-cont"></div>
  132. </div>
  133. <div>
  134.     <table class="BXEC-Calendar" cellPadding="0" cellSpacing="0" id="<?=$id?>_scel_table_month" style="display:none;">
  135.     <tr class="bxec-days-title"><td>
  136.         <!--Don't insert spases inside DOM layout!-->
  137.         <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>
  138.     </td></tr>
  139.     <tr><td class="bxec-days-grid-td"><div id="<?=$id?>_days_grid" class="bxec-days-grid-cont"></div>
  140.     </td></tr>
  141.     </table>
  142.     <table class="BXEC-Calendar-week" id="<?=$id?>_scel_table_week" cellPadding="0" cellSpacing="0" style="display:none;">
  143.         <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>
  144.         <tr class="bxec-days-tbl-more-ev"><td class="bxec-pad"></td><td class="bxec-pad2"></td></tr>
  145.         <tr class="bxec-days-tbl-grid"><td class="bxec-cont"><div class="bxec-timeline-div"></div></td></tr>
  146.     </table>
  147.     <table class="BXEC-Calendar-week" id="<?=$id?>_scel_table_day" cellPadding="0" cellSpacing="0" style="display:none;">
  148.         <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>
  149.         <tr class="bxec-days-tbl-more-ev"><td class="bxec-pad"></td><td class="bxec-pad2"></td></tr>
  150.         <tr class="bxec-days-tbl-grid"><td class="bxec-cont"><div class="bxec-timeline-div"></div></td></tr>
  151.     </table>
  152. </div>
  153. </div>
  154. <?
  155.         self::BuildDialogs($Params);
  156.  
  157.         if($Params['bShowTasks'])
  158.         {
  159.         ?>
  160. <script>
  161. // Js event handlers which will be captured in calendar's js
  162. function onPopupTaskAdded(arTask){BX.onCustomEvent(window, 'onCalendarPopupTaskAdded', [arTask]);}
  163. function onPopupTaskChanged(arTask){BX.onCustomEvent(window, 'onCalendarPopupTaskChanged', [arTask]);}
  164. function onPopupTaskDeleted(taskId){BX.onCustomEvent(window, 'onCalendarPopupTaskDeleted', [taskId]);}
  165. </script>
  166.         <?
  167.             $APPLICATION->IncludeComponent(
  168.                 "bitrix:tasks.iframe.popup",
  169.                 "",
  170.                 array(
  171.                     "ON_TASK_ADDED" => "onPopupTaskAdded",
  172.                     "ON_TASK_CHANGED" => "onPopupTaskChanged",
  173.                     "ON_TASK_DELETED" => "onPopupTaskDeleted",
  174.                     "TASKS_LIST" => $Params['arTaskIds']
  175.                 ),
  176.                 null,
  177.                 array("HIDE_ICONS" => "Y")
  178.             );
  179.         }
  180.  
  181.         //CCalendar::GetUserfieldsEditHtml(0);
  182.  
  183.         // Here can be added user's dialogs, scripts, html
  184.         $db_events = GetModuleEvents("calendar", "OnAfterBuildSceleton");
  185.         while($arEvent = $db_events->Fetch())
  186.             ExecuteModuleEventEx($arEvent);
  187.     }
RAW Paste Data