Пример #1
0
 function vpl_submissionlist_arrow($burl, $sort, $selsort, $seldir){
     global $OUTPUT;
     $newdir = 'down';
     $url = vpl_url_add_param($burl,'sort',$sort);
     if($sort == $selsort){
         $sortdir = $seldir;
         if($sortdir == 'up'){
             $newdir = 'down';
         }elseif($sortdir == 'down'){
             $newdir = 'up';
         }
     }else{
         $sortdir = 'move';
     }
     $url = vpl_url_add_param($url,'sortdir',$newdir);
     return ' <a href="'.$url.'">'.($OUTPUT->pix_icon('t/'.$sortdir,get_string($sortdir))).'</a>';
 }
Пример #2
0
 public static function vpl_list_arrow($burl, $sort, $instanceselection, $selsort, $seldir)
 {
     global $OUTPUT;
     $newdir = 'down';
     //Dir to go if click
     $url = vpl_url_add_param($burl, 'sort', $sort);
     $url = vpl_url_add_param($url, 'selection', $instanceselection);
     if ($sort == $selsort) {
         $sortdir = $seldir;
         if ($sortdir == 'up') {
             $newdir = 'down';
         } elseif ($sortdir == 'down') {
             $newdir = 'up';
         } else {
             //Unknow sortdir
             $sortdir = 'down';
         }
         $url = vpl_url_add_param($url, 'sortdir', $newdir);
     } else {
         $sortdir = 'move';
     }
     return '<a href="' . $url . '">' . $OUTPUT->pix_icon('t/' . $sortdir, get_string($sortdir)) . '</a>';
 }
 public function get_link()
 {
     global $OUTPUT;
     $text = '<spam class="vpl_sim' . (int) $this->get_level1() . '">';
     $text .= (int) $this->s1;
     $text .= '</spam>';
     $text .= '|';
     $text .= '<spam class="vpl_sim' . (int) $this->get_level2() . '">';
     $text .= (int) $this->s2;
     $text .= '</spam>';
     $text .= '|';
     $text .= '<spam class="vpl_sim' . (int) $this->get_level3() . '">';
     $text .= (int) $this->s3;
     $text .= '</spam>';
     if ($this->first->can_access() && $this->second->can_access()) {
         $url = vpl_mod_href('similarity/diff.php', 'id', required_param('id', PARAM_INT));
         foreach ($this->first->link_parms('1') as $parm => $value) {
             $url = vpl_url_add_param($url, $parm, $value);
         }
         foreach ($this->second->link_parms('2') as $parm => $value) {
             $url = vpl_url_add_param($url, $parm, $value);
         }
         $options = array('height' => 800, 'width' => 900, 'directories' => 0, 'location' => 0, 'menubar' => 0, 'personalbar' => 0, 'status' => 0, 'toolbar' => 0);
         $action = new popup_action('click', $url, 'viewdiff' . $this->id, $options);
         $HTML = $OUTPUT->action_link($url, $text, $action);
     } else {
         $HTML = $text;
     }
     $HTML .= $this->s1 >= self::$min_s1 ? '*' : '';
     $HTML .= $this->s2 >= self::$min_s2 ? '*' : '';
     $HTML .= $this->s3 >= self::$min_s3 ? '*' : '';
     $HTML = '<div class="vpl_sim' . (int) $this->get_level() . '">' . $HTML . '</div>';
     return $HTML;
 }