/** * method to run before an install/update/uninstall method * * @param string $type 'install', 'update' or 'discover_install' * @param JInstallerAdapterComponent $parent Installerobject * * @return boolean false will terminate the installation */ public function preflight($type, $parent) { $min_version = (string) $parent->get('manifest')->attributes()->version; $jversion = new JVersion(); if (!$jversion->isCompatible($min_version)) { JFactory::getApplication()->enqueueMessage(JText::sprintf('PLG_CONTENT_BIBLELINK_XT_VERSION_UNSUPPORTED', $min_version), 'error'); return false; } return true; }
/** * method to run before an install/update/uninstall method * * @param string $type 'install', 'update' or 'discover_install' * @param JInstallerAdapterComponent $parent Installerobject * * @since 1.0 * * @return boolean false will terminate the installation */ public function preflight($type, $parent) { $min_version = (string) $parent->get('manifest')->attributes()->version; $jversion = new JVersion(); if (!$jversion->isCompatible($min_version)) { $this->app->enqueueMessage(JText::sprintf('COM_SICHTWEITEN_VERSION_UNSUPPORTED', $min_version), 'error'); return false; } // Storing old release number for process in postflight if ($type == 'update') { $this->oldRelease = $this->getParam('version'); } return true; }
/** * Make sure the Component menu items are really published! * * @param JInstallerAdapterComponent $parent * * @return bool */ private function _reallyPublishAdminMenuItems($parent) { $db = F0FPlatform::getInstance()->getDbo(); $option = $parent->get('element'); $query = $db->getQuery(true)->update('#__menu AS m')->join('LEFT', '#__extensions AS e ON m.component_id = e.extension_id')->set($db->qn('published') . ' = ' . $db->q(1))->where('m.parent_id = 1')->where('m.client_id = 1')->where('e.type = ' . $db->quote('component'))->where('e.element = ' . $db->quote($option)); $db->setQuery($query); try { $db->execute(); } catch (Exception $e) { // If it fails, it fails. Who cares. } }