'; $button .= '
'; return $button; } function addLogo( ) { $button = ''; $button .= ''; return $button; } function getVersion($defaultVer) { $version = $defaultVer; $xmlFN = JPATH_ADMINISTRATOR .DS. 'components'.DS.'com_sql2excel'.DS.'install.xml'; if ( file_exists($xmlFN) ) { $xmltokens = JApplicationHelper::parseXMLInstallFile($xmlFN); if ( is_array($xmltokens ) ) { if ( isset( $xmltokens{'version'} ) ) { $version = $xmltokens{'version'}; } } } return $version; } /** * Method to get check if a upgrade is needed * @return empty string if no upgrade is needed. returns upgrade message if it is needed. */ function upgradeMessage() { $upgrade = ''; // Version 0.9.2 - Check #__sql2excel_worksheets columns $db = & JFactory::getDBO(); $query = 'SHOW COLUMNS FROM #__sql2excel_worksheets'; $db->setQuery( $query ); $cols = $db->loadObjectList(); // Pro 1.0.1, 1.1.3, 1.2.2, 1.6.0, 1.7.0, 2.1.0, 2.4.0, 2.5.0 if ( count($cols) < 40 ) { return $upgrade; } else { // Pro 1.0.1 - (15) // Pro 1.2.0 - (17) // Pro 1.6.0 - (19) // Pro 1.9.0 - (20) // Pro 2.4.0 - (23) // Pro 2.5.0 - (24) $db = & JFactory::getDBO(); $query = 'SHOW COLUMNS FROM #__sql2excel_workbooks'; $db->setQuery( $query ); $cols = $db->loadObjectList(); if ( count($cols) < 24 ) { return $upgrade; } else { if ( ! Sql2excelControlPanel::tableExists('#__sql2excel_databases') ) { return $upgrade; } else { // 1.6.0 (23) // 1.8.0 (36) $db = & JFactory::getDBO(); $query = 'SHOW COLUMNS FROM #__sql2excel_schedules'; $db->setQuery( $query ); $cols = $db->loadObjectList(); if ( count($cols) < 36 ) { return $upgrade; } else { return ''; } } } } } function tableExists($tableName) { $db = & JFactory::getDBO(); $prefix = $db->getPrefix(); $tableName = str_replace('#__', $prefix, $tableName); $tableList = $db->getTableList($db); if ( in_array($tableName,$tableList) ) { return true; } else { return false; } } }