Prepare for gettext

This commit is contained in:
Vojtěch Sajdl
2017-12-31 00:41:58 +01:00
parent 83e72e2f4c
commit bef338fd99
14 changed files with 149 additions and 149 deletions
+8 -8
View File
@@ -21,12 +21,12 @@ if (isset($_GET['delete']))
//TODO: Pamatovat si data
render_header("Dashboard", true);
render_header(_("Dashboard"), true);
?>
<div class="text-center">
<h1>Dashboard</h1>
<h3>Welcome <?php echo $user->get_name();?></h3>
<h1><?php echo _("Dashboard");?></h1>
<h3><?php echo _("Welcome");?> <?php echo $user->get_name();?></h3>
</div>
<div id="current">
@@ -38,7 +38,7 @@ render_header("Dashboard", true);
<div class="item">
<div class="timeline">
<div class="line text-muted"></div>
<h3>New incident</h3>
<h3><?php echo _("New incident");?></h3>
<form id="new-incident" action="/admin/?new=incident" method="POST" class="clearfix">
<article class="panel">
<?php if (isset($message))
@@ -68,13 +68,13 @@ render_header("Dashboard", true);
<i class="glyphicon glyphicon-info-sign"></i>
</div>
<div class="panel-heading clearfix">
<input type="text" name="title" id="title" placeholder="Title" value="<?php echo htmlspecialchars($_POST['title']); ?>" required> <span id="time"><input id="time_input" type="text" pattern="(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))" name="time" value="<?php echo htmlspecialchars($_POST['time']); ?>" class="pull-right" title="Use ISO 8601 format (e.g. 2017-11-23T19:50:51+00:00)" placeholder="Time"></span>
<input type="text" name="title" id="title" placeholder="<?php echo _("Title");?>" value="<?php echo htmlspecialchars($_POST['title']); ?>" required> <span id="time"><input id="time_input" type="text" pattern="(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))" name="time" value="<?php echo htmlspecialchars($_POST['time']); ?>" class="pull-right" title="Use ISO 8601 format (e.g. 2017-11-23T19:50:51+00:00)" placeholder="<?php echo _("Time");?>"></span>
</div>
<div class="panel-body">
<textarea name="text" placeholder="Here goes your text..." required><?php echo htmlspecialchars($_POST['text']); ?></textarea>
<textarea name="text" placeholder="<?php echo _("Here goes your text...");?>" required><?php echo htmlspecialchars($_POST['text']); ?></textarea>
</div>
<div class="panel-footer clearfix">
<small>Posted by: <?php echo $user->get_username();?> <span class="pull-right" id="end_time_wrapper">Ending:&nbsp;<input id="end_time" title="Use ISO 8601 format (e.g. 2017-11-23T19:50:51+00:00)" type="text" pattern="(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))" name="end_time" class="pull-right" placeholder="End time" value="<?php echo htmlspecialchars($_POST['end_time']); ?>"></span></small>
<small><?php echo _("Posted by");?>: <?php echo $user->get_username();?> <span class="pull-right" id="end_time_wrapper"><?php echo _("Ending");?>:&nbsp;<input id="end_time" title="Use ISO 8601 format (e.g. 2017-11-23T19:50:51+00:00)" type="text" pattern="(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))" name="end_time" class="pull-right" placeholder="<?php echo _("End time");?>" value="<?php echo htmlspecialchars($_POST['end_time']); ?>"></span></small>
</div>
</article>
<select class="form-control pull-left" id="type" name="type">
@@ -92,7 +92,7 @@ render_header("Dashboard", true);
}
?>
</select>
<button type="submit" class="btn btn-primary pull-right">Submit</button>
<button type="submit" class="btn btn-primary pull-right"><?php echo _("Submit");?></button>
</form>
<?php
$constellation->render_incidents(true,$offset,5,true);
+10 -10
View File
@@ -1,30 +1,30 @@
<?php
render_header("Login");
render_header(_("Login"));
?>
<div class="text-center">
<h1>Login</h1>
<h1><?php echo _("Login");?></h1>
</div>
<div id="login-form" class="center">
<?php if (isset($message)){?>
<p class="alert alert-danger"><?php echo $message?></p>
<?php }else{?>
<p class="alert alert-info">Please login to continue.</p>
<p class="alert alert-info"><?php echo _("Please login to continue.");?></p>
<?php }?>
<form action="/admin/" method="post">
<div class="form-group">
<label for="email">Email</label>
<input placeholder="Email" class="form-control" name="email" id="email" type="email" tabindex="1" value="<?php echo htmlspecialchars((isset($_POST['email'])?$_POST['email']:''),ENT_QUOTES);?>" required>
<label for="email"><?php echo _("Email");?></label>
<input placeholder="<?php echo _("Email");?>" class="form-control" name="email" id="email" type="email" tabindex="1" value="<?php echo htmlspecialchars((isset($_POST['email'])?$_POST['email']:''),ENT_QUOTES);?>" required>
</div>
<div class="form-group" style="margin-bottom: 8px">
<label for="pass">Password</label>
<input placeholder="Password" class="form-control" name="pass" id="pass" type="password" tabindex="2" required>
<label for="pass"><?php echo _("Password");?></label>
<input placeholder="<?php echo _("Password");?>" class="form-control" name="pass" id="pass" type="password" tabindex="2" required>
<div style="padding-top: 8px; position: relative;">
<a href="?do=lost-password" class="pull-right noselect" tabindex="5">Forgotten password?</a>
<input name="remember" id="remember" type="checkbox" tabindex="3"> <label class="lbl-login noselect" style="color: black;" for="remember">Remember me</label>
<a href="?do=lost-password" class="pull-right noselect" tabindex="5"><?php echo _("Forgotten password?");?></a>
<input name="remember" id="remember" type="checkbox" tabindex="3"> <label class="lbl-login noselect" style="color: black;" for="remember"><?php echo _("Remember me");?></label>
</div>
</div>
<div class="form-group clearfix">
<button type="submit" class="btn btn-success pull-right" tabindex="4">Login</button>
<button type="submit" class="btn btn-success pull-right" tabindex="4"><?php echo _("Login");?></button>
</div>
</form>
</div>
+17 -17
View File
@@ -1,8 +1,8 @@
<?php
render_header("Lost password");
render_header(_("Lost password"));
?>
<div class="text-center">
<h1>Lost password</h1>
<h1><?php echo _("Lost password");?></h1>
</div>
<div id="login-form" class="center">
@@ -13,12 +13,12 @@ render_header("Lost password");
$user->change_password($_POST['token']);
if (isset($message)){?>
<p class="alert alert-danger"><?php echo $message?></p>
<a href="/admin/?do=lost-password<?php echo "&id=".$_POST['id']."&token=".$_POST['token'];?>">Go back</a>
<a href="/admin/?do=lost-password<?php echo "&id=".$_POST['id']."&token=".$_POST['token'];?>"><?php echo _("Go back");?> </a>
<?php
}
else{?>
<p class="alert alert-success">Password changed successfully!</p>
<a href="/admin/">Go back to login page</a>
<p class="alert alert-success"><?php echo _("Password changed successfully!");?></p>
<a href="/admin/"><?php echo _("Go back to login page");?></a>
<?php
}
}
@@ -27,12 +27,12 @@ render_header("Lost password");
User::password_link();
if (isset($message)){?>
<p class="alert alert-danger"><?php echo $message?></p>
<a href="/admin/?do=lost-password">Go back to start</a>
<a href="/admin/?do=lost-password"><?php echo _("Go back to start");?></a>
<?php
}
else{?>
<p class="alert alert-success">Email with password reset link has been sent!</p>
<a href="/admin/">Go back to login page</a>
<p class="alert alert-success"><?php echo _("Email with password reset link has been sent!");?></p>
<a href="/admin/"><?php echo _("Go back to login page");?></a>
<?php
}
}
@@ -43,25 +43,25 @@ render_header("Lost password");
<?php }?>
<form action="/admin/?do=lost-password" method="post">
<?php if (!isset($_GET['id'])||!isset($_GET['token'])){?>
<label for="email">Email:</label>
<label for="email"><?php echo _("Email");?>:</label>
<div class="input-group pull-right">
<input class="form-control" name="email" id="email" placeholder="Email" type="email" required>
<input class="form-control" name="email" id="email" placeholder="<?php echo _("Email");?>" type="email" required>
<span class="input-group-btn">
<button type="submit" class="btn btn-success pull-right">Submit request</button>
<button type="submit" class="btn btn-success pull-right"><?php echo _("Submit request");?></button>
</span>
</div>
<?php }
else{
$user = new User($_GET['id']);
?>
<p class="alert alert-info">Reset password for <?php echo $user->get_name()." (".$user->get_username().")";?></p>
<p class="alert alert-info"><?php printf(_("Reset password for %s (%s)"),$user->get_name(), $user->get_username());?></p>
<input type="hidden" name="id" value="<?php echo $_GET['id'];?>" >
<input type="hidden" name="token" value="<?php echo $_GET['token'];?>" >
<label for="new_password">New password</label>
<input id="new_password" placeholder="New password" type="password" class="form-control" name="password">
<label for="new_password_check">Repeat password</label>
<input id="new_password_check" placeholder="Repeat password" type="password" class="form-control" name="password_repeat">
<button type="submit" class="btn btn-primary pull-right margin-top">Change password</button>
<label for="new_password"><?php echo _("New password");?></label>
<input id="new_password" placeholder="<?php echo _("New password");?>" type="password" class="form-control" name="password">
<label for="new_password_check"><?php echo _("Repeat password");?></label>
<input id="new_password_check" placeholder="<?php echo _("Repeat password");?>" type="password" class="form-control" name="password_repeat">
<button type="submit" class="btn btn-primary pull-right margin-top"><?php echo _("Change password");?></button>
<?php
}
?>
+8 -8
View File
@@ -4,7 +4,7 @@ if (isset($_GET['new']))
User::add();
}
render_header("New user", true); ?>
render_header(_("New user"), true); ?>
<div class="text-center">
<h2>Add new user</h2>
</div>
@@ -16,17 +16,17 @@ render_header("New user", true); ?>
<?php
} ?>
<div class="form-group">
<div class="col-sm-6"><label for="name">Name: </label><input type="text" maxlength="50" name="name" value="<?php echo htmlspecialchars($_POST['name'],ENT_QUOTES);?>" id="name" placeholder="Name" class="form-control" required></div>
<div class="col-sm-6"><label for="surname">Surname: </label><input type="text" maxlength="50" name="surname" value="<?php echo htmlspecialchars($_POST['surname'],ENT_QUOTES);?>" id="surname" placeholder="Surname" class="form-control" required></div>
<div class="col-sm-6"><label for="name"><?php echo _("Name");?>: </label><input type="text" maxlength="50" name="name" value="<?php echo htmlspecialchars($_POST['name'],ENT_QUOTES);?>" id="name" placeholder="<?php echo _("Name");?>" class="form-control" required></div>
<div class="col-sm-6"><label for="surname"><?php echo _("Surname");?>: </label><input type="text" maxlength="50" name="surname" value="<?php echo htmlspecialchars($_POST['surname'],ENT_QUOTES);?>" id="surname" placeholder="<?php echo _("Surname");?>" class="form-control" required></div>
</div>
<div class="form-group">
<div class="col-sm-6"><label for="username">Username:</label><input type="text" maxlength="50" name="username" value="<?php echo htmlspecialchars($_POST['username'],ENT_QUOTES);?>" id="username" placeholder="Username" class="form-control" required></div>
<div class="col-sm-6"><label for="email">Email:</label><input type="email" maxlength="60" name="email" value="<?php echo htmlspecialchars($_POST['email'],ENT_QUOTES);?>" id="email" placeholder="Email" class="form-control" required></div>
<div class="col-sm-6"><label for="username"><?php echo _("Username");?>:</label><input type="text" maxlength="50" name="username" value="<?php echo htmlspecialchars($_POST['username'],ENT_QUOTES);?>" id="username" placeholder="<?php echo _("Username");?>" class="form-control" required></div>
<div class="col-sm-6"><label for="email"><?php echo _("Email");?>:</label><input type="email" maxlength="60" name="email" value="<?php echo htmlspecialchars($_POST['email'],ENT_QUOTES);?>" id="email" placeholder="<?php echo _("Email");?>" class="form-control" required></div>
</div>
<div class="form-group">
<div class="col-sm-6"><label for="password">Password:</label><input type="password" name="password" value="<?php echo htmlspecialchars($_POST['password'],ENT_QUOTES);?>" id="password" placeholder="Password" class="form-control" required></div>
<div class="col-sm-6"><label for="password"><?php echo _("Password");?>:</label><input type="password" name="password" value="<?php echo htmlspecialchars($_POST['password'],ENT_QUOTES);?>" id="password" placeholder="<?php echo _("Password");?>" class="form-control" required></div>
<div class="col-sm-6">
<label for="permission">Permission: </label>
<label for="permission"><?php echo _("Permission");?>: </label>
<select name="permission" id="permission" class="form-control">
<?php
if (!empty($_POST['permission']))
@@ -50,5 +50,5 @@ render_header("New user", true); ?>
</select>
</div>
</div>
<button type="submit" class="btn btn-primary pull-right">Submit</button>
<button type="submit" class="btn btn-primary pull-right"><?php echo _("Submit");?></button>
</form>
+9 -9
View File
@@ -9,7 +9,7 @@ if (isset($_GET['delete']))
Service::delete();
}
render_header("Settings", true);
render_header(_("Settings"), true);
?>
<div class="text-center">
<h2>Settings</h2>
@@ -20,13 +20,13 @@ if (isset($message)){
<p class="alert alert-danger"><?php echo $message; ?></p>
<?php }?>
<section>
<h3 class="pull-left">Services</h3>
<h3 class="pull-left"><?php echo _("Services");?></h3>
<?php if ($user->get_rank() <= 1){?>
<form action="?do=settings&new=service" method="post">
<div class="input-group pull-right new-service">
<input class="form-control" name="service" placeholder="Name" type="text" value="<?php echo htmlspecialchars($_POST['service']); ?>" maxlength="50" required>
<span class="input-group-btn">
<button type="submit" class="btn btn-success pull-right">Add service</button>
<button type="submit" class="btn btn-success pull-right"><?php echo _("Add service");?></button>
</span>
</div>
</form>
@@ -34,11 +34,11 @@ if (isset($message)){
<table class="table">
<thead><tr>
<th scope="col">ID</th>
<th scope="col">Name</th>
<th scope="col"><?php echo _("ID");?></th>
<th scope="col"><?php echo _("Name");?></th>
<?php if ($user->get_rank()<=1)
{?>
<th scope="col">Delete</th>
<th scope="col"><?php echo _("Delete");?></th>
<?php } ?>
</tr>
</thead>
@@ -62,11 +62,11 @@ while($result = $query->fetch_assoc())
<section>
<h3 class="pull-left">Users</h3>
<?php if ($user->get_rank() == 0){?> <a href="?do=new-user" class="btn btn-success pull-right">Add new user</a><?php }?>
<h3 class="pull-left"><?php echo _("Users");?></h3>
<?php if ($user->get_rank() == 0){?> <a href="?do=new-user" class="btn btn-success pull-right"><?php echo _("Add new user");?></a><?php }?>
<table class="table">
<thead><tr><th scope="col">ID</th><th scope="col">Username</th><th scope="col">Name</th><th scope="col">Surname</th><th scope="col">Email</th><th scope="col">Role</th><th scope="col">Active</th></tr></thead>
<thead><tr><th scope="col"><?php echo _("ID");?></th><th scope="col"><?php echo _("Username");?></th><th scope="col"><?php echo _("Name");?></th><th scope="col"><?php echo _("Surname");?></th><th scope="col"><?php echo _("Email");?></th><th scope="col"><?php echo _("Role");?></th><th scope="col">Active</th></tr></thead>
<tbody>
<?php
$query = $mysqli->query("SELECT * FROM users");
+2 -2
View File
@@ -32,11 +32,11 @@ if ($_GET['what']=='toggle')
$displayed_user->toggle();
}
render_header("User", true);
render_header(_("User"), true);
?>
<div class="text-center">
<h1>User settings</h1>
<h1><?php echo _("User settings");?></h1>
</div>
<?php if (isset($message)){?>
<p class="alert alert-danger"><?php echo $message?></p>