nooku is a Public Portfolio from Assembla

Assembla offers free public and private SVN/Git repositories and project hosting with bug/issue tracking and collaboration tools.

Create your own Portfolio or check out other free and subscription products from Assembla that will help accelerate your development projects.

nooku-server

Commit 3541

User picture
  • Author: johanjanssens
  • 2012-04-02 18:24 (about 2 years ago)

re #101 : Initial refactoring of com_newsfeeds site component

Files Affected

 
Show contents
Show contents
35403541
16
    static $items;
16
    static $items;
17
 
17
 
18
    $segments    = array();
18
    $segments    = array();
19
    $itemid        = null;
19
    /*$itemid        = null;
20
 
20
 
21
    // Break up the newsfeed id into numeric and alias values.
21
    // Break up the newsfeed id into numeric and alias values.
22
    if (isset($query['id']) && strpos($query['id'], ':')) {
22
    if (isset($query['id']) && strpos($query['id'], ':')) {
...
 
...
 
164
        unset($query['alias']);
164
        unset($query['alias']);
165
        unset($query['catid']);
165
        unset($query['catid']);
166
        unset($query['catalias']);
166
        unset($query['catalias']);
167
    }
167
    }*/
168
 
168
 
169
    return $segments;
169
    return $segments;
170
}
170
}
...
 
...
 
174
    $vars    = array();
174
    $vars    = array();
175
 
175
 
176
    // Get the active menu item.
176
    // Get the active menu item.
177
    $menu    = &JSite::getMenu();
177
    /*$menu    = &JSite::getMenu();
178
    $item    = &$menu->getActive();
178
    $item    = &$menu->getActive();
179
 
179
 
180
    // Check if we have a valid menu item.
180
    // Check if we have a valid menu item.
...
 
...
 
237
                $vars['catid']    = $segments[$count-1];
237
                $vars['catid']    = $segments[$count-1];
238
            }
238
            }
239
        }
239
        }
240
    }
240
    }*/
241
 
241
 
242
    return $vars;
242
    return $vars;
243
}
243
}
244
?>
 
 
35403541
1
<?php // no direct access
1
<?
2
defined('_JEXEC') or die('Restricted access'); ?>
2
/**
3
<?php if ( $this->params->get( 'show_page_title', 1 ) ) : ?>
3
 * @version        $Id: default.php 3314 2012-02-10 02:14:52Z johanjanssens $
4
    <div class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
4
 * @category    Nooku
5
        <?php echo $this->escape($this->params->get('page_title')); ?>
5
 * @package     Nooku_Server
 
 
6
 * @subpackage  Weblinks
 
 
7
 * @copyright    Copyright (C) 2011 - 2012 Timble CVBA and Contributors. (http://www.timble.net)
 
 
8
 * @license        GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 
 
9
 * @link        http://www.nooku.org
 
 
10
 */
 
 
11
 
 
 
12
defined('KOOWA') or die('Restricted access'); ?>
 
 
13
 
 
 
14
<? if ( $params->def( 'show_page_title', 1 ) ) : ?>
 
 
15
    <div class="componentheading<?= @escape($params->get('pageclass_sfx')); ?>">
 
 
16
        <?= @escape($params->get('page_title')); ?>
6
    </div>
17
    </div>
7
<?php endif; ?>
18
<? endif; ?>
8
 
19
 
9
<table width="100%" cellpadding="4" cellspacing="0" border="0" align="center" class="contentpane<?php echo $this->escape($this->params->get( 'pageclass_sfx' )); ?>">
20
<? if ( ($params->def('image', -1) != -1) || $params->def('show_comp_description', 1) ) : ?>
10
<?php if ( ($this->params->get('image') != -1) || $this->params->get('show_comp_description') ) : ?>
21
<table width="100%" cellpadding="4" cellspacing="0" border="0" align="center" class="contentpane<?= @escape($params->get('pageclass_sfx')); ?>">
11
<tr>
22
<tr>
12
    <td valign="top" class="contentdescription<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
23
    <td valign="top" class="contentdescription<?= @escape($params->get('pageclass_sfx')); ?>">
13
    <?php
24
    <? if ( isset($image) ) : ?>
14
        if ( isset($this->image) ) :  echo $this->image; endif;
25
        <img src="<?= $image['src'] ?>" <? foreach ($image['attribs'] as $attrib => $value) : echo $attrib.'="'.$value.'" '; endforeach ?>/>
15
        echo $this->escape($this->params->get('comp_description'));
26
    <? endif; ?>
16
    ?>
27
    <?= @escape($params->get('comp_description')); ?>
17
    </td>
28
    </td>
18
</tr>
29
</tr>
19
<?php endif; ?>
 
 
20
</table>
30
</table>
 
 
31
<? endif; ?>
 
 
32
 
21
<ul>
33
<ul>
22
<?php foreach ( $this->categories as $category ) : ?>
34
<? foreach($categories as $category) : ?>
23
    <li>
35
    <li>
24
        <a href="<?php echo $category->link ?>" class="category<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
36
        <a href="<?= @route('view=newsfeeds&category='. $category->id.':'.$category->alias) ?>" class="category<?= @escape($params->get( 'pageclass_sfx' )); ?>">
25
            <?php echo $this->escape($category->title);?></a>
37
            <?= @escape($category->title);?>
26
        <?php if ( $this->params->get( 'show_cat_items' ) ) : ?>
38
        </a>
 
 
39
        <? if ( $params->get( 'show_cat_items' ) ) : ?>
27
        &nbsp;
40
        &nbsp;
28
        <span class="small">
41
        <span class="small">
29
            (<?php echo $category->numlinks;?>)
42
            (<?= $category->numlinks;?>)
30
        </span>
43
        </span>
31
        <?php endif; ?>
44
        <? endif; ?>
32
        <?php if ( $this->params->get( 'show_cat_description' ) && $category->description ) : ?>
45
        <? if ( $params->get( 'show_cat_description' ) && $category->description ) : ?>
33
        <br />
46
        <br />
34
        <?php echo $category->description; ?>
47
        <?= @escape($category->description); ?>
35
        <?php endif; ?>
48
        <? endif; ?>
36
    </li>
49
    </li>
37
<?php endforeach; ?>
50
<? endforeach; ?>
38
</ul>
51
</ul>
35403541
1
<?php // no direct acces
1
<?
2
defined('_JEXEC') or die('Restricted access'); ?>
2
/**
3
<?php
3
 * @version        $Id: default.php 3314 2012-02-10 02:14:52Z johanjanssens $
4
        $lang = &JFactory::getLanguage();
4
 * @category    Nooku
5
        $myrtl =$this->newsfeed->rtl;
5
 * @package     Nooku_Server
6
         if ($lang->isRTL() && $myrtl==0){
6
 * @subpackage  Newsfeeds
7
           $direction= "direction:rtl !important;";
7
 * @copyright    Copyright (C) 2011 - 2012 Timble CVBA and Contributors. (http://www.timble.net)
8
           $align= "text-align:right !important;";
8
 * @license        GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
9
           }
9
 * @link        http://www.nooku.org
10
         else if ($lang->isRTL() && $myrtl==1){
10
 */
11
           $direction= "direction:ltr !important;";
 
 
12
           $align= "text-align:left !important;";
 
 
13
           }
 
 
14
          else if ($lang->isRTL() && $myrtl==2){
 
 
15
           $direction= "direction:rtl !important;";
 
 
16
           $align= "text-align:right !important;";
 
 
17
           }
 
 
18
 
11
 
19
        else if ($myrtl==0) {
12
defined('KOOWA') or die('Restricted access'); ?>
20
        $direction= "direction:ltr !important;";
 
 
21
           $align= "text-align:left !important;";
 
 
22
           }
 
 
23
        else if ($myrtl==1) {
 
 
24
        $direction= "direction:ltr !important;";
 
 
25
           $align= "text-align:left !important;";
 
 
26
           }
 
 
27
        else if ($myrtl==2) {
 
 
28
           $direction= "direction:rtl !important;";
 
 
29
           $align= "text-align:right !important;";
 
 
30
           }
 
 
31
 
13
 
32
?>
14
<? if ($params->get('show_page_title', 1)) : ?>
33
<div style="<?php echo $direction; ?><?php echo $align; ?>">
15
    <div class="componentheading<?= @escape($params->get('pageclass_sfx')); ?>"><?= @escape($params->get('page_title')); ?></div>
34
<?php if ($this->params->get('show_page_title', 1)) : ?>
16
<? endif; ?>
35
    <div class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>" style="<?php echo $direction; ?><?php echo $align; ?>"><?php echo $this->escape($this->params->get('page_title')); ?></div>
17
<table width="100%" class="contentpane<?= @escape($params->get('pageclass_sfx')); ?>">
36
<?php endif; ?>
 
 
37
<table width="100%" class="contentpane<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
 
 
38
<tr>
18
<tr>
39
    <td class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>" style="<?php echo $direction; ?><?php echo $align; ?>">
19
    <td class="componentheading<?= @escape($params->get('pageclass_sfx')); ?>">
40
        <a href="<?php echo $this->newsfeed->channel['link']; ?>" target="_blank">
20
        <a href="<?= $channel['link']; ?>" target="_blank">
41
            <?php echo str_replace('&apos;', "'", $this->newsfeed->channel['title']); ?></a>
21
            <?= str_replace('&apos;', "'", $channel['title']); ?></a>
42
    </td>
22
    </td>
43
</tr>
23
</tr>
44
<?php if ( $this->params->get( 'show_feed_description' ) ) : ?>
24
<? if($params->get( 'show_feed_description' ) ) : ?>
45
<tr>
25
<tr>
46
    <td>
26
    <td>
47
        <?php echo str_replace('&apos;', "'", $this->newsfeed->channel['description']); ?>
27
        <?= str_replace('&apos;', "'", $channel['description']); ?>
48
        <br />
28
        <br />
49
        <br />
29
        <br />
50
    </td>
30
    </td>
51
</tr>
31
</tr>
52
<?php endif; ?>
32
<? endif; ?>
53
<?php if ( isset($this->newsfeed->image['url']) && isset($this->newsfeed->image['title']) && $this->params->get( 'show_feed_image' ) ) : ?>
33
<? if(isset($image['url']) && isset($image['title']) && $params->get( 'show_feed_image' ) ) : ?>
54
<tr>
34
<tr>
55
    <td>
35
    <td>
56
        <img src="<?php echo $this->newsfeed->image['url']; ?>" alt="<?php echo $this->newsfeed->image['title']; ?>" />
36
        <img src="<?= $image['url']; ?>" alt="<?= $image['title']; ?>" />
57
    </td>
37
    </td>
58
</tr>
38
</tr>
59
<?php endif; ?>
39
<? endif; ?>
60
<tr>
40
<tr>
61
    <td>
41
    <td>
62
        <ul>
42
        <ul>
63
        <?php foreach ( $this->newsfeed->items as $item ) :  ?>
43
        <? foreach ( $items as $item ) :  ?>
64
            <li>
44
            <li>
65
            <?php if ( !is_null( $item->get_link() ) ) : ?>
45
            <? if (!is_null( $item->get_link())) : ?>
66
                <a href="<?php echo $item->get_link(); ?>" target="_blank">
46
                <a href="<?= $item->get_link(); ?>" target="_blank">
67
                    <?php echo $item->get_title(); ?></a>
47
                    <?= $item->get_title(); ?></a>
68
            <?php endif; ?>
48
            <?php endif; ?>
69
            <?php if ( $this->params->get( 'show_item_description' ) && $item->get_description()) : ?>
49
            <?php if ( $params->get( 'show_item_description' ) && $item->get_description()) : ?>
70
                <br />
50
                <br />
71
                <?php $text = $this->limitText($item->get_description(), $this->params->get( 'feed_word_count' ));
51
                <? $text = $this->getView()->limitText($item->get_description(), $params->get( 'feed_word_count' )); ?>
72
                    echo str_replace('&apos;', "'", $text);
52
                <?= str_replace('&apos;', "'", $text); ?>
73
                ?>
 
 
74
                <br />
53
                <br />
75
                <br />
54
                <br />
76
            <?php endif; ?>
55
            <? endif; ?>
77
            </li>
56
            </li>
78
        <?php endforeach; ?>
57
        <? endforeach; ?>
79
        </ul>
58
        </ul>
80
    </td>
59
    </td>
81
</tr>
60
</tr>
82
</table>
61
</table>
83
</div>