本文整理汇总了PHP中HTMLTags_URL类的典型用法代码示例。如果您正苦于以下问题:PHP HTMLTags_URL类的具体用法?PHP HTMLTags_URL怎么用?PHP HTMLTags_URL使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HTMLTags_URL类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_html_url_in_public_images
public function get_html_url_in_public_images()
{
$image_row = $this->get_element();
$html_url = new HTMLTags_URL();
$html_url->set_file('/hc-database-img-cache/' . $image_row->get_id() . '.' . $image_row->get_file_extension());
return $html_url;
}
示例2: get_rss_titles_ul
public function get_rss_titles_ul(RSS_RSS $rss, $limit = 10)
{
// print_r($rss->get_xml());exit;
$items = $rss->get_items();
$tempCounter = 0;
$ul = new HTMLTags_UL();
$ul->set_attribute_str('class', 'rss');
foreach ($items as $item) {
# DISPLAY ONLY 10 ITEMS.
if ($tempCounter < $limit + 1) {
$li = new HTMLTags_LI();
if ($tempCounter % 2 == 0) {
$li->set_attribute_str('class', 'odd');
}
$a = new HTMLTags_A();
$url = new HTMLTags_URL();
$url->set_file($item->get_url_filename());
$a->set_href($url);
$a->append($item->get_title());
$li->append($a);
$ul->append($li);
}
$tempCounter += 1;
}
return $ul;
}
示例3: get_frame_png_thumbnail_img
public static function get_frame_png_thumbnail_img(Oedipus_Frame $frame, $max_width = 250, $max_height = 185)
{
$url = new HTMLTags_URL();
$url->set_file('/frames/images/thumbnails/frame-' . $frame->get_id() . '_' . $max_width . 'x' . $max_height . '.png');
$img = new HTMLTags_IMG();
$img->set_src($url);
$img->set_alt($frame->get_name());
return $img;
}
示例4: get_admin_section_home_page_href
public function get_admin_section_home_page_href()
{
$admin_section_home_page_href = new HTMLTags_URL();
$admin_section_home_page_href_str = '/admin/hpi/';
$admin_section_home_page_href_str .= $this->get_identifying_name();
$admin_section_home_page_href_str .= '/home.html';
$admin_section_home_page_href->set_file($admin_section_home_page_href_str);
return $admin_section_home_page_href;
}
开发者ID:saulhoward,项目名称:haddock-cms,代码行数:9,代码来源:HaddockProjectOrganisation_PlugInModuleDirectory.inc.php
示例5: get_home_page_url
public static function get_home_page_url()
{
$url = new HTMLTags_URL();
$url->set_file('/');
return $url;
// return self
// ::get_oo_page_url(
// '/'
// );
}
示例6: get_oedipus_png_frame
private function get_oedipus_png_frame(Oedipus_Frame $frame)
{
$max_width = 100;
$max_height = 100;
$url = new HTMLTags_URL();
$url->set_file('/frames/images/thumbnails/option-frame-' . $frame->get_id() . '_' . $max_width . 'x' . $max_height . '.png');
$img = new HTMLTags_IMG();
$img->set_src($url);
return $img;
}
示例7: get_image_img
public function get_image_img()
{
$img = new HTMLTags_IMG();
$url = new HTMLTags_URL();
$url->set_file($this->image_url);
$img->set_src($url);
$img->set_attribute_str('alt', $this->get_name());
$img->set_attribute_str('title', $this->get_description());
return $img;
}
示例8: get_spans
public static function get_spans($str_to_split, $num_displayed_char)
{
$spans = array();
$str_to_split_shortened = '';
# Shorten the string if it needs it
$max_length = $num_displayed_char;
if (strlen($str_to_split) > $max_length) {
# $str_to_split_shortened = substr($str_to_split, 0, $max_length);
# $pos = strrpos($str_to_split, " ");
#
# if($pos === false) {
# $str_to_split_shortened = substr($str_to_split, 0, $max_length)."...";
#
# }
#
#$str_to_split_shortened = substr($str_to_split, 0, $pos)."...";
$str_to_split_shortened = substr($str_to_split, 0, $max_length);
$truncated_span = new HTMLTags_Span();
$truncated_span->set_attribute_str('class', 'truncated');
$truncated_span->append_str_to_content($str_to_split_shortened);
$truncated_span->append_str_to_content(' ');
$truncated_span_show_link = new HTMLTags_A('More...');
#$truncated_span_show_link->set_attribute_str('onclick', 'javascript: showInline(');
$truncated_span_show_link->set_attribute_str('class', 'show');
$truncated_span_show_link->set_attribute_str('title', 'Show the rest of this text');
$truncated_span_show_location = new HTMLTags_URL();
$truncated_span_show_location->set_file('#');
$truncated_span_show_link->set_href($truncated_span_show_location);
$truncated_span->append_tag_to_content($truncated_span_show_link);
array_push($spans, $truncated_span);
$full_span = new HTMLTags_Span();
$full_span->set_attribute_str('class', 'full');
$full_span->append_str_to_content($str_to_split);
$full_span->append_str_to_content(' ');
$full_span_hide_link = new HTMLTags_A('...Hide');
$full_span_hide_link->set_attribute_str('class', 'hide');
$full_span_hide_link->set_attribute_str('title', 'hide the rest of this text');
$full_span_hide_location = new HTMLTags_URL();
$full_span_hide_location->set_file('#');
$full_span_hide_link->set_href($full_span_hide_location);
$full_span->append_tag_to_content($full_span_hide_link);
array_push($spans, $full_span);
} else {
$full_span = new HTMLTags_Span();
$full_span->append_str_to_content($str_to_split);
array_push($spans, $full_span);
}
return $spans;
}
示例9: get_url
/**
* Just because I was getting bored of typing out this minchia all the time...
*
* No error checking at this point, is it necessary or desirable?
*
* If the section is 'project-specific', the module should be set to NULL.
*/
public static function get_url($section, $module, $page, $type)
{
$url = new HTMLTags_URL();
$url->set_file('/');
$url->set_get_variable('section', 'haddock');
$url->set_get_variable('module', 'admin');
$url->set_get_variable('page', 'admin-includer');
$url->set_get_variable('type', $type);
$url->set_get_variable('admin-section', $section);
if (isset($module)) {
$url->set_get_variable('admin-module', $module);
}
$url->set_get_variable('admin-page', $page);
return $url;
}
示例10: get_base_url
public static function get_base_url()
{
$url = new HTMLTags_URL();
#$ph_cm = Configuration_ConfigManagerHelper
# ::get_config_manager(
# 'haddock',
# 'public-html'
# );
#if ($ph_cm->server_has_mod_rewrite()) {
if (PublicHTML_ServerCapabilitiesHelper::has_mod_rewrite()) {
$url->set_file('/');
} else {
$url->set_file('/haddock/public-html/public-html/index.php');
}
return $url;
}
示例11: get_body_div_header
public function get_body_div_header()
{
/*
* Create the HTML tags objects.
*/
$div_header = new HTMLTags_Div();
$div_header->set_attribute_str('id', 'header');
/*
* Project Logo IMG,
* for filename look in config,
* default should be some haddock fish
*/
$image_div = new HTMLTags_Div();
$image_div->set_attribute_str('id', 'logo_image');
$logo_img = new HTMLTags_IMG();
$logo_src_url = new HTMLTags_URL();
$cmf = HaddockProjectOrganisation_ConfigManagerFactory::get_instance();
/*
* The admin module has been moved to the plug-ins directory.
*
* RFI 2009-10-08
*/
#$config_manager = $cmf->get_config_manager('haddock', 'admin');
$config_manager = $cmf->get_config_manager('plug-ins', 'admin');
$logo_config_filename = $config_manager->get_logo_image_filename();
$logo_src_url->set_file($logo_config_filename);
$logo_img->set_src($logo_src_url);
$image_div->append($logo_img);
$div_header->append($image_div);
/*
* There are two headers:
* Project Title Link (H1)
* and Page Title (H2)
*/
$h1_title = new HTMLTags_Heading(1);
$h1_title->append_str_to_content($this->get_body_div_header_project_heading_content());
$div_header->append_tag_to_content($h1_title);
$h2_title = new HTMLTags_Heading(2);
$h2_title->append_str_to_content($this->get_body_div_header_heading_content());
$div_header->append_tag_to_content($h2_title);
$div_header->append($this->get_log_in_state_div());
$div_header->append($this->get_admin_header_navigation_link_div());
return $div_header;
}
示例12: do_actions
protected function do_actions()
{
if (isset($_GET['action'])) {
/*
* The action name.
*/
$an = $_GET['action'];
$amm = $this->get_action_method_map();
/*
* The acton method name.
*/
if (isset($amm[$an])) {
$amn = $amm[$an];
} else {
throw new Exception("Unknown action '{$an}'!");
}
/*
* Do it.
*/
try {
ObjectOrientation_NamedMethodCaller::call_method_by_name($this, $amn);
/*
* Is this actually necessary?
*
* They will all get set again when the user is taken
* back to the page.
*
* Does no harm and the user might be returning to a page
* other than the standard crud.
*/
if (isset($_SESSION['select-vars'])) {
unset($_SESSION['select-vars']);
}
#} catch (ReflectionException $e) {
# echo $e->getMessage();
# exit;
} catch (Database_CRUDException $e) {
/*
* If there was a problem changing the database,
* go back to whence we came.
*
* Hope that the session vars have been set for
* any forms.
*
* Also hope that the browser isn't playing silly buggars with
* the HTTP_REFERER field.
*/
$return_to = HTMLTags_URL::parse_and_make_url($_SERVER['HTTP_REFERER']);
$return_to->set_get_variable('error', urlencode($e->getMessage()));
#print_r($return_to); exit;
$this->set_return_to($return_to->get_as_string());
}
} else {
throw new Exception('No action set for Database_CRUDAdminRedirectScript!');
}
}
示例13: redirect_to_url
public static function redirect_to_url(HTMLTags_URL $url)
{
#throw new Exception('Testing exception handling');
#print_r($url);
$url_as_string = $url->get_as_string();
#echo "\$url_as_string: $url_as_string\n";
#
#exit;
#/*
# * See http://uk.php.net/manual/en/function.header.php#73583
# */
#header('Pragma: private');
#header('Cache-control: private, must-revalidate');
$header_directive = 'Location: ' . $url_as_string;
#echo "\$header_directive: $header_directive\n";
#exit;
header($header_directive);
exit;
}
示例14: get_db_page_url
public static function get_db_page_url($page_name)
{
#$ph_cm = Configuration_ConfigManagerHelper
# ::get_config_manager(
# 'haddock',
# 'public-html'
# );
#
#if ($ph_cm->server_has_mod_rewrite()) {
if (PublicHTML_ServerCapabilitiesHelper::has_mod_rewrite()) {
#echo "has mod_rewrite!\n";
$url = new HTMLTags_URL();
$url->set_file("/db-pages/{$page_name}.html");
} else {
$url = PublicHTML_URLHelper::get_base_url();
$url->set_get_variable('oo-page');
$url->set_get_variable('pcro-factory', 'DBPages_PCROFactory');
$url->set_get_variable('page', $page_name);
}
return $url;
}
示例15: make_local_url
/**
* Makes a local URL.
*
* Assumes that you want an OO page.
*/
public static function make_local_url($page_class, $get_variables = NULL)
{
$url = new HTMLTags_URL();
#if (isset($get_variables)) {
# $url->set_file('/');
#
# $url->set_get_variable('oo-page');
# $url->set_get_variable('page-class', $page_class);
#
# foreach ($get_variables as $k => $v) {
# $url->set_get_variable($k, $v);
# }
#} else {
# $url->set_file("/$page_class");
#}
$url->set_file('/');
$url->set_get_variable('oo-page');
$url->set_get_variable('page-class', $page_class);
if (isset($get_variables)) {
foreach ($get_variables as $k => $v) {
$url->set_get_variable($k, $v);
}
}
return $url;
}