Exemplo n.º 1
0
 public function setLicensePlaceholders($template)
 {
     $date = $this->license->getValidToDate();
     if ($date) {
         $formattedValidityDate = date(ASCMS_DATE_FORMAT_DATE, $date);
     } else {
         $formattedValidityDate = '';
     }
     $date = $this->license->getCreatedAtDate();
     if ($date) {
         $formattedCreateDate = date(ASCMS_DATE_FORMAT_DATE, $date);
     } else {
         $formattedCreateDate = '';
     }
     $cdate = $this->license->getValidToDate();
     $today = time();
     $difference = $cdate - $today;
     if ($difference < 0) {
         $difference = 0;
     }
     $validDayCount = ceil($difference / 60 / 60 / 24) - 1;
     if ($validDayCount < 0) {
         $validDayCount = 0;
     }
     $template->setVariable(array('LICENSE_STATE' => $this->lang['TXT_LICENSE_STATE_' . $this->license->getState()], 'LICENSE_EDITION' => contrexx_raw2xhtml($this->license->getEditionName()), 'INSTALLATION_ID' => contrexx_raw2xhtml($this->license->getInstallationId()), 'LICENSE_KEY' => contrexx_raw2xhtml($this->license->getLicenseKey()), 'LICENSE_VALID_TO' => contrexx_raw2xhtml($formattedValidityDate), 'LICENSE_VALID_DAY_COUNT' => contrexx_raw2xhtml($validDayCount), 'LICENSE_CREATED_AT' => contrexx_raw2xhtml($formattedCreateDate), 'LICENSE_REQUEST_INTERVAL' => contrexx_raw2xhtml($this->license->getRequestInterval()), 'LICENSE_GRAYZONE_DAYS' => contrexx_raw2xhtml($this->license->getGrayzoneTime()), 'LICENSE_FRONTENT_OFFSET_DAYS' => contrexx_raw2xhtml($this->license->getFrontendLockTime()), 'LICENSE_UPGRADE_URL' => contrexx_raw2xhtml($this->license->getUpgradeUrl()), 'LICENSE_PARTNER_TITLE' => contrexx_raw2xhtml($this->license->getPartner()->getTitle()), 'LICENSE_PARTNER_LASTNAME' => contrexx_raw2xhtml($this->license->getPartner()->getLastname()), 'LICENSE_PARTNER_FIRSTNAME' => contrexx_raw2xhtml($this->license->getPartner()->getFirstname()), 'LICENSE_PARTNER_COMPANY' => contrexx_raw2xhtml($this->license->getPartner()->getCompanyName()), 'LICENSE_PARTNER_ADDRESS' => contrexx_raw2xhtml($this->license->getPartner()->getAddress()), 'LICENSE_PARTNER_ZIP' => contrexx_raw2xhtml($this->license->getPartner()->getZip()), 'LICENSE_PARTNER_CITY' => contrexx_raw2xhtml($this->license->getPartner()->getCity()), 'LICENSE_PARTNER_COUNTRY' => contrexx_raw2xhtml($this->license->getPartner()->getCountry()), 'LICENSE_PARTNER_PHONE' => contrexx_raw2xhtml($this->license->getPartner()->getPhone()), 'LICENSE_PARTNER_URL' => contrexx_raw2xhtml($this->license->getPartner()->getUrl()), 'LICENSE_PARTNER_MAIL' => contrexx_raw2xhtml($this->license->getPartner()->getMail()), 'LICENSE_CUSTOMER_TITLE' => contrexx_raw2xhtml($this->license->getCustomer()->getTitle()), 'LICENSE_CUSTOMER_LASTNAME' => contrexx_raw2xhtml($this->license->getCustomer()->getLastname()), 'LICENSE_CUSTOMER_FIRSTNAME' => contrexx_raw2xhtml($this->license->getCustomer()->getFirstname()), 'LICENSE_CUSTOMER_COMPANY' => contrexx_raw2xhtml($this->license->getCustomer()->getCompanyName()), 'LICENSE_CUSTOMER_ADDRESS' => contrexx_raw2xhtml($this->license->getCustomer()->getAddress()), 'LICENSE_CUSTOMER_ZIP' => contrexx_raw2xhtml($this->license->getCustomer()->getZip()), 'LICENSE_CUSTOMER_CITY' => contrexx_raw2xhtml($this->license->getCustomer()->getCity()), 'LICENSE_CUSTOMER_COUNTRY' => contrexx_raw2xhtml($this->license->getCustomer()->getCountry()), 'LICENSE_CUSTOMER_PHONE' => contrexx_raw2xhtml($this->license->getCustomer()->getPhone()), 'LICENSE_CUSTOMER_URL' => contrexx_raw2xhtml($this->license->getCustomer()->getUrl()), 'LICENSE_CUSTOMER_MAIL' => contrexx_raw2xhtml($this->license->getCustomer()->getMail()), 'VERSION_NUMBER' => contrexx_raw2xhtml($this->license->getVersion()->getNumber()), 'VERSION_NUMBER_INT' => contrexx_raw2xhtml($this->license->getVersion()->getNumber(true)), 'VERSION_NAME' => contrexx_raw2xhtml($this->license->getVersion()->getName()), 'VERSION_CODENAME' => contrexx_raw2xhtml($this->license->getVersion()->getCodeName()), 'VERSION_STATE' => contrexx_raw2xhtml($this->license->getVersion()->getState()), 'VERSION_RELEASE_DATE' => contrexx_raw2xhtml($this->license->getVersion()->getReleaseDate())));
     if ($template->blockExists('upgradable')) {
         if ($this->license->isUpgradable()) {
             $template->touchBlock('upgradable');
         } else {
             $template->hideBlock('upgradable');
         }
     }
 }