/**
  * Uninstall the related extensions that are useless without the component
  */
 protected function uninstallRelated()
 {
     parent::uninstallRelated();
     if ($this->relatedExtensions) {
         $installer = new JInstaller();
         foreach ($this->relatedExtensions as $type => $folders) {
             foreach ($folders as $folder => $extensions) {
                 foreach ($extensions as $element => $settings) {
                     if ($settings[1]) {
                         if ($current = $this->findExtension($type, $element, $folder)) {
                             $msg = 'LIB_ALLEDIAINSTALLER_RELATED_UNINSTALL';
                             $msgtype = 'message';
                             if (!$installer->uninstall($current->type, $current->extension_id)) {
                                 $msg .= '_FAIL';
                                 $msgtype = 'error';
                             }
                             $this->setMessage(JText::sprintf($msg, $type, $element), $msgtype);
                         }
                     }
                 }
             }
         }
     }
 }