Changeset 44 for trunk/lib/SortOrder.inc.php
- Timestamp:
- Dec 19, 2005 7:10:45 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/SortOrder.inc.php
r43 r44 106 106 107 107 /** 108 * Set sort and order values. This is how you set new sort values after108 * Forcibly set sort and order values. This is how you set new sort values after 109 109 * already declaring a SortOrder object. This will ignore getFormData values. 110 110 * 111 * @param string $col The database column to sort by. 112 * @param string $col_name The human-readable title of the column. 113 * @param string $default_order The default order for this column (ASC, 111 * @param string $sort The sort by name. 112 * @param string $order The order direction (ASC, 114 113 * for example, for an alphabetical sort) 115 114 */ … … 144 143 145 144 if (!empty($this->_columns[strtolower($this->sort_by)][strtolower($this->order)])) { 146 return ' ORDER BY ' . addslashes($this->_columns[strtolower($this->sort_by)][strtolower($this->order)]);145 return sprintf(' ORDER BY %s ', addslashes($this->_columns[strtolower($this->sort_by)][strtolower($this->order)])); 147 146 } else { 148 147 App::logMsg(sprintf('Could not find SQL to sort by %s %s.', $this->sort_by, $this->order), LOG_WARNING, __FILE__, __LINE__);
Note: See TracChangeset
for help on using the changeset viewer.