Use lang strings instead of database strings for visibility

This commit is contained in:
Skylar Ittner 2017-12-03 19:57:52 -07:00
parent 72c2cb2e1b
commit e33478527e
4 changed files with 8 additions and 3 deletions

View File

@ -61,5 +61,9 @@ define("STRINGS", [
"delete" => "Delete",
"open" => "Open",
"page" => "Page",
"no permission" => "You don't have permission to do that."
"no permission" => "You don't have permission to do that.",
"visibility owner" => "Just me",
"visibility loggedin" => "People with accounts",
"visibility link" => "Anyone with the link",
"visibility password" => "Anyone with the link and password",
]);

View File

@ -121,6 +121,7 @@ for ($i = 0; $i < count($pubs); $i++) {
"size" => $pubs[$i]["sizename"],
"orientation" => ( $pubs[$i]["landscape"] == 0 ? lang("portrait", false) : lang("landscape", false) )
], false);
$pubs[$i]["visibility"] = lang("visibility " . strtolower($pubs[$i]["permname"]), false);
}
$out['pubs'] = $pubs;

View File

@ -132,7 +132,7 @@ if (!is_empty($VARS['id'])) {
$perms = $database->select("pub_permissions", ['permid', 'permname']);
foreach ($perms as $p) {
$pi = $p['permid'];
$pn = $p['permname'];
$pn = lang("visibility " . strtolower($p['permname']), false);
$ps = $pubdata["permid"] == $pi ? " selected" : "";
echo "<option value=\"$pi\"$ps>$pn</option>\n";
}

View File

@ -47,7 +47,7 @@ var pubtable = $('#pubtable').DataTable({
row.stylename,
row.columns,
row.pagesize,
row.permname
row.visibility
]);
});
return JSON.stringify(json);