public function upgrade() { parent::upgrade(); $pkg = Package::getByHandle($this->pkgHandle); //@todo write conversion from lang to locale //1.0 - 1.1 changed languaage to locale $db = Loader::db(); // update the MultilingualSections table $rows = $db->getAll("SELECT * FROM MultilingualSections"); if (is_array($rows) && count($rows)) { foreach ($rows as $r) { if (strlen($r['msLanguage']) && !strlen($r['msLocale'])) { $locale = $r['msLanguage'] . (strlen($r['msIcon']) ? "_" . $r['msIcon'] : ""); $db->query("UPDATE MultilingualSections SET msLocale = ? WHERE cID = ?", array($locale, $r['cID'])); } } } // install job Loader::model('job'); $jb = Job::installByPackage('generate_multilingual_sitemap', $pkg); // update the MultilingualPageRelations table $hasLocales = $db->getOne("SELECT COUNT(msLocale) FROM MultilingualSections WHERE LENGTH(msLocale)"); if (!$hasLocales) { $query = "UPDATE MultilingualPageRelations mpr, MultilingualSections \n\t\t\t\tSET mpr.mpLocale = MultilingualSections.msLocale\n\t\t\t\tWHERE mpr.mpLanguage = MultilingualSections.msLanguage"; $db->query($query); } // 1.1.2 $ak = CollectionAttributeKey::getByHandle('multilingual_exclude_from_copy'); if (!is_object($ak)) { CollectionAttributeKey::add('BOOLEAN', array('akHandle' => 'multilingual_exclude_from_copy', 'akName' => t('Exclude from Internationalization Copy'), 'akIsSearchable' => true), $pkg); } }
public function upgrade() { $pkg = $this; parent::upgrade(); /*if (!is_object(BlockType::getByHandle('simple_info'))) { BlockType::installBlockTypeFromPackage('simple_info', $pkg); }*/ }
function upgrade() { parent::upgrade(); /* Refresh all blocks */ Loader::model('block_types'); $items = array(BlockType::getByHandle('tweetcrete')); foreach ($items as $item) { $item->refresh(); } }
public function upgrade() { parent::upgrade(); //1.03 -> 1.04 //Update all positionTitles that were 'outside' to 'float' (new version of fancybox 1.3.4 changes 'outside' caption position to be unstyled, and provides a new 'float' position that looks like the old 'outside' position). $db = Loader::db(); $sql = 'UPDATE btDeluxeImageGallery SET lightboxTitlePosition = ? WHERE lightboxTitlePosition = ?'; $vals = array('float', 'outside'); $db->Execute($sql, $vals); }
public function upgrade() { // If you have an attribute type in your package that needs to // update it's database table, you will need to run this: // // $est = AttributeType::getByHandle('attribute_handle'); // $path = $est->getAttributeTypeFilePath(FILENAME_ATTRIBUTE_DB); // Package::installDB($path); parent::upgrade(); $pkg = Package::getByHandle($this->pkgHandle); $this->installAdditionalPageAttributes($pkg); $this->installJobs($pkg); }
public function upgrade() { // In case the schema changed, drop all cobble tables $db = Loader::db(); $db->Execute('DROP TABLE CobblePageThemes, CobblePageTypes, CobbleAreas, CobblePages, CobbleTemplateAreas'); // This needs to be called AFTER dropping tables! parent::upgrade(); // not using the job any more so remove it if it exists... Loader::model('job'); $job = Job::getByHandle('cobble_refresh'); if (!empty($job)) { $job->uninstall(); } }
public function upgrade() { parent::upgrade(); if (is_writable("./jobs")) { $job = Job::getByHandle('si_mysql_optimize'); if ($job) { $job->uninstall(); } @unlink("./jobs/si_mysql_optimize.php"); // We have to uninstall the package on the upgrade because on earlier versions the job was copied in the "/job/" directory. // In the new version we leave it in the "job" directory in the package. But this is the only way to upgrade, because // otherwise we would redeclare the class (here: "/job/si_mysql_optimize.php" and there "/packages/si_mysql_optimize/jobs/si_mysql_optimize.php") $this->uninstall(); } }
public function upgrade() { $this->installOrUpgrade($this); parent::upgrade(); }
public function upgrade() { $pkg = Package::getByHandle($this->pkgHandle); $this->installPageLinkAttribute($pkg); parent::upgrade(); }
public function upgrade() { $fromVersion = $this->getPackageVersion(); parent::upgrade(); $this->installOrUpgrade($this, $fromVersion); }
public function upgrade() { $pkg = Package::getByHandle('designer_content'); $this->_upgrade($pkg); parent::upgrade(); }
public function upgrade() { parent::upgrade(); $this->pkg = Package::getByHandle('remo_composer_list'); $this->addBlock('remo_attribute_edit'); }