| 407 |
} |
} |
| 408 |
|
|
| 409 |
/** |
/** |
| 410 |
* @param string SQL with ordering As value and 'name field' AS text |
* @param string |
| 411 |
* @param integer The length of the truncated headline |
* @return string |
| 412 |
|
* Deprecated - use the code within this function instead - not used in Mambo |
| 413 |
*/ |
*/ |
| 414 |
function mosGetOrderingList( $sql, $chop='30' ) { |
function mosParseParams( $txt ) { |
| 415 |
global $database; |
$pparser = new mosParameters($txt); |
| 416 |
|
return $pparser->getParams(); |
|
$order = array(); |
|
|
$database->setQuery( $sql ); |
|
|
if (!($orders = $database->loadObjectList())) { |
|
|
if ($database->getErrorNum()) { |
|
|
echo $database->stderr(); |
|
|
return false; |
|
|
} else { |
|
|
$order[] = mosHTML::makeOption( 1, 'first' ); |
|
|
return $order; |
|
|
} |
|
| 417 |
} |
} |
|
$order[] = mosHTML::makeOption( 0, '0 first' ); |
|
|
for ($i=0, $n=count( $orders ); $i < $n; $i++) { |
|
| 418 |
|
|
| 419 |
if (strlen($orders[$i]->text) > $chop) { |
class mosEmpty { |
| 420 |
$text = substr($orders[$i]->text,0,$chop)."..."; |
function def( $key, $value='' ) { |
| 421 |
} else { |
return 1; |
|
$text = $orders[$i]->text; |
|
| 422 |
} |
} |
| 423 |
|
function get( $key, $default='' ) { |
| 424 |
$order[] = mosHTML::makeOption( $orders[$i]->value, $orders[$i]->value.' ('.$text.')' ); |
return 1; |
| 425 |
} |
} |
|
$order[] = mosHTML::makeOption( $orders[$i-1]->value+1, ($orders[$i-1]->value+1).' last' ); |
|
|
|
|
|
return $order; |
|
| 426 |
} |
} |
| 427 |
|
|
|
|
|
| 428 |
?> |
?> |