Пример #1
0
 /**
  * Method to upgrade all registered packages at once
  *
  * @package MageBridge
  * @access public
  * @param int $allow_update
  * @return bool
  */
 public function updateAll($allow_update = array())
 {
     // Fetch all the available packages
     $packages = MageBridgeUpdateHelper::getPackageList();
     $count = 0;
     foreach ($packages as $package) {
         // Skip optional packages which are not yet installed and not selected in the list
         if (!in_array($package['name'], $allow_update)) {
             continue;
         }
         // Skip packages that are not available
         if ($package['available'] == 0) {
             continue;
         }
         // Update the package and add an error if something goes wrong
         if ($this->update($package['name']) == false) {
             JError::raiseWarning('SOME_ERROR_CODE', JText::sprintf('COM_MAGEBRIDGE_MODEL_UPDATE_INSTALL_FAILED', $package['name']));
             // Only crash when installing the component, continue for all other extensions
             if ($package['name'] == 'com_magebridge') {
                 return false;
             }
             continue;
         } else {
             $count++;
         }
     }
     // Run the helper to remove obsolete files
     YireoHelperInstall::remove();
     // Simple notices as feedback
     JError::raiseNotice('SOME_ERROR_CODE', JText::sprintf('COM_MAGEBRIDGE_MODEL_UPDATE_INSTALL_SUCCESS', $count));
     JError::raiseNotice('SOME_ERROR_CODE', JText::sprintf('COM_MAGEBRIDGE_MODEL_UPDATE_INSTALL_CHANGELOG', MageBridgeHelper::getHelpLink('changelog')));
     return true;
 }
Пример #2
0
 /**
  * Display method
  *
  * @param string $tpl
  * @return null
  */
 public function display($tpl = null)
 {
     // Add CSS-code
     $this->addCss('backend.css', 'media/com_magebridge/css/');
     if (MageBridgeHelper::isJoomla25()) {
         $this->addCss('backend-j25.css', 'media/com_magebridge/css/');
     }
     if (MageBridgeHelper::isJoomla35()) {
         $this->addCss('backend-j35.css', 'media/com_magebridge/css/');
     }
     // If we detect the API is down, report it
     $bridge = MageBridgeModelBridge::getInstance();
     if ($bridge->getApiState() != null) {
         $message = null;
         switch (strtoupper($bridge->getApiState())) {
             case 'EMPTY METADATA':
                 $message = JText::_('COM_MAGEBRIDGE_VIEW_API_ERROR_EMPTY_METADATA');
                 break;
             case 'SUPPORTKEY FAILED':
                 $message = JText::sprintf('COM_MAGEBRIDGE_VIEW_API_ERROR_KEY_FAILED', $bridge->getApiExtra());
                 break;
             case 'AUTHENTICATION FAILED':
                 $message = JText::_('COM_MAGEBRIDGE_VIEW_API_ERROR_AUTHENTICATION_FAILED');
                 break;
             case 'INTERNAL ERROR':
                 $message = JText::sprintf('COM_MAGEBRIDGE_VIEW_API_ERROR_INTERNAL_ERROR', MageBridgeHelper::getHelpLink('troubleshooting'));
                 break;
             case 'FAILED LOAD':
                 $message = JText::sprintf('COM_MAGEBRIDGE_VIEW_API_ERROR_FAILED_LOAD', MageBridgeHelper::getHelpLink('faq-troubleshooting:api-widgets'));
                 break;
             default:
                 $message = JText::sprintf('COM_MAGEBRIDGE_VIEW_API_ERROR_GENERIC', $bridge->getApiState());
                 break;
         }
         MageBridgeModelDebug::getInstance()->feedback($message);
     }
     // If debugging is enabled report it
     if (MagebridgeModelConfig::load('debug') == 1 && JFactory::getApplication()->input->getCmd('tmpl') != 'component' && in_array(JFactory::getApplication()->input->getCmd('view'), array('config', 'home'))) {
         MageBridgeModelDebug::getInstance()->feedback('COM_MAGEBRIDGE_VIEW_API_DEBUGGING_ENABLED');
     }
     parent::display($tpl);
 }
Пример #3
0
			<td class="key"><?php 
echo JText::_('COM_MAGEBRIDGE_CHECK_MAGENTO_CHECK');
?>
</td>
			<td class="result"><?php 
echo JText::_('COM_MAGEBRIDGE_CHECK_MAGENTO_CHECK_DESC');
?>
</td>
		</tr>
		<tr>
			<td class="key"><?php 
echo JText::_('COM_MAGEBRIDGE_CHECK_TROUBLESHOOTING_GUIDE');
?>
</td>
			<td class="result"><?php 
echo JText::sprintf('COM_MAGEBRIDGE_CHECK_TROUBLESHOOTING_GUIDE_DESC', MageBridgeHelper::getHelpLink('troubleshooting'));
?>
</td>
		</tr>
	</table>
	</fieldset>

	<fieldset class="adminform">
	<legend><?php 
echo JText::_('COM_MAGEBRIDGE_CHECK_COMPATIBILITY');
?>
</legend>
	<table class="admintable" width="100%">
	<?php 
foreach ($this->checks['compatibility'] as $result) {
    ?>