/**
  * Handle onAfterDispatch event to load template override.
  *
  * @return  void
  */
 public function onAfterDispatch()
 {
     $app = JFactory::getApplication();
     $doc = JFactory::getDocument();
     if ($app->isSite() and $doc->getType() == 'html' and JSNTplTemplateRecognization::detect()) {
         if ($app->input->getInt('jsntpl_position', 0) && $app->input->getInt('tp', 0)) {
             $config = JFactory::getConfig();
             $secret = $config->get('secret');
             if (md5($secret) == $app->input->getCmd('secret_key', '')) {
                 JSNTplTemplatePositionrender::renderEmptyComponent();
                 JSNTplTemplatePositionrender::renderEmptyModule();
             }
         }
     }
 }