2023-04-17 14:45:44 +00:00
|
|
|
<?php
|
|
|
|
|
2023-06-17 20:41:31 +00:00
|
|
|
function css_link($src) {
|
|
|
|
return '<link rel="stylesheet" href="'.$src.'">';
|
|
|
|
}
|
2023-04-30 18:37:16 +00:00
|
|
|
|
2023-06-17 20:41:31 +00:00
|
|
|
function generate_nav($active_page, $pages, $page_names) {
|
|
|
|
$output = array();
|
|
|
|
foreach ($pages as $key => $page) {
|
|
|
|
if ($page == $active_page)
|
|
|
|
$output[] = ['page' => $page, 'name' => $page_names[$key], 'active' => TRUE];
|
2023-04-30 18:37:16 +00:00
|
|
|
else
|
2023-06-17 20:41:31 +00:00
|
|
|
$output[] = ['page' => $page, 'name' => $page_names[$key], 'active' => FALSE];
|
2023-04-30 18:37:16 +00:00
|
|
|
}
|
|
|
|
|
2023-06-17 20:41:31 +00:00
|
|
|
return $output;
|
|
|
|
}
|
2023-05-06 21:51:56 +00:00
|
|
|
|
2023-06-17 20:41:31 +00:00
|
|
|
function html_link($href, $class, $innerHTML, $blank) {
|
|
|
|
if($blank)
|
|
|
|
return '<a href="'.$href.'" class="'.$class.'" target="_blank">'.$innerHTML.'</a>';
|
|
|
|
else
|
|
|
|
return '<a href="'.$href.'" class="'.$class.'">'.$innerHTML.'</a>';
|
|
|
|
}
|
2023-05-06 21:51:56 +00:00
|
|
|
|
2023-06-17 20:41:31 +00:00
|
|
|
function get_web_json($url) {
|
|
|
|
$data = json_decode(file_get_contents($url), true);
|
|
|
|
return $data;
|
|
|
|
}
|
2023-05-06 21:51:56 +00:00
|
|
|
|
2023-06-17 20:41:31 +00:00
|
|
|
function str_mass_replace($searchs, $replacers, $string) {
|
|
|
|
foreach ($searchs as $key => $search) {
|
|
|
|
$string = str_replace($search, $replacers[$key], $string);
|
2023-05-06 21:51:56 +00:00
|
|
|
}
|
2023-06-17 20:41:31 +00:00
|
|
|
return $string;
|
2023-04-17 14:45:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|