本文整理汇总了PHP中url::file方法的典型用法代码示例。如果您正苦于以下问题:PHP url::file方法的具体用法?PHP url::file怎么用?PHP url::file使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类url
的用法示例。
在下文中一共展示了url::file方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: head
static function head($theme)
{
// @tdo remove the addition css and organize.js (just here to test)
$script[] = html::script("modules/organize/js/organize_init.js");
$script[] = html::script("modules/organize/js/organize.js");
$script[] = "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("modules/organize/css/organize.css") . "\" />";
return implode("\n", $script);
//return html::script("modules/organize/js/organize_init.js");
}
示例2: head
static function head($theme)
{
// @todo: move this into the theme
$user = user::active();
if (!user::active()->guest) {
$url = url::file("lib/jquery.jeditable.js");
return "<script src=\"{$url}\" type=\"text/javascript\"></script>";
}
}
示例3: form_script_test
function form_script_test()
{
$form = new Forge("test/controller", "", "post", array("id" => "g-test-group-form"));
$group = $form->group("test_group")->label(t("Test Group"));
$group->input("title")->label(t("Title"));
$group->textarea("description")->label(t("Text Area"));
$form->script("")->url(url::file("test.js"))->text("alert('Test Javascript');");
$group->submit("")->value(t("Submit"));
$csrf = access::csrf_token();
$expected = "<form action=\"http://./index.php/test/controller\" method=\"post\" " . "id=\"g-test-group-form\">\n" . "<input type=\"hidden\" name=\"csrf\" value=\"{$csrf}\" />" . " <fieldset>\n" . " <legend>Test Group</legend>\n" . " <ul>\n" . " <li>\n" . " <label for=\"title\" >Title</label>\n" . " <input type=\"text\" name=\"title\" value=\"\" " . "class=\"textbox\" />\n" . " </li>\n" . " <li>\n" . " <label for=\"description\" >Text Area</label>\n" . " <textarea name=\"description\" rows=\"\" cols=\"\" " . "class=\"textarea\" ></textarea>\n" . " </li>\n" . " <li>\n" . " <input type=\"submit\" value=\"Submit\" class=\"submit\" />\n" . " </li>\n" . " </ul>\n" . " </fieldset>\n" . "<script type=\"text/javascript\" src=\"http://./test.js\"></script>\n\n" . "<script type=\"text/javascript\">\n" . "alert('Test Javascript');\n" . "</script>\n" . "</form>";
$this->assert_same($expected, (string) $form);
}
示例4: resize_img
public function resize_img($extra_attrs)
{
$panorama = ORM::factory("panorama")->where("item_id", "=", $this->id)->find();
if ($panorama->loaded() && $panorama->checked) {
$swfUrl = url::file("modules/panorama/lib/pan0.swf");
$panoramaHFOV = $panorama->HFOV;
$panoramaVFOV = $panorama->VFOV;
$img_url = $this->file_url();
return "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"\n codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\"\n width=\"640\" height=\"480\" title=\"FSPP Panorama Viewer\">\n <param name=\"allowFullScreen\" value=\"true\" />\n <param name=\"movie\" value=\"{$swfUrl}?panoSrc={$img_url}&FOV=40&minFOV=20&maxFOV=40&panHFOV={$panoramaHFOV}&panVFOV={$panorama->VFOV}\" />\n <param name=\"quality\" value=\"high\" />\n <param name=\"BGCOLOR\" value=\"#AAAAAA\" />\n <param name=\"wmode\" value=\"transparent\" />\n <embed src=\"{$swfUrl}?panoSrc={$img_url}&FOV=40&minFOV=20&maxFOV=40&panHFOV={$panoramaHFOV}&panVFOV={$panoramaVFOV}\"\n allowFullScreen=\"true\"\n width=\"640\" height=\"480\" quality=\"high\"\n wmode=\"transparent\"\n pluginspage=\"http://www.macromedia.com/go/getflashplayer\"\n type=\"application/x-shockwave-flash\" bgcolor=\"#DDDDDD\">\n </embed>\n </object>";
} else {
return parent::resize_img($extra_attrs);
}
}
示例5: admin_head
static function admin_head($theme)
{
$head = array();
if (strpos(Router::$current_uri, "admin/server_add") !== false) {
$head[] = "<link media=\"screen, projection\" rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("lib/jquery.autocomplete.css") . "\" />";
$base = url::site("__ARGS__");
$csrf = access::csrf_token();
$head[] = "<script> var base_url = \"{$base}\"; var csrf = \"{$csrf}\";</script>";
$head[] = html::script("lib/jquery.autocomplete.js");
$head[] = html::script("modules/server_add/js/admin.js");
}
return implode("\n", $head);
}
示例6: _get_admin_form
private function _get_admin_form()
{
if ($showunderphoto = module::get_var("ratings", "showunderphoto")) {
$showunderphoto = 1;
}
if ($showinsidebar = module::get_var("ratings", "showinsidebar")) {
$showinsidebar = 1;
}
if (!($fillcolor = module::get_var("ratings", "fillcolor"))) {
$fillcolor = "#FF0000";
}
if (!($votedcolor = module::get_var("ratings", "votedcolor"))) {
$votedcolor = "#0069FF";
}
if (!($hovercolor = module::get_var("ratings", "hovercolor"))) {
$hovercolor = "#FFA800";
}
if (!($castyourvotestring = module::get_var("ratings", "castyourvotestring"))) {
$castyourvotestring = "Click on a heart to cast your vote:";
}
$iconsets[url::file("modules/ratings/vendor/img/") . "hearts.png"] = 1;
$iconsets[url::file("modules/ratings/vendor/img/") . "filmstrip.png"] = 2;
$iconsets[url::file("modules/ratings/vendor/img/") . "stars.png"] = 3;
$iconsets[url::file("modules/ratings/vendor/img/") . "camera.png"] = 4;
$regonlyvote[1] = "true";
$regonlyvote[0] = "false";
// Make a new Form.
$form = new Forge("admin/ratings/saveprefs", "", "post", array("id" => "g-ratings-api-adminForm"));
// Set up some text boxes for the site owners Name, email and the
// text for the contact link.
$ratings_form = $form->group("RatingsBlockSettings");
$ratings_form->dropdown("regonly")->label(t("Allow only registered users to vote"))->options($regonlyvote)->selected(module::get_var("ratings", "regonly"));
$ratings_form->dropdown("iconset")->label(t("Choose an Icon Set"))->options($iconsets)->selected(module::get_var("ratings", "iconset"));
# $ratings_form->input("bgcolor")
# ->label(t("Background Color (behind icon set) [-- not yet working --]"))
# ->class("js_color {hash:true}")
# ->value(module::get_var("ratings","bgcolor"));
$ratings_form->input("fillcolor")->label(t("Fill Color"))->class("js_color {hash:true}")->value(module::get_var("ratings", "fillcolor"));
$ratings_form->input("hovercolor")->label(t("Hover Fill Color"))->class("js_color {hash:true}")->value(module::get_var("ratings", "hovercolor"));
$ratings_form->input("votedcolor")->label(t("Once Voted Fill Color"))->class("js_color {hash:true}")->value(module::get_var("ratings", "votedcolor"));
$ratings_form->checkbox("showunderphoto")->label(t("Show block under photo"))->class("g-unique g-button-text")->checked($showunderphoto);
$ratings_form->checkbox("showinsidebar")->label(t("Show block in the sidebar"))->class("g-unique g-button-text")->checked($showinsidebar);
$ratings_form->input("imageword")->label(t("Word to descibe the rating icon (IE: heart or star or filmstrip)"))->class("g-button-text")->value(module::get_var("ratings", "imageword"));
$ratings_form->input("votestring")->label(t("Word for 'vote'"))->class("g-button-text")->value(module::get_var("ratings", "votestring"));
$ratings_form->input("castyourvotestring")->label(t("Wording for 'Click on a heart to cast your vote:'"))->class("g-button-text")->value(module::get_var("ratings", "castyourvotestring"));
$ratings_form->input("textcolor")->label(t("Text Color"))->class("js_color {hash:true}")->value(module::get_var("ratings", "textcolor"));
// Add a save button to the form.
$form->submit("SaveSettings")->value(t("Save"));
// Return the newly generated form.
return $form;
}
示例7: admin_head
static function admin_head($theme)
{
$session = Session::instance();
$buf = "";
if ($session->get("debug")) {
$buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("modules/gallery/css/debug.css") . "\" />";
}
if ($session->get("l10n_mode", false)) {
$buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("modules/gallery/css/l10n_client.css") . "\" />";
$buf .= html::script("lib/jquery.cookie.js");
$buf .= html::script("modules/gallery/js/l10n_client.js");
}
return $buf;
}
示例8: index
public function index()
{
$name = module::get_var("watermark", "name");
$view = new Admin_View("admin.html");
$view->content = new View("admin_watermarks.html");
if ($name) {
$view->content->name = module::get_var("watermark", "name");
$view->content->url = url::file("var/modules/watermark/{$name}");
$view->content->width = module::get_var("watermark", "width");
$view->content->height = module::get_var("watermark", "height");
$view->content->position = module::get_var("watermark", "position");
}
print $view;
}
示例9: thumb_bottom
static function thumb_bottom($theme, $child)
{
if ($child->type == "movie") {
$view = new View("movie_thumb_bottom.html");
// pass some variable to the view
$view->url = $child->url();
$view->top = round($child->thumb_height / 2 - 20);
$view->texttime_top = round($child->thumb_height - 25);
// position the movie duration from the top as some themes add stuff below the thumb
$view->left = round($child->thumb_width / 2 - 20);
$view->images_url = url::file("modules/movie_overlay/images");
$view->icon = module::get_var("movie_overlay", "icon");
$view->trans = module::get_var("movie_overlay", "trans");
$view->movie_time = number_format(movie_overlay_theme_Core::get_movie_time($child), 2);
return $view;
}
}
示例10: t
?>
</title>
<link rel="stylesheet" type="text/css" href="<?php
echo url::file("modules/gallery/css/upgrader.css");
?>
"
media="screen,print,projection" />
<script src="<?php
echo url::file("lib/jquery.js");
?>
" type="text/javascript"></script>
</head>
<body>
<div id="outer">
<img src="<?php
echo url::file("modules/gallery/images/gallery.png");
?>
" />
<div id="inner">
<? if ($can_upgrade): ?>
<? if ($done): ?>
<div id="confirmation">
<a onclick="$('#confirmation').slideUp(); return false;" href="#" class="close">[x]</a>
<div>
<h1> <?php
echo t("That's it!");
?>
</h1>
<p>
<?php
echo t("Your <a href=\"%url\">Gallery</a> is up to date.", array("url" => url::site("albums/1")));
示例11: url
}
.rabidRating .ratingActive {
background-color: <?php
echo module::get_var("ratings", "hovercolor");
?>
;
}
.rabidRating .ratingText {
color: <?php
echo module::get_var("ratings", "textcolor");
?>
;
}
.rabidRating .ratingText.loading {
background: url('<?php
echo url::file("modules/ratings/vendor/img/ajax-loading.gif");
?>
') no-repeat;
text-indent: -999em;
}
</style>
<?php
require_once MODPATH . "ratings/vendor/ratings.php";
$rr = new RabidRatings();
?>
<script type="text/javascript">
<?php
include_once MODPATH . "ratings/js/ratings.js";
?>
示例12: defined
<?php
defined("SYSPATH") or die("No direct script access.");
?>
<script type="text/javascript">
$("document").ready(function() {
$("#g-tag").gallery_tag_cloud({
movie: "<?php
echo url::file("modules/tag_cloud/lib/tagcloud.swf");
?>
"
<?php
foreach ($options as $option => $value) {
?>
, <?php
echo $option;
?>
: "<?php
echo $value;
?>
"
<?php
}
?>
});
});
</script>
<div id="g-tag-cloud" ref="<?php
echo url::site("tags");
?>
">
示例13: defined
<?php
defined("SYSPATH") or die("No direct script access.");
?>
<link rel="stylesheet" type="text/css" href="<?php
echo url::file("modules/organize/css/organize_dialog.css");
?>
" />
<script type="text/javascript">
var ORGANIZE_TITLE =
<?php
echo t("Organize :: %album_title", array("album_title" => "__TITLE__"))->for_js();
?>
;
var done_organizing = function(album_id) {
$("#g-dialog").dialog("close");
window.location = '<?php
echo url::site("items/__ID__");
?>
'.replace("__ID__", album_id);
}
var set_title = function(title) {
$("#g-dialog").dialog("option", "title", ORGANIZE_TITLE.replace("__TITLE__", title));
}
set_title("<?php
echo $album->title;
?>
");
var done_loading = function() {
示例14: t
?>
<?php
} else {
?>
<a id="g-logo" class="g-left" href="<?php
echo item::root()->url();
?>
" title="<?php
echo t("go back to the Gallery home")->for_html_attr();
?>
">
<img width="107" height="48" alt="<?php
echo t("Gallery logo: Your photos on your web site")->for_html_attr();
?>
" src="<?php
echo url::file("lib/images/logo.png");
?>
" />
</a>
<?php
}
?>
<?php
echo $theme->user_menu();
?>
<?php
echo $theme->header_top();
?>
<!-- hide the menu until after the page has loaded, to minimize menu flicker -->
<div id="g-site-menu" style="visibility: hidden">
示例15: __call
public function __call($function, $args)
{
// request_uri: gallery3/var/trunk/albums/foo/bar.jpg
$request_uri = rawurldecode(Input::instance()->server("REQUEST_URI"));
$request_uri = preg_replace("/\\?.*/", "", $request_uri);
// var_uri: gallery3/var/
$var_uri = url::file("var/");
// Make sure that the request is for a file inside var
$offset = strpos(rawurldecode($request_uri), $var_uri);
if ($offset !== 0) {
throw new Kohana_404_Exception();
}
$file_uri = substr($request_uri, strlen($var_uri));
// Make sure that we don't leave the var dir
if (strpos($file_uri, "..") !== false) {
throw new Kohana_404_Exception();
}
list($type, $path) = explode("/", $file_uri, 2);
if ($type != "resizes" && $type != "albums" && $type != "thumbs") {
throw new Kohana_404_Exception();
}
// If the last element is .album.jpg, pop that off since it's not a real item
$path = preg_replace("|/.album.jpg\$|", "", $path);
$encoded_path = array();
foreach (explode("/", $path) as $path_part) {
$encoded_path[] = rawurlencode($path_part);
}
// We now have the relative path to the item. Search for it in the path cache
// The patch cache is urlencoded so re-encode the path. (it was decoded earlier to
// insure that the paths are normalized.
$item = ORM::factory("item")->where("relative_path_cache", "=", implode("/", $encoded_path))->find();
if (!$item->loaded()) {
// We didn't turn it up. It's possible that the relative_path_cache is out of date here.
// There was fallback code, but bharat deleted it in 8f1bca74. If it turns out to be
// necessary, it's easily resurrected.
// If we're looking for a .jpg then it's it's possible that we're requesting the thumbnail
// for a movie. In that case, the .flv or .mp4 file would have been converted to a .jpg.
// So try some alternate types:
if (preg_match('/.jpg$/', $path)) {
foreach (array("flv", "mp4") as $ext) {
$movie_path = preg_replace('/.jpg$/', ".{$ext}", $path);
$item = ORM::factory("item")->where("relative_path_cache", "=", $movie_path)->find();
if ($item->loaded()) {
break;
}
}
}
}
if (!$item->loaded()) {
throw new Kohana_404_Exception();
}
// Make sure we have access to the item
if (!access::can("view", $item)) {
throw new Kohana_404_Exception();
}
// Make sure we have view_full access to the original
if ($type == "albums" && !access::can("view_full", $item)) {
throw new Kohana_404_Exception();
}
// Don't try to load a directory
if ($type == "albums" && $item->is_album()) {
throw new Kohana_404_Exception();
}
if ($type == "albums") {
$file = $item->file_path();
} else {
if ($type == "resizes") {
$file = $item->resize_path();
} else {
$file = $item->thumb_path();
}
}
if (!file_exists($file)) {
throw new Kohana_404_Exception();
}
header("Pragma:");
// Check that the content hasn't expired or it wasn't changed since cached
expires::check(2592000, $item->updated);
// We don't need to save the session for this request
Session::abort_save();
expires::set(2592000, $item->updated);
// 30 days
// Dump out the image. If the item is a movie, then its thumbnail will be a JPG.
if ($item->is_movie() && $type != "albums") {
header("Content-type: image/jpeg");
} else {
header("Content-Type: {$item->mime_type}");
}
Kohana::close_buffers(false);
$fd = fopen($file, "rb");
fpassthru($fd);
fclose($fd);
}