15 if (isset(
$_GET[
'add']) && (
$_GET[
'add'] ===
"true"))
17 if (isset($_POST) && (!empty($_POST)))
19 if (isset($_FILES[
'fontFile'][
'tmp_name']) && (!empty($_FILES[
'fontFile'][
'tmp_name'])))
21 $exts = array(
'ttf',
'otf',
'woff');
23 $fontFileName = $_FILES[
'fontFile'][
'name'];
25 if(@in_array(end(explode(
'.', $fontFileName)), $exts))
28 $uploadFile =
$fontFolder . basename($_FILES[
'fontFile'][
'name']);
34 if (move_uploaded_file($_FILES[
'fontFile'][
'tmp_name'], $uploadFile))
36 alert::draw(
"success",
$lang[
'SUCCESS'],
"$lang[UPLOAD_SUCCESSFUL]: $uploadFile",
"", 1800);
40 alert::draw(
"danger",
$lang[
'ERROR'],
"$lang[UPLOAD_FAILED]: $uploadFile $lang[ERROR]: ".$_FILES[
'fontFile'][
'error'].
"",
"", 2600);
45 alert::draw(
"danger",
$lang[
'ERROR'],
"$lang[FILE_UPLOAD_ERROR] $lang[FOLDER]: $uploadFile",
"", 4800);
50 alert::draw(
"danger",
$lang[
'ERROR'],
"$lang[FONT_WRONG_TYPE]",
"", 4600);
55 if (isset($_POST[
'gfont']) && (!empty($_POST[
'gfont']) && (isset($_POST[
'gfontDescription']) && (!empty($_POST[
'gfontDescription'])))))
57 $description = $_POST[
'gfontDescription'];
58 $gfont = $_POST[
'gfont'];
60 if (template::addgfont(
$db, $gfont,$description) ===
true)
62 alert::draw(
"success",
"$lang[TPL_ADD_GFONT]",
"$lang[ADD_SUCCESSFUL]: $_POST[gfont]",
'', 1800);
66 alert::draw(
"danger",
"$lang[TPL_ADD_GFONT]",
"$lang[ADD_FAILED]: $_POST[gfont]",
'', 4600);
73 if (isset(
$_GET[
'delete']) && (
$_GET[
'delete'] ===
"true"))
75 if (isset(
$_GET[
'type']) && (!empty(
$_GET[
'type'])))
77 if (
$_GET[
'type'] ===
"custom")
79 if (isset(
$_GET[
'font']) && (!empty(
$_GET[
'font'])))
85 alert::draw(
"success",
"$lang[SUCCESS]",
"$lang[FONT_DEL_OK]: $_GET[font]",
"", 1200);
89 alert::draw(
"danger",
"$lang[ERROR]",
"$lang[FONT_DEL_FAILED]",
"", 2600);
94 alert::draw(
"success",
"$lang[ERROR]",
"$lang[FILEMAN_FILE_DOES_NOT_EXIST] $fontFolder$_GET[font]",
"", 4600);
99 alert::draw(
"success",
"$lang[ERROR]",
"$lang[VARS_MANIPULATED]",
"", 4600);
104 if (template::deleteGfont(
$db,
'',
$_GET[
'font']) ===
true)
106 alert::draw(
"success",
"$lang[SUCCESS]",
"$lang[FONT_DEL_OK]: $_GET[font]",
"", 1200);
110 alert::draw(
"danger",
"$lang[ERROR]",
"$lang[FONT_DEL_FAILED]",
"", 2600);
116 alert::draw(
"success",
"$lang[ERROR]",
"$lang[VARS_MANIPULATED]",
"", 4600);
138 @font-face { font-family: '$font';
139 src: url('$fontFolder$font') format('truetype'); }
150 @font-face { font-family: '$font';
151 src: url('$fontFolder$font') format('opentype'); }
163 @font-face { font-family: '$font';
164 src: url('$fontFolder$font') format('woff'); }
176 <link href=\"https://fonts.googleapis.com/css?family=$gFont\" rel=\"stylesheet\">
195 <!-- Content Wrapper. Contains page content -->
196 <div class=\"content-wrapper\" id=\"content-FX\">
197 <!-- Content Header (Page header) -->
198 <section class=\"content-header\">";
200 echo backend::getTitle(
$lang[
'SETTINGS'],
$lang[
'FONTS']);
201 echo backend::getSettingsBreadcrumbs(
$lang);
202 echo
"</section><!-- Main content -->
203 <section class=\"content\">";
207 <div
class=
"box-body">
208 <div
class=
"col-md-10">
209 <?php echo
"<h4><i class=\"fa fa-font\"></i> $lang[FONTS] <small>$lang[CONFIGURE]</small></h4>"; ?>
211 <div
class=
"col-md-2">
212 <
a href=
"#" id=
"addFontBtn" class=
"btn btn-success pull-right" data-toggle=
"modal" data-target=
"#myModal" style=
"margin-top:2px;"><
i class=
"fa fa-plus"></
i>&
nbsp; <?php echo
"$lang[FONT_ADD]"; ?></
a>
217 <!-- FONT MANAGEMENT -->
219 <!-- GOOGLE FONTS OVERVIEW -->
220 <div
class=
"col-md-3">
222 <div
class=
"box-header with-border">
223 <h3
class=
"box-title"><?php echo
$lang[
'FONTS_GOOGLE']; ?> <small> <?php echo
$lang[
'FONTS_GFONT']; ?></small></h3>
225 <div
class=
"box-body">
236 <!-- TTF FONT OVERVIEW -->
237 <div
class=
"col-md-3">
239 <div
class=
"box-header with-border">
240 <h3
class=
"box-title"><?php echo
$lang[
'FONTS_TTF']; ?> <small> <?php echo
$lang[
'FONTS_TRUETYPE']; ?></small></h3>
242 <div
class=
"box-body">
253 <!-- OTF FONTS OVERVIEW -->
254 <div
class=
"col-md-3">
256 <div
class=
"box-header with-border">
257 <h3
class=
"box-title"><?php echo
$lang[
'FONTS_OTF']; ?> <small> <?php echo
$lang[
'FONTS_OPENTYPE']; ?></small></h3>
259 <div
class=
"box-body">
270 <!-- WOFF FONT OVERVIEW -->
271 <div
class=
"col-md-3">
273 <div
class=
"box-header with-border">
274 <h3
class=
"box-title"><?php echo
$lang[
'FONTS_WOFF']; ?> <small> <?php echo
$lang[
'FONTS_WEBOPEN']; ?></small></h3>
276 <div
class=
"box-body">
289 <!-- Modal --ADD FONT-- -->
290 <div
class=
"modal fade" id=
"myModal" tabindex=
"-1" role=
"dialog" aria-labelledby=
"myModal2Label" aria-hidden=
"true">
291 <div
class=
"modal-dialog">
292 <div
class=
"modal-content">
293 <form enctype=
"multipart/form-data" action=
"index.php?page=settings-fonts&add=true" method=
"POST">
294 <div
class=
"modal-header">
295 <!-- modal header with close controls -->
296 <button
type=
"button" class=
"close" data-dismiss=
"modal" aria-hidden=
"true"><
i class=
"fa fa-times"></
i> </button>
298 <div
class=
"col-md-1"><h3
class=
"modal-title"><
i class=
"fa fa-font"></
i></h3></div>
299 <div
class=
"col-md-11"><h3
class=
"modal-title"><?php echo
$lang[
'FONT_ADD']; ?></h3></div>
303 <div
class=
"modal-body">
304 <!-- ADD CUSTOM FONT -->
305 <h4><
b><?php echo
$lang[
'FONT_ADD_CUSTOM']; ?></
b></h4>
306 <
b><?php echo
$lang[
'FONTS_SUPPORTED']; ?></
b>
308 <li><
b>.ttf</
b> <small><
i>(TrueType)</
i></small></li>
309 <li><
b>.otf</b> <small><i>(Open Type Font)</
i></small></li>
310 <li><
b>.woff</
b> <small><
i>(Web Open Font Format)</
i></small></li>
313 <label
for=
"fontFile"><?php echo
$lang[
'SELECT_FILE']; ?></label>
314 <input
type=
"hidden" name=
"MAX_FILE_SIZE" value=
"4194304"> <!-- 4 MB -->
315 <input
type=
"file" class=
"form-control" id=
"fontFile" name=
"fontFile">
316 <small><?php echo
$lang[
'FONTS_PATH']; ?></small>
318 <h4><
b><?php echo
$lang[
'FONT_ADD_GFONT']; ?></
b></h4>
319 <label
for=
"gfont"><?php echo
$lang[
'FONT_GOOGLE_NAME']; ?></label>
320 <input
type=
"text" class=
"form-control" id=
"gfont" name=
"gfont" placeholder=
"<?php echo $lang['FONT_GOOGLE_NAME_PH']; ?>">
321 <label
for=
"gfontDescription"><?php echo
$lang[
'FONT_GOOGLE_DESC']; ?></label>
322 <input
type=
"text" class=
"form-control" name=
"gfontDescription" id=
"gfontDescription" placeholder=
"<?php echo $lang['FONT_GOOGLE_DESC_PH']; ?>">
326 <!-- modal footer /
w submit btn -->
327 <div
class=
"modal-footer">
328 <input
class=
"btn btn-large btn-default" data-dismiss=
"modal" aria-hidden=
"true" type=
"submit" value=
"<?php echo $lang['CANCEL']; ?>">
329 <button
class=
"btn btn-large btn-success" type=
"submit"><
i class=
"fa fa-check"></
i>&
nbsp; <?php echo
$lang[
'FONT_ADD']; ?></button>
333 </div> <!-- modal content -->
334 </div> <!-- modal dialog -->
print $lang['FILEMAN_UPLOAD']
Throws a fancy Bootstrap Alert (success, info, warning or danger)
Backend class serves a few useful functions for the admin backend.
Mysqli database class; returns db connection object.
The language class - support multilingual backend.
The template controller - get and set template settings.
if(isset($_GET) &&(!empty($_GET))) $googleFonts
<!-- backend language -->< h3 >< i class="fa fa-language"></i > & nbsp