本文整理汇总了PHP中RM_UI_Strings类的典型用法代码示例。如果您正苦于以下问题:PHP RM_UI_Strings类的具体用法?PHP RM_UI_Strings怎么用?PHP RM_UI_Strings使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RM_UI_Strings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
public function render($stat_id = null)
{
global $rm_form_diary;
echo '<div class="rmagic">';
//$this->form_number = $rm_form_diary[$this->form_id];
$form = new Form('form_' . $this->form_id . "_" . $this->form_number);
$form->configure(array("prevent" => array("bootstrap", "jQuery", "focus"), "action" => "", "class" => "rmagic-form", "name" => "rm_form", "number" => $this->form_number, "view" => new View_UserForm(), "style" => isset($this->form_options->style_form) ? $this->form_options->style_form : null));
//Render content above the form
if (!empty($this->form_options->form_custom_text)) {
$form->addElement(new Element_HTML('<div class="rmheader">' . $this->form_options->form_custom_text . '</div>'));
}
if ($this->is_expired()) {
if ($this->form_options->form_message_after_expiry) {
echo $this->form_options->form_message_after_expiry;
} else {
echo '<div class="rm-no-default-from-notification">' . RM_UI_Strings::get('MSG_FORM_EXPIRY') . '</div>';
}
echo '</div>';
return;
}
if ($stat_id) {
$form->addElement(new Element_HTML('<div id="rm_stat_container" style="display:none">'));
$form->addElement(new Element_Number('RM_Stats', 'stat_id', array('value' => $stat_id, 'style' => 'display:none')));
$form->addElement(new Element_HTML('</div>'));
}
parent::pre_render();
$this->base_render($form);
parent::post_render();
echo '</div>';
}
示例2: __construct
public function __construct($id, $label, $options, $value, $page_no = 1, $is_primary = false, $extra_opts = null)
{
if (isset($options['value'])) {
if (!is_array($options['value'])) {
$options['value'] = RM_Utilities::trim_array(explode(',', $options['value']));
} else {
$options['value'] = $options['value'];
}
}
parent::__construct($id, 'Select', $label, $options, $value, $page_no, $is_primary, $extra_opts);
if (isset($options['multiple'])) {
$multiple = $options['multiple'];
} else {
$multiple = '';
}
$options = array();
if (!is_array($value)) {
$tmp_options = RM_Utilities::trim_array(explode(',', $value));
} else {
$tmp_options = $value;
}
foreach ($tmp_options as $val) {
$options[$val] = trim($val);
}
if ($multiple == 'multiple') {
$options = array(null => RM_UI_Strings::get('SELECT_FIELD_MULTI_OPTION')) + $options;
} else {
$options = array(null => RM_UI_Strings::get('SELECT_FIELD_FIRST_OPTION')) + $options;
}
$this->field_value = $options;
}
示例3: remove_field
private function remove_field($model, $service, $request, $params)
{
if (isset($request->req['rm_field_id'])) {
$result = $service->remove($request->req['rm_field_id']);
} else {
die(RM_UI_Strings::get('MSG_NO_FIELD_SELECTED'));
}
}
示例4: __construct
public function __construct($message = "")
{
if (!empty($message)) {
$this->message = $message;
} else {
$this->message = RM_UI_Strings::get('FORM_ERR_INVALID');
}
}
示例5: manage
public function manage($model, $service, $request, $params)
{
if (!isset($request->req['form_name'])) {
Form::clearErrors('rm_form_quick_add');
}
$sort_by = isset($request->req['rm_sortby']) ? $request->req['rm_sortby'] : null;
$descending = isset($request->req['rm_descending']) ? false : true;
$req_page = isset($request->req['rm_reqpage']) && $request->req['rm_reqpage'] > 0 ? $request->req['rm_reqpage'] : 1;
$items_per_page = 9;
$forms = $service->get_all(null, ($req_page - 1) * $items_per_page, $items_per_page, '*', $sort_by, $descending);
$i = 0;
$data = array();
if (is_array($forms) || is_object($forms)) {
foreach ($forms as $form) {
$data[$i] = new stdClass();
$data[$i]->form_id = $form->form_id;
$data[$i]->form_name = $form->form_name;
$data[$i]->count = $service->count(RM_Submissions::get_identifier(), array('form_id' => $form->form_id));
if ($data[$i]->count > 0) {
$data[$i]->submissions = $service->get(RM_Submissions::get_identifier(), array('form_id' => $form->form_id), array('%d'), 'results', 0, 3, '*', 'submitted_on', true);
$j = 0;
foreach ($data[$i]->submissions as $submission) {
$data[$i]->submissions[$j++]->gravatar = get_avatar($submission->user_email);
}
}
$data[$i]->field_count = $service->count(RM_Fields::get_identifier(), array('form_id' => $form->form_id));
$data[$i]->last_sub = $service->get(RM_Submissions::get_identifier(), array('form_id' => $form->form_id), array('%d'), 'var', 0, 1, 'submitted_on', 'submitted_on', true);
//$data[$i]->last_sub = date('H',strtotime($this->service->get(RM_Submissions::get_identifier(), array('form_id' => $data_single->form_id), array('%d'), 'var', 0, 1, 'submitted_on', 'submitted_on', true)));
$data[$i]->expiry_details = $service->get_form_expiry_stats($form, false);
$i++;
}
}
$total_forms = $service->count($model->get_identifier(), 1);
//New object to consolidate data for view.
$view_data = new stdClass();
$view_data->data = $data;
$view_data->curr_page = $req_page;
$view_data->total_pages = (int) ($total_forms / $items_per_page) + ($total_forms % $items_per_page == 0 ? 0 : 1);
$view_data->rm_slug = $request->req['page'];
$view_data->sort_by = $sort_by;
$view_data->descending = $descending;
$view_data->done_with_review_banner = $service->get_setting('done_with_review_banner') === 'no' ? false : true;
$view_data->def_form_id = $service->get_setting('default_form_id');
if (function_exists('is_multisite') && is_multisite()) {
$nl_subscribed = get_site_option('rm_option_newsletter_subbed', false);
} else {
$nl_subscribed = get_site_option('rm_option_newsletter_subbed', false);
}
if (!$nl_subscribed) {
$view_data->newsletter_sub_link = RM_UI_Strings::get('NEWSLETTER_SUB_MSG');
} else {
$view_data->newsletter_sub_link = null;
}
$view = $this->mv_handler->setView('form_manager');
$view->render($view_data);
}
示例6: __construct
public function __construct($pattern, $message = "")
{
if (!empty($message)) {
$this->message = $message;
} else {
$this->message = RM_UI_Strings::get('FORM_ERR_INVALID_REGEX');
}
$this->pattern = $pattern;
parent::__construct($this->message);
}
示例7: renderRepeatable
private function renderRepeatable($type = "prepend")
{
if ($type === "start") {
echo '<div class="rm_field_type_repeatable_container" id="rm_field_type_repeatable_container_' . $this->_attributes['id'] . '">';
}
if ($type === "prepend") {
echo '<div class="appendable_options">';
}
if ($type === "append") {
echo '<div class="rm_actions" id="rm_add_repeatable_field" onClick="rm_append_field(\'div\',\'rm_field_type_repeatable_container_' . $this->_attributes["id"] . '\')"><a>' . RM_UI_Strings::get("LABEL_ADD") . '</a></div><div class="rm_actions" onClick="rm_delete_appended_field(this,\'rm_field_type_repeatable_container_' . $this->_attributes["id"] . '\')"><a href="javascript:void(0)">' . RM_UI_Strings::get("LABEL_DELETE") . '</a></div></div>';
}
if ($type === "close") {
echo '</div>';
}
}
示例8: set_otp
public function set_otp($email, $key = null)
{
$response = new stdClass();
$response->error = false;
$response->show = "#rm_otp_kcontact";
$response->hide = "#rm_otp_kcontact";
$response->reload = false;
// Validate key
if ($key) {
$rm_user = $this->get('FRONT_USERS', array('otp_code' => $key), array('%s'), 'row');
if (!$rm_user) {
$response->error = true;
$response->msg = RM_UI_Strings::get('MSG_INVALID_OTP');
} else {
$this->set_auth_params($key, $rm_user->email);
$response->error = false;
$response->msg = RM_UI_Strings::get('MSG_AFTER_OTP_LOGIN');
$response->reload = true;
}
} else {
// Validate email
if (is_email($email)) {
if ($this->is_user($email)) {
$otp_code = $this->generate_otp($email);
$response->msg = RM_UI_Strings::get('MSG_OTP_SUCCESS');
$subject = RM_UI_Strings::get('LABEL_OTP');
$message = RM_UI_Strings::get('OTP_MAIL') . $otp_code;
wp_mail($email, $subject, $message);
} else {
$response->error = true;
$response->msg = RM_UI_Strings::get('MSG_EMAIL_NOT_EXIST');
}
} else {
$response->error = true;
$response->msg = RM_UI_Strings::get('INVALID_EMAIL');
}
}
return json_encode($response);
}
示例9: getPayments
public function getPayments()
{
$rm_services = new RM_Services();
$rm_front_service = new RM_Front_Service();
$user_email = $rm_front_service->get_user_email();
$payments = array();
if (!empty($user_email)) {
$submissions = $rm_services->get_submissions_by_email($user_email);
if (!empty($submissions)) {
foreach ($submissions as $submission) {
$payment = $rm_services->get_payments_by_submission_id($submission->submission_id);
if ($payment) {
$payment->form_name = $rm_services->get('FORMS', array('form_id' => $submission->form_id), array('%d'), 'var', 0, 1, 'form_name');
$payments[] = $payment;
}
}
}
if (!empty($payments)) {
include_once 'html/payments.php';
} else {
echo '<div class="rmnotice-container"><div class="rmnotice">' . RM_UI_Strings::get('MSG_NO_DATA_FOR_EMAIL') . '</div></div>';
}
}
}
示例10: notify_users
public function notify_users($note)
{
$gopt = new RM_Options();
if ($gopt->get_value_of('user_notification_for_notes') == "yes") {
if ($note->get_status() != 'publish') {
return;
}
$submission = new RM_Submissions();
$submission->load_from_db($note->get_submission_id());
$email = new stdClass();
//echo '<pre>';
//print_r($submission); die;
$email->to = $submission->get_user_email();
$from_email = $gopt->get_value_of('senders_email_formatted');
$header = "From: {$from_email}\r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$email->subject = get_bloginfo('name', 'display') . " Notification from Admin ";
$email->message = RM_UI_Strings::get('MSG_NOTE_FROM_ADMIN') . $note->get_notes();
$email->header = $header;
$email->attachments = array();
RM_Utilities::send_mail($email);
}
}
示例11: aweber
function aweber($model, $service, $request, $params)
{
if (isset($request->req['rm_form_id']) && (int) $request->req['rm_form_id']) {
$model->load_from_db($request->req['rm_form_id']);
$data = new stdClass();
$data->form_name = $model->form_name;
$data->form_id = $request->req['rm_form_id'];
$view = $this->mv_handler->setView('form_sett_aw');
} else {
$data = RM_UI_Strings::get('MSG_FS_NOT_AUTHORIZED');
$view = $this->mv_handler->setView('show_notice');
}
$view->render($data);
}
示例12: Element_Textbox
<?php
$form->addElement(new Element_Textbox("<b>" . RM_UI_Strings::get('LABEL_USERNAME') . "</b>:", "username", array("required" => "1", "placeholder" => RM_UI_Strings::get('LABEL_USERNAME'))));
/*
* Skip password field if auto generation is on
*/
if (!$is_auto_generate) {
$form->addElement(new Element_Password("<b>" . RM_UI_Strings::get('LABEL_PASSWORD') . "</b>:", "password", array("required" => 1, "longDesc" => RM_UI_Strings::get('HELP_PASSWORD_MIN_LENGTH'), "minLength" => 7, "validation" => new Validation_RegExp("/.{7,}/", "Error: The %element% must be atleast 7 characters long."))));
}
?>
示例13: render
public function render($extra_data_may_needed_in_child_class = null)
{
global $rm_form_diary;
echo '<div class="rmagic">';
//$this->form_number = $rm_form_diary[$this->form_id];
$form = new Form('form_' . $this->form_id . "_" . $this->form_number);
$form->configure(array("prevent" => array("bootstrap", "jQuery", "focus"), "action" => "", "class" => "rmagic-form", "name" => "rm_form", "view" => new View_UserForm(), "number" => $this->form_number, "style" => isset($this->form_options->style_form) ? $this->form_options->style_form : null));
//Render content above the form
if (!empty($this->form_options->form_custom_text)) {
$form->addElement(new Element_HTML('<div class="rmheader">' . $this->form_options->form_custom_text . '</div>'));
}
if (!$this->is_expired()) {
$this->pre_render();
$this->base_render($form);
$this->post_render();
} else {
if ($this->form_options->form_message_after_expiry) {
echo $this->form_options->form_message_after_expiry;
} else {
echo RM_UI_Strings::get('MSG_FORM_EXPIRY');
}
}
echo '</div>';
}
示例14:
<span><?php
echo $role;
?>
</span>
<span><?php
echo $role_name;
?>
</span>
</div>
<div class="rm-slab-buttons" onclick="delete_role(this,'checkbox_<?php
echo $role;
?>
')">
<a href="javascript:void(0)"><?php
echo RM_UI_Strings::get("LABEL_DELETE");
?>
</a>
</div>
</div>
</li>
<?php
}
}
?>
</form>
</ul>
<div class="rm-upgrade-note-gold">
<div class="rm-banner-title">Upgrade and expand the power of<img src="<?php
echo RM_IMG_URL . 'logo.png';
示例15: login_notice
/**
* returns the message when deactivated user tries to login
*
* @param string $notice
* @return string
*/
public function login_notice($notice)
{
if (isset($_GET['is_disabled']) && $_GET['is_disabled'] === '1') {
$notice = '<div id="login_error"><strong>' . RM_UI_Strings::get('LABEL_ERROR') . ':</strong> ' . apply_filters('rm_login_notice', RM_UI_Strings::get('ACCOUNT_NOT_ACTIVE_YET')) . '</div>';
} elseif (isset($_GET['is_reset']) && $_GET['is_reset'] === '1') {
$notice = '<p id="rm_login_error" class="message">' . apply_filters('rm_login_notice', RM_UI_Strings::get('LOGIN_AGAIN_AFTER_RESET')) . '</p>';
}
return $notice;
}