function &parseTypeOptions() { static $typeOptions; if (!isset($typeOptions)) { $info = optional_param('type', '', PARAM_ALPHANUM); $typeOptions = array(); if ($info != '') { // TODO! if (($s = strpos($info, 'repository')) !== false) { $v = ''; $p = substr($info, $s + 10); $i = -1; while (($c = substr($p, ++$i, 1)) >= 'A' && $c <= 'Z') { $v .= $c; } if ($v != '') { $typeOptions['repository'] = podcaster_util::az2number($v); } } if (($s = strpos($info, 'format')) !== false) { $v = ''; $p = substr($info, $s + 6); $i = -1; while (($c = substr($p, ++$i, 1)) >= 'A' && $c <= 'Z') { $v .= $c; } if ($v != '') { $typeOptions['format'] = strtolower($v); } } if (($s = strpos($info, 'license')) !== false) { $v = ''; $p = substr($info, $s + 7); $i = -1; while (($c = substr($p, ++$i, 1)) >= 'A' && $c <= 'Z') { $v .= $c; } if ($v != '') { $typeOptions['license'] = podcaster_util::az2number($v); } } } } return $typeOptions; }