public static function isPluginInstalled($strPluginName) { $installedPlugins = QPluginConfigParser::parseInstalledPlugins(); $found = false; foreach ($installedPlugins as $plugin) { if (strcmp($plugin->strName, $strPluginName) == 0) { $found = true; break; } } return $found; }
protected function Form_Create() { $strPluginName = QApplication::QueryString('strName'); $this->strPluginType = QApplication::QueryString('strType'); if (!isset($strPluginName) || !isset($this->strPluginType) || strlen($strPluginName) == 0 || strlen($this->strPluginType) == 0) { throw new Exception("Mandatory parameter was not set"); } if ($this->strPluginType == self::TYPE_VIEWING_ALREADY_INSTALLED) { $installedPlugins = QPluginConfigParser::parseInstalledPlugins(); foreach ($installedPlugins as $item) { if ($item->strName == $strPluginName) { $this->objPlugin = $item; } } } else { if ($this->strPluginType == self::TYPE_INSTALLING_NEW) { $configFile = __INCLUDES__ . QPluginInstaller::PLUGIN_EXTRACTION_DIR . $strPluginName . '/' . QPluginInstaller::PLUGIN_CONFIG_FILE; $this->objPlugin = QPluginConfigParser::parseNewPlugin($configFile); } else { throw new Exception("Invalid value of the type URL parameter: " . $this->strPluginType); } } if ($this->objPlugin == null) { throw new Exception("Plugin not found: " . $strPluginName); } $this->lblName_Create(); $this->lblDescription_Create(); $this->lblPluginVersion_Create(); $this->lblPlatformVersion_Create(); $this->lblAuthorName_Create(); $this->lblAuthorEmail_Create(); $this->lblFiles_Create(); $this->dlgStatus_Create(); $this->btnInstall_Create(); $this->btnCancelInstallation_Create(); $this->btnUninstall_Create(); $this->objDefaultWaitIcon = new QWaitIcon($this); }
public function dtgPlugins_Bind() { $this->dtgPlugins->DataSource = QPluginConfigParser::parseInstalledPlugins(); }
private static function augmentWithInstalledInfo(&$arrLatestVersions) { $arrInstalledPlugins = QPluginConfigParser::parseInstalledPlugins(); // Augment the list of instlaled plugins with QCubed core version $objCore = new QPlugin(); $objCore->strName = "QCubed"; $objCore->strVersion = QCUBED_VERSION_NUMBER_ONLY; $arrInstalledPlugins[] = $objCore; foreach ($arrLatestVersions as $objDownloadedItem) { /** @var $objDownloadedItem DownloadedItem */ foreach ($arrInstalledPlugins as $objInstalledPlugin) { /** @var $objInstalledPlugin QPlugin */ if (strtolower($objInstalledPlugin->strName) == strtolower($objDownloadedItem->name)) { $objDownloadedItem->installedVersion = floatval($objInstalledPlugin->strVersion); break; } } } }