Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit a7de154

Browse files
author
Julien Jomier
committed
BUG: 9690: Rename download link to view website
1 parent 7c6b139 commit a7de154

File tree

9 files changed

+51
-78
lines changed

9 files changed

+51
-78
lines changed

core/controllers/BrowseController.php

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,28 +42,17 @@ public function indexAction()
4242
$communities = $this->User->getUserCommunities($this->userSession->Dao);
4343
$communities = array_merge($communities, $this->Community->getPublicCommunities());
4444
}
45-
46-
$header .= "<ul class = 'pathBrowser'>";
47-
$header .= " <li class = 'pathData'><a href = '".$this->view->webroot."/browse'>".$this->t('Data')."</a></li>";
48-
$header .= "</ul>";
49-
45+
5046
$this->view->Date = $this->Component->Date;
5147

52-
$this->Component->Sortdao->field = 'name';
53-
$this->Component->Sortdao->order = 'asc';
54-
usort($communities, array($this->Component->Sortdao, 'sortByName'));
55-
$communities = $this->Component->Sortdao->arrayUniqueDao($communities );
56-
57-
$this->view->communities = $communities;
58-
$this->view->header = $header;
48+
$this->view->header = $this->t('Explore');
5949

6050
$this->view->itemThumbnails = $this->Item->getRandomItems($this->userSession->Dao, 0, 12, true);
6151
$this->view->nUsers = $this->User->getCountAll();
6252
$this->view->nCommunities = $this->Community->getCountAll();
6353
$this->view->nItems = $this->Item->getCountAll();
6454
$this->view->notifications = array();
6555

66-
$this->view->json['community']['createCommunity'] = $this->t('Create a community');
6756
$this->view->json['community']['titleCreateLogin'] = $this->t('Please log in');
6857
$this->view->json['community']['contentCreateLogin'] = $this->t('You need to be logged in to be able to create a community.');
6958
}

core/controllers/ItemController.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,20 @@ function viewAction()
9090
$itemDao->lastrevision = $itemRevision;
9191
$itemDao->revisions = $itemDao->getRevisions();
9292

93+
// Display the good link if the item is pointing to a website
94+
$this->view->itemIsLink = false;
95+
96+
$bitstreams = $itemRevision->getBitstreams();
97+
if(count($bitstreams) == 1)
98+
{
99+
$bitstream = $bitstreams[0];
100+
if(strpos($bitstream->getPath(), 'http://') !== false)
101+
{
102+
$this->view->itemIsLink = true;
103+
}
104+
}
105+
106+
93107
$this->Component->Sortdao->field = 'revision';
94108
$this->Component->Sortdao->order = 'desc';
95109
usort($itemDao->revisions, array($this->Component->Sortdao, 'sortByNumber'));
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
div.viewSideBar input.globalButton{
22
margin-left: 0px!important;
3-
}
3+
}

core/views/admin/dashboard.phtml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ PURPOSE. See the above copyright notices for more information.
2121
foreach($dasboard as $name => $status)
2222
{
2323
echo "<tr>";
24-
echo " <td>$name</td>";
24+
echo " <td>$name </td>";
2525
if($status)
2626
{
2727
echo " <td><img src='{$this->coreWebroot}/public/images/icons/ok.png' /></td>";
@@ -38,5 +38,4 @@ PURPOSE. See the above copyright notices for more information.
3838
}
3939
echo "</table>";
4040
}
41-
?>
42-
41+
?>

core/views/admin/upgrade.phtml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,18 @@ PURPOSE. See the above copyright notices for more information.
1313
<link type="text/css" rel="stylesheet" href="<?php echo $this->coreWebroot?>/public/css/admin/admin.upgrade.css" />
1414
<script type="text/javascript" src="<?php echo $this->coreWebroot?>/public/js/admin/admin.upgrade.js"></script>
1515

16-
<h3>Core :</h3>
17-
Current version: <?php echo $this->core['currentText']?> <br/>
16+
<h3>Core:</h3>
17+
Current version: <?php echo $this->core['currentText']?><br/>
1818
<?php
1919
if($this->core['current']<$this->core['target'])
2020
{
2121
echo "Need to upgrade to version: ".$this->core['targetText'];
2222
}
23+
else
24+
{
25+
echo "MIDAS is up to date.";
26+
}
2327
?>
24-
2528
<h3>Modules:</h3>
2629
<?php
2730
foreach($this->modules as $name=>$module)
@@ -32,11 +35,17 @@ foreach($this->modules as $name=>$module)
3235
{
3336
echo "Need to upgrade to version: ".$module['targetText'];
3437
}
35-
38+
}
39+
40+
if(count($this->modules) == 0)
41+
{
42+
echo "No module enabled.";
3643
}
3744
?>
3845
<br/>
3946
<br/>
4047
<form id='upgradeMIDAS' action="<?php echo $this->webroot?>/admin/upgrade" method="post">
4148
<input type='submit' class="globalButton" value="Upgrade"/>
42-
</form>
49+
</form>
50+
<br/><br/>
51+
<a href="<?php echo $this->webroot?>/admin/migratemidas2">Upgrade from MIDAS2</a>

core/views/browse/index.phtml

Lines changed: 6 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -19,59 +19,12 @@ $this->headScript()->appendFile($this->coreWebroot.'/public/js/common/common.bro
1919
<link type="text/css" rel="stylesheet" href="<?php echo $this->coreWebroot?>/public/css/common/common.browser.css" />
2020
<link type="text/css" rel="stylesheet" href="<?php echo $this->coreWebroot?>/public/css/browse/browse.index.css" />
2121
<div class="viewMain">
22-
<img class="tableLoading" alt="" src="<?php echo $this->coreWebroot?>/public/images/icons/loading.gif"/>
23-
<table id="browseTable" class="midasTree">
24-
<thead>
25-
<?php
26-
if(!empty($this->communities))
27-
{ ?>
28-
<tr>
29-
<th class="thData"><?php echo $this->t('Name');?></th>
30-
<th class="thSize"><?php echo $this->t('Size');?></th>
31-
<th class="thDate"><?php echo $this->t('Modified');?></th>
32-
<th class="thCheckbox"></th>
33-
</tr>
34-
<?php
35-
}
36-
?>
37-
</thead>
38-
<tbody>
39-
<?php
40-
$node=1;
41-
foreach($this->communities as $community)
42-
{
43-
$folder = $community->getFolder();
44-
if($folder != false)
45-
{
46-
echo "<tr id='node--$node' class='parent' privacy='".($community->getPrivacy() == 1 ? MIDAS_PRIVACY_PRIVATE : MIDAS_PRIVACY_PUBLIC )."' type='community' element='{$community->getCommunityId()}' ajax='{$folder->getFolderId()}'>";
47-
echo " <td class='treeBrowseElement'><span class='community'>{$community->getName()}</span></td>";
48-
echo " <td><img class='folderLoading' element='{$folder->getFolderId()}' alt='' src='{$this->coreWebroot}/public/images/icons/loading.gif'/></td>";
49-
echo " <td>{$this->Date->ago($folder->getDate(),true)}</td>";
50-
echo " <td><input type='checkbox' class='treeCheckbox' type='community' element='{$community->getCommunityId()}' /></td>";
51-
echo "</tr>";
52-
$node++;
53-
}
54-
}
55-
?>
56-
</tbody>
57-
</table>
58-
59-
<?php
60-
if(empty($this->communities))
61-
{
62-
echo "<h4>{$this->t("No community available")}. <a class='createCommunity' >{$this->t("Create your own community")}!</a> </h4>";
63-
}
64-
?>
22+
6523
</div>
6624

67-
<div id="guideRobot">
68-
<?php
69-
foreach($this->communities as $community)
70-
{
71-
echo "<a href='{$this->webroot}/community/{$community->getKey()}'>{$community->getName()}</a> ";
72-
}
73-
?>
74-
</div>
25+
26+
27+
7528

7629
<div class="viewSideBar">
7730
<div class="sideElementFirst viewAction" >
@@ -95,8 +48,8 @@ $this->headScript()->appendFile($this->coreWebroot.'/public/js/common/common.bro
9548

9649

9750
<div class="defaultSide" >
98-
<div class='sideElementFirst feedNotification'>
99-
MIDAS integrates multimedia server technology with Kitware's open-source data analysis and visualization clients. The server follows open standards for data storage, access and harvesting.
51+
<div align="justify" class='sideElementFirst feedNotification'>
52+
MIDAS integrates multimedia server technology with open-source data analysis and visualization clients. The server follows open standards for data storage, access and harvesting.
10053
</div>
10154
<?php
10255
if(!empty($this->notifications))

core/views/feed/index.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ $this->headScript()->appendFile($this->coreWebroot.'/public/js/feed/feed.index.j
2020
</div>
2121
<div class="viewSideBar">
2222
<div align="justify" class='sideElementFirst feedNotification'>
23-
MIDAS integrates multimedia server technology with Kitware's open-source data analysis and visualization clients. The server follows open standards for data storage, access and harvesting.
23+
MIDAS integrates multimedia server technology with open-source data analysis and visualization clients. The server follows open standards for data storage, access and harvesting.
2424
</div>
2525
<?php
2626
if(!empty($this->notifications))

core/views/item/view.phtml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,16 @@ $this->headScript()->appendFile($this->coreWebroot . '/public/js/item/item.view.
118118
<?php
119119
echo
120120
"<li>
121-
<a href='{$this->webroot}/download/?items={$this->itemDao->getKey()}'>{$this->t('Download lastest revision')}</a>
121+
<a href='{$this->webroot}/download/?items={$this->itemDao->getKey()}'>";
122+
if($this->itemIsLink)
123+
{
124+
echo $this->t('View as weblink');
125+
}
126+
else
127+
{
128+
echo $this->t('Download lastest revision');
129+
}
130+
echo "</a>
122131
</li>
123132
";
124133
if($this->preview)

core/views/user/register.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ PURPOSE. See the above copyright notices for more information.
1616
<link href="<?php echo $this->coreWebroot?>/public/css/user/user.register.css?<?php echo time();?> " rel="stylesheet" type="text/css" />
1717
<div class="registerContent">
1818
<div class="registerInfo">
19-
MIDAS integrates multimedia server technology with Kitware's open-source data analysis and visualization clients. The server follows open standards for data storage, access and harvesting.
19+
MIDAS integrates multimedia server technology with open-source data analysis and visualization clients. The server follows open standards for data storage, access and harvesting.
2020
</div>
2121
<div class="register">
2222
<form id="registerForm" class="genericForm" method="<?php echo $this->form['method']?>" action="<?php echo $this->form['action']?>">

0 commit comments

Comments
 (0)