Subversion Repositories eFlore/Applications.cel

Rev

Rev 580 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 580 Rev 612
Line 27... Line 27...
27
 * @author    James Stewart <james@jystewart.net>
27
 * @author    James Stewart <james@jystewart.net>
28
 * @version    Release: @package_version@
28
 * @version    Release: @package_version@
29
 * @package XML_Feed_Parser
29
 * @package XML_Feed_Parser
30
 * @todo    Find a Relax NG URI we can use
30
 * @todo    Find a Relax NG URI we can use
31
 */
31
 */
32
class XML_Feed_Parser_RSS09 extends XML_Feed_Parser_Type
32
class XmlFeedParserRss09 extends XmlFeedParserType {
33
{
-
 
34
    /**
33
    /**
35
     * The URI of the RelaxNG schema used to (optionally) validate the feed 
34
     * The URI of the RelaxNG schema used to (optionally) validate the feed 
36
     * @var string
35
     * @var string
37
     */
36
     */
38
    protected $relax = '';
37
    protected $relax = '';
Line 51... Line 50...
51
 
50
 
52
    /**
51
    /**
53
     * The class used to represent individual items 
52
     * The class used to represent individual items 
54
     * @var string
53
     * @var string
55
     */
54
     */
Line 56... Line 55...
56
    protected $itemClass = 'XML_Feed_Parser_RSS09Element';
55
    protected $itemClass = 'XmlFeedParserRss09Element';
57
    
56
    
58
    /**
57
    /**
59
     * The element containing entries 
58
     * The element containing entries 
Line 100... Line 99...
100
     * 
99
     * 
101
     * @todo    RelaxNG validation
100
     * @todo    RelaxNG validation
102
     * @param    DOMDocument    $xml    A DOM object representing the feed
101
     * @param    DOMDocument    $xml    A DOM object representing the feed
103
     * @param    bool (optional) $string    Whether or not to validate this feed
102
     * @param    bool (optional) $string    Whether or not to validate this feed
104
     */
103
     */
105
    function __construct(DOMDocument $model, $strict = false)
104
    function __construct(DOMDocument $model, $strict = false) {
106
    {
-
 
107
        $this->model = $model;
105
        $this->model = $model;
Line 108... Line 106...
108
 
106
 
109
        $this->xpath = new DOMXPath($model);
107
        $this->xpath = new DOMXPath($model);
110
        foreach ($this->namespaces as $key => $value) {
108
        foreach ($this->namespaces as $key => $value) {
Line 120... Line 118...
120
     * clear restrictions on the global uniqueness of IDs.
118
     * clear restrictions on the global uniqueness of IDs.
121
     *
119
     *
122
     * @param    string    $id    any valid ID.
120
     * @param    string    $id    any valid ID.
123
     * @return    false
121
     * @return    false
124
     */
122
     */
125
    function getEntryById($id)
123
    function getEntryById($id) {
126
    {
-
 
127
        return false;        
124
        return false;        
128
    }
125
    }
Line 129... Line 126...
129
 
126
 
130
    /**
127
    /**
131
     * Get details of the image associated with the feed.
128
     * Get details of the image associated with the feed.
132
     *
129
     *
133
     * @return  array|false an array simply containing the child elements
130
     * @return  array|false an array simply containing the child elements
134
     */
131
     */
135
    protected function getImage()
-
 
136
    {
132
    protected function getImage() {
137
        $images = $this->model->getElementsByTagName('image');
133
        $images = $this->model->getElementsByTagName('image');
138
        if ($images->length > 0) {
134
        if ($images->length > 0) {
139
            $image = $images->item(0);
135
            $image = $images->item(0);
140
            $details = array();
136
            $details = array();
Line 161... Line 157...
161
     * The textinput element is little used, but in the interests of
157
     * The textinput element is little used, but in the interests of
162
     * completeness we will support it.
158
     * completeness we will support it.
163
     *
159
     *
164
     * @return  array|false
160
     * @return  array|false
165
     */
161
     */
166
    protected function getTextInput()
162
    protected function getTextInput() {
167
    {
-
 
168
        $inputs = $this->model->getElementsByTagName('textinput');
163
        $inputs = $this->model->getElementsByTagName('textinput');
169
        if ($inputs->length > 0) {
164
        if ($inputs->length > 0) {
170
            $input = $inputs->item(0);
165
            $input = $inputs->item(0);
171
            $results = array();
166
            $results = array();
172
            $results['title'] = isset(
167
            $results['title'] = isset(
Line 198... Line 193...
198
     * In RSS1 a link is a text element but in order to ensure that we resolve
193
     * In RSS1 a link is a text element but in order to ensure that we resolve
199
     * URLs properly we have a special function for them.
194
     * URLs properly we have a special function for them.
200
     *
195
     *
201
     * @return  string
196
     * @return  string
202
     */
197
     */
203
    function getLink($offset = 0, $attribute = 'href', $params = false)
198
    function getLink($offset = 0, $attribute = 'href', $params = false) {
204
    {
-
 
205
        $links = $this->model->getElementsByTagName('link');
199
        $links = $this->model->getElementsByTagName('link');
206
        if ($links->length <= $offset) {
200
        if ($links->length <= $offset) {
207
            return false;
201
            return false;
208
        }
202
        }
209
        $link = $links->item($offset);
203
        $link = $links->item($offset);