14 <script
type=
"text/javascript" src=
"../system/engines/jquery/jscolor/jscolor.js"></script>
16 <script
type=
"text/javascript" src=
"../system/engines/jquery/bootstrap-tabcollapse.js"></script>
17 <!-- Javascript
for positions tab -->
18 <script
type=
"text/javascript">
20 $(document).
ready(
function () {
26 function saveHotkey() {
29 if (!(
event.which === 115 && (navigator.platform.match(
"Mac") ?
event.metaKey :
event.ctrlKey)) && !(
event.which === 19))
return true;
30 event.preventDefault();
35 $(document).keydown(
function (
event) {
36 if (
event.which === 83 && (navigator.platform.match(
"Mac") ?
event.metaKey :
event.ctrlKey)) {
37 event.preventDefault();
38 $(
'#savebutton').click();
48 $(
'form *').change(
function(){
50 $(
'#savebutton').click(
function(){
53 $(
'#addbutton').click(
function(){
59 window.onbeforeunload = confirmExit;
60 function confirmExit() {
61 if (formmodified === 1) {
62 return "<?php echo $lang['LEAVE_REQUEST']; ?>";
67 $(
'a[data-toggle="tab"]').
on(
'shown.bs.tab',
function (
e) {
69 localStorage.setItem(
'lastTab', $(
this).attr(
'href'));
72 const lastTab = localStorage.getItem(
'lastTab');
74 $(
'[href="' + lastTab +
'"]').tab(
'show');
76 const activeTab = lastTab.toLowerCase();
78 const activeFolder = activeTab.slice(1);
80 $(
'select option[value="'+activeFolder+
'"]').prop(
'selected',
true);
85 $(
'#tabs').tabCollapse({
86 tabsClass:
'hidden-sm hidden-xs',
87 accordionClass:
'visible-sm visible-xs'
90 $(
'[data-toggle="tooltip"]').tooltip();
97 if (!isset($template)) { $template =
new template(); }
99 if (!isset($user)) { $user =
new user(
$db); }
102 if (!isset($_SESSION) || (empty($_SESSION)))
105 $_SESSION[
'template'] = $template;
121 <!-- Content Wrapper. Contains page content -->
122 <div class=\"content-wrapper\" id=\"content-FX\">
123 <!-- Content Header (Page header) -->
124 <section class=\"content-header\">";
126 echo backend::getTitle(
$lang[
'TPL'],
$lang[
'DESIGN']);
127 echo backend::getTemplateBreadcrumbs(
$lang);
128 echo
"</section><!-- Main content -->
129 <section class=\"content\">";
132 <form
id=
"template-edit-form" action=
"index.php?page=template-save&action=template-typography&id=<?php echo $template->id; ?>" method=
"POST">
133 <!--
title header -->
136 <div
class=
"box-body">
137 <div
class=
"col-md-10">
138 <?php echo
"<h4><i class=\"fa fa-text-height\"></i> $lang[TYPOGRAPHY] <small>$lang[TYPO_DETAILS]</small></h4>"; ?>
140 <div
class=
"col-md-2">
141 <button
class=
"btn btn-success pull-right" id=
"savebutton" name=
"save" style=
"margin-top:2px;"><
i class=
"fa fa-check"></
i>&
nbsp;&
nbsp;<?php echo
$lang[
'TYPO_SAVE']; ?></button>
147 <div
class=
"box-body">
149 <h3><?php echo
"$lang[FONTS_TYPES] <small>$lang[TPL_FONTS_SUBTEXT]"; ?></small></h3>
151 <div
class=
"col-md-6">
153 <label
for=
"testText"><?php echo
$lang[
'TPL_FORM_TESTFIELD']; ?></label>
154 <div
class=
"input-group">
155 <!-- <div
class=
"input-group-addon" id=
"switchPreview" style=
"cursor: pointer;"><
i class=
"fa fa-link" title=
"switch preview"></
i></div> -->
156 <input
id=
"testText" name=
"testText" placeholder=
"<?php echo $lang['TPL_FORM_TESTFIELD_PLACEHOLDER']; ?>" maxlength=
"84" class=
"form-control">
157 <span
class=
"input-group-btn">
158 <button
type=
"button" disabled
id=
"resetTestText" class=
"btn btn-default" title=
"<?php echo $lang['RESET']; ?>"><
i class=
"fa fa-refresh"></
i></button>
161 <!-- common text
settings (size, shadow, color...) -->
165 <div
class=
"col-md-6">
170 <div
class=
"row animated fadeIn">
189 $(document).
ready(
function () {
194 previewFont($(
"#h1-fontfamily"),
'H1 Heading',
'h1-preview', $(
"#h1-preview"), $(
"#h1-size"), $(
"#h1-fontcolor"), $(
"#h1-fontshadowsize"), $(
"#h1-fontshadowcolor"), $(
"#h1-fontweight"), $(
"#h1-fontstyle"), $(
"#h1-textdecoration"));
195 previewFont($(
"#h2-fontfamily"),
'H2 Heading',
'h2-preview', $(
"#h2-preview"), $(
"#h2-size"), $(
"#h2-fontcolor"), $(
"#h2-fontshadowsize"), $(
"#h2-fontshadowcolor"), $(
"#h2-fontweight"), $(
"#h2-fontstyle"), $(
"#h2-textdecoration"));
196 previewFont($(
"#h3-fontfamily"),
'H3 Heading',
'h3-preview', $(
"#h3-preview"), $(
"#h3-size"), $(
"#h3-fontcolor"), $(
"#h3-fontshadowsize"), $(
"#h3-fontshadowcolor"), $(
"#h3-fontweight"), $(
"#h3-fontstyle"), $(
"#h3-textdecoration"));
197 previewFont($(
"#h4-fontfamily"),
'H4 Heading',
'h4-preview', $(
"#h4-preview"), $(
"#h4-size"), $(
"#h4-fontcolor"), $(
"#h4-fontshadowsize"), $(
"#h4-fontshadowcolor"), $(
"#h4-fontweight"), $(
"#h4-fontstyle"), $(
"#h4-textdecoration"));
198 previewFont($(
"#h5-fontfamily"),
'H5 Heading',
'h5-preview', $(
"#h5-preview"), $(
"#h5-size"), $(
"#h5-fontcolor"), $(
"#h5-fontshadowsize"), $(
"#h5-fontshadowcolor"), $(
"#h5-fontweight"), $(
"#h5-fontstyle"), $(
"#h5-textdecoration"));
199 previewFont($(
"#h6-fontfamily"),
'H6 Heading',
'h6-preview', $(
"#h6-preview"), $(
"#h6-size"), $(
"#h6-fontcolor"), $(
"#h6-fontshadowsize"), $(
"#h6-fontshadowcolor"), $(
"#h6-fontweight"), $(
"#h6-fontstyle"), $(
"#h6-textdecoration"));
200 previewFont($(
"#globaltext-fontfamily"),
'Default Text',
'globaltext-preview', $(
"#globaltext-preview"), $(
"#globaltext-size"), $(
"#globaltext-fontcolor"), $(
"#globaltext-fontshadowsize"), $(
"#globaltext-fontshadowcolor"), $(
"#globaltext-fontweight"), $(
"#globaltext-fontstyle"), $(
"#globaltext-textdecoration"));
212 function previewFont(font, heading, previewString, previewField, fontsize, fontcolor, fontshadowsize, fontshadowcolor, fontweight, fontstyle, textdecoration)
215 $(
"#resetTestText").click(
function()
217 $(previewField).html(heading);
219 $(
"#testText").val(
'');
221 $(
'#resetTestText').prop(
'disabled',
true);
225 $(
'#testText').keyup(
function(){
227 $(
'#resetTestText').prop(
'disabled',
false);
229 $(previewField).html($(
this).val());
234 const selectedFont = $(font).val();
235 const pathAndFont =
'../system/fonts/' + selectedFont;
239 if ($(font).val().toLowerCase().indexOf(
"-ttf") >= 0)
242 let fn = pathAndFont.slice(0,-4);
247 $(
"head").append(
"<style>" +
249 "\tfont-family: '"+selectedFont+
"';\n" +
250 "\tsrc: url("+fn+
");\n" +
252 "\t."+previewString+
" {\n" +
253 "\tfont-family: '"+selectedFont+
"' !important;\n" +
257 $(previewField).css(
"font-family", selectedFont);
260 else if ($(font).val().toLowerCase().indexOf(
"-otf") >= 0)
263 let fn = pathAndFont.slice(0,-4);
268 $(
"head").append(
"<style>" +
270 "\tfont-family: '"+selectedFont+
"';\n" +
271 "\tsrc: url("+fn+
");\n" +
273 "\t."+previewString+
" {\n" +
274 "\tfont-family: '"+selectedFont+
"' !important;\n" +
278 $(previewField).css(
"font-family", selectedFont);
281 else if ($(font).val().toLowerCase().indexOf(
"-woff") >= 0)
284 let fn = pathAndFont.slice(0,-5);
289 $(
"head").append(
"<style>" +
291 "\tfont-family: '"+selectedFont+
"';\n" +
292 "\tsrc: url("+fn+
");\n" +
294 "\t."+previewString+
" {\n" +
295 "\tfont-family: '"+selectedFont+
"' !important;\n" +
299 $(previewField).css(
"font-family", selectedFont);
302 else if ($(font).val().toLowerCase().indexOf(
"-gfont") >= 0)
305 fn = selectedFont.slice(0,-6);
307 var HtmlDocumentHead = $(
"head");
309 HtmlDocumentHead.append(
"<link href=\"https://fonts.googleapis.com/css?family="+fn+
"\" rel=\"stylesheet\">");
311 HtmlDocumentHead.append(
"<style>" +
312 "\t."+previewString+
" {\n" +
313 "\tfont-family: '"+fn+
"';\n" +
317 $(previewField).css(
"font-family", fn);
321 $(previewField).css(
"font-family", $(font).val());
323 $(previewField).css(
"font-size", $(fontsize).val());
324 $(previewField).css(
"color",
'#'+$(fontcolor).val());
325 $(previewField).css(
"text-shadow", $(fontshadowsize).val()+
' #'+$(fontshadowcolor).val());
326 $(previewField).css(
"font-weight", $(fontweight).val());
327 $(previewField).css(
"font-style", $(fontstyle).val());
328 $(previewField).css(
"text-decoration", $(textdecoration).val());
332 $(font).change(
function()
334 var selectedFont = $(font).val();
335 var pathAndFont =
'../system/fonts/'+selectedFont;
340 if ($(font).val().toLowerCase().indexOf(
"-ttf") >= 0)
343 fn = pathAndFont.slice(0,-4);
348 $(
"head").append(
"<style>" +
350 "\tfont-family: '"+selectedFont+
"';\n" +
351 "\tsrc: url("+fn+
");\n" +
353 "\t."+previewString+
" {\n" +
354 "\tfont-family: '"+selectedFont+
"' !important;\n" +
358 $(previewField).css(
"font-family", selectedFont);
361 else if ($(font).val().toLowerCase().indexOf(
"-otf") >= 0)
364 fn = pathAndFont.slice(0,-4);
369 $(
"head").append(
"<style>" +
371 "\tfont-family: '"+selectedFont+
"';\n" +
372 "\tsrc: url("+fn+
");\n" +
374 "\t."+previewString+
" {\n" +
375 "\tfont-family: '"+selectedFont+
"' !important;\n" +
379 $(previewField).css(
"font-family", selectedFont);
382 else if ($(font).val().toLowerCase().indexOf(
"-woff") >= 0)
385 fn = pathAndFont.slice(0,-5);
390 $(
"head").append(
"<style>" +
392 "\tfont-family: '"+selectedFont+
"';\n" +
393 "\tsrc: url("+fn+
");\n" +
395 "\t."+previewString+
" {\n" +
396 "\tfont-family: '"+selectedFont+
"' !important;\n" +
400 $(previewField).css(
"font-family", selectedFont);
403 else if ($(font).val().toLowerCase().indexOf(
"-gfont") >= 0)
406 fn = selectedFont.slice(0,-6);
407 googlePath =
"https://fonts.googleapis.com/css?family="+fn;
409 var HtmlDocumentHead = $(
"head");
411 HtmlDocumentHead.append(
"<link href=\"https://fonts.googleapis.com/css?family="+fn+
"\" rel=\"stylesheet\">");
413 HtmlDocumentHead.append(
"<style>" +
414 "\t."+previewString+
" {\n" +
415 "\tfont-family: '"+fn+
"';\n" +
419 $(previewField).css(
"font-family", fn);
423 $(previewField).css(
"font-family", $(font).val());
429 $(fontsize).keyup(
function() {
430 $(previewField).css(
"font-size", $(fontsize).val());
433 $(fontcolor).change(
function() {
434 $(previewField).css(
"color",
'#'+$(fontcolor).val());
437 $(fontshadowsize).keyup(
function() {
438 $(previewField).css(
"text-shadow", $(fontshadowsize).val()+
' #'+$(fontshadowcolor).val());
441 $(fontshadowcolor).change(
function() {
442 $(previewField).css(
"text-shadow", $(fontshadowsize).val()+
' #'+$(fontshadowcolor).val());
445 $(fontweight).change(
function() {
446 $(previewField).css(
"font-weight", $(fontweight).val());
449 $(fontstyle).change(
function() {
450 $(previewField).css(
"font-style", $(fontstyle).val());
453 $(textdecoration).change(
function() {
454 $(previewField).css(
"text-decoration", $(textdecoration).val());
print $lang['FILEMAN_UPLOAD']
Backend class serves a few useful functions for the admin backend.
Mysqli database class; returns db connection object.
The language class - support multilingual backend.
Settings class: get and set YaWK system settings.
The template controller - get and set template settings.
The default user class. Provide all functions to handle the user object.
<!-- backend language -->< h3 >< i class="fa fa-language"></i > & nbsp
if(!isset($template)) if(!isset($user)) if(!isset($_SESSION)||(empty($_SESSION))) $selectedTemplateID
document ready(function() { $('a[data-confirm]').click(function(ev) { modal='#dataConfirmModal';var href=$(this).attr('href');var title=$(this).attr('title');var icon=$(this).attr('data-icon');if(!icon) { icon='fa fa-trash-o';} if(!$(modal).length) { $('body').append('< div id="dataConfirmModal" class="modal fade" role="dialog" aria-labelledby="dataConfirmLabel" aria-hidden="true">< div class="modal-dialog">< div class="modal-content">< div class="modal-header">< button type="button" class="close" data-dismiss="modal" aria-hidden="true">< i class="fa fa-times"></i ></button >< br >< div class="col-md-1">< h3 class="modal-title">< i class="'+icon+'"></i ></h3 ></div >< div class="col-md-11">< h3 class="modal-title" id="dataConfirmLabel">'+title+'</h3 ></div ></h3 ></div >< div class="modal-body"></div >< div class="modal-footer">< button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true">Abbrechen</button >< a type="button" class="btn btn-danger" id="dataConfirmOK">< i class="'+icon+'"></i > L öschen</a ></div ></div ></div ></div >');} $(modal).find('.modal-body').text($(this).attr('data-confirm'));$('#dataConfirmOK').attr('href', href);$(modal).modal({show:true});return false;});$('#terminateUser').click(function() { var terminate=window.confirm("ACHTUNG!\nDas wird Deinen Account permanent deaktivieren.\n"+"Bist Du Dir sicher, dass Du das tun willst?");if(terminate===true) { var terminateUser=window.confirm("Bist Du Dir wirklich ganz sicher?\n"+"Diese Aktion kann nicht rueckgaengig gemacht werden.");if(terminateUser===true) { $.get('system/templates/YaWK-bootstrap3/js/terminate-user.php', function(data) { if(data==="true") { setTimeout("window.location='logout.html'", 0);} else { alert("Fehler: "+data);} });} } });function dismissNotifications() { $.ajax({ url:'js/dismiss-notifications.php', type:'POST', success:function(data) { if(!data) { alert('Something went wrong!');return false;} } });$("#bell-label").fadeOut();$('#notification-header').html('You have 0 notifications');$('#notification-menu').fadeOut();} $("#dismiss").click(function() { dismissNotifications();});function disableButtons(delay) { $('#loginButton').removeClass().addClass('btn btn-success disabled').attr('id', 'LOGIN_FORBIDDEN');$('#resetPasswordButton').removeClass().addClass('btn btn-danger disabled');setTimeout(function() { $('#LOGIN_FORBIDDEN').attr('id', 'loginButton').removeClass().addClass('btn btn-success');$('#resetPasswordButton').removeClass().addClass('btn btn-danger');}, delay);} $("#loginButton").click(function(){ if($('#loginButton').length > 0) { if($('#loginButton').hasClass('btn') &&$('#loginButton').hasClass('btn-success') &&$('#loginButton').hasClass('disabled')) { } else { $("#loginForm").submit();disableButtons(10000);} } else if($('#LOGIN_FORBIDDEN').length > 0) { if($('#LOGIN_FORBIDDEN').hasClass('btn') &&$('#LOGIN_FORBIDDEN').hasClass('btn-success') &&$('#LOGIN_FORBIDDEN').hasClass('disabled')) { } else { } } });$("#blockedBtn").hover(function() { $("#blockedBtn").hide();$("#askBtn").fadeIn(820);});})