Plugin Directory

Changeset 1052708


Ignore:
Timestamp:
12/23/2014 03:16:48 PM (11 years ago)
Author:
karevn
Message:

Minor fixes.

Location:
usernoise/trunk/inc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • usernoise/trunk/inc/form.php

    r972173 r1052708  
    2323                </div>
    2424            <?php endif ?>
    25             <?php $un_h->textarea('description', un_get_option(UN_FEEDBACK_TEXTAREA_PLACEHOLDER), array('id' => 'un-description', 'class' => 'text text-empty'))?>
     25            <?php $un_h->textarea('description', __(un_get_option(UN_FEEDBACK_TEXTAREA_PLACEHOLDER), 'usernoise'), array('id' => 'un-description', 'class' => 'text text-empty'))?>
    2626            <?php if (un_get_option(UN_FEEDBACK_FORM_SHOW_SUMMARY)): ?>
    27                 <?php $un_h->text_field('title', un_get_option(UN_FEEDBACK_SUMMARY_PLACEHOLDER), array('id' => 'un-title', 'class' => 'text text-empty'))?>
     27                <?php $un_h->text_field('title', __(un_get_option(UN_FEEDBACK_SUMMARY_PLACEHOLDER), 'usernoise'), array('id' => 'un-title', 'class' => 'text text-empty'))?>
    2828            <?php endif ?>
    2929            <?php if (un_get_option(UN_FEEDBACK_FORM_SHOW_EMAIL)): ?>
  • usernoise/trunk/inc/model.php

    r950056 r1052708  
    11<?php
    22class UN_Model{
    3    
     3
    44    public function __construct(){
    55        add_action('init', array($this, 'action_init'));
     
    77        add_filter('un_feedback_post_type_params', array($this, 'filter_un_feedback_post_type_params'));
    88    }
    9    
     9
    1010
    1111    public function action_init(){
     
    1515        $this->register_schema();
    1616    }
    17    
     17
    1818    function register_schema(){
    19         register_taxonomy(FEEDBACK_TYPE, FEEDBACK, 
     19        register_taxonomy(FEEDBACK_TYPE, FEEDBACK,
    2020            apply_filters('un_feedback_type_taxonomy_params', array(
    2121                'public' => false,
     
    4848        )));
    4949    }
    50    
     50
    5151    public function filter_un_feedback_post_type_params($params){
    5252        $params['supports'] = array(null);
    5353        return $params;
    5454    }
    55    
     55
    5656    public function validate_feedback_form($params){
    5757        $errors = array();
     
    6363        $email = trim(isset($params['email']) ? $params['email'] : '');
    6464        $name = trim(isset($params['name']) ? $params['name'] : '');
    65         if (un_get_option(UN_FEEDBACK_FORM_SHOW_EMAIL) && empty($email) && !is_user_logged_in() || 
     65        if (un_get_option(UN_FEEDBACK_FORM_SHOW_EMAIL) && empty($email) && !is_user_logged_in() ||
    6666                $email && !is_email($email))
    6767            $errors []= __('Please enter a valid email address.', 'usernoise');
     
    7070        return apply_filters('un_validate_feedback', $errors, $params);
    7171    }
    72    
     72
    7373    public function create_feedback($params){
    7474        global $un_settings;
     
    9898        $this->send_admin_message($id, $params);
    9999    }
    100    
     100
    101101    public function send_admin_message($id, $params){
    102102        if (!un_get_option(UN_ADMIN_NOTIFY_ON_FEEDBACK))
     
    109109        $message = apply_filters('un_feedback_received_message', $message, $id, $params);
    110110        $message = apply_filters('un_admin_notification_message', $message, $id, $params);
    111         $subject = apply_filters('un_admin_notification_subject', 
    112             sprintf(__('New %s submitted at %s'), __($type, 'usernoise'), get_bloginfo('name')));
     111        $subject = apply_filters('un_admin_notification_subject',
     112            sprintf(__('New %s submitted at %s'), __($type, 'usernoise'), html_entity_decode(get_bloginfo('name'), ENT_QUOTES | ENT_HTML5)));
    113113        $to = apply_filters('un_admin_notification_email', get_option('admin_email'));
    114114        $headers = apply_filters('un_admin_notification_headers', array(), $id);
     
    116116        do_action('un_admin_notification_sent', $id, $params, $message);
    117117    }
    118    
     118
    119119    public function action_parse_query($q){
    120         if (isset($q->query_vars['feedback_type_id']) && 
     120        if (isset($q->query_vars['feedback_type_id']) &&
    121121            $q->query_vars['feedback_type_id']){
    122122            if (empty($q->query_vars['tax_query'])){
     
    129129                );
    130130        }
    131         if (isset($q->query_vars['feedback_type_slug']) && 
     131        if (isset($q->query_vars['feedback_type_slug']) &&
    132132            $q->query_vars['feedback_type_slug']){
    133133            if (empty($q->query_vars['tax_query'])){
     
    141141        }
    142142    }
    143    
     143
    144144    public function get_pending_feedback_count($args = array()){
    145145        return count($this->get_pending_feedback($args));
    146146    }
    147    
     147
    148148    public function get_pending_feedback($args = array()){
    149149        $defaults = array('post_type' => FEEDBACK, 'numberposts' => -1, 'post_status' => 'pending');
     
    151151        return get_posts($args);
    152152    }
    153    
     153
    154154    public function get_feedback_type($feedback){
    155155        if (is_object($feedback))
     
    160160        return null;
    161161    }
    162    
     162
    163163    public function get_plural_feedback_type_label($type){
    164164        $term = get_term_by('slug', $type, FEEDBACK_TYPE);
  • usernoise/trunk/inc/template.php

    r975147 r1052708  
    125125    global $current_user;
    126126    if (!is_user_logged_in())
    127         return un_get_option(UN_FEEDBACK_EMAIL_PLACEHOLDER);
     127        return __(un_get_option(UN_FEEDBACK_EMAIL_PLACEHOLDER), 'usernoise');
    128128    get_currentuserinfo();
    129129    return $current_user->user_email;
     
    132132    global $current_user;
    133133    if (!is_user_logged_in())
    134         return un_get_option(UN_FEEDBACK_NAME_PLACEHOLDER);
     134        return __(un_get_option(UN_FEEDBACK_NAME_PLACEHOLDER), 'usernoise');
    135135    get_currentuserinfo();
    136136    return $current_user->display_name;
Note: See TracChangeset for help on using the changeset viewer.