Skip to content

Commit 3a6bc87

Browse files
committed
discopower: Code cleanup to match 1.17 module
1 parent 5e25f40 commit 3a6bc87

1 file changed

Lines changed: 7 additions & 27 deletions

File tree

themes/ssp/discopower/disco.tpl.php

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,34 +23,17 @@
2323
$faventry = $slist[$this->data['preferredidp']];
2424
}
2525

26-
27-
if(!array_key_exists('header', $this->data)) {
28-
$this->data['header'] = 'selectidp';
29-
}
26+
$this->data['header'] = $this->t('selectidp');
3027
$this->data['header'] = $this->t($this->data['header']);
31-
$this->data['jquery'] = array('core' => TRUE, 'ui' => TRUE, 'css' => TRUE);
32-
33-
34-
$this->data['head'] = '<script type="text/javascript" src="' . SimpleSAML\Module::getModuleUrl('discopower/assets/js/jquery.livesearch.js') . '"></script>';
35-
$this->data['head'] .= '<script type="text/javascript" src="' . SimpleSAML\Module::getModuleUrl('discopower/assets/js/' . $this->data['score'] . '.js') . '"></script>';
36-
37-
$this->data['head'] .= '<script type="text/javascript">
38-
39-
$(document).ready(function() {';
40-
$i = 0;
41-
foreach ($this->data['idplist'] AS $tab => $slist) {
42-
if ($tab == 'idps_in_searchable_list') {
43-
$this->data['head'] .= "\n" . '$("#query_' . $tab . '").liveUpdate("#list_' . $tab . '")' .
44-
(($i++ == 0) && (empty($faventry)) ? '.focus()' : '') . ';';
45-
}
46-
28+
$this->data['jquery'] = ['core' => true, 'ui' => true, 'css' => true];
4729

48-
}
4930

50-
$this->data['head'] .= '
51-
});
31+
$this->data['head'] = '<script type="text/javascript" src="'.
32+
SimpleSAML\Module::getModuleURL('discopower/assets/js/jquery.livesearch.js').'"></script>'."\n";
33+
$this->data['head'] .= '<script type="text/javascript" src="'.
34+
SimpleSAML\Module::getModuleURL('discopower/assets/js/' . $this->data['score'].'.js') . '"></script>'."\n";
5235

53-
</script>';
36+
$this->data['head'] .= $this->data['search'];
5437

5538
if (!empty($faventry)) $this->data['autofocus'] = 'favouritesubmit';
5639

@@ -230,7 +213,4 @@ function getTranslatedName($t, $metadata) {
230213
?>
231214

232215

233-
234-
235-
236216
<?php $this->includeAtTemplateBase('includes/footer.php');

0 commit comments

Comments
 (0)