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-components

Commit 670

User picture
  • Author: johanjanssens
  • 2010-10-27 08:09 (over 3 years ago)

Merged from 99-toolbar

Files Affected

 
669670
1
-- $Id$
1
-- $Id$
2
 
2
 
3
CREATE TABLE IF NOT EXISTS `#__terms_terms` (
3
CREATE TABLE IF NOT EXISTS `jos_terms_terms` (
4
    `terms_term_id` bigint(20) unsigned NOT NULL auto_increment,
4
    `terms_term_id` bigint(20) unsigned NOT NULL auto_increment,
5
    `title` VARCHAR( 255 ) NOT NULL,
5
    `title` VARCHAR( 255 ) NOT NULL,
6
    `slug` VARCHAR( 255 ) NOT NULL,
6
    `slug` VARCHAR( 255 ) NOT NULL,
...
 
...
 
16
    UNIQUE KEY ( `title` )
16
    UNIQUE KEY ( `title` )
17
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Terms table for taxonomy ';
17
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Terms table for taxonomy ';
18
 
18
 
19
CREATE TABLE IF NOT EXISTS `#__terms_relations` (
19
CREATE TABLE IF NOT EXISTS `jos_terms_relations` (
20
    `terms_term_id` BIGINT(20) UNSIGNED NOT NULL,
20
    `terms_term_id` BIGINT(20) UNSIGNED NOT NULL,
21
      `row` BIGINT(20) UNSIGNED NOT NULL,    
21
      `row` BIGINT(20) UNSIGNED NOT NULL,    
22
      `table` VARCHAR( 255 ) NOT NULL,
22
      `table` VARCHAR( 255 ) NOT NULL,
...
 
...
 
23
      PRIMARY KEY  (`terms_term_id`,`row`,`table`)
23
      PRIMARY KEY  (`terms_term_id`,`row`,`table`)
24
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT 'Relations table for taxonomy';
24
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT 'Relations table for taxonomy';
25
 
25
 
26
-- --------------------------------------------------------
26
-- --------------------------------------------------------
27
 
 
 
28
--
 
 
29
-- Dumping data for table `#_terms_terms`
 
 
30
--
 
 
31
 
 
 
32
INSERT IGNORE INTO `#__terms_terms` VALUES(1, 'Marketing', 'marketing', '');
 
 
33
INSERT IGNORE INTO `#__terms_terms` VALUES(2, 'Sales', 'sales', '');
 
 
34
INSERT IGNORE INTO `#__terms_terms` VALUES(3, 'Finance', 'finance', '');
 
 
35
INSERT IGNORE INTO `#__terms_terms` VALUES(4, 'Applications', 'applications', '');
 
 
36
INSERT IGNORE INTO `#__terms_terms` VALUES(5, 'Information Systems & Technology', 'information-systems-technology', '');
 
 
37
 
 
 
38
-- --------------------------------------------------------
 
 
39
 
 
 
40
--
 
 
41
-- Dumping data for table `#__terms_relations`
 
 
42
--
 
 
43
 
 
 
44
INSERT IGNORE INTO `#__terms_relations` VALUES(1, 2, 'profiles_people');
 
 
45
INSERT IGNORE INTO `#__terms_relations` VALUES(1, 3, 'profiles_people');
 
 
46
INSERT IGNORE INTO `#__terms_relations` VALUES(1, 4, 'profiles_people');
 
 
47
INSERT IGNORE INTO `#__terms_relations` VALUES(1, 5, 'profiles_people');
 
 
48
INSERT IGNORE INTO `#__terms_relations` VALUES(1, 6, 'profiles_people');
 
 
49
INSERT IGNORE INTO `#__terms_relations` VALUES(1, 7, 'profiles_people');
 
 
50
INSERT IGNORE INTO `#__terms_relations` VALUES(1, 8, 'profiles_people');
 
 
51
INSERT IGNORE INTO `#__terms_relations` VALUES(1, 9, 'profiles_people');
 
 
52
INSERT IGNORE INTO `#__terms_relations` VALUES(1, 10, 'profiles_people');
 
 
53
INSERT IGNORE INTO `#__terms_relations` VALUES(1, 11, 'profiles_people');
 
 
54
INSERT IGNORE INTO `#__terms_relations` VALUES(2, 12, 'profiles_people');
 
 
55
INSERT IGNORE INTO `#__terms_relations` VALUES(2, 13, 'profiles_people');
 
 
56
INSERT IGNORE INTO `#__terms_relations` VALUES(2, 14, 'profiles_people');
 
 
57
INSERT IGNORE INTO `#__terms_relations` VALUES(2, 15, 'profiles_people');
 
 
58
INSERT IGNORE INTO `#__terms_relations` VALUES(2, 16, 'profiles_people');
 
 
59
INSERT IGNORE INTO `#__terms_relations` VALUES(2, 17, 'profiles_people');
 
 
60
INSERT IGNORE INTO `#__terms_relations` VALUES(2, 18, 'profiles_people');
 
 
61
INSERT IGNORE INTO `#__terms_relations` VALUES(2, 19, 'profiles_people');
 
 
62
INSERT IGNORE INTO `#__terms_relations` VALUES(2, 20, 'profiles_people');
 
 
63
INSERT IGNORE INTO `#__terms_relations` VALUES(2, 21, 'profiles_people');
 
 
64
INSERT IGNORE INTO `#__terms_relations` VALUES(3, 22, 'profiles_people');
 
 
65
INSERT IGNORE INTO `#__terms_relations` VALUES(3, 23, 'profiles_people');
 
 
66
INSERT IGNORE INTO `#__terms_relations` VALUES(3, 24, 'profiles_people');
 
 
67
INSERT IGNORE INTO `#__terms_relations` VALUES(3, 25, 'profiles_people');
 
 
68
INSERT IGNORE INTO `#__terms_relations` VALUES(3, 26, 'profiles_people');
 
 
69
INSERT IGNORE INTO `#__terms_relations` VALUES(3, 27, 'profiles_people');
 
 
70
INSERT IGNORE INTO `#__terms_relations` VALUES(3, 28, 'profiles_people');
 
 
71
INSERT IGNORE INTO `#__terms_relations` VALUES(3, 29, 'profiles_people');
 
 
72
INSERT IGNORE INTO `#__terms_relations` VALUES(3, 30, 'profiles_people');
 
 
73
INSERT IGNORE INTO `#__terms_relations` VALUES(3, 31, 'profiles_people');
 
 
74
INSERT IGNORE INTO `#__terms_relations` VALUES(4, 32, 'profiles_people');
 
 
75
INSERT IGNORE INTO `#__terms_relations` VALUES(4, 33, 'profiles_people');
 
 
76
INSERT IGNORE INTO `#__terms_relations` VALUES(4, 34, 'profiles_people');
 
 
77
INSERT IGNORE INTO `#__terms_relations` VALUES(4, 35, 'profiles_people');
 
 
78
INSERT IGNORE INTO `#__terms_relations` VALUES(4, 36, 'profiles_people');
 
 
79
INSERT IGNORE INTO `#__terms_relations` VALUES(4, 37, 'profiles_people');
 
 
80
INSERT IGNORE INTO `#__terms_relations` VALUES(4, 38, 'profiles_people');
 
 
81
INSERT IGNORE INTO `#__terms_relations` VALUES(4, 39, 'profiles_people');
 
 
82
INSERT IGNORE INTO `#__terms_relations` VALUES(4, 40, 'profiles_people');
 
 
83
INSERT IGNORE INTO `#__terms_relations` VALUES(4, 41, 'profiles_people');
 
 
84
INSERT IGNORE INTO `#__terms_relations` VALUES(5, 42, 'profiles_people');
 
 
85
INSERT IGNORE INTO `#__terms_relations` VALUES(5, 43, 'profiles_people');
 
 
86
INSERT IGNORE INTO `#__terms_relations` VALUES(5, 44, 'profiles_people');
 
 
87
INSERT IGNORE INTO `#__terms_relations` VALUES(5, 45, 'profiles_people');
 
 
88
INSERT IGNORE INTO `#__terms_relations` VALUES(5, 46, 'profiles_people');
 
 
89
INSERT IGNORE INTO `#__terms_relations` VALUES(5, 47, 'profiles_people');
 
 
90
INSERT IGNORE INTO `#__terms_relations` VALUES(5, 48, 'profiles_people');
 
 
91
INSERT IGNORE INTO `#__terms_relations` VALUES(5, 49, 'profiles_people');
 
 
92
INSERT IGNORE INTO `#__terms_relations` VALUES(5, 50, 'profiles_people');
 
 
93
INSERT IGNORE INTO `#__terms_relations` VALUES(5, 51, 'profiles_people');
 
 
669670
23
    {
23
    {
24
        if(!$this->_state->isUnique()) {
24
        if(!$this->_state->isUnique()) {
25
            $query->select('COUNT( relations.terms_term_id ) AS count');
25
            $query->select('COUNT( relations.terms_term_id ) AS count');
 
 
26
            $query->select('table');
26
        }
27
        }
27
 
28
 
28
        return parent::_buildQueryColumns($query);
29
        return parent::_buildQueryColumns($query);
669670
14
}
14
}
15
 
15
 
16
// Create the controller dispatcher
16
// Create the controller dispatcher
17
KFactory::get('admin::com.terms.dispatcher')->dispatch(KRequest::get('get.view', 'cmd', 'terms'));
17
echo KFactory::get('admin::com.terms.dispatcher')->dispatch();
18
 
18
 
669670
11
{
11
{
12
    public function display()
12
    public function display()
13
    {
13
    {
14
        $model = KFactory::get($this->getModel());
 
 
15
        
 
 
16
        //If no row exists assign an empty array
14
        //If no row exists assign an empty array
17
        if($model->get('row')) {
15
        if($this->getModel()->get('row')) {
18
            $this->assign('disabled', false);
16
            $this->assign('disabled', false);
19
        } else {
17
        } else {
20
            $this->assign('disabled', true);
18
            $this->assign('disabled', true);
669670
11
</div>
11
</div>
12
 
12
 
13
<form action="<?= @route()?>" method="post" name="adminForm">
13
<form action="<?= @route()?>" method="post" name="adminForm">
14
    <input type="hidden" name="id" value="" />
14
<input type="hidden" name="id" value="" />
15
    <input type="hidden" name="action" value="browse" />
15
<input type="hidden" name="action" value="browse" />
16
    <table class="adminlist" style="clear: both;">
16
 
17
        <thead>
17
<table class="adminlist" style="clear: both;">
18
            <tr>
18
<thead>
19
                <th width="20">
19
    <tr>
20
                    <input type="checkbox" name="toggle" value="" onclick="checkAll(<?= count($terms); ?>);" />
20
        <th width="20">
21
                </th>
21
            <input type="checkbox" name="toggle" value="" onclick="checkAll(<?= count($terms); ?>);" />
22
                <th>
22
        </th>
23
                    <?= @helper('grid.sort', array('column' => 'title')); ?>
23
        <th>
24
                </th>
24
            <?= @helper('grid.sort', array('column' => 'title')); ?>
25
                <th>
25
        </th>
26
                    <?= @helper('grid.sort', array('column' => 'slug')); ?>
26
        <th>
27
                </th>
27
            <?= @helper('grid.sort', array('column' => 'slug')); ?>
28
                <th>
28
        </th>
29
                    <?= @helper('grid.sort', array('column' => 'count')); ?>
29
        <th>
30
                </th>
30
            <?= @helper('grid.sort', array('column' => 'count')); ?>
31
            </tr>
31
        </th>
32
            <tr>
32
    </tr>
33
                <td colspan="2">
33
    <tr>
34
                    <?= @text('Filters'); ?>    
34
        <td colspan="2">
35
                </td>
35
            <?= @text('Filters'); ?>    
36
                <td>
36
        </td>
37
                </td>
37
        <td>
38
            </tr>
38
        </td>
39
        </thead>
39
    </tr>
40
        <tbody>
40
</thead>
41
        <? if (count($terms)) : ?>
41
<tbody>
42
            <?= @template('default_terms'); ?>
42
<? if (count($terms)) : ?>
43
        <? else : ?>
43
    <?= @template('default_terms'); ?>
44
            <tr>
44
<? else : ?>
45
                <td colspan="8" align="center">
45
    <tr>
46
                    <?= @text('No items found'); ?>
46
        <td colspan="8" align="center">
47
                </td>
47
            <?= @text('No items found'); ?>
48
            </tr>
48
        </td>
49
        <? endif; ?>
49
    </tr>
50
        </tbody>
50
<? endif; ?>
51
        <tfoot>
51
</tbody>
52
            <tr>
52
<tfoot>
53
                <td colspan="20">
53
    <tr>
54
                    <?= @helper('admin::com.default.helper.paginator.pagination', array('total' => $total)) ?>
54
        <td colspan="20">
55
                </td>
55
            <?= @helper('paginator.pagination', array('total' => $total)) ?>
56
            </tr>
56
        </td>
57
        </tfoot>
57
    </tr>
58
    </table>
58
</tfoot>
 
 
59
</table>
59
</form>
60
</form>
669670
73
});
73
});
74
 
74
 
75
window.addEvent('domready', function() {
75
window.addEvent('domready', function() {
76
    Terms = new Terms('terms-panel');
76
    Terms = new Terms('terms-list');
77
});
77
});