2 function setCopyTplSettings(newTplName)
5 inputField = $(
"#newTplName");
7 $(
'#myModal').
on(
'shown.bs.modal',
function () {
9 $(inputField).focus().select();
12 inputField.val(newTplName+
'-copy');
17 $(document).
ready(
function() {
20 uploadModal = $(
"#uploadModal");
21 savebutton = $(
"#savebutton");
22 savebuttonIcon = $(
"#savebuttonIcon");
23 savebuttonText = $(
"#savebuttonText");
24 cancelButton = $(
"#cancelButton");
25 dismissButton = $(
"#dismissButton");
26 loadingText = $(savebutton).attr(
"data-loadingText");
29 $(uploadModal).
on(
'shown.bs.modal',
function () {
32 $(savebutton).click(
function() {
35 $(uploadModal).attr(
'data-backdrop',
'static');
37 $(uploadModal).attr(
'data-keyboard',
'false');
40 $(savebutton).removeClass(
'btn btn-success').addClass(
'btn btn-warning');
42 $(savebuttonIcon).removeClass(
'fa fa-check').addClass(
'fa fa-spinner fa-spin fa-fw');
44 $(dismissButton).fadeOut();
46 $(savebuttonText).html(loadingText);
49 $(cancelButton).prop(
"disabled",
true);
50 $(savebutton).attr(
"disabled",
true);
52 $(
'form#uploadForm').submit();
57 $(
'#table-sort').dataTable( {
59 "bLengthChange":
false,
72 if (isset(
$_GET[
'action']) && (
$_GET[
'action']) ===
"download")
74 if (isset(
$_GET[
'folder']) && (!empty(
$_GET[
'folder'])))
77 $templateFolder = strip_tags(
$_GET[
'folder']);
81 $template = new \YAWK\template();
83 if ($template->downloadTemplate(
$db, $templateFolder,
$templateID, $user) ===
true)
94 die (
'no folder sent');
98 if (isset(
$_GET[
'action']) && (
$_GET[
'action']) ===
"upload")
100 if (isset($_POST) && (!empty($_POST)))
103 $template = new \YAWK\template();
105 if ($template->uploadTemplate(
$db, $_POST, $_FILES,
$lang) ===
true)
124 if (!isset($template)) { $template = new \YAWK\template(); }
126 if (!isset($user)) { $user = new \YAWK\user(
$db); }
131 if (isset(
$_GET[
'toggle']) && (
$_GET[
'toggle'] ===
"1"))
133 if (isset(
$_GET[
'templateID']) && (is_numeric(
$_GET[
'templateID'])))
136 if (\
YAWK\settings::setSetting(
$db,
"selectedTemplate",
$_GET[
'templateID'],
$lang))
138 \YAWK\template::setTemplateActive(
$db,
$_GET[
'templateID']);
139 $user->setUserTemplate(
$db, 0,
$_GET[
'templateID'], $user->id);
140 $user->overrideTemplate = 0;
143 $template->loadProperties(
$db,
$_GET[
'templateID']);
147 \YAWK\alert::draw(
"warning",
"$lang[TPL_SWITCH_FAILED]",
"$lang[TPL_SWITCH_FAILED_SUBTEXT]",
"page=template-manage", 3000);
154 if (isset(
$_GET[
'delete']) && (
$_GET[
'delete'] ===
"1"))
156 if (isset(
$_GET[
'templateID']) && (is_numeric(
$_GET[
'templateID'])))
159 if (\
YAWK\template::deleteTemplate(
$db,
$_GET[
'templateID']))
161 \YAWK\alert::draw(
"success",
"<i class=\"fa fa-trash-o\"></i> $lang[TPL] $lang[DELETED]",
"$lang[SUCCESS]",
"", 3000);
165 \YAWK\alert::draw(
"danger",
"$lang[TPL_FAILED_TO_DELETE] $_GET[templateID]",
"$lang[PLEASE_TRY_AGAIN]",
"", 3000);
171 if (isset($_POST[
'savenewtheme']) && (!empty($_POST[
'savenewtheme']))
172 || (isset(
$_GET[
'savenewtheme']) && (!empty(
$_GET[
'savenewtheme']))))
174 if (isset($_POST[
'id']) && (!empty($_POST[
'id'])))
176 $template->id =
$db->quote($_POST[
'id']);
179 if (isset($_POST[
'name']) && (!empty($_POST[
'name'])))
181 $template->name =
$db->quote($_POST[
'name']);
184 if (isset($_POST[
'newTplName']) && (!empty($_POST[
'newTplName'])))
186 $template->newTplName =
$db->quote($_POST[
'newTplName']);
188 else if (isset(
$_GET[
'newthemename']) && (!empty(
$_GET[
'newthemename'])))
190 $template->newTplName =
$db->quote(
$_GET[
'newthemename']);
193 if (isset($_POST[
'newTplDescription']) && (!empty($_POST[
'newTplDescription'])))
195 $template->description =
$db->quote($_POST[
'newTplDescription']);
197 else if (isset(
$_GET[
'description']) && (!empty(
$_GET[
'description'])))
199 $template->description =
$db->quote(
$_GET[
'description']);
203 $template->description =
"Template Description";
206 if (isset($_POST[
'newTplAuthor']) && (!empty($_POST[
'newTplAuthor'])))
208 $template->author =
$db->quote($_POST[
'newTplAuthor']);
210 else { $template->author =
''; }
212 if (isset($_POST[
'newTplAuthorUrl']) && (!empty($_POST[
'newTplAuthorUrl'])))
214 $template->authorUrl =
$db->quote($_POST[
'newTplAuthorUrl']);
216 else { $template->authorUrl =
''; }
218 if (isset($_POST[
'newTplWeblink']) && (!empty($_POST[
'newTplWeblink'])))
220 $template->weblink =
$db->quote($_POST[
'newTplWeblink']);
222 else { $template->weblink =
''; }
224 if (isset($_POST[
'newTplVersion']) && (!empty($_POST[
'newTplVersion'])))
226 $template->version =
$db->quote($_POST[
'newTplVersion']);
228 else { $template->version =
"1.0"; }
230 if (isset($_POST[
'newTplFramework']) && (!empty($_POST[
'newTplFramework'])))
232 $template->framework =
$db->quote($_POST[
'newTplFramework']);
234 else { $template->version =
"1.0"; }
236 if (isset($_POST[
'newTplLicense']) && (!empty($_POST[
'newTplLicense'])))
238 $template->license =
$db->quote($_POST[
'newTplLicense']);
240 else { $template->license =
''; }
247 $template->saveAs(
$db);
249 \YAWK\template::setTemplateActive(
$db, $template->newId);
251 \YAWK\template::copyTemplateSettings(
$db, $template->id, $template->newId);
253 \YAWK\template::copyAssets(
$db, $template->id, $template->newId);
258 if (isset(
$_GET[
'id']) && (is_numeric(
$_GET[
'id']) || (isset($_POST[
'id']) && (is_numeric($_POST[
'id'])))))
261 if (empty(
$_GET[
'id']) || (!empty($_POST[
'id']))) {
$getID = $_POST[
'id']; }
262 else if (!empty(
$_GET[
'id']) || (empty($_POST[
'id']))) {
$getID =
$_GET[
'id']; }
268 $user->setUserTemplate(
$db, 0,
$getID, $user->id);
269 $user->overrideTemplate = 0;
271 $infoBadge =
"<span class=\"label label-success\"><i class=\"fa fa-check\"></i> $lang[VISIBLE_TO_EVERYONE]</span>";
277 $user->setUserTemplate(
$db, 1,
$getID, $user->id);
278 $user->overrideTemplate = 1;
280 $infoBadge =
"<span class=\"label label-success\"><i class=\"fa fa-eye\"></i> $lang[TPL_PREVIEW_VISIBLE_TO_YOU]</span>";
282 $previewButton =
"<a class=\"btn btn-danger\" href=\"index.php?page=template-manage&overrideTemplate=0&id=$getID\"><i class=\"fa fa-times\"></i> $lang[CLOSE_PREVIEW]</a>";
286 if ($user->isAllowedToOverrideTemplate(
$db, $user->id) ===
true)
288 if (isset(
$_GET[
'overrideTemplate']) && (
$_GET[
'overrideTemplate'] ===
"1"))
290 $user->setUserTemplate(
$db, 1,
$getID, $user->id);
291 $user->overrideTemplate = 1;
296 $user->setUserTemplate(
$db, 0,
$getID, $user->id);
297 $user->overrideTemplate = 0;
313 $infoBadge =
"<span class=\"label label-success\"><i class=\"fa fa-check\"></i> $lang[VISIBLE_TO_EVERYONE]</span>";
331 <!-- Content Wrapper. Contains page content -->
332 <div class=\"content-wrapper\" id=\"content-FX\">
333 <!-- Content Header (Page header) -->
334 <section class=\"content-header\">";
336 echo \YAWK\backend::getTitle(
$lang[
'TPL'],
$lang[
'OVERVIEW']);
337 echo \YAWK\backend::getTemplateBreadcrumbs(
$lang);
338 echo
"</section><!-- Main content -->
339 <section class=\"content\">";
342 <!--
title header -->
344 <div
class=
"box-body">
345 <div
class=
"col-md-12">
346 <?php echo
"<h4><i class=\"fa fa-home\"></i> $lang[OVERVIEW] <small>$template->name</small></h4>"; ?>
351 <!-- list TEMPLATE HOME PAGE (DETAILS) -->
352 <div
class=
"row animated fadeIn">
353 <div
class=
"col-md-5">
355 <div
class=
"box-header with-border">
356 <h3
class=
"box-title"><?php echo
"$lang[DETAILS] <small>$lang[OF_CURRENT_ACTIVE_THEME]"; ?></small></h3>
358 <div
class=
"box-body">
359 <dl
class=
"dl-horizontal">
363 if (isset($template->authorUrl) && (!empty($template->authorUrl)))
365 $authorUrl =
"<small> <a href=\"$template->authorUrl\" target=\"_blank\" title=\"$lang[AUTHORS_WEBLINK_DESC]\"
366 <i class=\"fa fa-external-link\"></i></a></small>";
368 else { $authorUrl =
""; }
371 if (isset($template->author) && (!empty($template->author)))
373 $author =
"<dt>$lang[AUTHOR]</dt><dd>$template->author $authorUrl</dd>";
375 else { $author =
""; }
378 if (isset($template->weblink) && (!empty($template->weblink)))
380 $weblink =
"<dt>$lang[WEBLINK]</dt><dd><a href=\"$template->weblink\" target=\"_blank\" title=\"$lang[PROJECT_WEBLINK_DESC]\">$template->weblink</a></dd>";
382 else { $weblink=
""; }
385 if (isset($template->modifyDate) && ($template->modifyDate !== NULL))
387 $modifyDate =
"<dt>$lang[MODIFIED]</dt><dd>$template->modifyDate</dd>";
389 else { $modifyDate =
''; }
392 if (isset($template->releaseDate) && ($template->releaseDate !== NULL))
394 $releaseDate =
"<dt>$lang[RELEASED]</dt><dd>$template->releaseDate</dd>";
396 else { $releaseDate =
''; }
399 if (isset($template->description) && (!empty($template->description)))
401 $description =
"<dt>$lang[DESCRIPTION]</dt><dd>$template->description</dd>";
403 else { $description =
""; }
406 if (isset($template->version) && (!empty($template->version)))
408 $version =
"<dt>$lang[VERSION]</dt><dd>$template->version</dd>";
410 else { $version =
""; }
412 if (isset($template->subAuthorUrl) && (!empty($template->subAuthorUrl)))
414 $subauthorurl =
"<small> <a href=\"$template->subAuthorUrl\" target=\"_blank\" title=\"$lang[MODIFIED_BY_LINKDESC]\"
415 <i class=\"fa fa-external-link\"></i></a></small>";
417 else { $subauthorurl =
""; }
420 if (isset($template->subAuthor) && (!empty($template->subAuthor)))
422 $subauthor =
"<dt>$lang[MODIFIED_BY]</dt><dd>$template->subAuthor $subauthorurl</dd>";
424 else { $subauthor =
""; }
427 if (isset($template->framework) && (!empty($template->framework)))
429 $framework =
"<dt>$lang[FRAMEWORK]</dt><dd>$template->framework</dd>";
431 else { $framework =
""; }
434 if (isset($template->license) && (!empty($template->license)))
436 $license =
"<dt>$lang[LICENSE]</dt><dd>$template->license</dd>";
438 else { $license =
""; }
441 <dd>".$template->countTemplateSettings(
$db, $template->id).
"</dd>";
444 <dt><?php echo
"$lang[TEMPLATE] $lang[NAME]"; ?></dt>
445 <dd><
b><?php echo $template->name; ?></
b></dd>
446 <dt><?php echo
$lang[
'STATUS']; ?></dt>
449 <?php echo $description.$author.$weblink.$framework.$license.$version.$releaseDate.$settings.
"<br>".$subauthor.$modifyDate; ?>
454 <dt><?php echo
$lang[
'ASSETS']; ?></dt>
456 <?php echo
$lang[
'ASSETS_USED']; ?><br>
457 <?php \YAWK\template::drawAssetsTitles(
$db, $template->id,
$lang); ?>
465 <div
class=
"col-md-7">
467 <div
class=
"box-header">
468 <h3
class=
"box-title"><?php echo
$lang[
'TPL_MANAGE']; ?></h3>
470 <div
class=
"box-body">
472 <
a href=
"#" data-toggle=
"modal" data-target=
"#uploadModal" class=
"btn btn-success pull-right"><?php echo
$lang[
'TPL_UPLOAD']; ?></
a>
473 <table style=
"width:100%;" id=
"table-sort" class=
"table table-striped table-hover table-responsive">
476 <td
class=
"text-center"><strong><?php echo
$lang[
'STATUS']; ?></strong></td>
477 <td><strong><?php echo
$lang[
'PREVIEW']; ?></strong></td>
478 <td><strong><?php echo
$lang[
'ID']; ?></strong></td>
479 <td><strong><
i class=
"fa fa-caret-down"></
i> <?php print
$lang[
'TEMPLATE']; ?></strong></td>
480 <td><strong><?php print
$lang[
'SCREENSHOT']; ?></strong></td>
481 <td
class=
"text-center"><strong><?php print
$lang[
'ACTIONS']; ?></strong></td>
493 if (
$res =
$db->query(
"SELECT * FROM {templates} ORDER BY active DESC"))
496 while($row = mysqli_fetch_assoc(
$res))
501 $tplCopyName = $row[
'name'].
"-copy";
502 $tplName = $row[
'name'];
504 if ($row[
'id'] === $activeTemplateId)
506 $pub =
"success"; $pubtext=
"$lang[ONLINE]";
509 $deleteIcon =
"<i class=\"fa fa-ban\" title=\"$lang[TPL_DEL_FAILED_DUE_ACTIVE]\"></i>";
510 $copyIcon =
"<a title=\"$lang[COPY]\" onclick=\"setCopyTplSettings('$tplName');\" href=\"#\" data-toggle=\"modal\" data-target=\"#myModal\" data-tplName=\"$row[name]\"><i class=\"fa fa-copy\"></i></a>";
512 else if ($row[
'id'] ===
"1" && ($activeTemplateId !== $row[
'id']))
514 $pub =
"danger"; $pubtext =
"$lang[OFFLINE]";
516 $deleteIcon =
"<i class=\"fa fa-ban\" title=\"$lang[TPL_DEL_DEFAULT_FAILED]\"></i>";
517 $copyIcon =
"<span title=\"$lang[COPY_ONLY_ACTIVE_TPL]\" href=\"#\"<i class=\"fa fa-copy text-muted\"></i></span>";
521 $pub =
"danger"; $pubtext =
"$lang[OFFLINE]";
524 $deleteIcon =
"<a class=\"fa fa-trash-o\" role=\"dialog\" data-confirm=\"$lang[TPL_DEL_CONFIRM] «".$row[
'name'].
" ID: ".$row[
'id'].
"»\"
525 title=\"".
$lang[
'TEMPLATE'].
" ".
$lang[
'DELETE'].
"\" href=\"index.php?page=template-overview&delete=1&templateID=".$row[
'id'].
"\"></a>";
527 $copyIcon =
"<span title=\"$lang[COPY_ONLY_ACTIVE_TPL]\" href=\"#\"<i class=\"fa fa-copy text-muted\"></i></span>";
529 if ($row[
'id'] == (
$userTemplateID) && ($row[
'id'] == $activeTemplateId))
531 $previewLabel =
"<a href=\"index.php?page=template-overview&overrideTemplate=1&id=".$row[
'id'].
"\" data-toggle=\"tooltip\" title=\"$lang[TPL_CURRENTLY_ACTIVE]\">
532 <span class=\"label label-success\"><i class=\"fa fa-eye\"></i> $lang[ACTIVE]</span></a>";
538 $previewLabel =
"<a href=\"index.php?page=template-overview&overrideTemplate=1&id=".$row[
'id'].
"\" data-toggle=\"tooltip\" title=\"$lang[TPL_ENABLE_PREVIEW]\">
539 <span class=\"label label-success\"><i class=\"fa fa-eye-slash\"></i> $lang[PREVIEW] $lang[ACTIVE]</span></a>";
545 $previewLabel =
"<a href=\"index.php?page=template-overview&overrideTemplate=1&id=".$row[
'id'].
"\" data-toggle=\"tooltip\" title=\"$lang[TPL_ENABLE_PREVIEW]\">
546 <span class=\"label label-default\"><i class=\"fa fa-eye-slash\"></i> $lang[PREVIEW]</span></a>";
552 $screenshot =
"../system/templates/".$row[
'name'].
"/images/screenshot.jpg";
553 if (!file_exists($screenshot))
555 $screenshot =
"$lang[NO_SCREENSHOT]";
560 $screenshot =
"<img src=\"../system/templates/".$row[
'name'].
"/images/screenshot.jpg\" width=\"200\" class=\"img-rounded\">";
563 $description =
"copy of: ".$row[
'name'].
"";
564 $downloadIcon =
"<a id=\"downloadTemplateLink-$row[id]\" title=\"$lang[TPL_DOWNLOAD]\" href=\"index.php?page=template-overview&action=download&folder=$tplName&id=$row[id]\" data-tplName=\"$tplName\"><i id=\"downloadTemplateIcon-$row[id]\" class=\"fa fa-file-zip-o\"></i></a>";
567 <td class=\"text-center\">
568 <a data-toggle=\"tooltip\" title=\"$statusText\" href=\"index.php?page=template-overview&toggle=1&templateID=".$row[
'id'].
"\">
569 <span class=\"label label-$pub\">$pubtext</span></a> </td>
570 <td>".$previewLabel.
"</td>
571 <td>".$row[
'id'].
"</td>
572 <td>".
$activeBoldStart.
"<a href=\"index.php?page=template-positions&id=".$row[
'id'].
"\"><div style=\"width:100%\">".$row[
'name'].
"</div></a>".$row[
'description'].
"".
$activeBoldEnd.
"</td>
573 <td><a href=\"index.php?page=template-positions&id=".$row[
'id'].
"\" title=\"$lang[EDIT]: ".$row[
'name'].
"\">".$screenshot.
"</a></td>
574 <td class=\"text-center\">
590 <!-- Modal ==COPY TEMPLATE== -->
591 <div
class=
"modal fade" id=
"myModal" tabindex=
"-1" role=
"dialog" aria-labelledby=
"myModal2Label" aria-hidden=
"true">
592 <div
class=
"modal-dialog">
593 <div
class=
"modal-content">
594 <form enctype=
"multipart/form-data" action=
"index.php?page=template-overview&savenewtheme=true" method=
"POST">
595 <div
class=
"modal-header">
596 <!-- modal header with close controls -->
597 <button
type=
"button" class=
"close" data-dismiss=
"modal" aria-hidden=
"true"><
i class=
"fa fa-times"></
i> </button>
599 <div
class=
"col-md-1"><h3
class=
"modal-title"><
i class=
"fa fa-copy"></
i></h3></div>
600 <div
class=
"col-md-11"><h3
class=
"modal-title"><?php echo
$lang[
'SAVE_NEW_THEME_AS']; ?> <!-- gets filled via JS setRenameFieldState--></h3></div>
604 <div
class=
"modal-body">
605 <!-- save to... folder select options -->
606 <label
id=
"newTplNameLabel" for=
"newTplName"><?php echo
$lang[
'TPL_NEW_NAME']; ?></label>
607 <input
id=
"newTplName" class=
"form-control" name=
"newTplName">
608 <input
id=
"name" type=
"hidden" name=
"name" value=
"<?php echo $template->name; ?>">
609 <input
id=
"id" type=
"hidden" name=
"id" value=
"<?php echo $template->id; ?>">
610 <label
for=
"newTplDescription"><?php echo
$lang[
'DESCRIPTION']; ?></label>
611 <textarea
id=
"newTplDescription" class=
"form-control" name=
"newTplDescription" placeholder=
"<?php echo $lang['SHORT_DESCRIPTION_PH']; ?>"></textarea>
612 <label
id=
"newTplAuthorLAbel" for=
"newTplAuthor"><?php echo
$lang[
'AUTHOR']; ?></label>
613 <input
id=
"newTplAuthor" class=
"form-control" name=
"newTplAuthor" placeholder=
"<?php echo $lang['AUTHOR_PH']; ?>">
614 <label
id=
"newTplAuthorUrlLabel" for=
"newTplAuthorUrl"><?php echo
$lang[
'AUTHOR'].
" ".
$lang[
'URL']; ?></label>
615 <input
id=
"newTplAuthorUrl" class=
"form-control" name=
"newTplAuthorUrl" placeholder=
"https://">
616 <label
id=
"newTplWeblinkLabel" for=
"newTplWeblink"><?php echo
$lang[
'WEBLINK']; ?></label>
617 <input
id=
"newTplWeblink" class=
"form-control" name=
"newTplWeblink" placeholder=
"https://">
618 <label
id=
"newTplVersionLabel" for=
"newTplVersion"><?php echo
$lang[
'VERSION']; ?></label>
619 <input
id=
"newTplVersion" class=
"form-control" name=
"newTplVersion" placeholder=
"1.0">
620 <label
id=
"newTplFrameworkLabel" for=
"newTplFramework"><?php echo
$lang[
'FRAMEWORK']; ?></label>
621 <select
id=
"newTplFramework" class=
"form-control" name=
"newTplFramework">
622 <?php
if ($template->framework ==
"bootstrap4") { $bs4Selected =
" selected"; }
else { $bs4Selected =
''; } ?>
623 <?php
if ($template->framework ==
"bootstrap3") { $bs3Selected =
" selected"; }
else { $bs3Selected =
''; } ?>
624 <option value=
"bootstrap4"<?php echo $bs4Selected;?>>Bootstrap 4</option>
625 <option value=
"bootstrap3"<?php echo $bs3Selected;?>>Bootstrap 3</option>
627 <label
id=
"newTplLicenseLabel" for=
"newTplLicense"><?php echo
$lang[
'LICENSE']; ?></label>
628 <select
id=
"newTplLicense" class=
"form-control" name=
"newTplLicense">
629 <option value=
""><?php echo
$lang[
'PLEASE_SELECT']; ?></option>
630 <option value=
"MIT">MIT License</option>
631 <option value=
"GPL-2.0">GPL 2.0 License</option>
632 <option value=
"GPL-3.0">GPL 3.0 License</option>
633 <option value=
"LGPL-2.0">Lesser GPL 2.0</option>
634 <option value=
"LGPL-2.1">Lesser GPL 2.1</option>
638 <!-- modal footer /
w submit btn -->
639 <div
class=
"modal-footer">
640 <input
class=
"btn btn-large btn-success" type=
"submit" value=
"<?php echo $lang['SAVE_NEW_THEME_AS']; ?>">
644 </div> <!-- modal content -->
645 </div> <!-- modal dialog -->
649 <!-- Modal ==UPLOAD MODAL== -->
650 <div
class=
"modal fade" id=
"uploadModal" data-backdrop=
"static" data-keyboard=
"false" tabindex=
"-1" role=
"dialog" aria-labelledby=
"uploadModalLabel" aria-hidden=
"true">
651 <div
class=
"modal-dialog">
652 <div
class=
"modal-content">
653 <form enctype=
"multipart/form-data" id=
"uploadForm" action=
"index.php?page=template-overview&action=upload" method=
"POST">
654 <div
class=
"modal-header">
655 <!-- modal header with close controls -->
656 <button
id=
"dismissButton" type=
"button" class=
"close" data-dismiss=
"modal" aria-hidden=
"true"><
i class=
"fa fa-times"></
i> </button>
658 <div
class=
"col-md-1"><h3
class=
"modal-title"><
i class=
"fa fa-download"></
i></h3></div>
659 <div
class=
"col-md-11"><h3
class=
"modal-title"><?php echo
$lang[
'TPL_INSTALL']; ?> <!-- gets filled via JS setRenameFieldState--></h3></div>
663 <div
class=
"modal-body">
664 <!--
template upload field -->
665 <input
type=
"hidden" name=
"MAX_FILE_SIZE" value=
"67108864">
666 <input
type=
"file" name=
"templateFile" id=
"templateFile" title=
"<?php echo $lang['TPL_SELECT_FILE']; ?>" class=
"btn btn-lg btn-default" style=
"width: 100%;">
667 <label
for=
"templateFile"><?php echo
$lang[
'POST_MAX_SIZE']; echo \YAWK\filemanager::getPostMaxSize();
668 echo
" / ".$lang[
'UPLOAD_MAX_SIZE']; echo \YAWK\filemanager::getUploadMaxFilesize(); ?>
669 &
nbsp;<
i class=
"fa fa-question-circle-o text-info" data-placement=
"auto right" data-toggle=
"tooltip" title=
"" data-original-
title=
"<?php echo $lang['UPLOAD_MAX_PHP']; ?>"></
i>
672 <
i class=
"fa fa-exclamation-triangle animated tada"></
i> &
nbsp;<?php echo
$lang[
'TPL_UPLOAD_HELP']; ?>
673 <?php echo
$lang[
'TPL_UPLOAD_TIP']; ?>
677 <!-- modal footer /
w submit btn -->
678 <div
class=
"modal-footer">
679 <input
id=
"cancelButton" class=
"btn btn-large btn-default" data-dismiss=
"modal" aria-hidden=
"true" type=
"submit" value=
"<?php echo $lang['CANCEL']; ?>">
680 <button
id=
"savebutton" data-loadingText=
"<?php echo $lang['TPL_LOADING']; ?>" class=
"btn btn-success" type=
"submit"><
i id=
"savebuttonIcon" class=
"fa fa-check"></
i> &
nbsp;&
nbsp;<span
id=
"savebuttonText"><?php echo
$lang[
'TPL_UPLOAD']; ?></span></button>
684 </div> <!-- modal content -->
685 </div> <!-- modal dialog -->
static draw($type, $title, $text, $redirect, $delay)
static getSetting($db, $property)
Get and return value for property from settings database.
static getMaxId($db)
return biggest ID from template database
static getUserTemplateID($db, $uid)
template ID for given user ID
This class serves methods to create backup from files.
<!-- backend language -->< h3 >< i class="fa fa-language"></i > & nbsp
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);});})