added config option to show frontends emoticon selector as button

This commit is contained in:
Ian 2013-05-23 14:55:35 +02:00
parent ec1640a168
commit 5f6d6e8d31
5 changed files with 26 additions and 5 deletions

View file

@ -1,3 +1,7 @@
2.4:
----
added config option to show frontends emoticon selector as button
2.3:
----
added faked drag and drop replacement handler for dragged and dropped emoticons into CKEditor WYSIWYG-Editor

View file

@ -12,4 +12,7 @@
// Next lines were translated on 2011/11/22
@define('PLUGIN_EVENT_EMOTICONCHOOSER_POPUP', 'Zeige die Smiley-Auswahl nur als Aufklappmenü?');
@define('PLUGIN_EVENT_EMOTICONCHOOSER_POPUPTEXT', 'Linkbezeichnung um die vorhandenen Smileys anzuzeigen');
@define('PLUGIN_EVENT_EMOTICONCHOOSER_POPUPTEXT_DEFAULT', 'Smileys');
@define('PLUGIN_EVENT_EMOTICONCHOOSER_POPUPTEXT_DEFAULT', 'Smileys');
// Next lines were translated on 2013/05/23
@define('PLUGIN_EVENT_EMOTICONCHOOSER_POPUP_BUTTON', 'Zeige Smiley-Auswahl im Frontend als Button?');

View file

@ -12,4 +12,7 @@
// Next lines were translated on 2011/11/22
@define('PLUGIN_EVENT_EMOTICONCHOOSER_POPUP', 'Zeige die Smiley-Auswahl nur als Aufklappmenü?');
@define('PLUGIN_EVENT_EMOTICONCHOOSER_POPUPTEXT', 'Linkbezeichnung um die vorhandenen Smileys anzuzeigen');
@define('PLUGIN_EVENT_EMOTICONCHOOSER_POPUPTEXT_DEFAULT', 'Smileys');
@define('PLUGIN_EVENT_EMOTICONCHOOSER_POPUPTEXT_DEFAULT', 'Smileys');
// Next lines were translated on 2013/05/23
@define('PLUGIN_EVENT_EMOTICONCHOOSER_POPUP_BUTTON', 'Zeige Smiley-Auswahl im Frontend als Button?');

View file

@ -12,5 +12,6 @@
@define('PLUGIN_EVENT_EMOTICONCHOOSER_POPUP', 'Only show emoticon selector as a "popup" element?');
@define('PLUGIN_EVENT_EMOTICONCHOOSER_POPUPTEXT', 'Title of the link to show available Smileys');
@define('PLUGIN_EVENT_EMOTICONCHOOSER_POPUPTEXT_DEFAULT', 'Smileys');
@define('PLUGIN_EVENT_EMOTICONCHOOSER_POPUP_BUTTON', 'Style frontend emoticon selector as button?');
?>

View file

@ -30,7 +30,7 @@ class serendipity_event_emoticonchooser extends serendipity_event
'smarty' => '2.6.7',
'php' => '4.1.0'
));
$propbag->add('version', '2.3');
$propbag->add('version', '2.4');
$propbag->add('event_hooks', array(
'backend_entry_toolbar_extended' => true,
'backend_entry_toolbar_body' => true,
@ -38,7 +38,7 @@ class serendipity_event_emoticonchooser extends serendipity_event
'css_backend' => true
));
$propbag->add('groups', array('BACKEND_EDITOR'));
$propbag->add('configuration', array('frontend', 'popup', 'popuptext'));
$propbag->add('configuration', array('frontend', 'popup', 'button', 'popuptext'));
}
function generate_content(&$title) {
@ -64,6 +64,14 @@ class serendipity_event_emoticonchooser extends serendipity_event
return true;
break;
case 'button':
$propbag->add('type', 'boolean');
$propbag->add('name', PLUGIN_EVENT_EMOTICONCHOOSER_POPUP_BUTTON);
$propbag->add('description', 'default: as link');
$propbag->add('default', false);
return true;
break;
case 'popuptext':
$propbag->add('type', 'string');
$propbag->add('name', PLUGIN_EVENT_EMOTICONCHOOSER_POPUPTEXT);
@ -137,7 +145,9 @@ class serendipity_event_emoticonchooser extends serendipity_event
$popuplink = '';
if (serendipity_db_bool($this->get_config('popup', false))) {
$popupstyle = '; display: none';
$popuplink = '<a class="serendipity_toggle_emoticon_bar' . $popcl . '" href="#" onclick="toggle_emoticon_bar_' . $func . '(); return false">' . $this->get_config('popuptext') . '</a>';
$popuplink = serendipity_db_bool($this->get_config('button', false))
? '<input type="button" onclick="toggle_emoticon_bar_' . $func . '(); return false" href="#" class="serendipity_toggle_emoticon_bar' . $popcl . '" value="' . $this->get_config('popuptext') . '">'
: '<a class="serendipity_toggle_emoticon_bar' . $popcl . '" href="#" onclick="toggle_emoticon_bar_' . $func . '(); return false">' . $this->get_config('popuptext') . '</a>';
}
$i = 1;