本文整理汇总了PHP中HTMLTags_A::set_attribute_str方法的典型用法代码示例。如果您正苦于以下问题:PHP HTMLTags_A::set_attribute_str方法的具体用法?PHP HTMLTags_A::set_attribute_str怎么用?PHP HTMLTags_A::set_attribute_str使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLTags_A
的用法示例。
在下文中一共展示了HTMLTags_A::set_attribute_str方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_mini_orders_for_current_session_div
public function get_mini_orders_for_current_session_div()
{
$mini_order_div = new HTMLTags_Div();
$top_right_p = new HTMLTags_P('Shopping Basket');
$top_right_p->set_attribute_str('class', 'top-right');
$mini_order_div->append_tag_to_content($top_right_p);
$mini_order_table = $this->get_mini_orders_for_current_session_table();
$middle_right_div = new HTMLTags_Div();
$middle_right_div->set_attribute_str('class', 'middle-right');
$middle_right_div->append_tag_to_content($mini_order_table);
$mini_order_div->append_tag_to_content($middle_right_div);
$bottom_left_div = new HTMLTags_Div();
$bottom_left_div->set_attribute_str('class', 'bottom-left');
$bottom_right_p = new HTMLTags_P();
$bottom_right_p->set_attribute_str('class', 'bottom-right');
$go_to_basket_link = new HTMLTags_A();
$go_to_basket_link->set_attribute_str('class', 'add-to-basket-link');
$go_to_basket_link->set_attribute_str('id', 'add-to-basket-link');
$go_to_basket_location = new HTMLTags_URL();
$go_to_basket_location->set_file('/shopping-basket.html');
$go_to_basket_link->set_href($go_to_basket_location);
$go_to_basket_link->append_tag_to_content(new HTMLTags_Span('Go to Basket'));
$bottom_right_p->append_tag_to_content($go_to_basket_link);
$bottom_left_div->append_tag_to_content($bottom_right_p);
$mini_order_div->append_tag_to_content($bottom_left_div);
return $mini_order_div;
}
示例2: __construct
public function __construct($message, $no_script_href = '', $status = NULL)
{
#echo "\$message: $message\n";
#echo "\$no_script_href: $no_script_href\n";
parent::__construct();
$this->set_attribute_str('id', 'lastActionBox');
#if (strlen($no_script_href) > 0) {
# $this->set_attribute_str('class', 'noscript');
#}
if ($status == 'error') {
$this->set_attribute_str('class', 'error');
}
$p = new HTMLTags_P();
$hide_a = new HTMLTags_A('Hide');
$hide_a->set_attribute_str('id', 'lastActionBoxA');
$hide_a->set_href(new HTMLTags_URL($no_script_href));
#if (strlen($no_script_href) < 1) {
# $hide_a->set_href(new HTMLTags_URL('#'));
#} else {
# $hide_a->set_href(new HTMLTags_URL($no_script_href));
#}
$hide_a->set_attribute_str('id', 'lastActionBoxHide');
$hide_a->set_attribute_str('title', 'Hide this notice');
$p->append_tag_to_content($hide_a);
$p->append_str_to_content($message);
$this->append_tag_to_content($p);
}
示例3: get_tag_cloud_div
public function get_tag_cloud_div($current_url, $javascript = FALSE)
{
$tags_table = $this->get_element();
#$database = $productgraph_row->get_database();
#$tags_table = $database->get_table('hpi_shop_product_tags');
#$productgraph_row = $productgraphs_table->get_row_by_id($_GET['productgraph_id']);
#$database = $productgraph_row->get_database();
$tag_cloud_div = new HTMLTags_Div();
$tag_cloud_div->set_attribute_str('id', 'tag_cloud_div');
$tag_cloud_heading = new HTMLTags_Heading(3);
$tag_cloud_heading->append_str_to_content('All Tags');
$tag_cloud_div->append_tag_to_content($tag_cloud_heading);
$tag_cloud_list = new HTMLTags_OL();
$tags = $tags_table->get_tags_with_counts('hpi_shop_product_tags.tag', 'ASC');
foreach ($tags as $tag) {
$tag_cloud_line = new HTMLTags_LI();
$tag_cloud_href = clone $current_url;
$tag_cloud_href->set_get_variable('tag_id', $tag->get_id());
$tag_cloud_link = new HTMLTags_A();
$tag_cloud_link->set_href($tag_cloud_href);
$tag_cloud_link->set_attribute_str('id', $tag->get_id());
if ($javascript) {
$onclick = 'javascript:return tagsOnClick(this);';
$tag_cloud_link->set_attribute_str('onclick', $onclick);
}
#tag_cloud_link->set_attribute_str('id', 'productgraph_page_link');
#echo $tag->get_product_count();
/*
* RFI 2007-03-27
*
* Is this the right way around?
*
* Aren't tags with a lower product count less popular?
*/
#if ($tag->get_product_count() > 3) {
# $tag_cloud_link->set_attribute_str('class', 'not-very-popular');
#}
$popularity_css_class = $tag->get_popularity_css_class();
#echo "\$popularity_css_class: $popularity_css_class\n\n";
$tag_cloud_link->set_attribute_str('class', $popularity_css_class);
$tag_cloud_link->set_attribute_str('rel', 'tag');
$tag_product_count = $tag->get_product_count();
if ($tag_product_count == 1) {
$tag_product_count_span_text = $tag_product_count . ' product is tagged with ';
} else {
$tag_product_count_span_text = $tag_product_count . ' products are tagged with ';
}
$tag_cloud_link_span = new HTMLTags_Span($tag_product_count_span_text);
$tag_cloud_link->append_tag_to_content($tag_cloud_link_span);
$tag_cloud_link->append_str_to_content($tag->get_tag());
$tag_cloud_line->append_tag_to_content($tag_cloud_link);
$tag_cloud_list->append_tag_to_content($tag_cloud_line);
}
$tag_cloud_div->append_tag_to_content($tag_cloud_list);
return $tag_cloud_div;
}
示例4: get_add_act_li
protected function get_add_act_li()
{
$li = new HTMLTags_LI();
$a = new HTMLTags_A('Add Act');
$a->set_attribute_str('id', 'add');
$a->set_attribute_str('title', 'Add an Act');
$a->set_href(Oedipus_DramaHelper::get_add_act_url($this->drama->get_id()));
$li->append($a);
return $li;
}
示例5: get_link_a_with_span
public static function get_link_a_with_span($node)
{
$span = new HTMLTags_Span();
$span->append($node['url_title']);
$a = new HTMLTags_A();
$a->append($span);
$a->set_href(HTMLTags_URL::parse_and_make_url($node['url_href']));
$a->set_attribute_str('title', $node['url_title']);
if ($node['open_in_new_window'] == 'Yes') {
#echo ' target="_blank" ';
$a->set_attribute_str('target', '_blank');
}
return $a;
}
示例6: 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;
}
示例7: get_link_a_to_admin_section
private static function get_link_a_to_admin_section($link_text, HTMLTags_URL $href)
{
$a = new HTMLTags_A($link_text);
$a->set_href($href);
$a->set_attribute_str('target', '_blank');
return $a;
}
示例8: get_admin_currencies_html_table_tr
public function get_admin_currencies_html_table_tr($current_page_url)
{
$html_row = new HTMLTags_TR();
$row = $this->get_element();
$table = $row->get_table();
/*
* The data.
*/
$name_field = $table->get_field('name');
$name_td = $this->get_data_html_table_td($name_field);
$html_row->append_tag_to_content($name_td);
$iso_4217_code_field = $table->get_field('iso_4217_code');
$iso_4217_code_td = $this->get_data_html_table_td($iso_4217_code_field);
$html_row->append_tag_to_content($iso_4217_code_td);
$symbol_field = $table->get_field('symbol');
$symbol_td = $this->get_data_html_table_td($symbol_field);
$html_row->append_tag_to_content($symbol_td);
/*
* The edit td.
*/
$edit_td = new HTMLTags_TD();
$edit_link = new HTMLTags_A('Edit');
$edit_link->set_attribute_str('class', 'cool_button');
$edit_link->set_attribute_str('id', 'edit_table_button');
$edit_location = clone $current_page_url;
$edit_location->set_get_variable('edit_id', $row->get_id());
$edit_link->set_href($edit_location);
$edit_td->append_tag_to_content($edit_link);
$html_row->append_tag_to_content($edit_td);
/*
* The delete td.
*/
$delete_td = new HTMLTags_TD();
$delete_link = new HTMLTags_A('Delete');
$delete_link->set_attribute_str('class', 'cool_button');
$delete_link->set_attribute_str('id', 'delete_table_button');
$delete_location = clone $current_page_url;
$delete_location->set_get_variable('delete_id', $row->get_id());
$delete_link->set_href($delete_location);
$delete_td->append_tag_to_content($delete_link);
$html_row->append_tag_to_content($delete_td);
return $html_row;
}
示例9: get_link_to_edit_video_admin_page_div
public static function get_link_to_edit_video_admin_page_div($video_id)
{
$div = new HTMLTags_Div();
$div->set_attribute_str('class', 'admin');
$a = new HTMLTags_A('Edit this Video');
$a->set_attribute_str('class', 'edit');
$a->set_href(VideoLibrary_URLHelper::get_edit_external_video_admin_page_url($video_id));
$div->append($a);
return $div;
}
示例10: get_frame_png_thumbnail_img_a
public static function get_frame_png_thumbnail_img_a(Oedipus_Frame $frame, $max_width = 250, $max_height = 185)
{
$url = Oedipus_DramaHelper::get_drama_page_url_for_frame_id($frame->get_id());
$a = new HTMLTags_A();
$a->set_href($url);
$a->set_attribute_str('title', 'View this Frame');
$img = self::get_frame_png_thumbnail_img($frame, $max_width, $max_height);
$a->append_tag_to_content($img);
return $a;
}
示例11: get_share_drama_li
private function get_share_drama_li()
{
$share_drama_url = $this->get_share_drama_url();
$link = new HTMLTags_A('Share this Drama');
$link->set_href($share_drama_url);
$link->set_attribute_str('id', 'selected');
$li = new HTMLTags_LI();
$li->append_tag_to_content($link);
$li->set_attribute_str('id', 'share-drama');
return $li;
}
示例12: get_shop_plug_in_action_td
private function get_shop_plug_in_action_td($location, $a_text, $a_id, $id_get_var_name)
{
$td = new HTMLTags_TD();
$row = $this->get_element();
$link = new HTMLTags_A($a_text);
$link->set_attribute_str('class', 'cool_button');
$link->set_attribute_str('id', $a_id);
// horrible bug fix where it seems to be passing the same location
// over and over again, with all previous get variables intact!
if ($location->is_get_variable_set('edit_id')) {
$location->unset_get_variable('edit_id');
}
if ($location->is_get_variable_set('delete_id')) {
$location->unset_get_variable('delete_id');
}
$location->set_get_variable($id_get_var_name, $row->get_id());
$link->set_href($location);
$td->append_tag_to_content($link);
return $td;
}
示例13: get_set_image_link_td
public function get_set_image_link_td()
{
$set_image_link_td = new HTMLTags_TD();
$product = $this->get_element();
$link = new HTMLTags_A('Set Image');
$link->set_attribute_str('class', 'cool_button');
$url = Admin_AdminIncluderURLFactory::get_url('plug-ins', 'trackit-stock-management', 'set-product-image', 'html');
$url->set_get_variable('product_id', $product->get_id());
$link->set_href($url);
$set_image_link_td->append_tag_to_content($link);
return $set_image_link_td;
}
示例14: get_admin_users_td
private function get_admin_users_td($a_text, $admin_page)
{
$user_row = $this->get_element();
$td = new HTMLTags_TD();
$confirm_url = Admin_AdminIncluderURLFactory::get_url('haddock', 'admin', $admin_page, 'html');
$confirm_url->set_get_variable('user_id', $user_row->get_id());
$a = new HTMLTags_A($a_text);
$a->set_href($confirm_url);
$a->set_attribute_str('class', 'cool_button');
$td->append_tag_to_content($a);
return $td;
}
示例15: get_thumbnail_div_for_video
public static function get_thumbnail_div_for_video($video_data, $options = array('admin' => FALSE))
{
$div = new HTMLTags_Div();
$div->set_attribute_str('class', 'video');
$url = VideoLibrary_URLHelper::get_video_page_url($video_data['id'], $video_data['name']);
$img_a = new HTMLTags_A();
$img_a->set_href($url);
$img_a->append(self::get_thumbnail_img($video_data['thumbnail_url']));
$details_ul = new HTMLTags_UL();
$details_ul->set_attribute_str('class', 'details');
$name_a = new HTMLTags_A();
$name_a->set_attribute_str('class', 'text');
$name_a->set_href($url);
$name_a->set_attribute_str('title', stripslashes($video_data['name']));
$name_a->append(self::truncate_video_name(stripslashes($video_data['name']), 50));
$name_li = new HTMLTags_LI();
$name_li->set_attribute_str('class', 'name');
$name_li->append($name_a);
$details_ul->append($name_li);
$length_min = self::get_minutes_from_seconds($video_data['length_seconds']);
$details_ul->append('<li class="length">' . $length_min . ' min</li>');
$details_ul->append('<li class="views">' . $video_data['views'] . ' views</li>');
$provider_img = self::get_img_for_external_provider_name($video_data['external_video_provider_name'], 16);
$provider_img->set_attribute_str('class', 'provider');
$div->append($img_a);
$div->append($details_ul);
$div->append($provider_img);
if ($options['admin'] && Admin_LogInHelper::is_logged_id()) {
$links_ul = new HTMLTags_UL();
$links_ul->set_attribute_str('class', 'options');
$edit_li = '<li>' . VideoLibrary_AdminHelper::get_link_to_edit_video_admin_page_div($video_data['id'])->get_as_string() . '</li>';
$links_ul->append($edit_li);
$div->append($links_ul);
$div->append('<hr />');
}
return $div;
}