本文整理汇总了PHP中Frame::get_id方法的典型用法代码示例。如果您正苦于以下问题:PHP Frame::get_id方法的具体用法?PHP Frame::get_id怎么用?PHP Frame::get_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Frame
的用法示例。
在下文中一共展示了Frame::get_id方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _build_tree_r
protected function _build_tree_r(DomNode $node)
{
$frame = new Frame($node);
$id = $frame->get_id();
$this->_registry[$id] = $frame;
if (!$node->hasChildNodes()) {
return $frame;
}
$children = array();
for ($i = 0; $i < $node->childNodes->length; $i++) {
$children[] = $node->childNodes->item($i);
}
foreach ($children as $child) {
$node_name = mb_strtolower($child->nodeName);
if (in_array($node_name, self::$_HIDDEN_TAGS)) {
if ($node_name !== "head" && $node_name !== "style") {
$child->parentNode->removeChild($child);
}
continue;
}
if ($node_name === "#text" && $child->nodeValue == "") {
$child->parentNode->removeChild($child);
continue;
}
if ($node_name === "img" && $child->getAttribute("src") == "") {
$child->parentNode->removeChild($child);
continue;
}
$frame->append_child($this->_build_tree_r($child), false);
}
return $frame;
}
开发者ID:EfncoPlugins,项目名称:web-portal-lite-client-portal-secure-file-sharing-private-messaging,代码行数:32,代码来源:frame_tree.cls.php
示例2:
function get_id()
{
return $this->_frame->get_id();
}
示例3: _build_tree_r
/**
* Recursively adds {@link Frame} objects to the tree
*
* Recursively build a tree of Frame objects based on a dom tree.
* No layout information is calculated at this time, although the
* tree may be adjusted (i.e. nodes and frames for generated content
* and images may be created).
*
* @param DomNode $node the current DomNode being considered
* @return Frame
*/
protected function _build_tree_r(DomNode $node)
{
$frame = new Frame($node);
$id = $frame->get_id();
$this->_registry[$id] = $frame;
if (!$node->hasChildNodes()) {
return $frame;
}
// Fixes 'cannot access undefined property for object with
// overloaded access', fix by Stefan radulian
// <stefan.radulian@symbion.at>
//foreach ($node->childNodes as $child) {
// Store the children in an array so that the tree can be modified
$children = array();
for ($i = 0; $i < $node->childNodes->length; $i++) {
$children[] = $node->childNodes->item($i);
}
foreach ($children as $child) {
$node_name = mb_strtolower($child->nodeName);
// Skip non-displaying nodes
if (in_array($node_name, self::$_HIDDEN_TAGS)) {
if ($node_name !== "head" && $node_name !== "style") {
$child->parentNode->removeChild($child);
}
continue;
}
// Skip empty text nodes
if ($node_name === "#text" && $child->nodeValue == "") {
$child->parentNode->removeChild($child);
continue;
}
// Skip empty image nodes
if ($node_name === "img" && $child->getAttribute("src") == "") {
$child->parentNode->removeChild($child);
continue;
}
$frame->append_child($this->_build_tree_r($child), false);
}
return $frame;
}
示例4: range
/**
* Update a row group after rows have been removed
*
* @param Frame $group The group to update
* @param Frame $last_row The last row in the row group
*/
function update_row_group(Frame $group, Frame $last_row)
{
$g_key = $group->get_id();
$r_key = $last_row->get_id();
$r_rows = $this->_frames[$r_key]["rows"];
$this->_frames[$g_key]["rows"] = range($this->_frames[$g_key]["rows"][0], end($r_rows));
}
示例5: _build_tree_r
/**
* Recursively adds {@link Frame} objects to the tree
*
* Recursively build a tree of Frame objects based on a dom tree.
* No layout information is calculated at this time, although the
* tree may be adjusted (i.e. nodes and frames for generated content
* and images may be created).
*
* @param DomNode $node the current DomNode being considered
* @return Frame
*/
protected function _build_tree_r(DomNode $node) {
$frame = new Frame($node);
$id = $frame->get_id();
$this->_registry[ $id ] = $frame;
if ( !$node->hasChildNodes() )
return $frame;
// Fixes 'cannot access undefined property for object with
// overloaded access', fix by Stefan radulian
// <stefan.radulian@symbion.at>
//foreach ($node->childNodes as $child) {
// Store the children in an array so that the tree can be modified
$children = array();
for ($i = 0; $i < $node->childNodes->length; $i++)
$children[] = $node->childNodes->item($i);
foreach ($children as $child) {
// Skip non-displaying nodes
if ( in_array( mb_strtolower($child->nodeName), self::$_HIDDEN_TAGS) ) {
if ( mb_strtolower($child->nodeName) != "head" &&
mb_strtolower($child->nodeName) != "style" )
$child->parentNode->removeChild($child);
continue;
}
// Skip empty text nodes
if ( $child->nodeName == "#text" && $child->nodeValue == "" ) {
$child->parentNode->removeChild($child);
continue;
}
// Add a container frame for images
if ( $child->nodeName == "img" ) {
$img_node = $child->ownerDocument->createElement("img_inner");
// Move attributes to inner node
foreach ( $child->attributes as $attr => $attr_node ) {
// Skip style, but move all other attributes
if ( $attr == "style" )
continue;
$img_node->setAttribute($attr, $attr_node->value);
}
foreach ( $child->attributes as $attr => $node ) {
if ( $attr == "style" )
continue;
$child->removeAttribute($attr);
}
$child->appendChild($img_node);
}
$frame->append_child($this->_build_tree_r($child), false);
}
return $frame;
}
示例6: foreach
/**
* Remove a row from the cellmap.
*
* @param Frame
*/
function remove_row(Frame $row)
{
// FIXME: handle row-groups
$key = $row->get_id();
if (!isset($this->_frames[$key])) {
return;
}
// Presumably this row has alredy been removed
$this->_row = $this->_num_rows--;
$rows = $this->_frames[$key]["rows"];
$columns = $this->_frames[$key]["columns"];
// Remove all frames from this row
foreach ($rows as $row) {
foreach ($columns as $col) {
$frame = $this->_cells[$row][$col];
unset($this->_frames[$frame->get_id()]);
unset($this->_cells[$row][$col]);
}
}
unset($this->_frames[$key]);
}
示例7: _build_tree_r
/**
* Recursively adds {@link Frame} objects to the tree
*
* Recursively build a tree of Frame objects based on a dom tree.
* No layout information is calculated at this time, although the
* tree may be adjusted (i.e. nodes and frames for generated content
* and images may be created).
*
* @param DOMNode $node the current DOMNode being considered
* @return Frame
*/
protected function _build_tree_r(DOMNode $node)
{
$node_name = mb_strtolower($node->nodeName);
switch ($node_name) {
// Let's dump inner svg elements into src attribute so the image renderer could take care of it
case 'svg':
/** @var DOMElement $node; */
if ($node->hasChildNodes()) {
$node->setAttribute('src', 'data:image/svg+xml,' . self::exportOuterXML($node));
}
$frame = new Frame($node);
$id = $frame->get_id();
$this->_registry[$id] = $frame;
return $frame;
default:
$frame = new Frame($node);
$id = $frame->get_id();
$this->_registry[$id] = $frame;
if (!$node->hasChildNodes()) {
return $frame;
}
// Fixes 'cannot access undefined property for object with
// overloaded access', fix by Stefan radulian
// <stefan.radulian@symbion.at>
//foreach ($node->childNodes as $child) {
// Store the children in an array so that the tree can be modified
$children = array();
for ($i = 0; $i < $node->childNodes->length; $i++) {
$children[] = $node->childNodes->item($i);
}
foreach ($children as $child) {
$node_name = mb_strtolower($child->nodeName);
// Skip non-displaying nodes
if (in_array($node_name, self::$_HIDDEN_TAGS)) {
if ($node_name !== "head" && $node_name !== "style") {
$child->parentNode->removeChild($child);
}
continue;
}
// Skip empty text nodes
if ($node_name === "#text" && $child->nodeValue == "") {
$child->parentNode->removeChild($child);
continue;
}
// Skip empty image nodes
if ($node_name === "img" && $child->getAttribute("src") == "") {
$child->parentNode->removeChild($child);
continue;
}
$frame->append_child($this->_build_tree_r($child), false);
}
return $frame;
}
}