/pdf/code/trunk/administrator/components/com_artofpdf/controllers/pdfs.php
PHP | 69 lines | 29 code | 7 blank | 33 comment | 1 complexity | 1075e6f28b3bead4992c89ac8735274c MD5 | raw file
- <?php
- /**
- * @version $Id: pdfs.php 278 2010-09-14 11:11:09Z eddieajau $
- * @package NewLifeInIT
- * @subpackage com_artofpdf
- * @copyright Copyright 2010 New Life in IT Pty Ltd. All rights reserved.
- * @license GNU General Public License version 2 or later.
- * @link http://www.theartofjoomla.com
- */
- // No direct access
- defined('_JEXEC') or die;
- juimport('joomla.application.component.controlleradmin');
- /**
- * ArtofPdf display helper.
- *
- * @package NewLifeInIT
- * @subpackage com_artofpdf
- * @since 1.0
- */
- class ArtofPdfControllerPdfs extends JControllerAdmin
- {
- /**
- * Method to copy an existing PDF.
- *
- * @return void
- * @since 1.0
- */
- public function duplicate()
- {
- // Check for request forgeries
- JRequest::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
- // Initialise variables.
- $pks = JRequest::getVar('cid', array(), 'post', 'array');
- try
- {
- if (empty($pks)) {
- throw new Exception(JText::_('COM_ARTOFPDF_NO_PDF_SELECTED'));
- }
- $model = $this->getModel();
- $model->duplicate($pks);
- $this->setMessage(JText::_('COM_ARTOFPDF_SUCCESS_DUPLICATED'));
- }
- catch (Exception $e)
- {
- JError::raiseWarning(500, $e->getMessage());
- }
- $this->setRedirect('index.php?option=com_artofpdf&view=pdfs');
- }
- /**
- * Proxy to get the model for this controller.
- *
- * @param string $name The model name. Optional.
- * @param string $prefix The class prefix. Optional.
- *
- * @return object The model.
- * @since 1.0
- */
- public function getModel($name = 'Pdf', $prefix = 'ArtofPdfModel')
- {
- return parent::getModel($name, $prefix, array('ignore_request' => true));
- }
- }