Example #1
0
 function update_cap($allcaps, $caps, $args, $user)
 {
     if (in_array('upload_files', $caps)) {
         if (!isset($allcaps['upload_files'])) {
             $flag = false;
             if (mmg()->post('action') == 'query-attachments') {
                 ///just query media belong to someone
                 $flag = true;
             } elseif (mmg()->post('action') == 'upload-attachment') {
                 //case upload a file, we only allow when upload via je uploader
                 if (mmg()->post('igu_uploading') == 1) {
                     $flag = true;
                 }
             }
             if ($flag == true) {
                 //check
                 // var_dump($_POST);die;
                 $allowed = mmg()->setting()->allow_attachment;
                 if (!is_array($allowed)) {
                     $allowed = array();
                 }
                 $allowed = array_filter($allowed);
                 foreach ($user->roles as $role) {
                     if (in_array($role, $allowed)) {
                         $allcaps['upload_files'] = true;
                         break;
                     }
                 }
             }
         }
     }
     //die;
     return $allcaps;
 }
Example #2
0
 function prepare_items()
 {
     $data = mmg()->get_available_addon();
     $items = array();
     foreach ($data as $key => $val) {
         $items[] = array('col_id' => $key, 'col_name' => $val['Name'], 'col_description' => $val['Description'], 'col_author' => $val['Author']);
     }
     //How many to display per page?
     $perpage = 10;
     //Which page is this?
     $paged = !empty($_GET["paged"]) ? mysql_real_escape_string($_GET["paged"]) : '';
     //Page Number
     if (empty($paged) || !is_numeric($paged) || $paged <= 0) {
         $paged = 1;
     }
     $offset = ($this->get_pagenum() - 1) * $perpage;
     //How many pages do we have in total?
     $totalpages = ceil(count($items) / $perpage);
     //adjust the query to take pagination into account
     /* -- Register the pagination -- */
     $this->set_pagination_args(array("total_items" => count($items), "total_pages" => $totalpages, "per_page" => $perpage));
     //The pagination links are automatically built according to those parameters
     /* — Register the Columns — */
     $columns = $this->get_columns();
     $hidden = array();
     $sortable = $this->get_sortable_columns();
     $this->_column_headers = array($columns, $hidden, $sortable);
     $this->items = array_slice($items, $offset, $perpage);
 }
 function pm_user($atts)
 {
     $this->button_id = uniqid();
     $a = shortcode_atts(array('user_id' => '', 'user_name' => '', 'text' => __('Message me', mmg()->domain), 'class' => 'btn btn-sm btn-primary', 'subject' => __('You have new message!', mmg()->domain), 'in_the_loop' => false), $atts);
     if (!empty($a['user_id'])) {
         $user = get_user_by('id', $a['user_id']);
     } elseif (!empty($a['user_name'])) {
         $user = get_user_by('login', $a['user_name']);
     } elseif ($a['in_the_loop'] == true && in_the_loop()) {
         //this is in the loop, we can get author
         $username = get_the_author_meta('user_login');
         if (!empty($username)) {
             $user = get_user_by('login', $username);
         }
     }
     if (!isset($user) || !is_object($user)) {
         return '';
     }
     if (!is_user_logged_in()) {
         mmg()->load_script('login');
     }
     //add modal in footer,only if user logged in
     add_action('wp_footer', array(&$this, 'message_me_modal'));
     return $this->render('message_me/buttons', array('a' => $a, 'user' => $user), false);
 }
 function sent_notification(MM_Message_Model $model)
 {
     //send message
     $setting = new MM_Setting_Model();
     $setting->load();
     $link = add_query_arg('message_id', $model->id, get_permalink(mmg()->setting()->inbox_page));
     $data = array('SITE_NAME' => get_bloginfo('name'), 'FROM_NAME' => $model->get_name($model->send_from), 'POST_LINK' => $link, 'FROM_MESSAGE' => $model->content);
     $data = apply_filters('message_notification_params', $data, $this);
     $subject = stripslashes($setting->noti_subject);
     $content = stripslashes($setting->noti_content);
     foreach ($data as $key => $val) {
         $subject = str_replace($key, $val, $subject);
         $content = str_replace($key, $val, $content);
     }
     $sendto = get_userdata($model->send_to);
     $from = get_userdata($model->send_from);
     //prepare atachments
     $attachments = array();
     if ($model->attachment) {
         $ids = explode(',', $model->attachment);
         $ids = array_filter($ids);
         foreach ($ids as $id) {
             if (filter_var($id, FILTER_VALIDATE_INT)) {
                 $upload = IG_Uploader_Model::model()->find($id);
                 if (is_object($upload) && $upload->file) {
                     $attachments[] = get_attached_file($upload->file);
                 }
             }
         }
     }
     $headers = array('From: ' . $model->get_name($model->send_from) . ' <' . $from->user_email . '>', 'Content-Type: text/html; charset=UTF-8');
     wp_mail($sendto->user_email, $subject, $content, $headers, $attachments);
 }
 public function before_validate()
 {
     if (mmg()->post('is_reply', 0) == 1) {
         $this->rules = array('content' => 'required');
     } else {
         $this->rules = array('subject' => 'required', 'content' => 'required', 'send_to' => 'required');
     }
 }
Example #6
0
        function append_form()
        {
            wp_enqueue_style('selectivejs');
            wp_enqueue_script('selectivejs');
            $block_list = get_user_meta(get_current_user_id(), 'mm_block_list', true);
            if (!$block_list) {
                $block_list = '';
            }
            ?>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <p class="help-block"><?php 
            _e("Block users list, separate by commas", mmg()->domain);
            ?>
</p>
                    <input id="mm-block-list-input" name="mm_user_block" type="text" class="form-control"
                           value="<?php 
            echo $block_list;
            ?>
"/>
                </div>
                <div class="clearfix"></div>
            </div>
            <script type="text/javascript">
                jQuery(document).ready(function ($) {
                    $('#mm-block-list-input').selectize({
                        plugins: ['remove_button'],
                        delimiter: ',',
                        persist: false,
                        create: false,
                        valueField: 'name',
                        labelField: 'name',
                        searchField: 'name',
                        load: function (query, callback) {
                            if (!query.length) return callback();
                            $.ajax({
                                type: 'POST',
                                url: '<?php 
            echo admin_url('admin-ajax.php?action=mm_all_users&_wpnonce=' . wp_create_nonce('mm_all_users'));
            ?>
',
                                data: {
                                    'query': query
                                },
                                beforeSend: function () {
                                    $('.selectize-input').append('<i style="position: absolute;right: 10px;" class="fa fa-circle-o-notch fa-spin"></i>');
                                },
                                success: function (data) {
                                    $('.selectize-input').find('i').remove();
                                    callback(data);
                                }
                            });
                        }
                    });
                })
            </script>
        <?php 
        }
    function broadcast_checkbox()
    {
        ?>
        <label><input type="checkbox" name="broadcast" id="mmg-broadcast">
            <?php 
        _e("Send this message to all users", mmg()->domain);
        ?>
</label>
    <?php 
    }
 private function __construct()
 {
     //variables init
     $this->plugin_url = plugin_dir_url(__FILE__) . 'bbpress-intergration/';
     $this->plugin_path = plugin_dir_path(__FILE__) . 'bbpress-intergration/';
     $this->domain = mmg()->domain;
     $this->prefix = mmg()->prefix;
     spl_autoload_register(array(&$this, 'loader'));
     add_action('wp_enqueue_scripts', array(&$this, 'scripts'));
     $this->controller = new MM_BBPress_Controller();
 }
    function notification_buttons($wp_admin_bar)
    {
        //create new menu
        $unread = MM_Conversation_Model::count_unread();
        $args = array('id' => 'mm-button', 'title' => __('<div class="ig-container mm-admin-bar"><i class="fa fa-envelope"></i>&nbsp;<span>' . $unread . '</span>
</div>', mmg()->domain), 'href' => '#');
        $wp_admin_bar->add_menu($args);
        //create group
        $args = array('id' => 'mm-buttons-group', 'parent' => 'mm-button');
        $wp_admin_bar->add_group($args);
        //add node send new message
        $args = array('id' => 'mm-compose-button', 'title' => __("Send New Message", mmg()->domain), 'href' => '#compose-form-container-admin-bar', 'parent' => 'mm-buttons-group', 'meta' => array('class' => 'mm-compose-admin-bar'));
        $wp_admin_bar->add_node($args);
        //add node inbox page
        $args = array('id' => 'mm-inbox-button', 'title' => __("View Inbox", mmg()->domain), 'href' => get_permalink(mmg()->setting()->inbox_page), 'parent' => 'mm-buttons-group', 'meta' => array('class' => 'mm-view-inbox-admin-bar'));
        $wp_admin_bar->add_node($args);
    }
Example #10
0
                        </div>
                        <div class="col-md-8">
                            <table class="table">
                                <thead>
                                <tr>
                                    <th><?php 
_e("Note:", mmg()->domain);
?>
</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr>
                                    <td>
                                        <?php 
_e("If the diagnose tool cannot create table, that means the database user doesn't have enough permission to do that, you will need to copy the below sql code to create the tables.", mmg()->domain);
?>
                                        <?php 
$charset_collate = '';
if (!empty($wpdb->charset)) {
    $charset_collate = "DEFAULT CHARACTER SET {$wpdb->charset}";
}
if (!empty($wpdb->collate)) {
    $charset_collate .= " COLLATE {$wpdb->collate}";
}
$sql = "-- ----------------------------;<br/>\r\nCREATE TABLE IF NOT EXISTS `{$wpdb->base_prefix}mm_conversation` (<br/>\r\n  `id` int(11) NOT NULL AUTO_INCREMENT,<br/>\r\n  `date_created` datetime DEFAULT NULL,<br/>\r\n  `message_count` tinyint(3) DEFAULT NULL,<br/>\r\n  `message_index` varchar(255) DEFAULT NULL,<br/>\r\n  `user_index` varchar(255) DEFAULT NULL,<br/>\r\n  `send_from` tinyint(3) DEFAULT NULL,<br/>\r\n  `site_id` tinyint(1) DEFAULT NULL,<br/>\r\n  `status` tinyint(1) DEFAULT 1,<br/>\r\n  PRIMARY KEY (id)<br/>\r\n) {$charset_collate};<br/><br/>\r\nCREATE TABLE IF NOT EXISTS `{$wpdb->base_prefix}mm_status` (<br/>\r\n`id` int(11) unsigned NOT NULL AUTO_INCREMENT,<br/>\r\n  `conversation_id` int(11) DEFAULT NULL,<br/>\r\n  `message_id` int(11) DEFAULT NULL,<br/>\r\n  `user_id` int(11) DEFAULT NULL,<br/>\r\n  `status` int(11) DEFAULT NULL,<br/>\r\n  `date_created` datetime DEFAULT NULL,<br/>\r\n  `type` tinyint(4) DEFAULT NULL,<br/>\r\n  PRIMARY KEY (id)<br/>\r\n) {$charset_collate};";
?>
<br/><br/>
                                        <code>
                                            <?php 
echo $sql;
 function admin_menu()
 {
     add_menu_page(__('Messaging', mmg()->domain), __('Messaging', mmg()->domain), 'manage_options', mmg()->prefix . 'main', array(&$this, 'main'), 'dashicons-email-alt');
 }
Example #12
0
?>
                </li>
                <li>
                    <mark><?php 
_e("class", mmg()->domain);
?>
</mark>
                    : <?php 
_e("If you want to style the message button, use this shortcodes parameter to define the class of the message button. ", mmg()->domain);
?>
                </li>
                <li>
                    <mark><?php 
_e("subject", mmg()->domain);
?>
</mark>
                    : <?php 
_e("This will define the subject of the message sent, if one is not added by the user. ", mmg()->domain);
?>
                </li>
                <li class="text-info">
                    <?php 
_e("Please note that <strong>user_id</strong> or <strong>user_name</strong> or <strong>in_the_loop</strong> must be defined.");
?>
                </li>
            </ul>

        </div>
    </div>
    <div class="clearfix"></div>
</div>
Example #13
0
                    <?php 
if (!of_get_option('tokopress_wc_disable_search')) {
    ?>
                        <div class="quicknav-search">
                            <a rel="nofollow" class="quicknav-icon" href="javascript:void(0)">
                                <i class="sli sli-magnifier"></i>
                            </a>
                        </div>
                    <?php 
}
?>

                    <div class="quicknav-message" style="float: left;">
                        <a rel="nofollow" class="quicknav-icon" href="<?php 
echo get_permalink(mmg()->setting()->inbox_page);
?>
">
                            <i class="fa fa-envelope-o"></i>
                        </a>
                    </div>

                    <?php 
if (!of_get_option('tokopress_wc_disable_link_account')) {
    ?>
                        <div class="quicknav-account">
                            <a rel="nofollow" class="quicknav-icon" href="javascript:void(0)">
                                <i class="sli sli-user"></i>
                            </a>
                            <ul class="account-menu">
                                <?php 
Example #14
0
<div class="wrap">
    <div class="ig-container">
        <div class="mmessage-container">

            <div class="row">
                <div class="col-md-12">
                    <div class="page-heading">
                        <h2><?php 
_e("Messages", mmg()->domain);
?>
</h2>
                    </div>
                    <?php 
$table = new MM_Messages_Table();
$table->prepare_items();
$table->display();
?>
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
    </div>
</div>
Example #15
0
        function js()
        {
            if (is_user_logged_in()) {
                global $current_user;
                ?>
                <script type="text/javascript">
                    jQuery(function ($) {
                        function poll() {
                            setTimeout(function () {
                                $.ajax({
                                    url: '<?php 
                echo admin_url('admin-ajax.php');
                ?>
',
                                    data: {
                                        _wpnonce: '<?php 
                echo wp_create_nonce(get_current_user_id());
                ?>
',
                                        action: 'mm_push_notification'
                                    },
                                    success: function (data) {
                                        if (data != null && data.count != undefined) {
                                            $('.mm-admin-bar').find('span').text(data.count);
                                            if ($('.unread-count').size() > 0) {
                                                $('.unread-count').attr('title', data.count + ' ' + $('.unread-count').data('text'));
                                            }
                                            jQuery.each(data.messages, function (i, v) {
                                                var text = "From: " + v.from + "<br/>" + v.subject + "<br/>" + v.text;
                                                var n = noty({
                                                    text: text,
                                                    'theme': 'relax',
                                                    template: '<div class="noty_message"><span class="noty_text"></span><div class="noty_close"></div></div>',
                                                    dismissQueue: true,
                                                    'type': 'alert',
                                                    'layout': 'topRight',
                                                    maxVisible: 5,
                                                    closeWith: ['click'],
                                                    buttons: [
                                                        {
                                                            addClass: 'btn btn-primary btn-xs',
                                                            text: 'View', onClick: function ($noty) {
                                                            var url = '<?php 
                echo get_permalink(mmg()->setting()->inbox_page);
                ?>
?box=unread';
                                                            location.href = url;
                                                        }
                                                        },
                                                        {
                                                            addClass: 'btn btn-danger btn-xs',
                                                            text: 'Close', onClick: function ($noty) {
                                                            $noty.close();
                                                            }
                                                        }
                                                    ],
                                                    animation: {
                                                        open: {height: 'toggle'}, // jQuery animate function property object
                                                        close: {height: 'toggle'}, // jQuery animate function property object
                                                        easing: 'swing', // easing
                                                        speed: 500 // opening & closing animation speed
                                                    },
                                                    callback: {
                                                        onShow: function() {
                                                            $('.noty_buttons').addClass('ig-container');
                                                        }
                                                    }
                                                });
                                            })
                                        }
                                        //Setup the next poll recursively
                                        poll();
                                    }, dataType: "json"
                                });
                            }, 10000);
                        };
                        poll();
                    })
                </script>
            <?php 
            }
        }
Example #16
0
                                                                <?php 
                    _e("Visit Link", mmg()->domain);
                    ?>
                                                            </a>
                                                        <?php 
                }
                ?>
                                                        <?php 
                if ($a_m->file) {
                    ?>
                                                            <a href="<?php 
                    echo $file_url;
                    ?>
" download
                                                               class="btn btn-info"><?php 
                    _e('Download File', mmg()->domain);
                    ?>
</a>
                                                        <?php 
                }
                ?>
                                                        <button type="button" class="btn btn-default attachment-close"
                                                                data-dismiss="modal">Close
                                                        </button>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                <?php 
            }
Example #17
0
<?php

$mes = new MM_Message_Model();
?>
<div class="wrap">
    <div class="ig-container">
        <div class="mmessage-container">
            <div class="page-header">
                <h2><?php 
_e("Message #" . $model->id, mmg()->domain);
?>
</h2>
            </div>
            <div class="row">
                <div class="clearfix"></div>
                <div class="col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-body">
                            <?php 
$messages = $model->get_messages();
$this->render_partial('shortcode/_inbox_message', array('messages' => $messages, 'render_reply' => false));
?>
                        </div>
                    </div>
                </div>
                <div class="clearfix"></div>
            </div>
        </div>
    </div>
</div>
 public static function search($s, $per_page = null)
 {
     global $wpdb;
     $model = new MM_Conversation_Model();
     if (!empty($s)) {
         if (!$per_page) {
             $per_page = mmg()->setting()->per_page;
         }
         $paged = mmg()->get('mpaged', 1);
         $offset = ($paged - 1) * $per_page;
         $total_pages = ceil(self::count_all() / $per_page);
         mmg()->global['conversation_total_pages'] = $total_pages;
         if (is_admin()) {
             $sql = "SELECT conversation.id FROM wp_mm_conversation conversation\r\n                    INNER JOIN wp_mm_status mstat ON mstat.conversation_id = conversation.id\r\n                    INNER JOIN wp_postmeta meta ON meta.meta_key='_conversation_id' AND meta.meta_value = conversation.id\r\n                    INNER JOIN wp_posts posts ON posts.ID = meta.post_id\r\n                    INNER JOIN wp_users users ON users.id = posts.post_author\r\n                    WHERE (posts.post_title LIKE %s OR posts.post_content LIKE %s OR users.user_login LIKE %s) AND site_id=%d\r\n                    GROUP BY conversation.id LIMIT %d,%d";
             $sql = $wpdb->prepare($sql, "%{$s}%", "%{$s}%", "%{$s}%", get_current_blog_id(), $offset, $per_page);
         } else {
             $sql = "SELECT conversation.id FROM wp_mm_conversation conversation\r\n                    INNER JOIN wp_mm_status mstat ON mstat.conversation_id = conversation.id\r\n                    INNER JOIN wp_postmeta meta ON meta.meta_key='_conversation_id' AND meta.meta_value = conversation.id\r\n                    INNER JOIN wp_posts posts ON posts.ID = meta.post_id\r\n                    INNER JOIN wp_users users ON users.id = posts.post_author\r\n                    WHERE mstat.user_id= %d AND (posts.post_title LIKE %s OR posts.post_content LIKE %s OR users.user_login LIKE %s) AND site_id=%d\r\n                    GROUP BY conversation.id LIMIT %d,%d";
             $sql = $wpdb->prepare($sql, get_current_user_id(), "%{$s}%", "%{$s}%", "%{$s}%", get_current_blog_id(), $offset, $per_page);
         }
         $ids = $wpdb->get_col($sql);
         $ids = array_filter(array_unique($ids));
         if (empty($ids)) {
             return array();
         }
         $models = $model->find_all_by_ids($ids, false, false, 'date_created DESC');
         return $models;
     } else {
         return self::get_conversation();
     }
 }
Example #19
0
_e("Shortcodes", mmg()->domain);
?>
</a>
                        </li>
                        <li class="<?php 
echo mmg()->get('tab') == 'attachment' ? 'active' : null;
?>
">
                            <a href="<?php 
echo add_query_arg('tab', 'attachment');
?>
">
                                <i class="glyphicon glyphicon-paperclip"></i> <?php 
_e("Attachments", mmg()->domain);
?>
                            </a>
                        </li>
                        <?php 
do_action('mm_setting_menu', $model);
?>
                    </ul>
                    <div class="tab-content col-md-9">
                        <?php 
do_action('mm_setting_' . mmg()->get('tab', 'general'), $model);
?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
Example #20
0
                    </a>
                </div>
                <!--For small viewport-->
                <div class="col-sm-12 col-xs-12 hidden-md hidden-lg no-padding">
                    <br/>
                    <a class="btn btn-default btn-sm" href="<?php 
    echo add_query_arg('box', 'setting');
    ?>
">
                        <i class="fa fa-gear"></i> <?php 
    _e("Settings", mmg()->domain);
    ?>
                    </a>
                    <a class="btn btn-primary btn-sm mm-compose" href="#compose-form-container">
                        <?php 
    _e("Compose", mmg()->domain);
    ?>
                    </a>
                </div>
                <div class="clearfix"></div>
            </div>
        <?php 
}
?>
        <?php 
echo $content;
?>

    </div>
</div>
<?php 
 function _reply_message($conv_id, $message_id, $user_id, $model)
 {
     //load conversation
     $conversation = MM_Conversation_Model::model()->find($conv_id);
     $conversation->status = MM_Message_Status_Model::STATUS_UNREAD;
     //we will add new message to this conversation
     $conversation->save();
     //update users from this conversation, now save the message
     $m = new MM_Message_Model();
     $m->import($model->export());
     $m->send_to = $user_id;
     $m->conversation_id = $conversation->id;
     $m->status = MM_Message_Model::UNREAD;
     $mess = MM_Message_Model::model()->find($message_id);
     if (!empty($m->reply_to)) {
         if (!is_numeric($m->reply_to)) {
             wp_send_json(array('status' => 'fail', 'errors' => $model->get_errors()));
             exit;
         }
         $title = $m->subject;
         $description = $m->content;
         $price = $m->reply_to;
         $product_html = get_custom_order_button($title, $description, $price);
     }
     if (empty($m->subject)) {
         $m->subject = __("Re:", mmg()->domain) . ' ' . $mess->subject;
     }
     if (isset($product_html)) {
         $m->subject = __('You have new estimates!', 'artgorae');
         $m->content = __('You have new estimates!', 'artgorae') . '<br/><br/>' . $product_html;
     }
     $m->save();
     //update status for send to
     $status = MM_Message_Status_Model::model()->find_one_with_attributes(array('conversation_id' => $conversation->id, 'user_id' => $user_id));
     if (is_object($status)) {
         $status->status = MM_Message_Status_Model::STATUS_UNREAD;
         $status->save();
     }
     //update index
     $conversation->update_index($m->id);
     do_action('mm_message_sent', $m);
 }
    public function display()
    {
        $singular = $this->_args['singular'];
        ?>
        <form method="get" action="<?php 
        echo admin_url('admin.php');
        ?>
">
            <input type="hidden" name="page" value="mm_main">
            <?php 
        $this->search_box(__("Search", mmg()->domain), 'mm_conv_search');
        ?>
        </form>
        <div class="clearfix" style="height:20px"></div>

        <table class="wp-list-table <?php 
        echo implode(' ', $this->get_table_classes());
        ?>
">
            <thead>
            <tr>
                <?php 
        $this->print_column_headers();
        ?>
            </tr>
            </thead>

            <tfoot>
            <tr>
                <?php 
        $this->print_column_headers(false);
        ?>
            </tr>
            </tfoot>

            <tbody id="the-list"<?php 
        if ($singular) {
            echo " data-wp-lists='list:{$singular}'";
        }
        ?>
>
            <?php 
        $this->display_rows_or_placeholder();
        ?>
            </tbody>
        </table>
        <?php 
        $this->display_tablenav('bottom');
    }
Example #23
0
?>
</h3>
            </div>
            <?php 
mm_login_form();
?>
        </div>
    </div>
    <div class="col-md-6 no-padding">
        <div class="mm_sign_up">
            <div class="page-header">
                <h3><?php 
_e("Sign Up", mmg()->domain);
?>
</h3>
            </div>
            <p><?php 
_e("Sign up to become a registered member of the site", mmg()->domain);
?>
</p>
            <a href="<?php 
echo wp_registration_url();
?>
" class="btn btn-primary mm_signup_btn"><?php 
_e("Create Account", mmg()->domain);
?>
</a>
        </div>
    </div>
    <div class="clearfix"></div>
</div>
Example #24
0
 function scripts()
 {
     wp_register_script('mm_sceditor', mmg()->plugin_url . 'app/addons/wysiwyg/sceditor/minified/jquery.sceditor.min.js', array('jquery'));
     wp_register_script('mm_sceditor_xhtml', mmg()->plugin_url . 'app/addons/wysiwyg/sceditor/minified/plugins/bbcode.js', array('jquery', 'mm_sceditor'));
     //cause the adminbar needed from anywhere,so we bind it
     wp_enqueue_style('mm_sceditor', mmg()->plugin_url . 'app/addons/wysiwyg/sceditor/minified/themes/default.min.css');
 }
Example #25
0
                                <input type="hidden" name="action" value="mm_send_message">
                                <?php 
if (mmg()->can_upload() == true) {
    ig_uploader()->show_upload_control($model, 'attachment', false, array('title' => __("Attach media or other files.", mmg()->domain)));
}
?>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-default compose-close"
                                        data-dismiss="modal"><?php 
_e("Close", mmg()->domain);
?>
</button>
                                <button type="submit"
                                        class="btn btn-primary compose-submit"><?php 
_e("Send", mmg()->domain);
?>
</button>
                            </div>
                            <?php 
$form->close();
?>
                        </div>
                        <!-- /.modal-content -->
                    </div>
                    <!-- /.modal-dialog -->
                </div>
            </div>
        </div>
    </div>
    <!-- /.modal -->
Example #26
0
    /**
     * @param array $args
     *
     * @return string
     * Getting from Worpdress, we can have custom design
     */
    function mm_login_form($args = array())
    {
        $defaults = array('echo' => true, 'redirect' => (is_ssl() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'form_id' => 'loginform', 'label_username' => __('Username'), 'label_password' => __('Password'), 'label_remember' => __('Remember Me'), 'label_log_in' => __('Sign In'), 'id_username' => 'user_login', 'id_password' => 'user_pass', 'id_remember' => 'rememberme', 'id_submit' => 'wp-submit', 'remember' => true, 'value_username' => '', 'value_remember' => false);
        /**
         * Filter the default login form output arguments.
         *
         * @since 3.0.0
         *
         * @see wp_login_form()
         *
         * @param array $defaults An array of default login form arguments.
         */
        $args = wp_parse_args($args, apply_filters('login_form_defaults', $defaults));
        /**
         * Filter content to display at the top of the login form.
         *
         * The filter evaluates just following the opening form tag element.
         *
         * @since 3.0.0
         *
         * @param string $content Content to display. Default empty.
         * @param array $args Array of login form arguments.
         */
        $login_form_top = apply_filters('login_form_top', '', $args);
        /**
         * Filter content to display in the middle of the login form.
         *
         * The filter evaluates just following the location where the 'login-password'
         * field is displayed.
         *
         * @since 3.0.0
         *
         * @param string $content Content to display. Default empty.
         * @param array $args Array of login form arguments.
         */
        $login_form_middle = apply_filters('login_form_middle', '', $args);
        /**
         * Filter content to display at the bottom of the login form.
         *
         * The filter evaluates just preceding the closing form tag element.
         *
         * @since 3.0.0
         *
         * @param string $content Content to display. Default empty.
         * @param array $args Array of login form arguments.
         */
        $login_form_bottom = apply_filters('login_form_bottom', '', $args);
        $form = '
		<form name="' . $args['form_id'] . '" id="' . $args['form_id'] . '" action="' . esc_url(site_url('wp-login.php', 'login_post')) . '" method="post">
			' . $login_form_top . '
			 <div class="form-group">
				<label for="' . esc_attr($args['id_username']) . '">' . esc_html($args['label_username']) . '</label>
				<input type="text" name="log" id="' . esc_attr($args['id_username']) . '" class="form-control" value="' . esc_attr($args['value_username']) . '" size="20" />
			</div>
			<div class="form-group">
				<label for="' . esc_attr($args['id_password']) . '">' . esc_html($args['label_password']) . '</label>
				<input type="password" name="pwd" id="' . esc_attr($args['id_password']) . '" class="form-control" value="" size="20" />
			</div>
			' . $login_form_middle . '
			' . ($args['remember'] ? '<p class="login-remember"><label><input name="rememberme" type="checkbox" id="' . esc_attr($args['id_remember']) . '" value="forever"' . ($args['value_remember'] ? ' checked="checked"' : '') . ' /> ' . esc_html($args['label_remember']) . '</label>
			<a class="pull-right" href="' . wp_lostpassword_url() . '">' . __("Forgot password?", mmg()->domain) . '</a></p>' : '') . '
			<p class="login-submit">
				<button type="submit" name="wp-submit" id="' . esc_attr($args['id_submit']) . '" class="btn btn-primary">' . esc_attr($args['label_log_in']) . '</button>
				<input type="hidden" name="redirect_to" value="' . esc_url($args['redirect']) . '" />
			</p>
			' . $login_form_bottom . '
		</form>';
        if ($args['echo']) {
            echo $form;
        } else {
            return $form;
        }
    }
Example #27
0
        function setting_menu()
        {
            ?>
            <li class="<?php 
            echo mmg()->get('tab') == 'cap' ? 'active' : null;
            ?>
">
                <a href="<?php 
            echo add_query_arg('tab', 'cap');
            ?>
">
                    <i class="fa fa-binoculars"></i> <?php 
            _e("Capability Settings", mmg()->domain);
            ?>
</a>
            </li>
        <?php 
        }
Example #28
0
 function mmg_load_languages()
 {
     load_plugin_textdomain(mmg()->domain, false, plugin_basename(mmg()->plugin_path . 'languages/'));
 }
Example #29
0
                    action: 'mm_create_message_page'
                },
                url: '<?php 
echo admin_url('admin-ajax.php');
?>
',
                beforeSend: function () {
                    that.attr('disabled', 'disabled').text('<?php 
echo esc_js(__('Creating...', mmg()->domain));
?>
');
                },
                success: function (data) {
                    var element = that.parent().parent().find('select').first();
                    $.get("<?php 
echo "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
?>
", function (html) {
                        html = $(html);
                        var clone = html.find('select[name="' + element.attr('name') + '"]');
                        element.replaceWith(clone);
                        that.removeAttr('disabled').text('<?php 
echo esc_js(__('Create Page', mmg()->domain));
?>
');
                    })
                }
            })
        })
    })
</script>
Example #30
0
</span>
                        </label>
                    </div>
                </div>
            </div>
            <?php 
    do_action('mm_after_user_setting_form');
    ?>
            <div class="row">
                <?php 
    echo wp_nonce_field('mm_user_setting_' . get_current_user_id());
    ?>
                <div class="col-md-10 col-md-offset-2">
                    <button name="mm_user_setting" value="1" class="btn btn-primary"
                            type="submit"><?php 
    _e("Save Changes", mmg()->domain);
    ?>
</button>
                </div>
            </div>
        </fieldset>
    </form>
    <script type="text/javascript">
        jQuery(function ($) {
            $(".mm-compose").leanModal({
                closeButton: ".compose-close",
                top:'5%',
                width:'90%',
                maxWidth:659
            });
        })