$html .= " $currentpage \n";
}
else {
- $html .= "<a href=\"".$this->pageurl->out(false, array($this->pageparamname => $currentpage))."\">";
+ $html .= "<a href=\"".$this->pageurl->out('', false, array($this->pageparamname => $currentpage))."\">";
$html .= " $currentpage </a>\n";
}
}
return false;
}
- redirect($this->pageurl->out());
+ redirect($this->pageurl->out('&'));
}
}
} else {
$action = $strmoveleft;
}
- $icons['left'] = $this->image_icon($action, $this->parentlist->pageurl->out_action(array('left'=>$this->id)), 'left');
+ $icons['left'] = $this->image_icon($action, $this->parentlist->pageurl->out_action('', array('left'=>$this->id)), 'left');
} else {
$icons['left'] = $this->image_spacer();
}
if (!$first) {
- $icons['up'] = $this->image_icon($strmoveup, $this->parentlist->pageurl->out_action(array('moveup'=>$this->id)), 'up');
+ $icons['up'] = $this->image_icon($strmoveup, $this->parentlist->pageurl->out_action('', array('moveup'=>$this->id)), 'up');
} else {
$icons['up'] = $this->image_spacer();
}
if (!$last) {
- $icons['down'] = $this->image_icon($strmovedown, $this->parentlist->pageurl->out_action(array('movedown'=>$this->id)), 'down');
+ $icons['down'] = $this->image_icon($strmovedown, $this->parentlist->pageurl->out_action('', array('movedown'=>$this->id)), 'down');
} else {
$icons['down'] = $this->image_spacer();
}
if (!empty($lastitem)) {
$makechildof = get_string('makechildof', 'question', $lastitem->name);
- $icons['right'] = $this->image_icon($makechildof, $this->parentlist->pageurl->out_action(array('right'=>$this->id)), 'right');
+ $icons['right'] = $this->image_icon($makechildof, $this->parentlist->pageurl->out_action('', array('right'=>$this->id)), 'right');
} else {
$icons['right'] = $this->image_spacer();
}
}
- function get_query_string($overrideparams = array()){
+ function get_query_string($seperator='', $overrideparams = array()){
$arr = array();
+ if ($seperator==''){
+ $seperator = '&';
+ }
$params = $overrideparams + $this->params;
foreach ($params as $key => $val){
$arr[] = urlencode($key)."=".urlencode($val);
}
- return implode($arr, "&");
+ return implode($arr, $seperator);
}
/**
* Outputs params as hidden form elements.
* @param array $overrideparams params to add to the output url, these override existing ones with the same name.
* @return string url
*/
- function out($noquerystring = false, $overrideparams = array()) {
+ function out($seperator='', $noquerystring = false, $overrideparams = array()) {
$uri = $this->scheme ? $this->scheme.':'.((strtolower($this->scheme) == 'mailto') ? '':'//'): '';
$uri .= $this->user ? $this->user.($this->pass? ':'.$this->pass:'').'@':'';
$uri .= $this->host ? $this->host : '';
$uri .= $this->port ? ':'.$this->port : '';
$uri .= $this->path ? $this->path : '';
if (!$noquerystring){
- $uri .= (count($this->params)||count($overrideparams)) ? '?'.$this->get_query_string($overrideparams) : '';
+ $uri .= (count($this->params)||count($overrideparams)) ? '?'.$this->get_query_string($seperator, $overrideparams) : '';
}
$uri .= $this->fragment ? '#'.$this->fragment : '';
return $uri;
* @param boolean $noquerystring whether to output page params as a query string in the url.
* @return string url
*/
- function out_action($overrideparams = array()) {
+ function out_action($seperator='', $overrideparams = array()) {
$overrideparams = array('sesskey'=> sesskey()) + $overrideparams;
- return $this->out(false, $overrideparams);
+ return $this->out($seperator, false, $overrideparams);
}
}
if (!is_a($baseurl, 'moodle_url')){
$output .= ' (<a href="'. $baseurl . $pagevar .'='. $pagenum .'">'. get_string('previous') .'</a>) ';
} else {
- $output .= ' (<a href="'. $baseurl->out(false, array($pagevar => $pagenum)).'">'. get_string('previous') .'</a>) ';
+ $output .= ' (<a href="'. $baseurl->out('', false, array($pagevar => $pagenum)).'">'. get_string('previous') .'</a>) ';
}
}
$lastpage = ceil($totalcount / $perpage);
if (!is_a($baseurl, 'moodle_url')){
$output .= ' <a href="'. $baseurl . $pagevar .'=0">1</a> ...';
} else {
- $output .= ' <a href="'. $baseurl->out(false, array($pagevar => 0)).'">1</a> ...';
+ $output .= ' <a href="'. $baseurl->out('', false, array($pagevar => 0)).'">1</a> ...';
}
} else {
$startpage = 0;
if (!is_a($baseurl, 'moodle_url')){
$output .= ' <a href="'. $baseurl . $pagevar .'='. $currpage .'">'. $displaypage .'</a>';
} else {
- $output .= ' <a href="'. $baseurl->out(false, array($pagevar => $currpage)).'">'. $displaypage .'</a>';
+ $output .= ' <a href="'. $baseurl->out('', false, array($pagevar => $currpage)).'">'. $displaypage .'</a>';
}
}
if (!is_a($baseurl, 'moodle_url')){
$output .= ' ...<a href="'. $baseurl . $pagevar .'='. $lastpageactual .'">'. $lastpage .'</a> ';
} else {
- $output .= ' ...<a href="'. $baseurl->out(false, array($pagevar => $lastpageactual)).'">'. $lastpage .'</a> ';
+ $output .= ' ...<a href="'. $baseurl->out('', false, array($pagevar => $lastpageactual)).'">'. $lastpage .'</a> ';
}
}
$pagenum = $page + 1;
if (!is_a($baseurl, 'moodle_url')){
$output .= ' (<a href="'. $baseurl . $pagevar .'='. $pagenum .'">'. get_string('next') .'</a>)';
} else {
- $output .= ' (<a href="'. $baseurl->out(false, array($pagevar => $pagenum)) .'">'. get_string('next') .'</a>)';
+ $output .= ' (<a href="'. $baseurl->out('', false, array($pagevar => $pagenum)) .'">'. get_string('next') .'</a>)';
}
}
$output .= '</div>';