Пример #1
0
 function calendar()
 {
     $date = JDate::createFromFormat('Y', $_POST['year']);
     $min_date = clone $date;
     $min_date = $min_date->modify('-1 year');
     $max_date = $date->modify('+1 year');
     $calendar_attributes = array('min_select_year' => $min_date->format('Y'), 'max_select_year' => $max_date->format('Y'));
     if (isset($_REQUEST['action']) and $_REQUEST['action'] == 'pn_get_month_cal') {
         require_once JPATH_COMPONENT_ADMINISTRATOR . '/classes/calendar.php';
         AImporter::css('calendar');
         $calendar = new PN_Calendar($calendar_attributes);
         echo $calendar->draw(array(), $_REQUEST['year'], $_REQUEST['month']);
         exit;
     }
 }
 function calendar()
 {
     $date = JDate::createFromFormat('Y', $_POST['year']);
     $min_date = clone $date;
     $min_date = $min_date->modify('-1 year');
     $max_date = $date->modify('+1 year');
     $calendar_attributes = array('min_select_year' => $min_date->format('Y'), 'max_select_year' => $max_date->format('Y'));
     if (isset($_REQUEST['action']) and $_REQUEST['action'] == 'pn_get_month_cal') {
         AImporter::classes('dayoffcalendar');
         AImporter::css('calendar');
         $calendar = new PN_Calendar($calendar_attributes);
         echo $calendar->draw(array(), $_REQUEST['year'], $_REQUEST['month']);
         exit;
     }
 }
Пример #3
0
 protected function index()
 {
     $indexingParams = array();
     if ($this->input->getString('u') || $this->input->getString('update')) {
         $lastModified = $this->input->getString('u', $this->input->getString('update'));
         $d = JDate::createFromFormat("Y-m-d\\TH:i:sP", $lastModified, new DateTimeZone(JFactory::getConfig()->get('offset')));
         $valid = false;
         if ($d) {
             if ($d->getTimezone()) {
                 $format = "Y-m-d\\TH:i:s" . ($d->getTimezone()->getName() == 'Z' ? '\\Z' : 'P');
                 if ($d->format($format) == $lastModified) {
                     $valid = true;
                 }
             }
         }
         if ($valid) {
             $indexingParams['lastModified'] = $lastModified;
         } else {
             $client = \JSolr\Index\Factory::getService();
             if ($client->ping()) {
                 $response = $client->luke();
                 $indexingParams['lastModified'] = $response->index->lastModified;
             }
         }
     }
     $start = new JDate('now');
     $this->out("crawl start " . $start->format("c"));
     $this->_fireEvent('onIndex', array(get_class($this), $this->_isVerbose(), $indexingParams), $this->_getPlugin());
     $end = new JDate('now');
     $this->out("crawl end " . $end->format("c"));
     $time = $start->diff($end);
     $this->out("execution time: " . $time->format("%H:%I:%S"));
 }