芝麻web文件管理V1.00
编辑当前文件:/www/wwwroot/fashionmodelquicktrack.com/wp-content/plugins/fixed-toc/frontend/html/class-dom.php
obj_element = $obj_element; $this->tagname = $this->obj_element->get_tagname(); $this->content = $this->obj_element->get_content(); $this->attrs = $this->obj_element->get_attrs(); if ( $created ) { $this->create_html(); } } /** * Create html code. * * @since 3.0.0 * @access public * * @return void. */ public function create_html() { if ( empty( $this->tagname ) ) { $this->html = ''; return; } $str_attrs = ''; if ( $this->attrs ) { foreach ( $this->attrs as $key => $value ) { $key = trim( $key ); $value = trim( $value ); if ( empty( $key ) || empty( $value ) ) { continue; } $str_attrs .= ' ' . $key . '="' . esc_attr( $value ) . '"'; } $str_attrs = rtrim( $str_attrs ); } $this->html = '<' . $this->tagname . $str_attrs . '>' . $this->content . '' . $this->tagname . '>'; } /** * Prepend to $this->content. * * @since 3.0.0 * @access public * * @param string $prepend Extra content prepend to the content. * * @return void. */ public function prepend_content( $prepend ) { $this->content = $prepend . $this->content; } /** * Append to $this->content. * * @since 3.0.0 * @access public * * @param string $append Extra content append to the content. * * @return void. */ public function append_content( $append ) { $this->content .= $append; } /** * Insert extra class property value. * * @since 3.0.0 * @access public * * @param string $cls Extra value append to the class * * @return void. */ public function insert_class_attr( $cls ) { if ( isset( $this->attrs['class'] ) ) { $this->attrs['class'] .= ' ' . $cls; } else { $this->attrs['class'] = $cls; } } /** * Get html code. * * @since 3.0.0 * @access private * * @return string. */ public function get_html() { return $this->html; } }