Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 364... Línea 364...
364
 * @return string HTML
364
 * @return string HTML
365
 */
365
 */
366
function _adodb_getmenu_option($defstr, $compare, $value, $display)
366
function _adodb_getmenu_option($defstr, $compare, $value, $display)
367
{
367
{
368
	if (   is_array($defstr) && in_array($compare, $defstr)
368
	if (   is_array($defstr) && in_array($compare, $defstr)
369
		|| !is_array($defstr) && strcasecmp($compare, $defstr) == 0
369
		|| !is_array($defstr) && strcasecmp($compare, $defstr ?? '') == 0
370
	) {
370
	) {
371
		$selected = ' selected="selected"';
371
		$selected = ' selected="selected"';
372
	} else {
372
	} else {
373
		$selected = '';
373
		$selected = '';
374
	}
374
	}
Línea 375... Línea 375...
375
 
375
 
376
	return "\n<option $value$selected>" . htmlspecialchars($display) . '</option>';
376
	return "\n<option $value$selected>" . htmlspecialchars($display) . '</option>';
Línea 377... Línea 377...
377
}
377
}
378
 
378
 
379
/*
379
/**
380
	Count the number of records this sql statement will return by using
380
 * Count the number of records this sql statement will return by using
381
	query rewriting heuristics...
381
 * query rewriting heuristics...
382
 
382
 *
383
	Does not work with UNIONs, except with postgresql and oracle.
383
 * Does not work with UNIONs, except with postgresql and oracle.
384
 
-
 
385
	Usage:
384
 *
386
 
385
 * Usage:
-
 
386
 *     $conn->Connect(...);
-
 
387
 *     $cnt = _adodb_getcount($conn, $sql);
-
 
388
 *
-
 
389
 * @param ADOConnection $zthis
-
 
390
 * @param string        $sql
387
	$conn->Connect(...);
391
 * @param bool          $inputarr
-
 
392
 * @param int           $secs2cache
388
	$cnt = _adodb_getcount($conn, $sql);
393
 *
389
 
394
 * @return false|int|mixed
390
*/
395
 */
391
function _adodb_getcount($zthis, $sql,$inputarr=false,$secs2cache=0)
396
function _adodb_getcount($zthis, $sql,$inputarr=false,$secs2cache=0)
Línea 392... Línea 397...
392
{
397
{
Línea 1379... Línea 1384...
1379
	}
1384
	}
1380
	if ($html) {
1385
	if ($html) {
1381
		$s .= '</pre>';
1386
		$s .= '</pre>';
1382
	}
1387
	}
1383
	if ($printOrArr) {
1388
	if ($printOrArr) {
1384
		print $s;
1389
		ADOConnection::outp($s);
1385
	}
1390
	}
Línea 1386... Línea 1391...
1386
 
1391
 
1387
	return $s;
1392
	return $s;