quiptreeparser.class.php
- package
- quip
- Classes
- QuipTreeParser
Description
Quip
Copyright 2010-11 by Shaun McCormick shaun@modx.com
This file is part of Quip, a simple commenting component for MODx Revolution.
Quip is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Quip is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Quip; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\QuipTreeParser
- package
- quip
- Properties
- $last
- $openThread
- $output
- $tpl
- Methods
- __construct
- _iterate
- getOpenThread
- parse
- setOpenThread
- setOpenThreadChildren
Description
Handles row-parsing of naive tree data.
Properties
$last
string $last = ''
The last node output
Details
- string
- visibility
- protected
- default
- final
- false
- static
- false
$openThread
array $openThread = 'array'
The current open thread node
Details
- array
- visibility
- protected
- default
- array
- final
- false
- static
- false
$output
string $output = ''
The current collected output
Details
- string
- visibility
- protected
- default
- final
- false
- static
- false
$tpl
string $tpl = ''
The chunk tpl to use for each node
Details
- string
- visibility
- protected
- default
- final
- false
- static
- false
Methods
__construct
__construct(
\Quip $quip, array $config
=
array
)
:
Arguments
- $quip
- \Quip
A reference to the Quip instance - $config
- array
An array of configuration options
Details
- visibility
- public
- final
- false
- static
- false
_iterate
_iterate(
array $current
)
:
string
Iterate across the current node
Arguments
- $current
- array
Output
- string
Details
- visibility
- private
- final
- false
- static
- false
getOpenThread
getOpenThread(
int $depth
)
:
string
Get the current open thread parsed
Arguments
- $depth
- int
Output
- string
Details
- visibility
- protected
- final
- false
- static
- false
parse
parse(
array $array, string $tpl
)
:
string
Parse the array in tree iteration
Arguments
- $array
- array
The array of nodes to parse - $tpl
- string
The chunk to use for each node
Output
- string
- The outputted content
Details
- visibility
- public
- final
- false
- static
- false
setOpenThread
setOpenThread(
string $string, int $depth
)
:
void
Set the current open thread node
Arguments
- $string
- string
- $depth
- int
Details
- visibility
- protected
- final
- false
- static
- false
setOpenThreadChildren
setOpenThreadChildren(
int $depth, string $string
)
:
void
Set the current open thread node's children
Arguments
- $depth
- int
The current depth - $string
- string
The children data to set
Details
- visibility
- protected
- final
- false
- static
- false