コード例 #1
0
ファイル: email.php プロジェクト: joestump/jax
 function JxPaymentProcess_email($card, $orderID)
 {
     $this->JxPaymentProcess();
     $this->card = $card;
     $this->orderID = $orderID;
     $this->email = JxModuleConfig::get('payment', 'email');
 }
コード例 #2
0
ファイル: contact.php プロジェクト: joestump/jax
 /**
  * contact
  *
  * This builds the contact form and processes it when the form is posted.
  * All form handling is done using the JxForm class.
  *
  * @author Joe Stump <*****@*****.**>
  * @access public
  * @return void
  */
 function contact()
 {
     $this->JxAuthNo();
     $this->page->title = 'Contact Us';
     $this->form =& new JxHtmlForm();
     $container =& new JxHtmlFormContainer('contact');
     $container->label = 'Contact Us';
     if (!count($_POST)) {
         $name = $this->user->fname . ' ' . $this->user->lname;
         $email = $this->user->email;
     } else {
         $name = $_POST['name'];
         $email = $_POST['email'];
     }
     $field =& new JxFieldText('name', $name);
     $field->label = 'Your Name';
     $field->required = true;
     $container->addComponent($field);
     $field =& new JxFieldEmail('email', $email);
     $field->label = 'Your Email Address';
     $field->required = true;
     $container->addComponent($field);
     $field =& new JxFieldPhone('phone', $_POST['phone']);
     $field->label = 'Phone Number';
     $field->required = false;
     $container->addComponent($field);
     $field =& new JxFieldText('subject', $_POST['subject']);
     $field->label = 'Subject';
     $field->required = true;
     $container->addComponent($field);
     $field =& new JxFieldTextarea('comments', $_POST['comments']);
     $field->label = 'Comments';
     $field->required = true;
     $container->addComponent($field);
     $field =& new JxFieldSubmit('button', 'Contact Us');
     $container->addComponent($field);
     $this->form->addComponent($container);
     if (!$this->form->isValid()) {
         $this->setData('contactForm', $this->form->getForm());
     } else {
         $data = $this->form->getData();
         $email =& new JxEmail($this->path . '/tpl');
         $to = JxModuleConfig::get('contact', 'email');
         if (!JxEmail::isError($email) && strlen($to)) {
             $h = array();
             $h['From'] = stripslashes($data['name']) . " <" . $data['email'] . ">";
             $h['Reply-To'] = $data['email'];
             $h['Return-Path'] = $data['email'];
             $subject = '[' . $_SERVER['SERVER_NAME'] . '] Contact Us';
             $email->template->assign('data', $data);
             $result = $email->send($to, $subject, 'contactEmail.tpl', $h);
             if (JxEmail::isError($result)) {
                 $this->log->log($result->getMessage());
             }
         }
         $this->setData('data', $data);
         $this->templateFile = 'contactConfirm.tpl';
     }
 }
コード例 #3
0
ファイル: JxNewsWelcome.php プロジェクト: joestump/jax
 function welcome(&$module)
 {
     $content =& new JxContent('news');
     $userID = JxModuleConfig::get('blog', 'BLOG_DEFAULT_USER');
     if ($userID !== false) {
         $content->userID = $userID;
     }
     $content->orderBy('content.posted DESC');
     if ($content->find()) {
         $news = array();
         while ($content->fetch()) {
             $content->getLinks();
             $news[] = $content->toArray();
         }
         $tplPath = JX_HOSTED_PATH . '/modules/news/tpl';
         $module->template =& new JxTemplate($tplPath);
         if (!PEAR::isError($module->template)) {
             $module->templateFile = 'news.tpl';
         }
     }
     $entries = array('entries' => $news);
     $module->template->assign('news', $entries);
 }
コード例 #4
0
ファイル: JxModuleConfig.php プロジェクト: joestump/jax
 function loadDefaults($module, $defaults)
 {
     while (list($key, $val) = each($defaults)) {
         JxModuleConfig::set($key, $val);
     }
 }