public function install() { parent::install(); //1. move template for advanced search panel //the standard algorithm already moves userdata/view templates into plugin separate direstory thats why we need to move this file into main template directory $rootPath = RM_Environment::getConnector()->getRootPath(); $pluginFolderPath = implode(DIRECTORY_SEPARATOR, array($rootPath, 'RM', 'userdata', 'modules', $this->name, 'views', 'user', 'scripts', 'Search', 'advanced', 'category_advanced.phtml')); $userdataFolderPath = implode(DIRECTORY_SEPARATOR, array($rootPath, 'RM', 'userdata', 'views', 'user', 'scripts', 'Search', 'advanced', 'category_advanced.phtml')); return rename($pluginFolderPath, $userdataFolderPath); }
public function install() { parent::install(); //Add iso columns into rm_extras table for each already installed language $languageModule = new RM_Languages(); $languages = $languageModule->fetchAll(); require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'Extras.php'; $extrasModule = new RM_Extras(); foreach ($languages as $language) { $extrasModule->addLanguage($language->iso); } }
public function install() { parent::install(); $languageModule = new RM_Languages(); $languages = $languageModule->fetchAll(); require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'EmailNotifications.php'; $model = new RM_EmailNotifications(); foreach ($languages as $language) { if ($language->iso !== 'en_GB') { $model->addLanguage($language->iso); } } //Currently we just added extra columns and need to clean cache Zend_Db_Table_Abstract::getDefaultMetadataCache()->clean(); //Copy en_GB default value to all other languages $emailNotification = $model->fetchByName('ReservationCompleteSuccessful', RM_EmailNotifications::REGULAR_USER); foreach ($languages as $language) { $iso = $language->iso; if ($iso !== 'en_GB') { $emailNotification->{$iso} = $emailNotification->en_GB; } } $emailNotification->save(); }