tinyMCE.init({
mode : "textareas",
editor_selector : "htmlEditor",
elements : "content",
theme : "advanced",
convert_urls : false,
gecko_spellcheck: true,
plugins: "autolink",
theme_advanced_buttons1 : "cut,copy,paste,|,undo,redo,|,formatselect,fontselect,fontsizeselect,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull",
theme_advanced_buttons2 : "sub,sup,|,charmap,|,bullist,numlist,|,outdent,indent,insertdate,inserttime,preview,|,forecolor,backcolor,|,hr,removeformat,visualaid,|,link,unlink,anchor,image,cleanup,code",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true
});
';
}
/* Print main manage users page */
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?>
';
} else {
echo '
';
}
?>
$value) {
$languages[$key] = $hesk_settings['languages'][$key]['folder'];
}
// Get all files, but don't worry about index.htm, items beginning with '.', or the html folder
// We'll also assume the template file exists in all language folders and in the html folder
reset($languages);
$firstKey = key($languages);
$firstDirectory = HESK_PATH . 'language/' . $languages[$firstKey] . '/emails';
$directoryListing = preg_grep('/^([^.])/', scandir($firstDirectory));
$emailTemplates = array_diff($directoryListing, array('html', 'index.htm'));
?>
$languageCode): ?>
$languageCode): ?>
';
$markup .= ' ';
$markup .= '';
return $markup;
} else {
$markup = '';
$markup .= ' ';
$markup .= ' ';
return $markup;
}
}
function save()
{
global $hesklang;
$filePath = HESK_PATH . 'language/' . $_POST['language'] . '/emails/' . $_POST['template'];
if ($_POST['html'] == '1') {
$filePath = HESK_PATH . 'language/' . $_POST['language'] . '/emails/html/' . $_POST['template'];
}
$success = file_put_contents($filePath, $_POST['text']);
if ($success === false) {
hesk_process_messages($hesklang['email_template_not_saved'], 'manage_email_templates.php');
} else {
$message = sprintf($hesklang['email_template_saved'], $_POST['template']);
hesk_process_messages($message, 'manage_email_templates.php', 'SUCCESS');
}
}
function getSpecialTagMap()
{
global $hesk_settings, $modsForHesk_settings, $hesklang;
$map = array();
$map['%%NAME%%'] = $hesklang['customer_name'];
$map['%%EMAIL%%'] = $hesklang['customer_email'];
$map['%%SUBJECT%%'] = $hesklang['ticket_subject'];
$map['%%MESSAGE%%'] = $hesklang['ticket_message'];
$map['%%MESSAGE_NO_ATTACHMENTS%%'] = $hesklang['ticket_message_no_attachments'];
$map['%%CREATED%%'] = $hesklang['ticket_created'];
$map['%%UPDATED%%'] = $hesklang['ticket_updated'];
$map['%%TRACK_ID%%'] = $hesklang['ticket_trackID'];
$map['%%TRACK_URL%%'] = $hesklang['ticket_url'];
$map['%%SITE_TITLE%%'] = $hesklang['wbst_title'];
$map['%%SITE_URL%%'] = $hesklang['wbst_url'];
$map['%%CATEGORY%%'] = $hesklang['ticket_category'];
$map['%%OWNER%%'] = $hesklang['ticket_owner'];
$map['%%PRIORITY%%'] = $hesklang['ticket_priority'];
$map['%%STATUS%%'] = $hesklang['ticket_status'];
$i = 1;
foreach ($hesk_settings['custom_fields'] as $key => $value) {
if ($value['use']) {
$uppercaseKey = strtoupper($key);
$map['%%' . $uppercaseKey . '%%'] = sprintf($hesklang['custom_field_x'], $i++);
}
}
return $map;
}