function check_crossword_result()
 {
     global $option;
     if (!CWAuthorization::authorize($option, 'access', 'crosswords', 'all')) {
         echo json_encode(array('error' => JText::_('MSG_NOT_AUTHORIZED')));
     } else {
         $model =& $this->getModel('crosswords');
         $failed = $model->check_result();
         if ($failed === false) {
             echo json_encode(array('error' => $model->getError()));
         } else {
             if (empty($failed)) {
                 $cid = JRequest::getVar("id", 0, "post", "int");
                 $crossword =& $model->get_crossword($cid, false);
                 CrosswordsHelper::awardPoints($user->id, 2, $crossword, JText::_('TXT_AWARD_POINTS_SOLVED_CROSSWORD'));
                 $app =& JFactory::getApplication();
                 $cwConfig = $app->getUserState(SESSION_CONFIG);
                 if ($cwConfig[STREAM_SOLVED_CROSSWORD] == '1') {
                     CrosswordsHelper::streamActivity(2, $crossword);
                 }
                 echo json_encode(array('message' => JText::_('MSG_CROSSWORD_SOLVED')));
             } else {
                 echo json_encode(array('failed' => $failed));
             }
         }
     }
     jexit();
 }
</a>
				<?php 
}
?>
				<?php 
if (CWAuthorization::authorize($option, 'words', 'crosswords', 'all')) {
    ?>
				<a id="menu-submit_question" href="#"><?php 
    echo JText::_("LBL_SUBMIT_QUESTION");
    ?>
</a>
				<?php 
}
?>
				<?php 
if (CWAuthorization::authorize($option, 'create', 'crosswords', 'all')) {
    ?>
				<a id="menu-create_crossword" href="#"><?php 
    echo JText::_("LBL_CREATE_CROSSWORD");
    ?>
</a>
				<?php 
}
?>
			</span>
		</div>
	</div>
	<?php 
if (!empty($this->crosswords)) {
    ?>
	<div class="page-title" style="margin-top: 10px;"><?php 
 *
 * Crosswords is a Joomla component to generate crosswords with Community touch.
 */
// no direct access
defined('_JEXEC') or die('Restricted access');
jimport('joomla.filesystem.file');
global $option;
// Require the base controller
require_once JPATH_COMPONENT . DS . 'controller.php';
require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'helper.php';
require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'constants.php';
require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'template.php';
require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'cwauthorization.php';
require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'Date_Difference.php';
JFactory::getApplication()->set('jquery', true);
if (!JRequest::getVar('view')) {
    JRequest::setVar('view', 'crosswords');
}
$cwConfig =& CrosswordsHelper::getConfig(true);
$auth = new CWAuthorization($cwConfig);
if (!CWAuthorization::authorize($option, "access", "crosswords", "all")) {
    JError::raiseError(403, JText::_('Access Forbidden. Error Code: 10003.'));
}
// Initialize the controller
$controller = new CrosswordsController();
$controller->execute(JRequest::getCmd("task"));
// Redirect if set by the controller
$controller->redirect();
if ($cwConfig[ENABLE_POWERED_BY]) {
    echo CrosswordsHelper::getPoweredByLink();
}