Commit 0779f98a authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1667181: Alter the search box options

Add in the new search by and order options

Change-Id: If0ab8397793a3aad3df4d7fa4e4a69ccd4b908b9
parent 8ddfdb51
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -89,12 +89,12 @@ $string['collectionsubmittedtogroup'] = 'This collection has been submitted to <
$string['collectionsubmittedtogroupon'] = 'This collection was submitted to <a href="%s">%s</a> on %s.';
$string['submittedpendingrelease'] = 'Pending release after archiving.';
$string['nobodycanseethisview2'] = 'Only you can see this page.';
$string['noviews'] = 'No pages.';
$string['noviews1'] = 'No pages or collections.';
$string['nviews'] = array(
    '1 page',
    '%s pages',
);
$string['youhavenoviews'] = 'You have no pages.';
$string['youhavenoviews1'] = 'You don\'t have any pages or collections.';
$string['youhaventcreatedanyviewsyet'] = "You have not created any pages yet.";
$string['youhaveoneview'] = 'You have 1 page.';
$string['youhaveviews']   = 'You have %s pages.';
@@ -433,7 +433,7 @@ $string['blockcopypermission'] = 'Block copy permission';
$string['blockcopypermissiondesc'] = 'If you allow other users to copy this page, you may choose how this block will be copied';

// Sort by
$string['defaultsort'] = '';
$string['defaultsort'] = 'Alphabetical';
$string['latestcreated'] = 'Date created';
$string['latestmodified'] = 'Last modified';
$string['latestviewed'] = 'Last viewed';
@@ -451,8 +451,9 @@ $string['grouphomepagedescription'] = 'The group homepage contains the content t
// Shared views
$string['sharedwithme'] = 'Shared with me';
$string['titleanddescription'] = 'Title, description, tags';
$string['titleanddescriptionnotags'] = 'Title, description';
$string['titleanddescriptionandtagsandowner'] = 'Title, description, tags, owner';
$string['tagsonly'] = 'Tags only';
$string['tagsonly1'] = 'Tags';
$string['sharedviewsdescription'] = 'This page lists the most recently modified or commented on pages that have been shared with you. They may have been shared with you directly, shared with friends of the owner, or shared with one of your groups.';
$string['sharedwith'] = 'Shared with';
$string['sharewith'] = 'Share with';
+1 −1
Original line number Diff line number Diff line
@@ -243,7 +243,7 @@ function expected_account_preferences() {
                 'licensedefault' => '',
                 'viewsperpage' => 20,
                 'itemsperpage' => 10,
                 'orderpagesby' => 'atoz',
                 'orderpagesby' => 'latestmodified',
                 );
}

+8 −5
Original line number Diff line number Diff line
@@ -3615,7 +3615,7 @@ class View {
            $collwhere .= ' AND v.template != ' . self::SITE_TEMPLATE;
        }

        $order = $groupby = $emptycollgroupby = '';
        $order = $groupby = $collgroupby = $emptycollgroupby = '';
        if (!empty($orderby)) {
            switch($orderby) {
                case 'latestcreated':
@@ -3640,6 +3640,7 @@ class View {
                    $from .= $mcfromstr;
                    $collfrom .= $mcfromstr;
                    $groupby = ' GROUP BY v.id';
                    $collgroupby = ' GROUP BY v.id, c.id';
                    $emptycollgroupby = ' GROUP BY c.id';
                    $order = 'commentcount DESC,';
                    break;
@@ -3708,6 +3709,7 @@ class View {

            if (!empty($groupby)) {
                $groupby .= ', g.id, h.wwwroot';
                $collgroupby .= ', g.id, h.wwwroot';
            }
            $sort = '
                ORDER BY ' . $order . ' vtitle, vid';
@@ -3723,13 +3725,13 @@ class View {
                                                    SELECT COUNT(v.id) ' . $from . $where . $groupby . ') t1
                                                UNION
                                                SELECT COUNT(*) AS count FROM (
                                                    SELECT COUNT(v.id) ' . $collfrom . $collwhere . $groupby . ') t2
                                                    SELECT COUNT(v.id) ' . $collfrom . $collwhere . $collgroupby . ') t2
                                                UNION
                                                SELECT COUNT(*) AS count FROM (
                                                    SELECT COUNT(c.id) ' . $emptycollfrom . $emptycollwhere . $emptycollgroupby . ') t3
                                            ) t4', $values);
            $viewdata = get_records_sql_array($select . $from . $where . $groupby .
                                              $collselect . $collfrom . $collwhere . $groupby .
                                              $collselect . $collfrom . $collwhere . $collgroupby .
                                              $emptycollselect . $emptycollfrom . $emptycollwhere . $emptycollgroupby .
                                              $sort, $values, $offset, $limit);
        }
@@ -3894,8 +3896,9 @@ class View {
        $tag    = param_variable('tag', null);

        $searchoptions = array(
            'titleanddescription' => get_string('titleanddescription', 'view'),
            'tagsonly' => get_string('tagsonly', 'view'),
            'titleanddescriptionandtags' => get_string('titleanddescription', 'view'),
            'titleanddescription' => get_string('titleanddescriptionnotags', 'view'),
            'tagsonly' => get_string('tagsonly1', 'view'),
        );

        if (!empty($tag)) {
+1 −1
Original line number Diff line number Diff line
@@ -49,6 +49,6 @@
</div>
{else}
<div class="panel-body">
    <p class="lead text-small">{str tag=noviews section=view}</p>
    <p class="lead text-small">{str tag=noviews1 section=view}</p>
</div>
{/if}
+1 −1
Original line number Diff line number Diff line
@@ -12,5 +12,5 @@
{/foreach}
</ul>
{else}
<p>{str tag=youhavenoviews section=view}</p>
<p>{str tag=youhavenoviews1 section=view}</p>
{/if}
Loading