/**
  * Triggers the "real" creation of the report and wraps the code inline into a xml-structure
  *
  * @return string
  * @permissions view
  */
 protected function actionGetReport()
 {
     $strPlugin = $this->getParam("plugin");
     $strReturn = "";
     $objPluginManager = new class_pluginmanager(class_module_stats_admin::$STR_PLUGIN_EXTENSION_POINT, "/admin/statsreports");
     $objPlugin = null;
     foreach ($objPluginManager->getPlugins(array(class_carrier::getInstance()->getObjDB(), $this->objToolkit, $this->getObjLang())) as $objOneReport) {
         if (uniStrReplace("class_stats_report_", "", get_class($objOneReport)) == $strPlugin) {
             $objPlugin = $objOneReport;
             break;
         }
     }
     if ($objPlugin !== null && $objPlugin instanceof interface_admin_statsreports) {
         //get date-params as ints
         $intStartDate = mktime(0, 0, 0, $this->objDateStart->getIntMonth(), $this->objDateStart->getIntDay(), $this->objDateStart->getIntYear());
         $intEndDate = mktime(0, 0, 0, $this->objDateEnd->getIntMonth(), $this->objDateEnd->getIntDay(), $this->objDateEnd->getIntYear());
         $objPlugin->setEndDate($intEndDate);
         $objPlugin->setStartDate($intStartDate);
         $objPlugin->setInterval($this->intInterval);
         $arrImage = $objPlugin->getReportGraph();
         if (!is_array($arrImage)) {
             $arrImage = array($arrImage);
         }
         foreach ($arrImage as $strImage) {
             if ($strImage != "") {
                 $strReturn .= $this->objToolkit->getGraphContainer($strImage);
             }
         }
         $strReturn .= $objPlugin->getReport();
         $strReturn = "<content><![CDATA[" . $strReturn . "]]></content>";
     }
     return $strReturn;
 }
Пример #2
0
 /**
  * Validates if the passed day is a easter bank holiday.
  * This includes: friday before easter, easter saturday and sunday, easter monday
  *
  * @param class_date $objDate
  *
  * @return bool
  */
 public function isEasterHoliday(class_date $objDate)
 {
     $objEasterSunday = $this->calcEasterSunday($objDate->getIntYear());
     $objEasterSaturday = clone $objEasterSunday;
     $objEasterSaturday->setPreviousDay();
     $objEasterFriday = clone $objEasterSaturday;
     $objEasterFriday->setPreviousDay();
     $objEasterMonday = clone $objEasterSunday;
     $objEasterMonday->setNextDay();
     return $objDate->isSameDay($objEasterFriday) || $objDate->isSameDay($objEasterSaturday) || $objDate->isSameDay($objEasterSunday) || $objDate->isSameDay($objEasterMonday);
 }
 /**
  * Responsible for creating the xml-feed
  *
  * @param string $strTitle
  * @param string $strLink
  * @param string $strDesc
  * @param string $strPage
  * @param class_module_news_news[] $arrNews
  *
  * @return string
  */
 private function createNewsfeedXML($strTitle, $strLink, $strDesc, $strPage, $arrNews)
 {
     $objFeed = new class_rssfeed();
     $objFeed->setStrTitle($strTitle);
     $objFeed->setStrLink($strLink);
     $objFeed->setStrDesc($strDesc);
     foreach ($arrNews as $objOneNews) {
         if ($objOneNews->rightView()) {
             $objDate = $objOneNews->getObjStartDate();
             if ($objDate == null) {
                 $objDate = new class_date();
             }
             $objFeed->addElement($objOneNews->getStrTitle(), getLinkPortalHref($strPage, "", "newsDetail", "", $objOneNews->getSystemid(), "", $objOneNews->getStrTitle()), $objOneNews->getSystemid(), $objOneNews->getStrIntro(), mktime($objDate->getIntHour(), $objDate->getIntMin(), $objDate->getIntSec(), $objDate->getIntMonth(), $objDate->getIntDay(), $objDate->getIntYear()));
         }
     }
     return $objFeed->generateFeed();
 }
Пример #4
0
 /**
  * Returns a simple date-form element. By default used to enter a date without a time.
  *
  * @param string $strName
  * @param string $strTitle
  * @param class_date $objDateToShow
  * @param string $strClass = inputDate
  * @param boolean $bitWithTime
  *
  * @throws class_exception
  * @return string
  * @since 3.2.0.9
  */
 public function formDateSingle($strName, $strTitle, $objDateToShow, $strClass = "", $bitWithTime = false)
 {
     //check passed param
     if ($objDateToShow != null && !$objDateToShow instanceof class_date) {
         throw new class_exception("param passed to class_toolkit_admin::formDateSingle is not an instance of class_date", class_exception::$level_ERROR);
     }
     if ($bitWithTime) {
         $strTemplateID = $this->objTemplate->readTemplate("/elements.tpl", "input_datetime_simple");
     } else {
         $strTemplateID = $this->objTemplate->readTemplate("/elements.tpl", "input_date_simple");
     }
     $arrTemplate = array();
     $arrTemplate["class"] = $strClass;
     $arrTemplate["titleDay"] = $strName . "_day";
     $arrTemplate["titleMonth"] = $strName . "_month";
     $arrTemplate["titleYear"] = $strName . "_year";
     $arrTemplate["titleHour"] = $strName . "_hour";
     $arrTemplate["titleMin"] = $strName . "_minute";
     $arrTemplate["title"] = $strTitle;
     $arrTemplate["valueDay"] = $objDateToShow != null ? $objDateToShow->getIntDay() : "";
     $arrTemplate["valueMonth"] = $objDateToShow != null ? $objDateToShow->getIntMonth() : "";
     $arrTemplate["valueYear"] = $objDateToShow != null ? $objDateToShow->getIntYear() : "";
     $arrTemplate["valueHour"] = $objDateToShow != null ? $objDateToShow->getIntHour() : "";
     $arrTemplate["valueMin"] = $objDateToShow != null ? $objDateToShow->getIntMin() : "";
     $arrTemplate["valuePlain"] = dateToString($objDateToShow, false);
     //        if($bitWithTime)
     $arrTemplate["dateFormat"] = class_carrier::getInstance()->getObjLang()->getLang("dateStyleShort", "system");
     //        else
     //            $arrTemplate["dateFormat"] = class_carrier::getInstance()->getObjLang()->getLang("dateStyleLong", "system");
     $arrTemplate["calendarLang"] = class_carrier::getInstance()->getObjSession()->getAdminLanguage();
     $arrTemplate["titleTime"] = class_carrier::getInstance()->getObjLang()->getLang("titleTime", "system");
     //set up the container div
     $arrTemplate["calendarId"] = $strName;
     $strContainerId = $strName . "_calendarContainer";
     $arrTemplate["calendarContainerId"] = $strContainerId;
     $arrTemplate["calendarLang_weekday"] = " [" . class_carrier::getInstance()->getObjLang()->getLang("toolsetCalendarWeekday", "system") . "]\n";
     $arrTemplate["calendarLang_month"] = " [" . class_carrier::getInstance()->getObjLang()->getLang("toolsetCalendarMonth", "system") . "]\n";
     return $this->objTemplate->fillTemplate($arrTemplate, $strTemplateID);
 }
Пример #5
0
 public function testReports()
 {
     if (!defined("_skinwebpath_")) {
         define("_skinwebpath_", "1");
     }
     echo "processing reports...\n";
     $arrReportsInFs = class_resourceloader::getInstance()->getFolderContent("/admin/statsreports", array(".php"), false, function ($strOneFile) {
         if (uniStripos($strOneFile, "class_stats_report") === false) {
             return false;
         }
         return true;
     }, function (&$strOneFile) {
         $strOneFile = uniSubstr($strOneFile, 0, -4);
         $strOneFile = new $strOneFile(class_carrier::getInstance()->getObjDB(), class_carrier::getInstance()->getObjToolkit("admin"), class_carrier::getInstance()->getObjLang());
     });
     $arrReports = array();
     foreach ($arrReportsInFs as $objReport) {
         if ($objReport instanceof interface_admin_statsreports) {
             $arrReports[$objReport->getTitle()] = $objReport;
         }
         $objStartDate = new class_date();
         $objStartDate->setPreviousDay();
         $objEndDate = new class_date();
         $objEndDate->setNextDay();
         $intStartDate = mktime(0, 0, 0, $objStartDate->getIntMonth(), $objStartDate->getIntDay(), $objStartDate->getIntYear());
         $intEndDate = mktime(0, 0, 0, $objEndDate->getIntMonth(), $objEndDate->getIntDay(), $objEndDate->getIntYear());
         $objReport->setEndDate($intEndDate);
         $objReport->setStartDate($intStartDate);
         $objReport->setInterval(2);
     }
     /** @var interface_admin_statsreports $objReport */
     foreach ($arrReports as $objReport) {
         ob_start();
         echo "processing report " . $objReport->getTitle() . "\n";
         $objReport->getReport();
         $objReport->getReportGraph();
     }
 }
Пример #6
0
/**
 * Converts a dateobject to a readable string
 *
 * @param class_date $objDate
 * @param bool $bitLong
 * @param string $strFormat if given, the passed format will be used, otherwise the format defined in the i18n files
 *                          usable placeholders are: d, m, y, h, i, s
 *
 * @return string
 */
function dateToString($objDate, $bitLong = true, $strFormat = "")
{
    $strReturn = "";
    //if the $objDate is a string, convert it to date object
    if ($objDate != null && !$objDate instanceof class_date && uniEreg("([0-9]){14}", $objDate)) {
        $objDate = new class_date($objDate);
    }
    if ($objDate instanceof class_date) {
        //convert to a current date
        if ($strFormat == "") {
            if ($bitLong) {
                $strReturn = uniStrtolower(class_carrier::getInstance()->getObjLang()->getLang("dateStyleLong", "system"));
            } else {
                $strReturn = uniStrtolower(class_carrier::getInstance()->getObjLang()->getLang("dateStyleShort", "system"));
            }
        } else {
            $strReturn = $strFormat;
        }
        //"d.m.Y H:i:s";
        $strReturn = uniStrReplace("d", $objDate->getIntDay(), $strReturn);
        $strReturn = uniStrReplace("m", $objDate->getIntMonth(), $strReturn);
        $strReturn = uniStrReplace("y", $objDate->getIntYear(), $strReturn);
        $strReturn = uniStrReplace("h", $objDate->getIntHour(), $strReturn);
        $strReturn = uniStrReplace("i", $objDate->getIntMin(), $strReturn);
        $strReturn = uniStrReplace("s", $objDate->getIntSec(), $strReturn);
    }
    return $strReturn;
}
 /**
  * Creates a form to edit a users data
  *
  * @return string
  */
 private function editUserData()
 {
     $arrErrors = array();
     $bitForm = true;
     //what to do?
     if ($this->getParam("submitUserForm") != "") {
         if ($this->getParam("password") != "") {
             if ($this->getParam("password") != $this->getParam("password2")) {
                 $arrErrors[] = $this->getLang("passwordsUnequal");
             }
         }
         $objValidator = new class_email_validator();
         if (!$objValidator->validate($this->getParam("email"))) {
             $arrErrors[] = $this->getLang("invalidEmailadress");
         }
         if (count($arrErrors) == 0) {
             $bitForm = false;
         }
     }
     if ($bitForm) {
         if ($this->arrElementData["portallogin_editmode"] == 1) {
             $strTemplateID = $this->objTemplate->readTemplate("/element_portallogin/" . $this->arrElementData["portallogin_template"], "portallogin_userdataform_complete");
         } else {
             $strTemplateID = $this->objTemplate->readTemplate("/element_portallogin/" . $this->arrElementData["portallogin_template"], "portallogin_userdataform_minimal");
         }
         $arrTemplate = array();
         $objUser = new class_module_user_user($this->objSession->getUserID());
         if ($objUser->getObjSourceUser()->isEditable() && $objUser->getStrSubsystem() == "kajona" && $objUser->getObjSourceUser() instanceof class_usersources_user_kajona) {
             $arrTemplate["username"] = $objUser->getStrUsername();
             $arrTemplate["email"] = $objUser->getObjSourceUser()->getStrEmail();
             $arrTemplate["forename"] = $objUser->getObjSourceUser()->getStrForename();
             $arrTemplate["name"] = $objUser->getObjSourceUser()->getStrName();
             $arrTemplate["street"] = $objUser->getObjSourceUser()->getStrStreet();
             $arrTemplate["postal"] = $objUser->getObjSourceUser()->getStrPostal();
             $arrTemplate["city"] = $objUser->getObjSourceUser()->getStrCity();
             $arrTemplate["phone"] = $objUser->getObjSourceUser()->getStrTel();
             $arrTemplate["mobile"] = $objUser->getObjSourceUser()->getStrMobile();
             $arrTemplate["portallogin_elsystemid"] = $this->arrElementData["content_id"];
             $objDate = new class_date($objUser->getObjSourceUser()->getLongDate());
             $arrTemplate["date_day"] = $objDate->getIntDay();
             $arrTemplate["date_month"] = $objDate->getIntMonth();
             $arrTemplate["date_year"] = $objDate->getIntYear();
             $arrTemplate["formaction"] = class_link::getLinkPortalHref($this->getPagename(), "", "portalEditProfile");
             $arrTemplate["formErrors"] = "";
             if (count($arrErrors) > 0) {
                 foreach ($arrErrors as $strOneError) {
                     $strErrTemplate = $this->objTemplate->readTemplate("/element_portallogin/" . $this->arrElementData["portallogin_template"], "errorRow");
                     $arrTemplate["formErrors"] .= "" . $this->fillTemplate(array("error" => $strOneError), $strErrTemplate);
                 }
             }
             return $this->fillTemplate($arrTemplate, $strTemplateID);
         } else {
             return "Login provider not supported.";
         }
     } else {
         $objUser = new class_module_user_user($this->objSession->getUserID());
         if ($objUser->getObjSourceUser() instanceof class_usersources_user_kajona) {
             $objUser->getObjSourceUser()->setStrEmail($this->getParam("email"));
             $objUser->getObjSourceUser()->setStrForename($this->getParam("forename"));
             $objUser->getObjSourceUser()->setStrName($this->getParam("name"));
             $objUser->getObjSourceUser()->setStrPass($this->getParam("password"));
             if ($this->arrElementData["portallogin_editmode"] == 1) {
                 $objUser->getObjSourceUser()->setStrStreet($this->getParam("street"));
                 $objUser->getObjSourceUser()->setStrPostal($this->getParam("postal"));
                 $objUser->getObjSourceUser()->setStrCity($this->getParam("city"));
                 $objUser->getObjSourceUser()->setStrTel($this->getParam("phone"));
                 $objUser->getObjSourceUser()->setStrMobile($this->getParam("mobile"));
                 $objDate = new class_date();
                 $objDate->setIntDay($this->getParam("date_day"));
                 $objDate->setIntMonth($this->getParam("date_month"));
                 $objDate->setIntYear($this->getParam("date_year"));
                 $objUser->getObjSourceUser()->setLongDate($objDate->getLongTimestamp());
             }
             $objUser->getObjSourceUser()->updateObjectToDb();
         }
         $this->portalReload(class_link::getLinkPortalHref($this->getPagename()));
     }
     return "";
 }
    /**
     * Saves the passed Element to the database (edit or new modes)
     *
     * @throws class_exception
     * @return string "" in case of success
     */
    protected function actionSaveElement()
    {
        $strReturn = "";
        //There are two modes - edit and new
        //The element itself just knows the edit mode, so in case of new, we have to create a dummy element - before
        //passing control to the element
        if ($this->getParam("mode") == "new") {
            //Using the passed placeholder-param to load the element and get the table
            $strPlaceholder = $this->getParam("placeholder");
            //Split up the placeholder
            $arrPlaceholder = explode("_", $strPlaceholder);
            $strPlaceholderName = $arrPlaceholder[0];
            $strPlaceholderElement = $this->getParam("element");
            //Now, load all infos about the requested element
            $objElement = class_module_pages_element::getElement($strPlaceholderElement);
            //Load the class to create an object
            $strElementClass = str_replace(".php", "", $objElement->getStrClassAdmin());
            //and finally create the object
            /** @var class_element_admin $objElement */
            $objElement = new $strElementClass();
            //really continue? try to validate the passed data.
            if ($objElement->getAdminForm() !== null && !$objElement->getAdminForm()->validateForm()) {
                class_carrier::getInstance()->setParam("peClose", "");
                $strReturn .= $this->actionNew(true);
                return $strReturn;
            } else {
                if (!$objElement->validateForm()) {
                    class_carrier::getInstance()->setParam("peClose", "");
                    $strReturn .= $this->actionNew(true);
                    return $strReturn;
                }
            }
            //So, lets do the magic - create the records
            $objPageElement = new class_module_pages_pageelement();
            $objPageElement->setStrName($strPlaceholderName);
            $objPageElement->setStrPlaceholder($strPlaceholder);
            $objPageElement->setStrElement($strPlaceholderElement);
            $objPageElement->setStrLanguage($this->getParam("page_element_ph_language"));
            if (!$objPageElement->updateObjectToDb($this->getSystemid())) {
                throw new class_exception("Error saving new element-object to db", class_exception::$level_ERROR);
            }
            $strElementSystemId = $objPageElement->getSystemid();
            $objLockmanager = new class_lockmanager($strElementSystemId);
            $objLockmanager->lockRecord();
            //To have the element working as expected, set the systemid
            $this->setSystemid($strElementSystemId);
        }
        // ************************************* Edit the current Element *******************************
        //check, if the element isn't locked
        $objCommons = new class_module_system_common($this->getSystemid());
        $strPageSystemid = $objCommons->getPrevId();
        $objLockmanager = new class_lockmanager($this->getSystemid());
        if ($objLockmanager->isLockedByCurrentUser()) {
            //Load the data of the current element
            $objElementData = new class_module_pages_pageelement($this->getSystemid());
            /** @var $objElement class_element_admin */
            $objElement = $objElementData->getConcreteAdminInstance();
            //really continue? try to validate the passed data.
            if ($objElement->getAdminForm() !== null && !$objElement->getAdminForm()->validateForm()) {
                class_carrier::getInstance()->setParam("peClose", "");
                $strReturn .= $this->actionEdit(true);
                return $strReturn;
            } else {
                if (!$objElement->validateForm()) {
                    class_carrier::getInstance()->setParam("peClose", "");
                    $strReturn .= $this->actionEdit(true);
                    return $strReturn;
                }
            }
            //pass the data to the element, maybe the element wants to update some data
            $objElement->setArrParamData($this->getAllParams());
            if ($objElement->getAdminForm() !== null) {
                $objElement->getAdminForm()->updateSourceObject();
            }
            $objElement->doBeforeSaveToDb();
            //check, if we could save the data, so the element needn't to
            //woah, we are soooo great
            $objElement->updateForeignElement();
            //Edit Date of page & unlock
            $objPage = class_objectfactory::getInstance()->getObject($strPageSystemid);
            $objPage->updateObjectToDb();
            $objLockmanager->unlockRecord();
            //And update the internal comment and language
            $objElementData->setStrTitle($this->getParam("page_element_ph_title"));
            $objElementData->setStrLanguage($this->getParam("page_element_ph_language"));
            //placeholder to update?
            if ($this->getParam("placeholder") != "") {
                $objElementData->setStrPlaceholder($this->getParam("placeholder"));
            }
            $objStartDate = new class_date("0");
            $objEndDate = new class_date("0");
            $objStartDate->generateDateFromParams("start", $this->getAllParams());
            $objEndDate->generateDateFromParams("end", $this->getAllParams());
            if ($objStartDate->getIntYear() == "0000") {
                $objElementData->setObjStartDate(null);
            } else {
                $objElementData->setObjStartDate($objStartDate);
            }
            if ($objEndDate->getIntYear() == "0000") {
                $objElementData->setObjEndDate(null);
            } else {
                $objElementData->setObjEndDate($objEndDate);
            }
            if (!$objElementData->updateObjectToDb()) {
                throw new class_exception("Error updating object to db", class_exception::$level_ERROR);
            }
            //allow the element to run actions after saving
            $objElement->doAfterSaveToDb();
            //Loading the data of the corresponding site
            $objPage = new class_module_pages_page($strPageSystemid);
            $this->flushCompletePagesCache();
            if ($this->getParam("peClose") == "1") {
                //generate the elements' output
                $objPortalElement = $objElementData->getConcretePortalInstance();
                $strElementContent = $objPortalElement->getElementOutput();
                $strContent = json_encode($strElementContent, JSON_FORCE_OBJECT);
                //JSON_HEX_QUOT|JSON_HEX_APOS
                $strReturn = <<<JS
                    parent.KAJONA.admin.portaleditor.changeElementData('{$objElementData->getStrPlaceholder()}', '{$objElementData->getSystemid()}', {$strContent});
                    parent.KAJONA.admin.portaleditor.closeDialog(true);

JS;
                class_carrier::getInstance()->setParam("peClose", null);
                return "<script type='text/javascript'>{$strReturn}</script>";
            }
            $this->adminReload(class_link::getLinkAdminHref("pages_content", "list", "systemid=" . $objPage->getSystemid()));
        } else {
            $strReturn = $this->objToolkit->warningBox($this->getLang("ds_gesperrt"));
        }
        return $strReturn;
    }
Пример #9
0
echo str_pad("Hits", 15);
echo str_pad("Visitors", 15);
echo str_pad("Downloads", 15);
echo str_pad("PServer-Requests", 20);
echo str_pad("PServer-Unique", 20);
echo "\n";
for ($intYear = 2012; $intYear <= 2014; $intYear++) {
    for ($intMonth = 1; $intMonth <= 12; $intMonth++) {
        $objStartDate->setIntDay(1)->setIntMonth($intMonth)->setIntYear($intYear)->setIntHour(0)->setIntMin(0)->setIntSec(1);
        $objEndDate = clone $objStartDate;
        $objEndDate->setNextDay();
        while ($objEndDate->getIntDay() != 1) {
            $objEndDate->setNextDay();
        }
        $objEndDate->setPreviousDay()->setIntHour(23)->setIntMin(59)->setIntSec(59);
        echo str_pad($objStartDate->getIntMonth() . "/" . $objStartDate->getIntYear(), 10);
        echo str_pad(getHits($objStartDate->getTimeInOldStyle(), $objEndDate->getTimeInOldStyle()), 15, " ", STR_PAD_LEFT);
        echo str_pad(getVisitors($objStartDate->getTimeInOldStyle(), $objEndDate->getTimeInOldStyle()), 15, " ", STR_PAD_LEFT);
        echo str_pad(getDownloads($objStartDate->getTimeInOldStyle(), $objEndDate->getTimeInOldStyle()), 15, " ", STR_PAD_LEFT);
        echo str_pad(getPackageserverRequests($objStartDate->getLongTimestamp(), $objEndDate->getLongTimestamp()), 20, " ", STR_PAD_LEFT);
        echo str_pad(getUniquePackageserverSystems($objStartDate->getLongTimestamp(), $objEndDate->getLongTimestamp()), 20, " ", STR_PAD_LEFT);
        echo "\n";
        flush();
        ob_flush();
    }
}
echo "Total unique installations: \n";
getTotalUniquePackagesererSystems();
function getTotalUniquePackagesererSystems()
{
    $strQuery = "SELECT log_hostname, count(*) AS ANZ\n                FROM " . _dbprefix_ . "packageserver_log\n                GROUP BY log_hostname\n                ORDER BY ANZ DESC   ";
 /**
  * @return string
  * @permissions view
  */
 protected function actionRenderCalendar()
 {
     $strReturn = "";
     $strContent = "";
     $arrJsHighlights = array();
     $strReturn .= "<content><![CDATA[";
     /** @var interface_calendarsource_admin[] $arrRelevantModules  */
     $arrRelevantModules = array();
     //fetch modules relevant for processing
     $arrModules = class_module_system_module::getAllModules();
     foreach ($arrModules as $objSingleModule) {
         if ($objSingleModule->getIntRecordStatus() == 1 && $objSingleModule->getAdminInstanceOfConcreteModule() instanceof interface_calendarsource_admin) {
             $arrRelevantModules[] = $objSingleModule->getAdminInstanceOfConcreteModule();
         }
     }
     //the header row
     $arrWeekdays = explode(",", $this->getLang("calendar_weekday"));
     foreach ($arrWeekdays as $intKey => $strValue) {
         $arrWeekdays[$intKey] = trim(uniStrReplace("\"", "", $strValue));
     }
     $strContent .= $this->objToolkit->getCalendarHeaderRow($arrWeekdays);
     //render the single rows. calculate the first day of the row
     $objDate = new class_date();
     $objDate->setIntDay(1);
     //set to interval stored in session
     if ($this->objSession->getSession($this->strStartMonthKey) != "") {
         $objDate->setIntMonth($this->objSession->getSession($this->strStartMonthKey));
     }
     if ($this->objSession->getSession($this->strStartYearKey) != "") {
         $objDate->setIntYear($this->objSession->getSession($this->strStartYearKey));
     }
     $intCurMonth = $objDate->getIntMonth();
     $intCurYear = $objDate->getIntYear();
     $objToday = new class_date();
     //start by monday
     while ($objDate->getIntDayOfWeek() != 1) {
         $objDate->setPreviousDay();
     }
     $strEntries = "";
     $intRowEntryCount = 0;
     while ($objDate->getIntMonth() <= $intCurMonth && $objDate->getIntYear() <= $intCurYear || $objDate->getIntMonth() == 12 && $objDate->getIntYear() < $intCurYear || $intRowEntryCount % 7 != 0) {
         $intRowEntryCount++;
         $strDate = $objDate->getIntDay();
         $arrEvents = array();
         if ($objDate->getIntMonth() == $intCurMonth) {
             //Query modules for dates
             $objStartDate = clone $objDate;
             $objStartDate->setIntHour(0)->setIntMin(0)->setIntSec(0);
             $objEndDate = clone $objDate;
             $objEndDate->setIntHour(23)->setIntMin(59)->setIntSec(59);
             foreach ($arrRelevantModules as $objOneModule) {
                 $arrEvents = array_merge($objOneModule->getArrCalendarEntries($objStartDate, $objEndDate), $arrEvents);
             }
         }
         while (count($arrEvents) <= 3) {
             $objDummy = new class_calendarentry();
             $objDummy->setStrClass("spacer");
             $objDummy->setStrName("&nbsp;");
             $arrEvents[] = $objDummy;
         }
         $strEvents = "";
         /** @var class_calendarentry $objOneEvent */
         foreach ($arrEvents as $objOneEvent) {
             $strName = $objOneEvent->getStrName();
             $strSecondLine = $objOneEvent->getStrSecondLine();
             if ($strSecondLine != "") {
                 $strSecondLine = "<br />" . $strSecondLine;
             }
             //register mouse-over highlight relations
             if ($objOneEvent->getStrHighlightId() != "" && $objOneEvent->getStrSystemid() != "") {
                 if (!isset($arrJsHighlights[$objOneEvent->getStrHighlightId()])) {
                     $arrJsHighlights[$objOneEvent->getStrHighlightId()] = array();
                 }
                 $arrJsHighlights[$objOneEvent->getStrHighlightId()][] = $objOneEvent->getStrSystemid();
             }
             $strEvents .= $this->objToolkit->getCalendarEvent($strName . $strSecondLine, $objOneEvent->getStrSystemid(), $objOneEvent->getStrHighlightId(), $objOneEvent->getStrClass());
         }
         $bitBlocked = false;
         if ($objDate->getIntDayOfWeek() == 0 || $objDate->getIntDayOfWeek() == 6) {
             $bitBlocked = true;
         }
         $strToday = "";
         if ($objToday->getIntYear() == $objDate->getIntYear() && $objToday->getIntMonth() == $objDate->getIntMonth() && $objToday->getIntDay() == $objDate->getIntDay()) {
             $strToday = " calendarDateToday";
         }
         if ($objDate->getIntMonth() != $intCurMonth) {
             $strEntries .= $this->objToolkit->getCalendarEntry($strEvents, $strDate, "calendarEntryOutOfRange" . $strToday);
         } else {
             if ($bitBlocked) {
                 $strEntries .= $this->objToolkit->getCalendarEntry($strEvents, $strDate, "calendarEntryBlocked" . $strToday);
             } else {
                 $strEntries .= $this->objToolkit->getCalendarEntry($strEvents, $strDate, "calendarEntry" . $strToday);
             }
         }
         if ($intRowEntryCount % 7 == 0) {
             $strContent .= $this->objToolkit->getCalendarRow($strEntries);
             $strEntries = "";
         }
         $objDate->setNextDay();
     }
     if ($strEntries != "") {
         $strContent .= $this->objToolkit->getCalendarRow($strEntries);
     }
     $strReturn .= $this->objToolkit->getCalendarWrapper($strContent);
     //build js-arrays
     $strJs = "<script type=\"text/javascript\">";
     foreach ($arrJsHighlights as $strCommonId => $arrEntries) {
         $strJs .= " var kj_cal_" . $strCommonId . " = new Array();";
         foreach ($arrEntries as $strOneIdentifier) {
             $strJs .= "kj_cal_" . $strCommonId . ".push('" . $strOneIdentifier . "');";
         }
     }
     $strJs .= "</script>";
     $strReturn .= $strJs;
     $strReturn .= "]]></content>";
     return $strReturn;
 }
 /**
  * Creates and array which contains the years until 2099 starting from the current year
  *
  * @return array
  */
 private static function getArrYear()
 {
     $arrDropDownYear = array();
     $objCurrentDate = new class_date();
     for ($intI = $objCurrentDate->getIntYear(); $intI < 2100; $intI++) {
         $arrDropDownYear[$intI . ""] = $intI;
     }
     return $arrDropDownYear;
 }