english/administrator/components/com_modules/controllers/modules.php
/**
	 * Method to clone an existing module.
	 * @since	1.6
	 */
Method to clone an existing module.
Method to clone an existing module .
public function duplicate()
	{
		JRequest::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
		$pks = JRequest::getVar('cid', array(), 'post', 'array');
		JArrayHelper::toInteger($pks);
		try {
			if (empty($pks)) {
				throw new Exception(JText::_('COM_MODULES_ERROR_NO_MODULES_SELECTED'));
			}
			$model = $this->getModel();
			$model->duplicate($pks);
			$this->setMessage(JText::plural('COM_MODULES_N_MODULES_DUPLICATED', count($pks)));
		} catch (Exception $e) {
			JError::raiseWarning(500, $e->getMessage());
		}
		$this->setRedirect('index.php?option=com_modules&view=modules');
	}
public function duplicate ( ) { JRequest :: checkToken ( ) or jexit ( JText :: _ ( 'JINVALID_TOKEN' ) ) ; $ pks = JRequest :: getVar ( 'cid' , array ( ) , 'post' , 'array' ) ; JArrayHelper :: toInteger ( $ pks ) ; try { if ( empty ( $ pks ) ) { throw new Exception ( JText :: _ ( 'COM_MODULES_ERROR_NO_MODULES_SELECTED' ) ) ; } $ model = $ this -> getModel ( ) ; $ model -> duplicate ( $ pks ) ; $ this -> setMessage ( JText :: plural ( 'COM_MODULES_N_MODULES_DUPLICATED' , count ( $ pks ) ) ) ; } catch ( Exception $ e ) { JError :: raiseWarning ( 500 , $ e -> getMessage ( ) ) ; } $ this -> setRedirect ( 'index.php?option=com_modules&view=modules' ) ; }
Method to clone an existing module.
Method to clone an existing module .
// Check for request forgeries // Initialise variables.