| @@ 549-567 (lines=19) @@ | ||
| 546 | } |
|
| 547 | ||
| 548 | // Delete the older file and redirect |
|
| 549 | if ($path !== $oldpath && file_exists($oldpath)) |
|
| 550 | { |
|
| 551 | if (!JFile::delete($oldpath)) |
|
| 552 | { |
|
| 553 | $app->enqueueMessage(JText::_('COM_LOCALISE_ERROR_OLDFILE_REMOVE'), 'notice'); |
|
| 554 | } |
|
| 555 | ||
| 556 | $task = JFactory::getApplication()->input->get('task'); |
|
| 557 | ||
| 558 | if ($task == 'save') |
|
| 559 | { |
|
| 560 | $app->redirect(JRoute::_('index.php?option=com_localise&view=packages', false)); |
|
| 561 | } |
|
| 562 | else |
|
| 563 | { |
|
| 564 | // Redirect to the new $id as name has changed |
|
| 565 | $app->redirect(JRoute::_('index.php?option=com_localise&view=packagefile&layout=edit&id=' . $this->getState('packagefile.id'), false)); |
|
| 566 | } |
|
| 567 | } |
|
| 568 | ||
| 569 | $this->cleanCache(); |
|
| 570 | ||
| @@ 565-583 (lines=19) @@ | ||
| 562 | } |
|
| 563 | ||
| 564 | // Delete the older file and redirect |
|
| 565 | if ($path !== $oldpath && file_exists($oldpath)) |
|
| 566 | { |
|
| 567 | if (!JFile::delete($oldpath)) |
|
| 568 | { |
|
| 569 | $app->enqueueMessage(JText::_('COM_LOCALISE_ERROR_OLDFILE_REMOVE'), 'notice'); |
|
| 570 | } |
|
| 571 | ||
| 572 | $task = JFactory::getApplication()->input->get('task'); |
|
| 573 | ||
| 574 | if ($task == 'save') |
|
| 575 | { |
|
| 576 | $app->redirect(JRoute::_('index.php?option=com_localise&view=packages', false)); |
|
| 577 | } |
|
| 578 | else |
|
| 579 | { |
|
| 580 | // Redirect to the new $id as name has changed |
|
| 581 | $app->redirect(JRoute::_('index.php?option=com_localise&view=package&layout=edit&id=' . $this->getState('package.id'), false)); |
|
| 582 | } |
|
| 583 | } |
|
| 584 | ||
| 585 | $this->cleanCache(); |
|
| 586 | ||