Ejemplo n.º 1
0
 /**
  * Show a form
  * @param mform $showform the form to display
  * @param string $heading the title of the form
  * @param string $message any status messages from previous actions
  */
 function show_form($showform, $heading, $message = '')
 {
     global $OUTPUT;
     //if we have a status message, display it.
     if ($message) {
         echo $this->output->heading($message, 5, 'main');
     }
     echo $this->output->heading($heading, 3, 'main');
     $showform->display();
     echo $this->output->footer();
 }
Ejemplo n.º 2
0
 /**
  * Render the login signup form into a nice template for the theme.
  *
  * @param mform $form
  * @return string
  */
 public function render_login_signup_form($form)
 {
     $context = $form->export_for_template($this);
     return $this->render_from_template('core/signup_form_layout', $context);
 }
Ejemplo n.º 3
0
 /**
  * Render the login signup form into a nice template for the theme.
  *
  * @param mform $form
  * @return string
  */
 public function render_login_signup_form($form)
 {
     global $SITE;
     $context = $form->export_for_template($this);
     $url = $this->get_logo_url();
     if ($url) {
         $url = $url->out(false);
     }
     $context['logourl'] = $url;
     $context['sitename'] = format_string($SITE->fullname, true, array('context' => context_course::instance(SITEID)));
     return $this->render_from_template('core/signup_form_layout', $context);
 }
Ejemplo n.º 4
0
- upload one or more files 
- save the files to a temp location with random name
- keep original name and temp name as sessions
- when sending mail, add temp file and set name to original name
- after sending, clean temp files 
- clean old files (orphans that did not send)
*/
global $MF;
/**
 *	Load Language file
 */
$langfile = dirname(__FILE__) . "/languages/" . LANGUAGE . ".php";
require_once !file_exists($langfile) ? dirname(__FILE__) . "/languages/EN.php" : $langfile;
require_once dirname(__FILE__) . '/functions.php';
$mf = new mform($section_id);
$get_settings = $database->query("SELECT * FROM " . TABLE_PREFIX . "mod_miniform WHERE section_id = '{$section_id}'");
$settings = $get_settings->fetchRow();
$form = $settings['template'];
$email = $settings['email'];
$subject = $settings['subject'];
$emailmessage = $mf->get_template('email');
$emailmessage = $mf->add_template($emailmessage, "{SUBJECT}", $subject);
$email_field_val = $mf->get_template('email_field_value');
$email_field_data = '';
$replyto = '';
$successpage = $settings['successpage'];
$prevdata = '';
$dbdata = '';
if (isset($_POST['__next'])) {
    $next_template = $mf->get_template('form_' . $_POST['__next']);