function show_version($pname, $i, $v) { $num = $v["num"]; $file = $v["file"]; $status = $v["status"]; if (is_dev($v)) { $status = $status . "\n <br><span class=dev>\n (MAY BE UNSTABLE - USE ONLY FOR TESTING)\n </span>\n "; } $path = "dl/{$file}"; $s = number_format(filesize($path) / 1000000, 2); $date = $v["date"]; $type = $v["type"]; $type_text = type_text($type); $url = version_url($v); echo "<tr>\n <td class=rowlineleft>{$num}</td>\n <td class=rowline>{$status}</td>\n <td class=rowline><a href=\"{$url}\"><b>Download</b></a> ({$s} MB)</td>\n <td class=rowlineright>{$date}</td>\n </tr>\n "; }
/** * Dynamically include CSS in the template * * NOTE: This function does NOT check for existence of .css file * * @access public * @param string $style CSS file to link, import or embed * @param string $type 'link', 'import' or 'embed' * @param string|bool $media media attribute to use with 'link' type only, FALSE for none * @return bool TRUE on success, FALSE otherwise */ function add_css($style, $type = 'link', $media = FALSE) { $success = TRUE; $css = NULL; $this->CI->load->helper('url'); switch ($type) { case 'dynamic': $filepath = asset_url(preg_replace('|^(/)|', '', $style)); $css = '<link type="text/css" rel="stylesheet" href="' . version_url($filepath) . '"'; if ($media) { $css .= ' media="' . $media . '"'; } $css .= ' />'; break; case 'link': $filepath = preg_match('/^(https?:\\/\\/|\\/\\/)/', $style) ? $style : asset_url($style); $css = '<link type="text/css" rel="stylesheet" href="' . version_url($filepath) . '"'; if ($media) { $css .= ' media="' . $media . '"'; } $css .= ' />'; break; case 'import': $css = '<style type="text/css">@import url(' . $filepath . ');</style>'; break; case 'embed': $css = '<style type="text/css">'; $css .= $style; $css .= '</style>'; break; default: $success = FALSE; break; } // Add to css array if it doesn't already exist if ($css != NULL && !in_array($css, $this->css)) { $this->css[] = $css; $this->write('_styles', $css); } return $success; }
function show_version($pname, $i, $v) { if (!$v) { return; } $num = $v["num"]; $file = $v["file"]; $status = $v["status"]; if (is_dev($v)) { $status = $status . "\n <br><span class=dev>\n (MAY BE UNSTABLE - USE ONLY FOR TESTING)\n </span>\n "; } $path = "dl/{$file}"; $s = number_format(filesize($path) / 1000000, 2); $date = $v["date"]; $type = $v["type"]; $type_text = type_text($type); $url = version_url($v['file']); $link = ""; if (array_key_exists('vbox_file', $v)) { $vbox_file = $v['vbox_file']; $vbox_version = $v['vbox_version']; $vbox_url = version_url($vbox_file); $vbox_path = "dl/{$vbox_file}"; $vbox_size = number_format(filesize($vbox_path) / 1000000, 2); $link = "<a href=\"{$vbox_url}\"><b>Download BOINC + VirtualBox {$vbox_version}</b></a> ({$vbox_size} MB)<br>"; } $link .= "<a href=\"{$url}\"><b>Download</b></a> ({$s} MB)"; echo "<tr>\n <td class=rowlineleft>{$num}</td>\n <td class=rowline>{$status}</td>\n <td class=rowline>{$link}</td>\n <td class=rowlineright>{$date}</td>\n </tr>\n "; }