Changeset 407


Ignore:
Timestamp:
Aug 30, 2012 5:19:34 PM (12 years ago)
Author:
anonymous
Message:

Renamed function arguments to improve readability; added missing param comments.

Location:
trunk/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/App.inc.php

    r406 r407  
    753753     * @access  public
    754754     * @param   mixed   $query_key  The key (or keys, as an array) of the query argument to remove.
     755     * @param   bool    $unset      Remove any values set in the request matching the given $query_key.
    755756     * @author  Quinn Comendant <quinn@strangecode.com>
    756757     * @since   18 Jun 2007 20:57:29
  • trunk/lib/TemplateGlue.inc.php

    r396 r407  
    108108 * data types in table columns.
    109109 *
    110  * @param  string $db_table   database table to lookup
    111  * @param  string $db_col     database column to lookup
    112  * @param  bool   $sort          Sort the output.
    113  */
    114 function printSetSelectForm($db_table, $db_col, $preselected, $blank=false, $sort=false)
     110 * @param  string $db_table     Database table to lookup
     111 * @param  string $db_col       Database column to lookup
     112 * @param  string $preselected  The currently selected value of the menu. compared to the $val_column
     113 * @param  bool   $first        Optional first item; set true for a blank item, array for item with name and value.
     114 * @param  bool   $sort         Sort the output.
     115 */
     116function printSetSelectForm($db_table, $db_col, $preselected, $first=false, $sort=false)
    115117{
    116118    $values = getSetEnumFieldValues($db_table, $db_col, $sort);
     
    120122        return false;
    121123    }
    122     if (true === $blank) {
     124    if (true === $first) {
    123125        $selected = ($preselected == '') ? ' selected' : '';
    124126        ?><option value=""<?php echo $selected; ?>>&nbsp;</option>
     
    126128    }
    127129    // When the 'blank' value needs a specific key->val pair.
    128     if (is_array($blank)) {
    129         foreach ($blank as $key=>$val) {
     130    if (is_array($first)) {
     131        foreach ($first as $key=>$val) {
    130132            $selected = ($preselected == $val) ? ' selected="selected"' : '';
    131133            ?><option value="<?php echo oTxt($key); ?>"<?php echo $selected; ?>><?php echo oTxt($val); ?></option>
     
    143145 * Prints radio buttons from a set/enum column.
    144146 *
    145  * @param  string $db_table   database table to lookup
    146  * @param  string $db_col     database column to lookup
    147  * @param  bool   $sort          Sort the output.
    148  */
    149 function printEnumRadios($name, $db_table, $db_col, $preselected, $blank=false, $sort=false)
     147 * @param  string $db_table     Database table to lookup
     148 * @param  string $db_col       Database column to lookup
     149 * @param  string $preselected  The currently selected value of the menu. compared to the $val_column
     150 * @param  bool   $first        Optional first item; set true for a blank item, array for item with name and value.
     151 * @param  bool   $sort         Sort the output.
     152 */
     153function printEnumRadios($name, $db_table, $db_col, $preselected, $first=false, $sort=false)
    150154{
    151155    $values = getSetEnumFieldValues($db_table, $db_col, $sort);
     
    319323 * @param  string $val_column       column containing the computer values for the select menu
    320324 * @param  string $preselected      the currently selected value of the menu. compared to the $val_column
    321  * @param  bool   $blank            leave one blank at the top?
     325 * @param  bool   $first            Optional first item; set true for a blank item, array for item with name and value.
    322326 * @param  string $extra_clause     SQL exclude clause. Something like "WHERE girls != 'buckteeth'"
    323327 */
    324 function printSelectForm($db_table, $key_column, $val_column, $preselected, $blank=false, $extra_clause='', $sql_format='SELECT %1$s, %2$s FROM %3$s %4$s')
     328function printSelectForm($db_table, $key_column, $val_column, $preselected, $first=false, $extra_clause='', $sql_format='SELECT %1$s, %2$s FROM %3$s %4$s')
    325329{
    326330    $db =& DB::getInstance();
     
    332336
    333337    // Print a blank first option.
    334     if (true === $blank) {
     338    if (true === $first) {
    335339        $selected = in_array('', $preselected) ? ' selected="selected"' : '';
    336340        ?><option value=""<?php echo $selected; ?>>&nbsp;</option>
     
    339343
    340344    // When the 'blank' value needs a specific key->val pair.
    341     if (is_array($blank)) {
    342         foreach ($blank as $key=>$val) {
     345    if (is_array($first)) {
     346        foreach ($first as $key=>$val) {
    343347            $selected = in_array($key, $preselected) ? ' selected="selected"' : '';
    344348            ?><option value="<?php echo $key; ?>"<?php echo $selected; ?>><?php echo oTxt($val); ?></option>
Note: See TracChangeset for help on using the changeset viewer.