Location: PHPKode > projects > injooosm > components/com_injooosm/controller.php
<?php
/**
 * Joomla! 1.5 component injooosm
 *
 * @version $Id: controller.php 2010-01-29 14:03:00$
 * @author Christian Knorr
 * @package injooosm
 * @subpackage frontend
 * @license GNU/GPL
 * @filesource
 *
 */

// no direct access
defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.controller');

/**
 * injooosm Component Controller
 */
class injooosmController extends JController {
	function display() {
        // Make sure we have a default view
        if( !JRequest::getCmd( 'view' )) {
		    JRequest::setVar('view', 'injooosm' );
        }

		//update the hit count for the file
		if(JRequest::getCmd('view') == 'files')
		{
			$model =& $this->getModel('files');
			$model->hit();
		}

		parent::display();
	}

    /**
     * calls the captcha image
     */
    function displayimg()
    {
            global $mainframe;
            // By default, just display an image
            $document = &JFactory::getDocument();
            $doc = &JDocument::getInstance('raw');
            // Swap the objects
            $document = $doc;
	    $mainframe->triggerEvent('onCaptcha_display', array());
    }
}
Return current item: injooosm