Example #1
0
 function display($tpl = null)
 {
     $this->Application = JFactory::getApplication();
     $user = JFactory::getUser();
     $this->cparams = $this->Application->getMenu()->getActive()->params;
     if ($description = $this->cparams->get('menu-meta_description')) {
         $this->document->setDescription($description);
     }
     if ($keywords = $this->cparams->get('menu-meta_keywords')) {
         $this->document->setMetadata('keywords', $keywords);
     }
     if ($robots = $this->cparams->get('robots')) {
         $this->document->setMetadata('robots', $robots);
     }
     $prefix = "index.php?option=" . $this->Application->scope . "&view=loader" . "&owner=" . $this->Application->owner . "&bid=" . $this->Application->bid . "&id=" . $this->Application->oid;
     $b2jContactModel = new B2jContactModelContact();
     $b2jContactItem = $b2jContactModel->getItem($this->Application->bid, $this->cparams);
     $this->cparams = $b2jContactItem->params;
     $groups = $user->getAuthorisedViewLevels();
     if (!in_array($b2jContactItem->access, $groups)) {
         JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR'));
         return;
     }
     $stylesheet = "b2jcontact.css";
     $css_name = preg_replace("/\\.[^.\\s]{3,4}\$/", "", $stylesheet);
     $this->document->addStyleSheet($prefix . "&root=components&type=css&filename=" . $css_name);
     $this->MessageBoard = new B2JMessageBoard();
     $this->FieldsBuilder = new B2JFieldsBuilder($this->cparams, $this->MessageBoard);
     $this->Submitter = new B2JSubmitter($this->cparams, $this->MessageBoard, $this->FieldsBuilder);
     $this->AjaxUploader = new B2JAjaxUploader($this->cparams, $this->MessageBoard);
     $this->Uploader = new B2JUploader($this->cparams, $this->MessageBoard);
     $this->B2jCaptcha = new B2JCaptcha($this->cparams, $this->MessageBoard);
     $this->JMessenger = new B2JJMessenger($this->cparams, $this->MessageBoard, $this->FieldsBuilder);
     $this->Antispam = new B2JAntispam($this->cparams, $this->MessageBoard, $this->FieldsBuilder);
     $this->AdminMailer = new B2JAdminMailer($this->cparams, $this->MessageBoard, $this->FieldsBuilder);
     $this->SubmitterMailer = new B2JSubmitterMailer($this->cparams, $this->MessageBoard, $this->FieldsBuilder);
     $this->FormText .= $this->FieldsBuilder->Show();
     $this->FormText .= $this->AjaxUploader->Show();
     $this->FormText .= $this->B2jCaptcha->Show();
     $this->FormText .= $this->Antispam->Show();
     $this->FormText .= $this->Submitter->Show();
     switch (0) {
         case $this->Submitter->IsValid():
             break;
         case $this->FieldsBuilder->IsValid():
             break;
         case $this->AjaxUploader->IsValid():
             break;
         case $this->Uploader->IsValid():
             break;
         case $this->B2jCaptcha->IsValid():
             break;
         case $this->Antispam->IsValid():
             break;
         case $this->JMessenger->Process():
             break;
         case $this->AdminMailer->Process():
             break;
         case $this->SubmitterMailer->Process():
             break;
         default:
             $this->FormText = "";
             $jsession = JFactory::getSession();
             $b2jsession = new B2JSession($jsession->getId(), $this->Application->b2jcomid, $this->Application->b2jmoduleid, $this->Application->bid);
             $b2jsession->PurgeValue("captcha_answer");
             B2JHeaderRedirect($this->cparams);
     }
     if (count($errors = $this->get('Errors'))) {
         $this->Application->enqueueMessage(implode('<br />', $errors), 'error');
     }
     parent::display($tpl);
 }
Example #2
0
$form_text .= $ajax_uploader->Show();
$form_text .= $b2jcaptcha->Show();
$form_text .= $antispam->Show();
$form_text .= $submitter->Show();
switch (0) {
    case $submitter->IsValid():
        break;
    case $fieldsBuilder->IsValid():
        break;
    case $ajax_uploader->IsValid():
        break;
    case $uploader->IsValid():
        break;
    case $b2jcaptcha->IsValid():
        break;
    case $antispam->IsValid():
        break;
    case $jMessenger->Process():
        break;
    case $adminMailer->Process():
        break;
    case $submitterMailer->Process():
        break;
    default:
        $form_text = "";
        $jsession = JFactory::getSession();
        $b2jsession = new B2JSession($jsession->getId(), 0, $module->id, $app->bid);
        $b2jsession->PurgeValue("captcha_answer");
        B2JHeaderRedirect($params);
}
require JModuleHelper::getLayoutPath($app->scope, $params->get('layout', 'default'));