diff --git a/acp/acp_mchat_info.php b/acp/acp_mchat_info.php
index bffff83..f18ee57 100644
--- a/acp/acp_mchat_info.php
+++ b/acp/acp_mchat_info.php
@@ -3,7 +3,8 @@
/**
*
* @package phpBB Extension - mChat
- * @copyright (c) 2015 dmzx - http://www.dmzx-web.net
+ * @copyright (c) 2016 dmzx - http://www.dmzx-web.net
+ * @copyright (c) 2016 kasimi
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
diff --git a/acp/acp_mchat_module.php b/acp/acp_mchat_module.php
index 9a7b508..243c9d2 100644
--- a/acp/acp_mchat_module.php
+++ b/acp/acp_mchat_module.php
@@ -3,7 +3,8 @@
/**
*
* @package phpBB Extension - mChat
- * @copyright (c) 2015 dmzx - http://www.dmzx-web.net
+ * @copyright (c) 2016 dmzx - http://www.dmzx-web.net
+ * @copyright (c) 2016 kasimi
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
@@ -19,21 +20,14 @@ class acp_mchat_module
global $phpbb_container, $user;
// Add the ACP lang file
- $user->add_lang_ext('dmzx/mchat', 'info_acp_mchat');
+ $user->add_lang_ext('dmzx/mchat', 'mchat_acp');
- // Load a template from adm/style for our ACP page
+ // Set template
$this->tpl_name = 'acp_mchat';
+ $this->page_title = 'MCHAT_ACP_TITLE';
- // Set the page title for our ACP page
- $this->page_title = 'MCHAT_TITLE';
-
- // Get an instance of the admin controller
- $admin_controller = $phpbb_container->get('dmzx.mchat.admin.controller');
-
- // Make the $u_action url available in the admin controller
- $admin_controller->set_page_url($this->u_action);
-
- // Load the display settings handle in the admin controller
- $admin_controller->display_options();
+ // Get an instance of the ACP controller and display the options
+ $controller = $phpbb_container->get('dmzx.mchat.acp.controller');
+ $controller->display_options($this->u_action);
}
}
diff --git a/adm/style/acp_mchat.html b/adm/style/acp_mchat.html
index 5a5350b..3c875b8 100644
--- a/adm/style/acp_mchat.html
+++ b/adm/style/acp_mchat.html
@@ -1,6 +1,8 @@
-
').css({
- position: 'absolute',
- top: -9999,
- left: -9999,
- width: 'auto',
- fontSize: input.css('fontSize'),
- fontFamily: input.css('fontFamily'),
- fontWeight: input.css('fontWeight'),
- letterSpacing: input.css('letterSpacing'),
- whiteSpace: 'nowrap'
- });
- testSubject.insertAfter(input);
- $(this).on('keypress blur change submit focus', function() {
- if (val === (val = input.val())) {
- return;
- }
- var escaped = val.replace(/&/g, '&').replace(/\s/g, ' ').replace(//g, '>');
- var testerWidth = testSubject.html(escaped).width();
- var newWidth = (testerWidth + comfortZone) >= minWidth ? testerWidth + comfortZone : minWidth;
- if ((newWidth < input.width() && newWidth >= minWidth) || (newWidth > minWidth && newWidth < $('.mchat-panel').width() - comfortZone)) {
- input.width(newWidth);
- }
- });
- });
- return this;
- };
-
- mChat.resetSession(true);
-
- if (!mChat.messageTop) {
- mChat.$$('main').animate({scrollTop: mChat.$$('main')[0].scrollHeight}, 'slow', 'swing');
- }
-
- mChat.$$('user-sound').prop('checked', mChat.playSound && !Cookies.get('mchat_no_sound'));
-
- if (Cookies.get('mchat_show_smilies')) {
- mChat.$$('smilies').slideToggle('slow');
- }
-
- if (Cookies.get('mchat_show_bbcodes')) {
- mChat.$$('bbcodes').slideToggle('slow', function() {
- if (Cookies.get('mchat_show_colour')) {
- mChat.$$('colour').slideToggle('slow');
- }
- });
- }
-
- if (Cookies.get('mchat_show_userlist')) {
- mChat.$$('userlist').slideToggle('slow');
- }
-
- mChat.$$('colour').html(phpbb.colorPalette('h', 15, 10)).on('click', 'a', function(e) {
- var color = $(this).data('color');
- bbfontstyle('[color=#' + color + ']', '[/color]');
- e.preventDefault();
- });
-
- if (!mChat.$$('user-sound').prop('checked')) {
- Cookies.set('mchat_no_sound', 'yes');
- }
-
- mChat.$$('user-sound').change(function() {
- if (this.checked) {
- Cookies.remove('mchat_no_sound');
- } else {
- Cookies.set('mchat_no_sound', 'yes');
- }
- });
-
- if (mChat.$$('input').is('input')) {
- $('#mchat-form').on('keypress', function(e) {
- if (e.which == 13) {
- mChat.add();
- e.preventDefault();
- }
- });
- }
-
- mChat.$$('input').autoGrowInput();
- }
-
- $(window).on('beforeunload', function() {
- mChat.pageIsUnloading = true;
- });
-
- $('#phpbb').on('click', '[data-mchat-action]', function(e) {
- var action = $(this).data('mchat-action');
- mChat[action].call(this);
- e.preventDefault();
- }).on('click', '[data-mchat-toggle]', function(e) {
- var elem = $(this).data('mchat-toggle');
- mChat.toggle(elem);
- e.preventDefault();
- });
-});
diff --git a/styles/prosilver/template/mchat_bbcodes.html b/styles/prosilver/template/mchat_bbcodes.html
deleted file mode 100644
index 1ee41b4..0000000
--- a/styles/prosilver/template/mchat_bbcodes.html
+++ /dev/null
@@ -1,93 +0,0 @@
-
diff --git a/styles/prosilver/template/mchat_body.html b/styles/prosilver/template/mchat_body.html
deleted file mode 100644
index 0a38e46..0000000
--- a/styles/prosilver/template/mchat_body.html
+++ /dev/null
@@ -1,195 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
style="height:{MCHAT_CUSTOM_HEIGHT}{MCHAT_INDEX_HEIGHT}px">
-
-
{L_CONFIRM}
-
-
-
-
-
-
-
{L_MCHAT_NOMESSAGE}
-
-
-
-
{L_MCHAT_ANNOUNCEMENT}{L_COLON} {MCHAT_STATIC_MESS}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{L_WHO_IS_CHATTING}
-
-
- {MCHAT_WHOIS_REFRESH_EXPLAIN}
- {L_MCHAT_REFRESHING}
-
{L_LEGEND}{L_COLON} {LEGEND}
-
-
-
- {L_LEGEND}{L_COLON} {LEGEND}
-
-
-
-
-
-
diff --git a/styles/prosilver/template/mchat_messages.html b/styles/prosilver/template/mchat_messages.html
deleted file mode 100644
index b8dcf62..0000000
--- a/styles/prosilver/template/mchat_messages.html
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
data-usercolor="{mchatrow.MCHAT_USERNAME_COLOR}" data-message="{mchatrow.MCHAT_MESSAGE_EDIT}" data-message-time="{mchatrow.MCHAT_MESSAGE_TIME}" data-edit-time="{mchatrow.MCHAT_EDIT_TIME}" data-edit-delete-limit="1">
-
-
-
-
-
-
-
{mchatrow.MCHAT_MESSAGE}
-
-
diff --git a/styles/prosilver/template/mchat_whois.html b/styles/prosilver/template/mchat_whois.html
deleted file mode 100644
index 652d385..0000000
--- a/styles/prosilver/template/mchat_whois.html
+++ /dev/null
@@ -1,8 +0,0 @@
-
diff --git a/styles/prosilver/template/ucp_mchat.html b/styles/prosilver/template/ucp_mchat.html
deleted file mode 100644
index 917f641..0000000
--- a/styles/prosilver/template/ucp_mchat.html
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
diff --git a/styles/prosilver/theme/mchat.css b/styles/prosilver/theme/mchat.css
deleted file mode 100644
index 1150233..0000000
--- a/styles/prosilver/theme/mchat.css
+++ /dev/null
@@ -1,176 +0,0 @@
-/**
- *
- * @package phpBB Extension - mChat
- * @copyright (c) 2015 dmzx - http://www.dmzx-web.net
- * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
- *
- */
-.mchat-message {
- background: linear-gradient(#B6BFC4, #FFFFFF, #FFFFFF, #B6BFC4);
- border: 1px solid #999999;
- border-radius: 6px;
- padding: 5px;
- margin-right: 1px;
- overflow: hidden;
-}
-
-.mchat-message:hover {
- background-color: #F6F4D0;
-}
-
-.mchat-bg-1 {
- color: #333333;
-}
-
-.mchat-bg-2 {
- color: #444444;
-}
-
-.mchat-row-limit {
- overflow: auto;
- width: 100%;
-}
-
-.mchat-panel {
- text-align: center;
- padding: 3px;
- clear: both;
-}
-
-#mchat-input {
- cursor: text;
- width: 50%;
- background-color: #FFFFFF;
- border: 1px solid #B4BAC0;
- color: #333333;
- font-size: 1.1em;
- padding: 5px 5px 3px 5px;
- margin: 3px 0px 3px 5px;
-}
-
-#mchat-input:hover {
- border-color: #11A3EA;
-}
-
-#mchat-body {
- width: 100% !important;
- background-color: #E9F0F5 !important;
-}
-
-#mchat-static, #mchat-stats, #mchat-whois, .mchat-refresh {
- padding-left: 5px;
- text-align: left;
- font-size: 1.1em;
-}
-
-#mchat-static {
- color: #990000;
-}
-
-#mchat-stats, #mchat-whois {
- margin-top: 2px;
- min-height: 1.3em;
- height: auto !important;
-}
-
-.mchat-refresh {
- margin-top: 1.5em;
- clear: both;
-}
-
-.mchat-text {
- padding: 3px;
- font-size: 1.1em;
- width: 98%;
-}
-
-.mchat-text ul {
- margin-left: 10px;
-}
-
-.mchat-text blockquote {
- margin: 5px 0 0 10px
-}
-
-.mchat-panel-image {
- margin-top: -4px;
- vertical-align: middle;
-}
-
-.mchat-message-header {
- float: left;
-}
-
-.mchat-message-icons {
- float: right;
-}
-
-.mchat-mention, .mchat-message-icons > * {
- cursor: pointer;
-}
-
-#mchat-smilies {
- padding: 5px;
-}
-
-#mchat-refresh-load {
- vertical-align: middle;
- cursor: wait;
- display: none;
-}
-
-#mchat-refresh-ok {
- vertical-align: middle;
- cursor: help;
-}
-
-#mchat-refresh-error, #mchat-refresh-paused {
- vertical-align: middle;
- cursor: help;
- display: none;
-}
-
-#mchat-status {
- padding: 5px;
-}
-
-.mchat-alert {
- color: #7E2217;
- padding: 10px;
-}
-
-#mchat-userlist {
- float: left;
-}
-
-.mchat-avatar {
- float: left;
- width: 40px;
- padding-right: 5px;
-}
-
-.mchat-message-avatar .mchat-text {
- margin-left: 50px;
- width: 90%;
- margin-right: 5px;
-}
-
-#mchat-confirm textarea {
- width: 100%;
- height: 100px;
-}
-
-#mchat-colour {
- margin-top: 5px;
-}
-
-#mchat-colour table {
- margin: 0 auto;
- border-collapse: separate;
- border-spacing: 1px;
-}
-
-#mchat-bbcodes {
- padding: 5px;
- display: none;
-}
diff --git a/styles/simplicity/template/event/overall_header_head_append.html b/styles/simplicity/template/event/overall_header_head_append.html
new file mode 100644
index 0000000..22a6a0f
--- /dev/null
+++ b/styles/simplicity/template/event/overall_header_head_append.html
@@ -0,0 +1,2 @@
+
+
diff --git a/styles/simplicity/template/mchat_navlink.html b/styles/simplicity/template/mchat_navlink.html
new file mode 100644
index 0000000..99a90ef
--- /dev/null
+++ b/styles/simplicity/template/mchat_navlink.html
@@ -0,0 +1 @@
+
{L_MCHAT_TITLE}
diff --git a/styles/simplicity/theme/mchat_custom.css b/styles/simplicity/theme/mchat_custom.css
new file mode 100644
index 0000000..d222458
--- /dev/null
+++ b/styles/simplicity/theme/mchat_custom.css
@@ -0,0 +1,81 @@
+/**
+ *
+ * @package phpBB Extension - mChat
+ * @copyright (c) 2016 dmzx - http://www.dmzx-web.net
+ * @copyright (c) 2016 kasimi
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+ *
+ */
+
+.icon-mchat {
+ position: relative;
+}
+
+.icon-mchat:after {
+ content: '\f086';
+ font-family: 'FontAwesome';
+ width: 18px;
+ text-align: center;
+ position: absolute;
+ top: 50%;
+ left: 0;
+ height: 14px;
+ margin-top: -7px;
+ font-size: 12px;
+ line-height: 14px;
+ vertical-align: baseline;
+ font-weight: normal;
+ font-style: normal;
+ text-transform: none;
+ text-indent: 0;
+ pointer-events: none;
+}
+
+.navbar .nav-tabs .mchat .nav-link {
+ position: relative;
+ text-indent: 999px;
+ width: 15px;
+ padding: 0 8px;
+ overflow: hidden;
+}
+
+.navbar .nav-tabs .mchat .nav-link:after {
+ content: '\f086';
+ font-family: 'FontAwesome';
+ position: absolute;
+ top: 50%;
+ margin-top: -7.5px;
+ width: 15px;
+ line-height: 15px;
+ height: 15px;
+ font-weight: normal;
+ font-style: normal;
+ text-indent: 0;
+ text-align: center;
+ font-size: 15px;
+ left:8px
+}
+
+.rtl .navbar .nav-tabs .mchat .nav-link {
+ padding-left: 12px;
+ padding-right: 30px;
+}
+
+.rtl .navbar .nav-tabs .mchat .nav-link:after {
+ left: auto;
+ right: 8px;
+}
+
+li.mchat-message {
+ padding: 5px !important;
+}
+
+li.mchat-message:first-child {
+ border-top-width: 1px !important;
+ padding-top: 5px !important;
+}
+
+li.mchat-message:last-child {
+ border-bottom-width: 1px !important;
+ padding-bottom: 5px !important;
+}
diff --git a/styles/we_universal/template/event/overall_header_head_append.html b/styles/we_universal/template/event/overall_header_head_append.html
new file mode 100644
index 0000000..22a6a0f
--- /dev/null
+++ b/styles/we_universal/template/event/overall_header_head_append.html
@@ -0,0 +1,2 @@
+
+
diff --git a/styles/we_universal/theme/mchat_custom.css b/styles/we_universal/theme/mchat_custom.css
new file mode 100644
index 0000000..7ac850f
--- /dev/null
+++ b/styles/we_universal/theme/mchat_custom.css
@@ -0,0 +1,12 @@
+/**
+ *
+ * @package phpBB Extension - mChat
+ * @copyright (c) 2016 dmzx - http://www.dmzx-web.net
+ * @copyright (c) 2016 kasimi
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+ *
+ */
+
+#mchat-panel {
+ border-radius: 0;
+}
diff --git a/ucp/ucp_mchat_info.php b/ucp/ucp_mchat_info.php
index 32c8dc1..51c3178 100644
--- a/ucp/ucp_mchat_info.php
+++ b/ucp/ucp_mchat_info.php
@@ -3,7 +3,8 @@
/**
*
* @package phpBB Extension - mChat
- * @copyright (c) 2015 dmzx - http://www.dmzx-web.net
+ * @copyright (c) 2016 dmzx - http://www.dmzx-web.net
+ * @copyright (c) 2016 kasimi
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
diff --git a/ucp/ucp_mchat_module.php b/ucp/ucp_mchat_module.php
index 2722ae7..a8b15f4 100644
--- a/ucp/ucp_mchat_module.php
+++ b/ucp/ucp_mchat_module.php
@@ -3,7 +3,8 @@
/**
*
* @package phpBB Extension - mChat
- * @copyright (c) 2015 dmzx - http://www.dmzx-web.net
+ * @copyright (c) 2016 dmzx - http://www.dmzx-web.net
+ * @copyright (c) 2016 kasimi
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
@@ -12,83 +13,21 @@ namespace dmzx\mchat\ucp;
class ucp_mchat_module
{
- function main($id, $mode)
+ public $u_action;
+
+ public function main($id, $mode)
{
- global $config, $db, $user, $template, $request;
+ global $phpbb_container, $user;
- $error = $data = array();
+ // Add the UCP lang file
+ $user->add_lang_ext('dmzx/mchat', 'mchat_ucp');
- switch ($mode)
- {
- case 'configuration':
-
- $data = array(
- 'user_mchat_index' => $request->variable('user_mchat_index', (bool) $user->data['user_mchat_index']),
- 'user_mchat_sound' => $request->variable('user_mchat_sound', (bool) $user->data['user_mchat_sound']),
- 'user_mchat_stats_index' => $request->variable('user_mchat_stats_index', (bool) $user->data['user_mchat_stats_index']),
- 'user_mchat_topics' => $request->variable('user_mchat_topics', (bool) $user->data['user_mchat_topics']),
- 'user_mchat_avatars' => $request->variable('user_mchat_avatars', (bool) $user->data['user_mchat_avatars']),
- 'user_mchat_input_area' => $request->variable('user_mchat_input_area', (bool) $user->data['user_mchat_input_area']),
- );
-
- add_form_key('ucp_mchat');
-
- if ($request->is_set_post('submit'))
- {
- if (!check_form_key('ucp_mchat'))
- {
- $error[] = 'FORM_INVALID';
- }
-
- if (!sizeof($error))
- {
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $data) . '
- WHERE user_id = ' . (int) $user->data['user_id'];
- $db->sql_query($sql);
-
- meta_refresh(3, $this->u_action);
- $message = $user->lang('PROFILE_UPDATED') . '
' . sprintf($user->lang('RETURN_UCP'), '
', '');
- trigger_error($message);
- }
-
- // Replace "error" strings with their real, localised form
- // The /e modifier is deprecated since PHP 5.5.0
- //$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
- foreach ($error as $i => $err)
- {
- $lang = $user->lang($err);
- if (!empty($lang))
- {
- $error[$i] = $lang;
- }
- }
- }
-
- $template->assign_vars(array(
- 'ERROR' => sizeof($error) ? implode('
', $error) : '',
-
- 'S_DISPLAY_MCHAT' => $data['user_mchat_index'],
- 'S_SOUND_MCHAT' => $data['user_mchat_sound'],
- 'S_STATS_MCHAT' => $data['user_mchat_stats_index'],
- 'S_TOPICS_MCHAT' => $data['user_mchat_topics'],
- 'S_AVATARS_MCHAT' => $data['user_mchat_avatars'],
- 'S_INPUT_MCHAT' => $data['user_mchat_input_area'],
- 'S_MCHAT_TOPICS' => $config['mchat_new_posts_edit'] || $config['mchat_new_posts_quote'] || $config['mchat_new_posts_reply'] || $config['mchat_new_posts_topic'],
- 'S_MCHAT_INDEX' => $config['mchat_on_index'],
- 'S_MCHAT_INDEX_STATS' => $config['mchat_stats_index'],
- 'S_MCHAT_AVATARS' => $config['mchat_avatars'],
- ));
- break;
- }
-
- $template->assign_vars(array(
- 'L_TITLE' => $user->lang('UCP_PROFILE_MCHAT'),
- 'S_UCP_ACTION' => $this->u_action,
- ));
-
- // Set desired template
+ // Set template
$this->tpl_name = 'ucp_mchat';
$this->page_title = 'UCP_PROFILE_MCHAT';
+
+ // Get an instance of the UCP controller and display the options
+ $controller = $phpbb_container->get('dmzx.mchat.ucp.controller');
+ $controller->display_options($this->u_action);
}
}