Use setting API to determine if the setting exists in the db.

This commit is contained in:
Colin Kuskie 2009-08-23 19:09:37 +00:00
parent 4f23d88b19
commit 223a5125bf
2 changed files with 5 additions and 5 deletions

View file

@ -47,7 +47,7 @@ finish($session); # this line required
sub addInboxSmsNotificationTemplateIdSetting {
my $session = shift;
print "\tAdding inboxSmsNotificationTemplateId setting... " unless $quiet;
if (!$session->db->quickScalar('select count(*) from settings where name = "inboxSmsNotificationTemplateId"')) {
if (!$session->setting->has("inboxSmsNotificationTemplateId")) {
$session->setting->add('inboxSmsNotificationTemplateId', 'i9-G00ALhJOr0gMh-vHbKA');
}
print "DONE!\n" unless $quiet;

View file

@ -579,10 +579,6 @@ sub getRichEditor {
$out = q|<a style="display: block;" href="javascript:toggleEditor('|.$nameId.q|')">|.$i18n->get('Toggle editor').q|</a>|;
}
$out .= q|<script type="text/javascript">|;
while (my ($plugin, $path) = each %loadPlugins) {
$out .= "tinymce.PluginManager.load('$plugin', '$path');\n";
}
$out .= "\ttinyMCE.init(" . JSON->new->pretty->encode(\%config) . " );\n";
if ($ask) {
$out .= <<"EOHTML1";
function toggleEditor(id) {
@ -596,6 +592,10 @@ function turnOffTinyMCE_$nameId () {
}
EOHTML1
}
while (my ($plugin, $path) = each %loadPlugins) {
$out .= "tinymce.PluginManager.load('$plugin', '$path');\n";
}
$out .= "\ttinyMCE.init(" . JSON->new->pretty->encode(\%config) . " );\n";
$out .= "</script>";
}