function build_dash_tile_list($dtiles_available) { global $lang, $baseurl_short, $baseurl; foreach ($dtiles_available as $tile) { $checked = false; if (!empty($tile["dash_tile"])) { $checked = true; } $buildstring = explode('?', $tile["url"]); parse_str(str_replace("&", "&", $buildstring[1]), $buildstring); ?> <tr id="tile<?php echo $tile["ref"]; ?> "> <td> <input type="checkbox" class="tilecheck" name="tiles[]" value="<?php echo $tile["ref"]; ?> " onChange="changeTile(<?php echo $tile["ref"]; ?> ,<?php echo $tile["all_users"]; ?> );" <?php echo $checked ? "checked" : ""; ?> /> </td> <td> <?php if (isset($buildstring["tltype"]) && $buildstring["tltype"] == "conf" && $buildstring["tlstyle"] != "custm" && $buildstring["tlstyle"] != "pend") { echo $lang[$tile["title"]]; } else { echo $tile["title"]; } ?> </td> <td> <?php if (isset($buildstring["tltype"]) && $buildstring["tltype"] == "conf" && $buildstring["tlstyle"] != "custm" && $buildstring["tlstyle"] != "pend") { $tile["txt"] = text($tile["title"]); } else { if (isset($buildstring["tltype"]) && $buildstring["tltype"] == "conf" && $buildstring["tlstyle"] == "pend") { if (isset($lang[strtolower($tile['txt'])])) { $tile['txt'] = $lang[strtolower($tile["txt"])]; } else { $tile['txt'] = htmlspecialchars($tile['txt']); } } } if (strlen($tile["txt"]) > 75) { echo substr($tile["txt"], 0, 72) . "..."; } else { echo $tile["txt"]; } ?> </td> <td> <a href="<?php echo mb_strtolower(substr($tile["link"], 0, 4)) == "http" ? $tile["link"] : $baseurl . "/" . htmlspecialchars($tile["link"]); ?> " target="_blank" > <?php echo $lang["dashtilevisitlink"]; ?> </a> </td> <td><?php echo $tile["resource_count"] ? $lang["yes"] : $lang["no"]; ?> </td> <td> <?php if ($tile["allow_delete"] && ($tile["all_users"] && checkPermission_dashadmin() || !$tile["all_users"] && (checkPermission_dashuser() || checkPermission_dashadmin()))) { ?> <a href="<?php echo $baseurl_short; ?> pages/dash_tile.php?edit=<?php echo $tile['ref']; ?> " ><?php echo $lang["action-edit"]; ?> </a> <?php } ?> </td> </tr> <?php } }
function checkPermission_dashcreate() { #Home_dash is on, And not Anonymous use, And (Dash tile user (Not with a managed dash) || Dash Tile Admin) global $managed_home_dash, $unmanaged_home_dash_admins; return !checkPermission_anonymoususer() && (!$managed_home_dash && (checkPermission_dashuser() || checkPermission_dashadmin()) || $managed_home_dash && checkPermission_dashadmin() || $unmanaged_home_dash_admins && checkPermission_dashadmin()); }