Skip to content
Permalink
Browse files

- removed plain text editor mode; updates #236

- insert smiley images in HTML editor mode; updates #782
- consolidated redundant editor JS code
- increased new-cache-desc editor window size
- improved remove-cache-desc page layout
  • Loading branch information...
following5 committed Aug 10, 2015
1 parent b771f91 commit b7dddd7128ee396fbe8a66d58726fd25549647d0
@@ -502,6 +502,14 @@ function dbv_128() // see util2/gns/mksearchindex.php; fix for #175/3
mysql_free_result($rs);
}
function dbv_129() // discarded text editor mode (#236)
{
sql("ALTER TABLE `cache_desc` CHANGE COLUMN `desc_html` `desc_html` tinyint(1) NOT NULL default '1' COMMENT 'obsolete'");
sql("ALTER TABLE `cache_desc` CHANGE COLUMN `desc_htmledit` `desc_htmledit` tinyint(1) NOT NULL default '1'");
sql("ALTER TABLE `cache_logs` CHANGE COLUMN `text_html` `text_html` tinyint(1) NOT NULL default '1' COMMENT 'obsolete'");
sql("ALTER TABLE `cache_logs` CHANGE COLUMN `text_htmledit` `text_htmledit` tinyint(1) NOT NULL default '1'");
sql("ALTER TABLE `user` CHANGE COLUMN `no_htmledit_flag` `no_htmledit_flag` tinyint(1) NOT NULL default '0' COMMENT 'inverted meaning'");
}
// When adding new mutations, take care that they behave well if run multiple
// times. This improves robustness of database versioning.
@@ -1456,7 +1456,7 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('553', 'Save', '
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('554', 'The following settings are stored for your logo:', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('555', 'Show logentries', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('556', 'Statistic picture', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('558', 'Don\'t use an HTML editor by default.', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('558', 'Use simple HTML editor by default.', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('559', 'Don\'t log me out after 15 minutes inaktivity.', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('560', 'I\'m taking an PMR walkie talkie on channel 2 with me.', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('561', 'Others:', '2010-08-28 11:48:04');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('554', 'DE', 'Folgende Einstellungen sind für dein Statistikbild gespeichert:', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('555', 'DE', 'Logeinträge anzeigen', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('556', 'DE', 'Statistikbild', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('558', 'DE', 'Als Vorgabe keinen HTML-Editor verwenden.', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('558', 'DE', 'Einfachen HTML-Editor als Vorgabe verwenden.', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('559', 'DE', 'Der automatische Logout 15 Minuten nach Verlassen der Webseite ist deaktiviert.', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('560', 'DE', 'Ich nehme ein PMR-Funkgerät auf Kanal 2 mit zum Cachen.', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('561', 'DE', 'Sonstiges:', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('554', 'EN', 'The following settings are stored for your logo:', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('555', 'EN', 'Show log entries', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('556', 'EN', 'Statistics picture', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('558', 'EN', 'Don\'t use the HTML editor by default.', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('558', 'EN', 'Use simple HTML editor by default.', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('559', 'EN', 'Don\'t log me out after 15 minutes of inactivity.', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('560', 'EN', 'I\'m taking a PMR walkie talkie on channel 2 with me.', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('561', 'EN', 'Others:', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('554', 'ES', 'Las siguientes configuraciones se almacenan para su logo:', '2010-12-09 00:17:57');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('555', 'ES', 'Mostrar log de entrada', '2010-12-09 00:17:57');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('556', 'ES', 'Statistics imagen', '2010-12-09 00:17:57');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('558', 'ES', 'No utilice el editor HTML de forma predeterminada.', '2010-12-09 00:17:57');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('558', 'ES', 'Utilice el editor HTML de forma predeterminada.', '2010-12-09 00:17:57');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('559', 'ES', 'No me registro después de 15 minutos de inactividad.', '2010-12-09 00:17:57');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('560', 'ES', 'Llevaré un walkie talkie PMR en el canal 2 conmigo.', '2010-12-09 00:17:57');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('561', 'ES', 'Otros:', '2010-12-09 00:17:57');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('554', 'IT', 'Le seguenti impostazioni sono state salvate per il tuo logo:', '2010-10-27 18:49:19');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('555', 'IT', 'Visualizza i log', '2010-08-31 20:06:23');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('556', 'IT', 'Statistiche', '2010-09-10 23:15:35');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('558', 'IT', 'Non usare l\'editor HTML di default.', '2010-08-31 20:06:23');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('558', 'IT', 'Usare l\'editor HTML di default.', '2010-08-31 20:06:23');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('559', 'IT', 'Non disconnettermi dopo 15 minuti di inattività.', '2010-09-01 23:49:02');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('560', 'IT', 'Ho con me una radio PMR sul canale 2.', '2010-08-31 20:06:23');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('561', 'IT', 'Altro:', '2010-09-01 23:49:02');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('554', 'NL', 'De volgende instellingen voor uw statistiekenweergave zijn opgeslagen:', '2011-02-04 19:50:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('555', 'NL', 'Laat logs zien', '2011-02-04 19:50:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('556', 'NL', 'Statistieklogo', '2011-02-04 19:50:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('558', 'NL', 'Als standaard geen HTML gebruiken.', '2011-02-04 19:50:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('559', 'NL', 'Het automatisch uitloggen na 15 minuten na het verlaten van de website is uitgeschakeld.', '2011-02-04 19:50:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('560', 'NL', 'Ik neem een PMR zender mee op kanaal 2 met het cachen.', '2011-02-04 19:50:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('561', 'NL', 'Anders:', '2011-02-04 19:50:07');
@@ -9,8 +9,8 @@ CREATE TABLE `cache_desc` (
`cache_id` int(10) unsigned NOT NULL,
`language` char(2) NOT NULL,
`desc` mediumtext NOT NULL,
`desc_html` tinyint(1) NOT NULL default '0',
`desc_htmledit` tinyint(1) NOT NULL default '0',
`desc_html` tinyint(1) NOT NULL default '1' COMMENT 'obsolete',
`desc_htmledit` tinyint(1) NOT NULL default '1',
`hint` mediumtext NOT NULL,
`short_desc` varchar(120) NOT NULL,
PRIMARY KEY (`id`),
@@ -13,8 +13,8 @@ CREATE TABLE `cache_logs` (
`oc_team_comment` tinyint(1) NOT NULL default '0',
`date` datetime NOT NULL,
`text` mediumtext NOT NULL,
`text_html` tinyint(1) NOT NULL default '0',
`text_htmledit` tinyint(1) NOT NULL default '0',
`text_html` tinyint(1) NOT NULL default '1' COMMENT 'obsolete',
`text_htmledit` tinyint(1) NOT NULL default '1',
`owner_notified` tinyint(1) NOT NULL default '0',
`picture` smallint(5) unsigned NOT NULL COMMENT 'via Trigger (picture)',
PRIMARY KEY (`id`),
@@ -36,7 +36,7 @@ CREATE TABLE `user` (
`activation_code` varchar(13) NOT NULL,
`statpic_logo` tinyint(3) unsigned NOT NULL default '0',
`statpic_text` varchar(30) NOT NULL default 'Opencaching',
`no_htmledit_flag` tinyint(1) NOT NULL default '0',
`no_htmledit_flag` tinyint(1) NOT NULL default '0' COMMENT 'inverted meaning',
`notify_radius` int(10) unsigned NOT NULL default '0',
`notify_oconly` tinyint(1) NOT NULL default '1',
`admin` smallint(5) unsigned NOT NULL default '0',
@@ -67,7 +67,7 @@
else
{
$desc_rs = sql("SELECT `cache_desc`.`cache_id` `cache_id`, `cache_desc`.`node` `node`, `cache_desc`.`language` `language`, `caches`.`name` `name`, `caches`.`user_id` `user_id`, `caches`.`wp_oc`, `cache_desc`.`desc` `desc`, `cache_desc`.`hint` `hint`, `cache_desc`.`short_desc` `short_desc`, `cache_desc`.`desc_html` `desc_html`, `cache_desc`.`desc_htmledit` `desc_htmledit` FROM `caches`, `cache_desc` WHERE (`caches`.`cache_id` = `cache_desc`.`cache_id`) AND `cache_desc`.`id`='&1'", $descid);
$desc_rs = sql("SELECT `cache_desc`.`cache_id` `cache_id`, `cache_desc`.`node` `node`, `cache_desc`.`language` `language`, `caches`.`name` `name`, `caches`.`user_id` `user_id`, `caches`.`wp_oc`, `cache_desc`.`desc` `desc`, `cache_desc`.`hint` `hint`, `cache_desc`.`short_desc` `short_desc`, `cache_desc`.`desc_htmledit` `desc_htmledit` FROM `caches`, `cache_desc` WHERE (`caches`.`cache_id` = `cache_desc`.`cache_id`) AND `cache_desc`.`id`='&1'", $descid);
$desc_record = sql_fetch_array($desc_rs);
sql_free_result($desc_rs);
@@ -104,17 +104,20 @@
switch ($descMode)
{
case 2:
case 1:
// plain text mode -- no longer supported, see issue #236;
// descMode 1 is only retained for Ocprop compatibility
$desc_html = 0;
$desc_htmledit = 0;
case 2:
// edit HTML as plain text
$desc_html = 1;
break;
case 3:
$desc_htmledit = 1;
$desc_html = 1;
$desc_htmledit = 0;
break;
default:
$desc_htmledit = 0;
$desc_html = 0;
// edit HTML in TinyMCE
$desc_html = 1;
$desc_htmledit = 1;
break;
}
$short_desc = $_POST['short_desc']; // Ocprop
@@ -174,7 +177,7 @@
`hint`='&5',
`language`='&6'
WHERE `id`='&7'",
(($desc_html == 1) ? '1' : '0'),
'1',
(($desc_htmledit == 1) ? '1' : '0'),
(($desc_html == 1) ? $desc : nl2br($desc)),
$short_desc,
@@ -212,22 +215,14 @@
$short_desc = strip_tags($desc_record['short_desc']);
$hint = strip_tags($desc_record['hint']);
$desc_htmledit = $desc_record['desc_htmledit'];
$desc_html = $desc_record['desc_html'];
$desc_lang = $desc_record['language'];
if ($desc_html == 1)
$desc = $desc_record['desc'];
else{
$desc = strip_tags($desc_record['desc']);
}
$desc = $desc_record['desc'];
}
//here we only set up the template variables
if ($desc_html == 1)
tpl_set_var('desc', htmlspecialchars($desc, ENT_COMPAT, 'UTF-8'), true);
else
tpl_set_var('desc', $desc, true);
tpl_set_var('desc', htmlspecialchars($desc, ENT_COMPAT, 'UTF-8'), true);
// ok ... die desclang zusammenbauen
if ($show_all_langs == false)
@@ -277,22 +272,18 @@
tpl_set_var('submit', $submit);
// Text / normal HTML / HTML editor
tpl_set_var('use_tinymce', (($desc_htmledit == 1) ? 1 : 0));
if (($desc_html == 1) && ($desc_htmledit == 1))
$headers = tpl_get_var('htmlheaders') . "\n";
if ($desc_htmledit == 1)
{
// TinyMCE
$headers = tpl_get_var('htmlheaders') . "\n";
$headers .= '<script language="javascript" type="text/javascript" src="resource2/tinymce/tiny_mce_gzip.js"></script>' . "\n";
$headers .= '<script language="javascript" type="text/javascript" src="resource2/tinymce/config/desc.js.php?cacheid=' . ($desc_record['cache_id']+0) . '&lang=' . strtolower($locale) . '"></script>' . "\n";
tpl_set_var('htmlheaders', $headers);
tpl_set_var('descMode', 3);
}
else if ($desc_html == 1)
tpl_set_var('descMode', 2);
else
tpl_set_var('descMode', 1);
tpl_set_var('descMode', 2);
$headers .= '<script language="javascript" type="text/javascript" src="templates2/ocstyle/js/editor.js"></script>' . "\n";
tpl_set_var('htmlheaders', $headers);
}
else
{
@@ -62,7 +62,6 @@
`cache_logs`.`user_id` AS `user_id`,
`cache_logs`.`type` AS `logtype`,
`cache_logs`.`oc_team_comment` AS `oc_team_comment`,
`cache_logs`.`text_html` AS `text_html`,
`cache_logs`.`text_htmledit` AS `text_htmledit`,
`caches`.`name` AS `cachename`,
`caches`.`type` AS `cachetype`,
@@ -151,13 +150,10 @@
}
else
{
if ($log_record['text_html'] == 1)
if ($log_record['text_htmledit'] == 1)
$descMode = 3;
else
$descMode = 2;
if ($log_record['text_htmledit'] == 1)
$descMode = 3;
else
$descMode = 1;
$descMode = 2;
}
// fuer alte Versionen von OCProp
@@ -262,7 +258,7 @@
$oc_team_comment,
$log_date,
(($descMode != 1) ? $log_text : nl2br($log_text)),
(($descMode != 1) ? 1 : 0),
'1',
(($descMode == 3) ? 1 : 0),
$log_id);
@@ -343,23 +339,17 @@
else
tpl_set_var('logtext', $log_text);
// Text / normal HTML / HTML editor
tpl_set_var('use_tinymce', (($descMode == 3) ? 1 : 0));
if ($descMode == 1)
tpl_set_var('descMode', 1);
else if ($descMode == 2)
tpl_set_var('descMode', 2);
else
// normal HTML / HTML editor
tpl_set_var('descMode', $descMode);
$headers = tpl_get_var('htmlheaders') . "\n";
if ($descMode == 3)
{
// TinyMCE
$headers = tpl_get_var('htmlheaders') . "\n";
$headers .= '<script language="javascript" type="text/javascript" src="resource2/tinymce/tiny_mce_gzip.js"></script>' . "\n";
$headers .= '<script language="javascript" type="text/javascript" src="resource2/tinymce/config/log.js.php?logid=0&lang='.strtolower($locale).'"></script>' . "\n";
tpl_set_var('htmlheaders', $headers);
tpl_set_var('descMode', 3);
}
$headers .= '<script language="javascript" type="text/javascript" src="templates2/ocstyle/js/editor.js"></script>' . "\n";
tpl_set_var('htmlheaders', $headers);
if ($use_log_pw == true && $log_pw != '')
if (!$pw_ok && isset($_POST['submitform']))
@@ -379,7 +369,7 @@
{
$tmp_smiley = $smiley_link;
$tmp_smiley = mb_ereg_replace('{smiley_image}', $smileyimage[$i], $tmp_smiley);
$smilies = $smilies.mb_ereg_replace('{smiley_text}', ' '.$smileytext[$i].' ', $tmp_smiley).'&nbsp;';
$smilies = $smilies.mb_ereg_replace('{smiley_text}', $smileyname[$i], $tmp_smiley).'&nbsp;';
}
}
}
@@ -34,7 +34,7 @@
$diff_not_ok_message = '&nbsp;<span class="errormsg">' . t('Choose both valuations!') . '</span>';
$safari_not_allowed_message = '<span class="errormsg">' . t('Only virtual caches can be safari caches.') . '</span>';
$bad_wpgc_message = '<span class="errormsg">' . t('GC waypoint is invalid, must be GCxxxxx') . '</span>';
$nopictures = '<tr><td colspan="2">' . t('No pictures available') . '</td></tr>';
$nopictures = '<tr><td colspan="2">' . t('No pictures available') . '</td></tr><tr><td colspan="2">&nbsp;</td></tr>';
$pictureline = '<tr><td colspan="2"><a href="{link}">{title}</a> [<a href="picture.php?action=edit&uuid={uuid}">' . t('Edit') . '</a>] [<a href="picture.php?action=delete&uuid={uuid}">' . t('Delete') . '</a>]</td></tr>';
// Ocprop: <a href=\"http://.*?\.opencaching\.de/images/uploads/.*?\">(.*?)<\/a>.*?\[<a href=\"picture\.php\?action=[a-z]*?\&uuid=(.*?)\">
$picturelines = '{lines}<tr><td colspan="2">&nbsp;</td></tr>';
Oops, something went wrong.

0 comments on commit b7dddd7

Please sign in to comment.
You can’t perform that action at this time.