Changeset 615


Ignore:
Timestamp:
Oct 3, 2017 7:18:12 AM (7 years ago)
Author:
anonymous
Message:

Add 'href' key to printSubmitButtons()

Location:
trunk/lib
Files:
2 edited

Legend:

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

    r611 r615  
    6565        'storagetype' => 'session',
    6666
    67         // This parameter is only used for legacy support, superceeded by the 'storagetype' setting.
     67        // This parameter is only used for legacy support, superseded by the 'storagetype' setting.
    6868        // Enable database storage. If this is false, all prefs will live only as long as the session.
    6969        'persistent' => null,
  • trunk/lib/TemplateGlue.inc.php

    r479 r615  
    474474                $defaults = array();
    475475                $defaults['type'] = isset($b['type']) ? $b['type'] : 'submit';
    476                 $defaults['id'] = isset($b['id']) ? $b['id'] : sprintf('sc-%s-button', $b['name']);
    477                 $b = array_merge($defaults, $b);
    478                 echo '<input';
    479                 foreach ($b as $key => $value) {
    480                     printf(' %s="%s"', $key, oTxt($value));
     476                if (isset($b['href'])) {
     477                    echo '<a';
     478                    foreach (array_diff_key($b, array('value' => null)) as $key => $value) {
     479                        printf(' %s="%s"', $key, oTxt($value));
     480                    }
     481                    echo '>' . oTxt($b['value']) . '</a>';
     482                } else {
     483                    $defaults['id'] = isset($b['id']) ? $b['id'] : sprintf('sc-%s-button', $b['name']);
     484                    $b = array_merge($defaults, $b);
     485                    echo '<input';
     486                    foreach ($b as $key => $value) {
     487                        printf(' %s="%s"', $key, oTxt($value));
     488                    }
     489                    echo ' />';
    481490                }
    482                 echo ' />';
    483491            } else {
    484492                // For backwards compatibility.
Note: See TracChangeset for help on using the changeset viewer.