Changeset 451 for branches


Ignore:
Timestamp:
Dec 25, 2013 12:39:28 AM (10 years ago)
Author:
anonymous
Message:

Added SortOrder::get() method; minor changes

Location:
branches/eli_branch
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eli_branch/bin/module_maker/skel/admin.php

    r443 r451  
    379379    if (getFormData('filter___///__', false)) {
    380380        // Limit by filter.
    381         $where_clause .= (empty($where_clause) ? 'WHERE' : 'AND') . " __///__ = '" . $db->escapeString(getFormData('filter___///__')) . "'";
     381        $where_clause .= (empty($where_clause) ? 'WHERE' : ' AND') . " __///__ = '" . $db->escapeString(getFormData('filter___///__')) . "'";
    382382    }
    383383
  • branches/eli_branch/lib/SortOrder.inc.php

    r439 r451  
    44 * For details visit the project site: <http://trac.strangecode.com/codebase/>
    55 * Copyright 2001-2012 Strangecode, LLC
    6  * 
     6 *
    77 * This file is part of The Strangecode Codebase.
    88 *
     
    1111 * Free Software Foundation, either version 3 of the License, or (at your option)
    1212 * any later version.
    13  * 
     13 *
    1414 * The Strangecode Codebase is distributed in the hope that it will be useful, but
    1515 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1616 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    1717 * details.
    18  * 
     18 *
    1919 * You should have received a copy of the GNU General Public License along with
    2020 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>.
     
    5656    {
    5757        $app =& App::getInstance();
    58        
     58
    5959        // Setup the HTML for printing ASC/DESC paths.
    6060        // This should be converted to CSS someday.
     
    6262        $this->asc_widget = sprintf('<img src="%s/sort_ascending.gif" alt="%s" width="11" height="7" border="0" />', $images_path, _("Ascending"));
    6363        $this->desc_widget = sprintf('<img src="%s/sort_descending.gif" alt="%s" width="11" height="7" border="0" />', $images_path, _("Ascending"));
    64        
     64
    6565        // Setup prefs object.
    6666        $this->prefs = new Prefs($_SERVER['PHP_SELF']);
     
    154154    }
    155155
     156    /**
     157     * Get the current sort and order values.
     158     *
     159     * @return array    Array with keys: sort and order. These can be fed back into the SortOrder::set() method or defaults.
     160     */
     161    function get()
     162    {
     163        return array(
     164            'sort' => $this->prefs->get('sort_by'),
     165            'order' => $this->prefs->get('sort_order'),
     166        );
     167    }
    156168
    157169    /**
     
    202214            } else {
    203215                ?><a href="<?php echo $app->oHREF($_SERVER['PHP_SELF'] . '?sort=' . $col . '&order=' . $default_order); ?>" title="<?php echo sprintf(_("Sort by %s"), $col_name); ?>"><?php echo $col_name; ?></a><?php
    204             }           
     216            }
    205217        } else {
    206218            echo $col_name;
Note: See TracChangeset for help on using the changeset viewer.