setIniParser ($this->getQuaziIniParser ()); $this->patchDatabase (); if ($this->getDictionaryUpdate ()) { $this->updateDictionaries (); $this->updateLocale (); } else { $this->notice ('No dictionaries were updated.'); } $installed_templates = array (); if ($this->getTemplateClearance ()) { $this->notice ('Removing all the templates.'); $this->clearTemplates (); } $this->updateCurrencyRate (); $this->updateTemplates ($installed_templates); $this->updateDiscountedPrice (); $this->updateTemplateCount (); Addon_Manifest::enumerate ('onPeriodicUpdate', $this->logger ()); $this->updateLastTimeParameter (); $this->notifyAboutUpdate ($installed_templates); if ($this->getScreenshotUpdate () and Setting_Model::get (Setting_Model::S_SCREENSHOT_LOCAL)) { $this->downloadQueuedScreenshots (); $this->downloadTemplatePreviews (); } else { $this->notice ('No screenshots were downloaded.'); } if ($this->getVirtualMenuUpdate() && $this->isVirtualMenuConstantAvailable()) { $this->updateVirtualTypeMenu(); } } private function getQuaziIniParser () { $config = array ( 'template' => array ( 'initial' => $this->getTemplateCount (), 'start_from' => $this->getTemplateStartFrom () )); return new Parser_Ini_Setup (new Zend_Config ($config)); } function setTemplateCount ($template_count) { $this->template_count = $template_count; } private function getTemplateCount () { return $this->template_count; } function setTemplateStartFrom ($start_from) { $this->start_from = $start_from; } function getTemplateStartFrom () { if (isset ($this->start_from)) { return $this->start_from; } return 0; } private function notifyAboutUpdate ($installed_templates) { $this->notice ('Sending an e-mail notification to the site admin.'); $new_template_info = 'No new templates were installed.'; if ($installed_templates) { $new_template_info =''; if(isset($installed_templates['Installing']) && is_array($installed_templates['Installing']) && count($installed_templates['Installing']) ) { $installed_count = count($installed_templates['Installing']); $new_template_info .= ($installed_count > 1)?'New templates have been installed: ':'New template has been installed: '; $new_template_info .= join(', ', array_slice($installed_templates['Installing'], 0, self::MAX_NUMBER_OF_TEMPLATES_IN_NOTIFICATION)); if ($installed_count > self::MAX_NUMBER_OF_TEMPLATES_IN_NOTIFICATION) { $new_template_info .= sprintf(' and %s more.', $installed_count - self::MAX_NUMBER_OF_TEMPLATES_IN_NOTIFICATION); } $new_template_info .= '
'; } if(isset($installed_templates['Updating']) && is_array($installed_templates['Updating']) && count($installed_templates['Updating']) ) { $updated_count = count($installed_templates['Updating']); $new_template_info .= $updated_count; $new_template_info .= ($updated_count >1)?' templates have been updated.':' template has been updated.'; $new_template_info .= '
'; } } $site = url::getSiteRootUrl (); $text = <<
Your Ready Made Affiliate Shop has been updated

Your Ready Made Affiliate Shop template information has been updated.

$new_template_info

The link to your shop is $site

html; $this->sendEmail ("Template data for your shop $site were successfully updated!", $text); } function setDictionaryUpdate ($flag_dictionary) { $this->flag_dictionary = $flag_dictionary; } function getDictionaryUpdate () { return $this->flag_dictionary; } function setScreenshotUpdate ($flag_screenshots) { $this->flag_screenshots = $flag_screenshots; } function getScreenshotUpdate () { return $this->flag_screenshots; } function setTemplateClearance ($flag_remove_templates) { $this->flag_remove_templates = $flag_remove_templates; } function getTemplateClearance () { return $this->flag_remove_templates; } function setVirtualMenuUpdate($flag_virtual_type_menu) { $this->flag_virtual_type_menu = $flag_virtual_type_menu; } function getVirtualMenuUpdate() { return $this->flag_virtual_type_menu; } }