CalendarController --------------------
505386
public function actionEvents() {

		$user = Yii::$app->user->GetIdentity();

		$startDate	= Yii::$app->request->post( 'startDate' );
		$endDate	= Yii::$app->request->post( 'endDate' );

		$events = $this->modelService->getByRangeUserId( $startDate, $endDate, $user->id );
		$data	= [];

		foreach( $events as $event ) {

			$data[] = [ 'id' => $event->id, 'title' => "$event->name - $event->description", 'start' => $event->scheduledAt ];
		}

		// Trigger Ajax Success
		return AjaxUtil::generateSuccess( Yii::$app->coreMessage->getMessage( CoreGlobal::MESSAGE_REQUEST ), $data );
	}
866618
function createCalendar() {
    $calendarInit1 = $calendarInit2 = $calendarxCaldecl = $calendarStart = $calendar = null;
    switch( $this->format ) {
      case 'xcal':
        $calendarInit1 = '<?xml version="1.0" encoding="UTF-8"?>'.$this->nl.
                         '<!DOCTYPE iCalendar PUBLIC "-//IETF//DTD XCAL/iCalendar XML//EN"'.$this->nl.
                         '"http://www.ietf.org/internet-drafts/draft-ietf-calsch-many-xcal-01.txt"';
        $calendarInit2 = '>'.$this->nl;
        $calendarStart = '<vcalendar';
        break;
      default:
        $calendarStart = 'BEGIN:VCALENDAR'.$this->nl;
        break;
    }
    $calendarStart .= $this->createCalscale();
    $calendarStart .= $this->createMethod();
    $calendarStart .= $this->createProdid();
    $calendarStart .= $this->createVersion();
    switch( $this->format ) {
      case 'xcal':
        $nlstrlen = strlen( $this->nl );
        if( $this->nl == substr( $calendarStart, ( 0 - $nlstrlen )))
          $calendarStart = substr( $calendarStart, 0, ( strlen( $calendarStart ) - $nlstrlen ));
        $calendarStart .= '>'.$this->nl;
        break;
      default:
        break;
    }
    $calendar .= $this->createXprop();
    foreach( $this->components as $component ) {
      if( '' >= $component->getConfig( 'language'))
        $component->setConfig( 'language',  $this->getConfig( 'language' ));
      $component->setConfig( 'allowEmpty',  $this->getConfig( 'allowEmpty' ));
      $component->setConfig( 'nl',          $this->getConfig( 'nl' ));
      $component->setConfig( 'unique_id',   $this->getConfig( 'unique_id' ));
      $component->setConfig( 'format',      $this->getConfig( 'format' ));
      $calendar .= $component->createComponent( $this->xcaldecl );
    }
    if(( 0 < count( $this->xcaldecl )) && ( 'xcal' == $this->format )) { // xCal only
      $calendarInit1 .= $this->nl.'['.$this->nl;
      $old_xcaldecl = array();
      foreach( $this->xcaldecl as $declix => $declPart ) {
        if(( 0 < count( $old_xcaldecl)) &&
           ( in_array( $declPart['uri'],      $old_xcaldecl['uri'] )) &&
           ( in_array( $declPart['external'], $old_xcaldecl['external'] )))
          continue; // no duplicate uri and ext. references
        $calendarxCaldecl .= '<!';
        foreach( $declPart as $declKey => $declValue ) {
          switch( $declKey ) {                    // index
            case 'xmldecl':                       // no 1
              $calendarxCaldecl .= $declValue.' ';
              break;
            case 'uri':                           // no 2
              $calendarxCaldecl .= $declValue.' ';
              $old_xcaldecl['uri'][] = $declValue;
              break;
            case 'ref':                           // no 3
              $calendarxCaldecl .= $declValue.' ';
              break;
            case 'external':                      // no 4
              $calendarxCaldecl .= '"'.$declValue.'" ';
              $old_xcaldecl['external'][] = $declValue;
              break;
            case 'type':                          // no 5
              $calendarxCaldecl .= $declValue.' ';
              break;
            case 'type2':                         // no 6
              $calendarxCaldecl .= $declValue;
              break;
          }
        }
        $calendarxCaldecl .= '>'.$this->nl;
      }
      $calendarInit2 = ']'.$calendarInit2;
    }
    switch( $this->format ) {
      case 'xcal':
        $calendar .= '</vcalendar>'.$this->nl;
        break;
      default:
        $calendar .= 'END:VCALENDAR'.$this->nl;
        break;
    }
    return $calendarInit1.$calendarxCaldecl.$calendarInit2.$calendarStart.$calendar;
  }
298445
function () {
            if (this._cfg.waiAria) {
                // it is important to set aria-owns and aria-expanded attributes before
                // calling the parent _afterDropdownOpen method (which gives focus to
                // the calendar)
                var dropDownIcon = this._getDropdownIcon();
                var calendarId = this.controller.getCalendar().getCalendarDomId();
                dropDownIcon.setAttribute("aria-owns", calendarId);
                dropDownIcon.setAttribute("aria-activedescendant", calendarId);
                dropDownIcon.setAttribute("aria-expanded", "true");
            }
            this.$DropDownTextInput._afterDropdownOpen.apply(this, arguments);
        }
1159338
public function dispatch()
    {
		/**
         * Calling before dispatch listener
         */
		if ( is_object($this->_events_manager) )
        {
            $this->_events_manager->fire( "dispatch:beforeDispatch", $this );
		}

		$finished = false;

		$number_dispatches = 0;

		while ( !$finished )
		{
			$number_dispatches++;

			if ( $number_dispatches == 100 )
            {
                $this->_throwDispatchException( "Dispatch error. Cyclic routing.", self::EXCEPTION_CYCLIC_ROUTING );
				break;
			}

            $controller_name = $this->_route->getControllerName();
            $action_name     = $this->_route->getActionName();
            $params          = $this->_route->getParams();

            if ( !class_exists($controller_name) )
            {
                if ( $this->_throwDispatchException( $controller_name . " controller class cannot be loaded.", self::EXCEPTION_CONTROLLER_NOT_FOUND ) == false )
                {
                    continue;
                }

                break;
            }

            $controller_instance = new $controller_name();

            if ( !method_exists($controller_instance, $action_name) )
            {
                if ( $this->_throwDispatchException( $action_name . "Action action does not exist in " . $controller_name . ".", self::EXCEPTION_ACTION_NOT_FOUND ) == false )
                {
                    continue;
                }

                break;
            }

            /**
             * Calling before execute route listener
             */
            if ( is_object($this->_events_manager) )
            {
                $this->_events_manager->fire( "dispatch:beforeExecuteRoute", $this );

                /**
                 * If there was a forward in the listener
                 */
                if ( $this->_was_forwarded )
                {
                    $this->_was_forwarded = false;
                    continue;
                }
            }

            $controller_instance->setDI( $this->_di );

            $controller_instance->initialize();

			/**
             * Calling action in controller with params
             */
            call_user_func_array( array($controller_instance, $action_name), $params );

			/**
             * If there was a forward in the action
             */
			if ( $this->_was_forwarded )
            {
				$this->_was_forwarded = false;
				continue;
			}

			$finished = true;
		}
    }
951126
function() {
    // Calendar widget
    if(YAHOO.widget.Calendar) {
        var calContainer = this.getContainerEl().appendChild(document.createElement("div"));
        calContainer.id = this.getId() + "-dateContainer"; // Needed for Calendar constructor
        var calendar =
                new YAHOO.widget.Calendar(this.getId() + "-date",
                calContainer.id, this.calendarOptions);
        calendar.render();
        calContainer.style.cssFloat = "none";

        if(ua.ie) {
            var calFloatClearer = this.getContainerEl().appendChild(document.createElement("div"));
            calFloatClearer.style.clear = "both";
        }
        
        this.calendar = calendar;

        if(this.disableBtns) {
            this.handleDisabledBtns();
        }
    }
    else {
        YAHOO.log("Could not find YUI Calendar", "error", this.toString());
    }
    
}
212391
public function main()
    {
        try {
            $lock = new FileLock('import_' . md5(__FILE__) . '.lock');
        } catch (Exception $e) {
            $this->abort($e->getMessage());

            // Rethrow the exception if some reason we have reached this point
            // This shouldn't happen since `$this->abort` throw another Exception
            throw $e;
        }

        if (!$lock->lock()) {
            $this->abort('Import is already in progress');
        }

        /** @var \Qobo\Calendar\Model\Table\CalendarAttendeesTable $table */
        $table = TableRegistry::get('Qobo/Calendar.CalendarAttendees');
        $this->attendeesTable = $table;

        /** @var \Qobo\Calendar\Model\Table\CalendarsTable $table */
        $table = TableRegistry::get('Qobo/Calendar.Calendars');
        $this->calendarsTable = $table;

        /** @var \CakeDC\Users\Model\Table\UsersTable $table */
        $table = $this->getUsersTable();
        $this->usersTable = $table;

        $calendarsProcessed = 1;
        $output = $result = $options = [];

        /** @var \Cake\Shell\Helper\ProgressHelper $progress */
        $progress = $this->helper('Progress');
        $progress->init();

        $this->info('Preparing for calendar sync...');

        $options = $this->setDefaultTimePeriod($this->params);

        $result['calendars'] = $this->calendarsTable->syncCalendars($options);

        if (empty($result['calendars'])) {
            $this->abort('No calendars found for synchronization');
        }

        foreach ($result['calendars'] as $actionName => $calendars) {
            foreach ($calendars as $k => $calendar) {
                $resultEvents = $this->calendarsTable->syncCalendarEvents($calendar, $options);

                $resultAttendees = $this->calendarsTable->syncEventsAttendees($calendar, $resultEvents);

                $output[] = [
                    'action' => $actionName,
                    'calendar' => $calendar,
                    'events' => $resultEvents,
                    'attendees' => $resultAttendees,
                ];

                $progress->increment(100 / ++$calendarsProcessed);
                $progress->draw();
            }
        }

        $this->syncAttendees();
        $birthdays = $this->syncBirthdays($this->calendarsTable);

        $this->out(null);
        $this->success('Synchronization complete!');
        $this->out(null);

        if (true == $this->params['verbose']) {
            print_r($output);
        }

        $lock->unlock();
    }
310028
function makeCalendar(char) {
    let calendar = function (id) {
        if (id === undefined) {
            return calendar.history();
        }
        else {
            return new EventImpl(char, id);
        }
    };
    calendar.history = function (fromId) {
        return char.agent.request('get_characters_character_id_calendar', {
            path: { character_id: char.id }, query: { from_event: fromId }
        }, char.ssoToken);
    };
    return calendar;
}
719007
public function run()
    {
        echo $this->renderWidget() . "\n";

        $containerID = $this->inline ? $this->containerOptions['id'] : $this->options['id'];
        $language = $this->language ? $this->language : Yii::$app->language;

        if (strncmp($this->dateFormat, 'php:', 4) === 0) {
            $this->clientOptions['dateFormat'] = FormatConverter::convertDatePhpToJui(substr($this->dateFormat, 4));
        } else {
            $this->clientOptions['dateFormat'] = FormatConverter::convertDateIcuToJui($this->dateFormat, 'date', $language);
        }

        if ($language !== 'en-US') {
            $view = $this->getView();
            $assetBundle = DatePickerLanguageAsset::register($view);
            $assetBundle->language = $language;
            $options = Json::htmlEncode($this->clientOptions);
            $language = Html::encode($language);
            $view->registerJs("jQuery('#{$containerID}').datepicker($.extend({}, $.datepicker.regional['{$language}'], $options));");
        } else {
            $this->registerClientOptions('datepicker', $containerID);
        }

        $this->registerClientEvents('datepicker', $containerID);
        JuiAsset::register($this->getView());
    }
218446
function returnCalendar() {
    $filename = $this->getConfig( 'filename' );
    $output   = $this->createCalendar();
    $filesize = strlen( $output );
//    if( headers_sent( $filename, $linenum ))
//      die( "Headers already sent in $filename on line $linenum\n" );
    if( 'xcal' == $this->format )
      header( 'Content-Type: application/calendar+xml; charset=utf-8' );
    else
      header( 'Content-Type: text/calendar; charset=utf-8' );
    header( 'Content-Length: '.$filesize );
    header( 'Content-Disposition: attachment; filename="'.$filename.'"' );
    header( 'Cache-Control: max-age=10' );
    echo $output;
    die();
  }
1029243
function CalendarYearCtrl($element, $scope, $animate, $q,
    $$mdDateUtil, $mdUtil) {

    /** @final {!angular.JQLite} */
    this.$element = $element;

    /** @final {!angular.Scope} */
    this.$scope = $scope;

    /** @final {!angular.$animate} */
    this.$animate = $animate;

    /** @final {!angular.$q} */
    this.$q = $q;

    /** @final */
    this.dateUtil = $$mdDateUtil;

    /** @final {HTMLElement} */
    this.calendarScroller = $element[0].querySelector('.md-virtual-repeat-scroller');

    /** @type {boolean} */
    this.isInitialized = false;

    /** @type {boolean} */
    this.isMonthTransitionInProgress = false;

    /** @final */
    this.$mdUtil = $mdUtil;

    var self = this;

    /**
     * Handles a click event on a date cell.
     * Created here so that every cell can use the same function instance.
     * @this {HTMLTableCellElement} The cell that was clicked.
     */
    this.cellClickHandler = function() {
      self.onTimestampSelected($$mdDateUtil.getTimestampFromNode(this));
    };
  }
664398
public function retrieveDashboardCalendarEventsAction(){
        $calendarTable = $this->getServiceLocator()->get('MelisCalendarTable');
        $result = $calendarTable->retrieveDashboardCalendarEvents();
        return new JsonModel($result->toArray());
    }
1277512
public function generateScheduleAction()
    {
        Mage::app()->removeCache(Mage_Cron_Model_Observer::CACHE_KEY_LAST_SCHEDULE_GENERATE_AT);

        /* @var Aoe_Scheduler_Model_ScheduleManager $scheduleManager */
        $scheduleManager = Mage::getModel('aoe_scheduler/scheduleManager');
        $scheduleManager->generateSchedules();

        $this->_getSession()->addSuccess($this->__('Generated schedule'));
        $this->_redirect('*/*/index');
    }
512192
function Controller(ngeoWMSTime) {

  /**
   * @type {import("ngeo/misc/WMSTime.js").WMSTime}
   * @private
   */
  this.ngeoWMSTime_ = ngeoWMSTime;

  /**
   * Function called after date(s) changed/selected
   * @type {Function}
   */
  this.onDateSelected = () => undefined;


  /**
   * A time object for directive initialization
   * @type {?import('ngeo/datasource/OGC.js').TimeProperty}
   */
  this.time = null;

  /**
   * If the component is used to select a date range
   * @type {boolean}
   */
  this.isModeRange = false;

  /**
   * Minimal value of the slider (time in ms)
   * @type {number}
   */
  this.minValue = -1;

  /**
   * Maximal value of the slider (time in ms)
   * @type {number}
   */
  this.maxValue = 999999;

  /**
   * Used when WMS time object has a property 'values' instead of an interval
   * @type {?Array<number>}
   */
  this.timeValueList = null;

  /**
   * Default Slider options (used by ui-slider directive)
   * @type {?{
   *  range : boolean,
   *  min : number,
   *  max : number
   * }}
   */
  this.sliderOptions = null;

  /**
   * Model for the ui-slider directive (date in ms format)
   * @type {Array<number>|number}
   */
  this.dates = [];
}
1070858
public function onKernelController()
    {
        $themeContext = $this->container->get('theme.context.front');
        $themeContext->setCurrentTheme($this->getShopStorage()->getCurrentShop()->getTheme());
    }
1230582
public function onKernelController(FilterControllerEvent $event) {
        $css = rtrim($this->cssBase, '/') . '/' . trim($this->lteAdmin, '/');
        $mng = $this->manager;

        $mng->registerStyle('jquery-ui', $css . '/jQueryUI/jquery-ui-1.10.3.custom.css');
        $mng->registerStyle('bootstrap', $css . '/bootstrap.css', ['jquery-ui']);
        $mng->registerStyle('bootstrap-slider', $css . '/bootstrap-slider/slider.css', ['bootstrap']);
        $mng->registerStyle('datatables', $css . '/datatables/dataTables.bootstrap.css', ['bootstrap']);
        $mng->registerStyle('fontawesome', $css . '/font-awesome.css');
        $mng->registerStyle('ionicons', $css . '/ionicons.css');
        $mng->registerStyle('admin-lte', $css . '/AdminLTE.css', ['bootstrap-slider', 'fontawesome', 'ionicons', 'datatables']);
        $mng->registerStyle('bs-colorpicker', $css . '/colorpicker/bootstrap-colorpicker.css', ['admin-lte']);
        $mng->registerStyle('daterangepicker', $css . '/daterangepicker/daterangepicker.css', ['admin-lte']);
        $mng->registerStyle('timepicker', $css . '/timepicker/bootstrap-timepicker.css', ['admin-lte']);
        $mng->registerStyle('wysiwyg', $css . '/bootstrap-wysihtml5/bootstrap3-wysihtml5.css', ['admin-lte']);
    }
105459
public function bindToController()
    {
        if ($this->controller->widget === null) {
            $this->controller->widget = new stdClass;
        }

        $this->controller->widget->{$this->alias} = $this;
    }
16054
function calendarDirective() {
    return {
      template:
        '<table aria-hidden="true" class="md-calendar-day-header"><thead></thead></table>' +
        '<div class="md-calendar-scroll-mask">' +
        '<md-virtual-repeat-container class="md-calendar-scroll-container" ' +
              'md-offset-size="' + (TBODY_SINGLE_ROW_HEIGHT - TBODY_HEIGHT) + '">' +
            '<table role="grid" tabindex="0" class="md-calendar" aria-readonly="true">' +
              '<tbody ' +
                  'md-calendar-month-body ' +
                  'role="rowgroup" ' +
                  'md-virtual-repeat="i in monthCtrl.items" ' +
                  'md-month-offset="$index" ' +
                  'class="md-calendar-month" ' +
                  'md-start-index="monthCtrl.getSelectedMonthIndex()" ' +
                  'md-item-size="' + TBODY_HEIGHT + '">' +

                // The <tr> ensures that the <tbody> will always have the
                // proper height, even if it's empty. If it's content is
                // compiled, the <tr> will be overwritten.
                '<tr aria-hidden="true" md-force-height="\'' + TBODY_HEIGHT + 'px\'"></tr>' +
              '</tbody>' +
            '</table>' +
          '</md-virtual-repeat-container>' +
        '</div>',
      require: ['^^mdCalendar', 'mdCalendarMonth'],
      controller: CalendarMonthCtrl,
      controllerAs: 'monthCtrl',
      bindToController: true,
      link: function(scope, element, attrs, controllers) {
        var calendarCtrl = controllers[0];
        var monthCtrl = controllers[1];
        monthCtrl.initialize(calendarCtrl);
      }
    };
  }