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 3515

User picture
  • Author: gergoerdosi
  • 2012-03-27 00:15 (about 2 years ago)

Fix revisable behavior. re #204

Files Affected

 
35143515
27
     *
27
     *
28
     * @param  object   A database table object
28
     * @param  object   A database table object
29
     * @param  string   The row status
29
     * @param  string   The row status
30
     * @param  array    Array of row id's
30
     * @param  object   A KDatabaseQuerySelect object.
31
     * @return KDatabaseRowsetInterface
31
     * @return KDatabaseRowsetInterface
32
     */
32
     */
33
    protected function _selectRevisions($table, $status, $where)
33
    protected function _selectRevisions($table, $status, $query)
34
    {
34
    {
35
        $result = parent::_selectRevisions($table, $status, $where);
35
        $result = parent::_selectRevisions($table, $status, $query);
 
 
36
        $needle = array();
36
 
37
 
37
        $needle = array();
38
        // Filter by category id if set in the query.
38
        if(isset($where['tbl.catid'])) {
39
        foreach ($query->where as $where) {
39
            $needle['category_id'] = $where['tbl.catid'];
40
            if (preg_match('/(?:^|AND\s+)tbl\\.catid\s*=\s*(\d+|:[a-z_]+)/', $where['condition'], $matches)) {
 
 
41
                if (is_numeric($matches[1])) {
 
 
42
                    $needle['category_id'] = (int) $matches[1];
 
 
43
                    break;
 
 
44
                } elseif (isset($query->params[substr($matches[1], 1)])) {
 
 
45
                    $needle['category_id'] = (int) $query->params[substr($matches[1], 1)];
 
 
46
                    break;
 
 
47
                }
 
 
48
            }
40
        }
49
        }
41
 
50
 
42
        if(isset($where['tbl.sectionid'])) {
51
        // Filter by section id if set in the query.
43
            $needle['section_id'] = $where['tbl.sectionid'];
52
        foreach ($query->where as $where) {
 
 
53
            if (preg_match('/(?:^|AND\s+)tbl\\.sectionid\s*=\s*(\d+|:[a-z_]+)/', $where['condition'], $matches)) {
 
 
54
                if (is_numeric($matches[1])) {
 
 
55
                    $needle['section_id'] = (int) $matches[1];
 
 
56
                    break;
 
 
57
                } elseif (isset($query->params[substr($matches[1], 1)])) {
 
 
58
                    $needle['section_id'] = (int) $query->params[substr($matches[1], 1)];
 
 
59
                    break;
 
 
60
                }
 
 
61
            }
44
        }
62
        }
45
 
63
 
46
        if(!empty($needle)) {
64
        if($needle) {
47
            $result = $result->find($needle);
65
            $result = $result->find($needle);
48
        }
66
        }
49
 
67
 
35143515
12
 
12
 
13
<div class="scopebar">
13
<div class="scopebar">
14
    <ul>
14
    <ul>
15
        <li class="<?= is_null($state->state) && is_null($state->access) && is_null($state->featured) && is_null($state->deleted) ? 'active' : ''; ?> separator-right">
15
        <li class="<?= is_null($state->state) && is_null($state->access) && is_null($state->featured) && is_null($state->trashed) ? 'active' : ''; ?> separator-right">
16
            <a href="<?= @route('state=&access=&featured=&trashed=' ) ?>">
16
            <a href="<?= @route('state=&access=&featured=&trashed=' ) ?>">
17
                <?= 'All' ?>
17
                <?= 'All' ?>
18
            </a>
18
            </a>