private function userEmailOption() { /** @var WpProQuiz_Model_Email * */ $email = $this->quiz->getUserEmail(); $email = $email === null ? WpProQuiz_Model_Email::getDefault(false) : $email; $to = $email->getTo(); ?> <div class="postbox" id="userEmailSettings"> <h3 class="hndle"><?php _e('User e-mail settings', 'wp-pro-quiz'); ?> </h3> <div class="inside"> <table class="form-table"> <tbody> <tr> <th scope="row"> <?php _e('User e-mail notification', 'wp-pro-quiz'); ?> </th> <td> <fieldset> <legend class="screen-reader-text"> <span><?php _e('User e-mail notification', 'wp-pro-quiz'); ?> </span> </legend> <label> <input type="checkbox" name="userEmailNotification" value="1" <?php $this->checked($this->quiz->isUserEmailNotification()); ?> > <?php _e('Activate', 'wp-pro-quiz'); ?> </label> <p class="description"> <?php _e('If you enable this option, an email is sent with his quiz result to the user.', 'wp-pro-quiz'); ?> </p> </fieldset> </td> </tr> <tr> <th scope="row"> <?php _e('To:', 'wp-pro-quiz'); ?> </th> <td> <label> <input type="checkbox" name="userEmail[toUser]" value="1" <?php $this->checked($email->isToUser()); ?> > <?php _e('User Email-Address (only registered users)', 'wp-pro-quiz'); ?> </label><br> <label> <input type="checkbox" name="userEmail[toForm]" value="1" <?php $this->checked($email->isToForm()); ?> > <?php _e('Custom fields', 'wp-pro-quiz'); ?> : <select name="userEmail[to]" class="emailFormVariables" data-default="<?php echo empty($to) && $to != 0 ? -1 : $email->getTo(); ?> "></select> <?php _e('(Type Email)', 'wp-pro-quiz'); ?> </label> </td> </tr> <tr> <th scope="row"> <?php _e('From:', 'wp-pro-quiz'); ?> </th> <td> <label> <input type="text" name="userEmail[from]" value="<?php echo $email->getFrom(); ?> " class="regular-text"> </label> </td> </tr> <tr> <th scope="row"> <?php _e('Subject:', 'wp-pro-quiz'); ?> </th> <td> <label> <input type="text" name="userEmail[subject]" value="<?php echo $email->getSubject(); ?> " class="regular-text"> </label> </td> </tr> <tr> <th scope="row"> <?php _e('HTML', 'wp-pro-quiz'); ?> </th> <td> <label> <input type="checkbox" name="userEmail[html]" value="1" <?php $this->checked($email->isHtml()); ?> > <?php _e('Activate', 'wp-pro-quiz'); ?> </label> </td> </tr> <tr> <th scope="row"> <?php _e('Message body:', 'wp-pro-quiz'); ?> </th> <td> <?php wp_editor($email->getMessage(), 'userEmailEditor', array('textarea_rows' => 20, 'textarea_name' => 'userEmail[message]')); ?> <div style="padding-top: 10px;"> <table style="width: 100%;"> <thead> <tr> <th style="padding: 0;"> <?php _e('Allowed variables', 'wp-pro-quiz'); ?> </th> <th style="padding: 0;"> <?php _e('Custom fields - Variables', 'wp-pro-quiz'); ?> </th> </tr> </thead> <tbody> <tr> <td style="vertical-align: top;"> <ul> <li><span>$userId</span> - <?php _e('User-ID', 'wp-pro-quiz'); ?> </li> <li><span>$username</span> - <?php _e('Username', 'wp-pro-quiz'); ?> </li> <li><span>$quizname</span> - <?php _e('Quiz-Name', 'wp-pro-quiz'); ?> </li> <li><span>$result</span> - <?php _e('Result in precent', 'wp-pro-quiz'); ?> </li> <li><span>$points</span> - <?php _e('Reached points', 'wp-pro-quiz'); ?> </li> <li><span>$ip</span> - <?php _e('IP-address of the user', 'wp-pro-quiz'); ?> </li> <li><span>$categories</span> - <?php _e('Category-Overview', 'wp-pro-quiz'); ?> </li> </ul> </td> <td style="vertical-align: top;"> <ul class="formVariables"></ul> </td> </tr> </tbody> </table> </div> </td> </tr> </tbody> </table> </div> </div> <?php }