Exemple #1
0
 /**
  * Method to delete Content Element file.
  *
  * @return  boolean  True if successful, false otherwise.
  */
 public function deleteContentElement()
 {
     // Check for request forgeries.
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     $app = JFactory::getApplication();
     $option = $app->input->getString('component');
     $xmlFile = $app->input->getString('contentElement');
     if ($xmlFile == 'all') {
         RTranslationTable::batchContentElements($option, 'delete');
     } else {
         RTranslationTable::deleteContentElement($option, $xmlFile);
     }
     $this->redirectAfterAction();
 }
Exemple #2
0
 /**
  * Install the package translations
  *
  * @param   JInstallerAdapter  $parent  class calling this method
  *
  * @return  void
  */
 protected function installTranslations($parent)
 {
     // Required objects
     $manifest = $parent->get('manifest');
     if (method_exists('RTranslationTable', 'batchContentElements')) {
         if ($nodes = $manifest->translations->translation) {
             foreach ($nodes as $node) {
                 $extName = (string) $node->attributes()->name;
                 try {
                     RTranslationTable::batchContentElements($extName, 'install', false);
                 } catch (Exception $e) {
                     // We are already setting message queue so we don't need to set it here as well
                 }
                 $this->_storeStatus('translations', array('name' => $extName, 'result' => true));
             }
         }
     }
 }