Ejemplo n.º 1
0
 function admin_settings()
 {
     $token = fep_create_nonce();
     $url = 'https://shamimbiplob.wordpress.com/contact-us/';
     $actionURL = admin_url('admin.php?page=fep-admin-settings');
     $ReviewURL = 'https://wordpress.org/support/view/plugin-reviews/front-end-pm';
     $capUrl = 'http://codex.wordpress.org/Roles_and_Capabilities';
     if (isset($_POST['fep-admin-settings_submit'])) {
         $errors = $this->admin_settings_action();
         if (count($errors->get_error_messages()) > 0) {
             echo fep_error($errors);
         } else {
             echo '<div id="message" class="updated fade">' . __("Options successfully saved.", 'fep') . ' </div>';
         }
     }
     echo "<div id='poststuff'>\r\n\r\n\t\t<div id='post-body' class='metabox-holder columns-2'>\r\n\r\n\t\t<!-- main content -->\r\n\t\t<div id='post-body-content'>\r\n\t\t<div class='postbox'><div class='inside'>\r\n\t  \t  <h2>" . __("Front End PM Settings", 'fep') . "</h2>\r\n\t\t  <h5>" . sprintf(__("If you like this plugin please <a href='%s' target='_blank'>Review in Wordpress.org</a> and give 5 star", 'fep'), esc_url($ReviewURL)) . "</h5>\r\n          <form method='post' action='{$actionURL}'>\r\n          <table class='widefat'>\r\n          <thead>\r\n          <tr><th width='50%'>" . __("Setting", 'fep') . "</th><th width='50%'>" . __("Value", 'fep') . "</th></tr>\r\n          </thead>\r\n          <tr><td>" . __("Max messages a user can keep in box? (0 = Unlimited)", 'fep') . "<br /><small>" . __("Admins always have Unlimited", 'fep') . "</small></td><td><input type='text' name='num_messages' value='" . fep_get_option('num_messages', 50) . "' /><br/> " . __("Default", 'fep') . ": 50</td></tr>\r\n          <tr><td>" . __("Messages to show per page", 'fep') . "<br/><small>" . __("Do not set this to 0!", 'fep') . "</small></td><td><input type='text' name='messages_page' value='" . fep_get_option('messages_page', 15) . "' /><br/> " . __("Default", 'fep') . ": 15</td></tr>\r\n\t\t  <tr><td>" . __("Maximum user per page in Directory", 'fep') . "<br/><small>" . __("Do not set this to 0!", 'fep') . "</small></td><td><input type='text' name='user_page' value='" . fep_get_option('user_page', 50) . "' /><br/> " . __("Default", 'fep') . ": 50</td></tr>\r\n\t\t  <tr><td>" . __("Time delay between two messages send by a user in minutes (0 = No delay required)", 'fep') . "<br/><small>" . __("Admins have no restriction", 'fep') . "</small></td><td><input type='text' name='time_delay' value='" . fep_get_option('time_delay', 5) . "' /><br/> " . __("Default", 'fep') . ": 5</td></tr>\r\n\t\t  <tr><td>" . __("Block Username", 'fep') . "<br /><small>" . __("Separated by comma", 'fep') . "</small></td><td><TEXTAREA name='have_permission'>" . fep_get_option('have_permission') . "</TEXTAREA></td></tr>\r\n\t\t  <tr><td>" . __("Custom CSS", 'fep') . "<br /><small>" . __("add or override", 'fep') . "</small></td><td><TEXTAREA name='custom_css'>" . trim(fep_get_option('custom_css')) . "</TEXTAREA></td></tr>\r\n\t\t  \r\n\t\t  <tr><td>" . __("Editor Type", 'fep') . "<br /><small>" . __("Admin alwayes have Wp Editor", 'fep') . "</small></td><td><select name='editor_type'>\r\n\t\t  <option value='wp_editor' " . selected(fep_get_option('editor_type', 'teeny'), 'wp_editor', false) . ">Wp Editor</option>\r\n\t\t  <option value='teeny' " . selected(fep_get_option('editor_type', 'teeny'), 'teeny', false) . ">Wp Editor (Teeny)</option>\r\n\t\t  <option value='textarea' " . selected(fep_get_option('editor_type', 'teeny'), 'textarea', false) . ">Textarea</option></select></td></tr>\r\n\t\t  \r\n\t\t  <tr><td>" . __("Minimum Capability to use messaging", 'fep') . "<br /><small>" . sprintf(__("see <a href='%s' target='_blank'>WORDPRESS CAPABILITIES</a> to get capabilities (use only one capability)", 'fep'), esc_url($capUrl)) . "</small></td><td><input type='text' size='30' name='min_cap' value='" . fep_get_option('min_cap', 'read') . "' /><br /><small>" . __("Keep blank if allowed for all users", 'fep') . "</small></td></tr>";
     do_action('fep_admin_setting_form');
     echo "\r\n\t\t  <tr><td>" . __("Valid email address for \"to\" field of announcement email", 'fep') . "<br /><small>" . __("All users email will be in \"Bcc\" field", 'fep') . "</small></td><td><input type='text' size='30' name='ann_to' value='" . fep_get_option('ann_to', get_bloginfo('admin_email')) . "' /></td></tr>\r\n\t\t  <tr><td colspan='2'><input type='checkbox' name='notify_ann' value='1' " . checked(fep_get_option('notify_ann', 0), '1', false) . " /> " . __("Send email to all users when a new announcement is published?", 'fep') . "</td></tr>\r\n\t\t  <tr><td colspan='2'><input type='checkbox' name='hide_directory' value='1' " . checked(fep_get_option('hide_directory', 0), '1', false) . " /> " . __("Hide Directory from front end?", 'fep') . "<br /><small>" . __("Always shown to Admins", 'fep') . "</small></td></tr>\r\n\t\t  <tr><td colspan='2'><input type='checkbox' name='hide_autosuggest' value='1' " . checked(fep_get_option('hide_autosuggest', 0), '1', false) . " /> " . __("Hide Autosuggestion when typing recipient name?", 'fep') . "<br /><small>" . __("Always shown to Admins", 'fep') . "</small></td></tr>\r\n\t\t  <tr><td colspan='2'><input type='checkbox' name='disable_new' value='1' " . checked(fep_get_option('disable_new', 0), '1', false) . " /> " . __("Disable \"send new message\" for all users except admins?", 'fep') . "<br /><small>" . __("Users can send reply", 'fep') . "</small></td></tr>\r\n\t\t  <tr><td colspan='2'><input type='checkbox' name='hide_notification' value='1' " . checked(fep_get_option('hide_notification', 0), '1', false) . " /> " . __("Hide site wide notification in header?", 'fep') . "</td></tr>\r\n          <tr><td colspan='2'><input type='checkbox' name='hide_branding' value='1' " . checked(fep_get_option('hide_branding', 0), '1', false) . " /> " . __("Hide Branding Footer?", 'fep') . "</td></tr>\r\n          <tr><td colspan='2'><span><input class='button-primary' type='submit' name='fep-admin-settings_submit' value='" . __("Save Options", 'fep') . "' /></span></td><td><input type='hidden' name='token' value='{$token}' /></td></tr>\r\n          </table>\r\n\t\t  </form>\r\n\t\t  <ul>" . sprintf(__("For paid support pleasse visit <a href='%s' target='_blank'>Front End PM</a>", 'fep'), esc_url($url)) . "</ul>\r\n          </div></div></div>\r\n\t\t  " . $this->fep_admin_sidebar() . "\r\n\t\t  </div></div>";
 }
 function add()
 {
     $html = '<h2>' . __('Add Announcement', 'fep') . '</h2>';
     if (isset($_POST['add-announcement'])) {
         $errors = $this->check();
         if (count($errors->get_error_messages()) > 0) {
             $html .= fep_error($errors);
             $html .= $this->form();
         } else {
             $html .= '<div id="fep-success">' . __("Announcement successfully added.", 'fep') . ' </div>';
         }
     } else {
         $html .= $this->form();
     }
     echo $html;
     return;
 }
Ejemplo n.º 3
0
 function new_message_action()
 {
     $html = '<h2>' . __('Send Message', 'fep') . '</h2>';
     if (isset($_POST['new_message'])) {
         $errors = $this->check_message();
         if (count($errors->get_error_messages()) > 0) {
             $html .= fep_error($errors);
             $html .= $this->new_message();
         } else {
             $html .= '<div id="fep-success">' . __("Message successfully send.", 'fep') . ' </div>';
         }
     } else {
         $html .= $this->new_message();
     }
     return $html;
 }