mirror of
https://github.com/processwire/processwire.git
synced 2025-08-17 20:11:46 +02:00
A couple of minor adjustments
This commit is contained in:
@@ -1007,6 +1007,10 @@ class WireDatabaseBackup {
|
|||||||
protected function restorePDO($filename, array $options = array()) {
|
protected function restorePDO($filename, array $options = array()) {
|
||||||
|
|
||||||
$fp = fopen($filename, "rb");
|
$fp = fopen($filename, "rb");
|
||||||
|
if($fp === false) {
|
||||||
|
$this->error("Unable to open: $filename");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
$numInserts = 0;
|
$numInserts = 0;
|
||||||
$numTables = 0;
|
$numTables = 0;
|
||||||
$numQueries = 0;
|
$numQueries = 0;
|
||||||
|
@@ -63,10 +63,9 @@ class InputfieldSelect extends Inputfield {
|
|||||||
* If you want to add an optgroup, use the $value param as the label, and the label param as an array of options.
|
* If you want to add an optgroup, use the $value param as the label, and the label param as an array of options.
|
||||||
* Note that optgroups may not be applicable to other Inputfields that descend from InputfieldSelect.
|
* Note that optgroups may not be applicable to other Inputfields that descend from InputfieldSelect.
|
||||||
*
|
*
|
||||||
* @param string $value Value that the option submits
|
* @param string $value Value that the option submits (or label of optgroup, if specifying an optgroup)
|
||||||
* @param string $label|array Optional label associated with the value (if null, value will be used as the label)
|
* @param string $label|array Optional label associated with the value (if null, value will be used as the label), or array of optgroup options [value=>label]
|
||||||
* @param array $attributes Optional attributes to be associated with this option (i.e. a 'selected' attribute for
|
* @param array $attributes Optional attributes to be associated with this option (i.e. a 'selected' attribute for an <option> tag)
|
||||||
* an <option> tag)
|
|
||||||
* @return $this
|
* @return $this
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -315,7 +314,7 @@ class InputfieldSelect extends Inputfield {
|
|||||||
public function isOptionSelected($value) {
|
public function isOptionSelected($value) {
|
||||||
|
|
||||||
$valueAttr = $this->attr('value');
|
$valueAttr = $this->attr('value');
|
||||||
if(empty($valueAttr)) {
|
if($this->isEmpty()) {
|
||||||
// no value set yet, check if it's set in any of the option attributes
|
// no value set yet, check if it's set in any of the option attributes
|
||||||
$selected = false;
|
$selected = false;
|
||||||
if(isset($this->optionAttributes[$value])) {
|
if(isset($this->optionAttributes[$value])) {
|
||||||
|
Reference in New Issue
Block a user