public static function build_body($args = array()) { $body = ''; foreach ($args as $key => $value) { $tag = isset($value['tag']) ? $value['tag'] : ''; if (!empty($tag)) { $html = new SB_HTML($tag); $text = isset($value['text']) ? $value['text'] : ''; $html->set_attribute('text', $text); $body .= $html->build(); } } return $body; }
public static function number($args = array()) { $name = self::get_name($args); $value = isset($args['value']) ? $args['value'] : ''; $id = isset($args['id']) ? $args['id'] : ''; if (empty($id)) { $id = $name; } $label = isset($args['label']) ? $args['label'] : ''; $field_class = isset($args['field_class']) ? trim($args['field_class']) : ''; echo '<p>'; echo '<label for="' . $id . '">' . $label . ':</label>'; $input = new SB_HTML('input'); $input->set_attribute('type', 'number'); $input->set_attribute('class', $field_class); $input->set_attribute('value', $value); $input->set_attribute('name', $name); $input->set_attribute('id', $id); $input->output(); echo '</p>'; }
public static function send_signup_verify_email($user) { $cookie = self::get_verify_email_cookie($user); $session = self::get_verify_email_session($user); if (1 == $cookie || 1 == $session) { return; } $code = self::generate_activation_code($user); $url = self::get_account_verify_url($user->ID, $code); $subject = __('Xác nhận đăng ký tài khoản', 'sb-core'); $paragraph = new SB_HTML('p'); $paragraph->set_text(sprintf(__('Cảm ơn bạn đã đăng ký với tên tài khoản của bạn là %s, hãy nhấn chuột vào nút bên dưới để xác thực địa chỉ email của bạn.', 'sb-core'), $user->user_login)); $body = $paragraph->build(); $paragraph->set_attribute('style', 'display: block; clear: both; padding: 20px 0px;'); $paragraph->set_text('<a target="_blank" style="white-space: nowrap; text-align: center; height: 28px; background: none repeat scroll 0% 0% rgb(77, 144, 254); border: 1px solid rgb(48, 121, 237); color: rgb(255, 255, 255); text-decoration: none; padding: 5px 30px; font-size: 13px; font-weight: 700;" href="' . $url . '">' . __('Xác nhận địa chỉ email', 'sb-core') . '</a>'); $body .= $paragraph->build(); $paragraph->set_attribute('style', 'padding: 0;'); $paragraph->set_text(__('Hoặc bạn có thể sử dụng đường dẫn bên dưới:', 'sb-core') . '<br><a target="_blank" style="border:none;color:#0084b4;text-decoration:none" href="' . $url . '">' . $url . '</a>'); $body .= $paragraph->build(); $paragraph->set_text(sprintf(__('Mã xác nhận: %s', 'sb-core'), $code)); $body .= $paragraph->build(); $result = SB_Mail::send_html($user->user_email, $subject, $body); if ($result) { self::set_verify_email_session($user); } }