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

Commit 7c6b139

Browse files
author
Julien Jomier
committed
ENH: Some style fixes
ENH: Added User page BUG: 9679: Data/Données should be renamed "Explore"
1 parent 25b71ad commit 7c6b139

File tree

18 files changed

+200
-37
lines changed

18 files changed

+200
-37
lines changed

core/controllers/CommunityController.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function init()
2929
}
3030
} // end init()
3131

32-
/** manage community*/
32+
/** Manage community*/
3333
function manageAction()
3434
{
3535
if(!$this->logged)
@@ -214,7 +214,7 @@ function manageAction()
214214
}//end manageAction
215215

216216

217-
/** index*/
217+
/** Index */
218218
function indexAction()
219219
{
220220
$this->view->header = $this->t("Communities");
@@ -235,12 +235,12 @@ function indexAction()
235235
$this->Component->Sortdao->field = 'name';
236236
$this->Component->Sortdao->order = 'asc';
237237
usort($communities, array($this->Component->Sortdao, 'sortByName'));
238-
$communities = $this->Component->Sortdao->arrayUniqueDao($communities );
238+
$communities = $this->Component->Sortdao->arrayUniqueDao($communities);
239239

240240
$this->view->userCommunities = $communities;
241241
}//end index
242242

243-
/** view a community*/
243+
/** View a community*/
244244
function viewAction()
245245
{
246246
$this->view->Date = $this->Component->Date;
@@ -313,7 +313,7 @@ function viewAction()
313313

314314
$this->view->title .= ' - '.$communityDao->getName();
315315
$this->view->metaDescription = substr($communityDao->getDescription(), 0, 160);
316-
}//end view
316+
} //end index
317317

318318
/** Delete a community*/
319319
function deleteAction()
@@ -337,7 +337,7 @@ function deleteAction()
337337
$this->_redirect('/');
338338
}//end delete
339339

340-
/** Invit user to a community*/
340+
/** Invite a user to a community*/
341341
function invitationAction()
342342
{
343343
$this->_helper->layout->disableLayout();
@@ -376,9 +376,9 @@ function invitationAction()
376376
}
377377
}
378378
}
379-
}//end delete
379+
}//end invite
380380

381-
/** create a community (ajax)*/
381+
/** Create a community (ajax)*/
382382
function createAction()
383383
{
384384
if(!$this->logged)
@@ -404,9 +404,9 @@ function createAction()
404404
$this->_helper->layout->disableLayout();
405405
$this->view->form = $this->getFormAsArray($form);
406406
}
407-
}//end index
407+
}//end create
408408

409-
/** valid entries (ajax)*/
409+
/** Validate entries (ajax)*/
410410
public function validentryAction()
411411
{
412412
if(!$this->getRequest()->isXmlHttpRequest())

core/controllers/UserController.php

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,30 @@ function init()
2828
}
2929
} // end init()
3030

31+
/** Index */
32+
function indexAction()
33+
{
34+
$this->view->header = $this->t("Users");
35+
$this->view->json['user']['createCommunity'] = $this->t('Create a community');
36+
$this->view->json['user']['titleCreateLogin'] = $this->t('Please log in');
37+
$this->view->json['user']['contentCreateLogin'] = $this->t('You need to be logged in to be able to create a community.');
38+
39+
if($this->logged && $this->userSession->Dao->isAdmin())
40+
{
41+
$users = $this->User->getAll();
42+
}
43+
else
44+
{
45+
$users = $this->User->getPublicUsers();
46+
}
47+
48+
$this->Component->Sortdao->field = 'name';
49+
$this->Component->Sortdao->order = 'asc';
50+
usort($users, array($this->Component->Sortdao, 'sortByName'));
51+
$users = $this->Component->Sortdao->arrayUniqueDao($users);
52+
53+
$this->view->users = $users;
54+
} //end index
3155

3256
/** Recover the password (ajax) */
3357
function recoverpasswordAction()
@@ -77,7 +101,6 @@ function make_seed_recoverpass()
77101

78102
$user->setPassword(md5($pass));
79103

80-
81104
// Send the email
82105
$url = $this->getServerURL().$this->view->webroot;
83106

@@ -100,7 +123,7 @@ function make_seed_recoverpass()
100123
}
101124
} // end recoverpassword
102125

103-
/** logout an user*/
126+
/** Logout a user */
104127
function logoutAction()
105128
{
106129
$this->userSession->Dao = null;
@@ -110,7 +133,7 @@ function logoutAction()
110133
} //end logoutAction
111134

112135

113-
/** register an user*/
136+
/** Register a user */
114137
function registerAction()
115138
{
116139
$form = $this->Form->User->createRegisterForm();
@@ -132,8 +155,7 @@ function registerAction()
132155
));
133156
} //end register
134157

135-
136-
/** check log in action*/
158+
/** Login action */
137159
function loginAction()
138160
{
139161
$this->Form->User->uri = $this->getRequest()->getRequestUri();
@@ -159,7 +181,6 @@ function loginAction()
159181
$authLdap = false;
160182
}
161183

162-
163184
$passwordPrefix = Zend_Registry::get('configGlobal')->password->prefix;
164185
if($authLdap || $userDao != false && md5($passwordPrefix.$form->getValue('password')) == $userDao->getPassword())
165186
{
@@ -207,7 +228,7 @@ function loginAction()
207228
} // end method login
208229

209230

210-
/** term of service */
231+
/** Term of service */
211232
public function termofserviceAction()
212233
{
213234
if($this->getRequest()->isXmlHttpRequest())
@@ -217,7 +238,7 @@ public function termofserviceAction()
217238
} // end term of service
218239

219240

220-
/** valid entries (ajax)*/
241+
/** Valid entries (ajax) */
221242
public function validentryAction()
222243
{
223244
if(!$this->getRequest()->isXmlHttpRequest() && !$this->isTestingEnv())
@@ -274,7 +295,7 @@ public function validentryAction()
274295
}
275296
} //end valid entry
276297

277-
/** settings page action*/
298+
/** Settings page action */
278299
public function settingsAction()
279300
{
280301
if(!$this->logged)
@@ -470,7 +491,7 @@ public function settingsAction()
470491
$this->view->customTabs = Zend_Registry::get('notifier')->notify(MIDAS_NOTIFY_GET_CONFIG_TABS, array());
471492
}
472493

473-
/** user page action*/
494+
/** User page action*/
474495
public function userpageAction()
475496
{
476497
$this->view->Date = $this->Component->Date;
@@ -521,7 +542,7 @@ public function userpageAction()
521542
$this->view->information = array();
522543
}
523544

524-
/** manage files page action*/
545+
/** Manage files page action*/
525546
public function manageAction()
526547
{
527548
$this->view->Date = $this->Component->Date;

core/layouts/layout.phtml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ echo $this->doctype()
168168
}
169169
if($this->highNumberError)
170170
{
171-
echo '<span style="color:red;">More thant 5 errors occured during the last 24 hours. <a href="'.$this->webroot.'/admin/#ui-tabs-2">Check the logs</a></span><br/><br/>';
171+
echo '<span style="color:red;">More than 5 errors occured in the last 24 hours. <a href="'.$this->webroot.'/admin/#ui-tabs-2">Check the logs</a></span><br/><br/>';
172172
}
173173
?>
174174
<div class=SubWrapper">
@@ -177,15 +177,16 @@ echo $this->doctype()
177177
<div class="SideBar">
178178
<ul>
179179
<li <?php if($this->activemenu=='feed') {echo 'class="active"';} ?> onclick="location.replace('<?php echo $this->webroot?>/feed');" ><a href="<?php echo $this->webroot?>/feed"><img alt="" src="<?php echo $this->coreWebroot?>/public/images/icons/feed.png" /><span> <?php echo $this->t('Feed');?></span></a></li>
180-
<li <?php if($this->activemenu=='browse') {echo 'class="active"';} ?> onclick="location.replace('<?php echo $this->webroot?>/browse');" ><a href="<?php echo $this->webroot?>/browse"><img alt="" src="<?php echo $this->coreWebroot?>/public/images/icons/data.png" /><span> <?php echo $this->t('Data');?></span></a></li>
181-
<li <?php if($this->activemenu=='community') {echo 'class="active"';} ?> onclick="location.replace('<?php echo $this->webroot?>/community');" ><a href="<?php echo $this->webroot?>/community"><img alt="" src="<?php echo $this->coreWebroot?>/public/images/icons/community.png" /><span> <?php echo $this->t('Communities');?></span></a></li>
182-
<li id="menuUserInfo" <?php if($this->activemenu=='user') {echo 'class="active"';} ?> ><a href="javascript:;"><img alt="" src="<?php echo $this->coreWebroot?>/public/images/icons/upload.png" /><span> <?php echo $this->t('My Uploads');?></span></a></li>
180+
<li <?php if($this->activemenu=='browse') {echo 'class="active"';} ?> onclick="location.replace('<?php echo $this->webroot?>/browse');" ><a href="<?php echo $this->webroot?>/browse"><img alt="" src="<?php echo $this->coreWebroot?>/public/images/icons/explore.png" /><span> <?php echo $this->t('Explore');?></span></a></li>
181+
<li <?php if($this->activemenu=='community') {echo 'class="active"';} ?> onclick="location.replace('<?php echo $this->webroot?>/community');" ><a href="<?php echo $this->webroot?>/community"><img alt="" src="<?php echo $this->coreWebroot?>/public/images/icons/community2.png" /><span> <?php echo $this->t('Communities');?></span></a></li>
182+
<li <?php if($this->activemenu=='user') {echo 'class="active"';} ?> onclick="location.replace('<?php echo $this->webroot?>/user');" ><a href="<?php echo $this->webroot?>/user"><img alt="" src="<?php echo $this->coreWebroot?>/public/images/icons/users.png" /><span> <?php echo $this->t('Users');?></span></a></li>
183+
<li id="menuUserInfo" <?php if($this->activemenu=='user') {echo 'class="active"';} ?> ><a href="javascript:;"><img alt="" src="<?php echo $this->coreWebroot?>/public/images/icons/user.png" /><span> <?php echo $this->t('My profile');?></span></a></li>
183184

184185
<?php
185186
if($this->showUploadedLink)
186187
{
187188
?>
188-
<li <?php if($this->activemenu=='uploaded') {echo 'class="active"';} ?> onclick="location.replace('<?php echo $this->webroot?>/browse/uploaded');" ><a href="<?php echo $this->webroot?>/browse/uploaded"><img alt="" src="<?php echo $this->coreWebroot?>/public/images/icons/addfile.png" /><span> <?php echo $this->t('Uploaded files');?></span></a></li>
189+
<li <?php if($this->activemenu=='uploaded') {echo 'class="active"';} ?> onclick="location.replace('<?php echo $this->webroot?>/browse/uploaded');" ><a href="<?php echo $this->webroot?>/browse/uploaded"><img alt="" src="<?php echo $this->coreWebroot?>/public/images/icons/addfile.png" /><span> <?php echo $this->t('My uploads');?></span></a></li>
189190
<?php
190191
}
191192
?>

core/models/base/UserModelBase.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ abstract function getUserCommunities($userDao);
5353
abstract function getByUuid($uuid);
5454
/** Returns a user given its folder (either public,private or base folder) */
5555
abstract function getByFolder($folder);
56+
/** Returns all the public users. Limited to 20 by default. */
57+
abstract function getPublicUsers($limit = 20);
58+
/** Returns all the users */
59+
abstract function getAll();
5660

5761
/** save */
5862
public function save($dao)

core/models/pdo/CommunityModel.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,10 @@ function getAll()
6363
$return[] = $this->initDao('Community', $row);
6464
}
6565
return $return;
66-
} // end getByName()
66+
} // end getAll()
6767

68-
/** get public Communities
69-
*
70-
* @return Array of Community Dao
71-
*/
68+
/** Get public Communities
69+
* @return Array of Community Dao */
7270
function getPublicCommunities($limit = 20)
7371
{
7472
if(!is_numeric($limit))
@@ -86,7 +84,7 @@ function getPublicCommunities($limit = 20)
8684
$return[] = $this->initDao('Community', $row);
8785
}
8886
return $return;
89-
}
87+
} // end getPublicCommunities()
9088

9189
/** Return a list of communities corresponding to the search */
9290
function getCommunitiesFromSearch($search, $userDao, $limit = 14, $group = true, $order = 'view')

core/models/pdo/UserModel.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,40 @@ public function getUserCommunities($userDao)
7474
return $return;
7575
} // end getUserCommunities
7676

77+
/** Get all */
78+
function getAll()
79+
{
80+
$rowset = $this->database->fetchAll($this->database->select());
81+
$return = array();
82+
foreach($rowset as $row)
83+
{
84+
$return[] = $this->initDao('User', $row);
85+
}
86+
return $return;
87+
} // end getAll()
88+
89+
/** Get public users
90+
* @return Array of Users Dao */
91+
function getPublicUsers($limit = 20)
92+
{
93+
if(!is_numeric($limit))
94+
{
95+
throw new Zend_Exception("Error parameter.");
96+
}
97+
$sql = $this->database->select()->from($this->_name)
98+
->where('privacy = ?', MIDAS_USER_PUBLIC)
99+
->limit($limit);
100+
101+
$rowset = $this->database->fetchAll($sql);
102+
$return = array();
103+
foreach($rowset as $row)
104+
{
105+
$return[] = $this->initDao('User', $row);
106+
}
107+
return $return;
108+
} // end getPublicUsers()
109+
110+
77111
/** Returns a user given its folder (either public,private or base folder) */
78112
function getByFolder($folder)
79113
{

core/public/css/item/item.view.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,8 @@ table#browseTable{
1313

1414
table#metadataTable{
1515
display: table!important;
16-
}
16+
}
17+
18+
div.genericInfo .genericCompany {
19+
font-size: 10px;
20+
}

core/public/css/user/user.index.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
div.userList{
2+
3+
}
4+
5+
div.userList div{
6+
border-bottom: 1px dotted grey;
7+
padding-top: 5px;
8+
padding-bottom: 5px;
9+
}
10+
11+
div.userList a.userTitle{
12+
font-weight: bold;
13+
font-size: 14px;
14+
}
15+
16+
div.userList span{
17+
padding-left: 15px;
18+
}
19+
20+
div.userBlock:hover{
21+
background-color: #F6F9FE;
22+
cursor: pointer;
23+
}
340 Bytes
Loading

core/public/images/icons/explore.png

3.47 KB
Loading

core/public/images/icons/user.png

705 Bytes
Loading

core/public/images/icons/users.png

1.03 KB
Loading

core/public/js/layout/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ $(function() {
196196
});
197197

198198
$('#menuUserInfo').click(function(){
199-
globalAuthAsk(json.global.webroot+'/user/userpage#tabs-3');
199+
globalAuthAsk(json.global.webroot+'/user/userpage');
200200
});
201201
$("div.TopDynamicBar .closeButton").click(function()
202202
{

core/public/js/user/user.index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
$(document).ready(function() {
2+
3+
$('.userBlock').click(function(){
4+
$(location).attr('href',($('> .userTitle',this).attr('href')));
5+
})
6+
7+
});
8+

core/translation/fr-main.csv

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,4 +238,6 @@ Step 3: Where do you want to upload your files;Etape 3: Ou voulez vous ajouter d
238238
Save Link;Sauver Lien
239239
Please use the large file tool, the following files are too big:;Merci d'utiliser l'outil pour ajouter des fichiers volumineux pour les fichiers suivants:
240240
Not registered yet?;Pas encore enregistr�?
241-
Register here;Enregistrez vous ici
241+
Register here;Enregistrez vous ici
242+
My profile;Mon profile
243+
My uploads;Mes uploads

core/views/admin/index.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ $this->headScript()->appendFile($this->coreWebroot . '/public/js/admin/admin.ind
9595
echo "Total space: {$assetstore->totalSpaceText}<br/>";
9696
if(($assetstore->freeSpace/$assetstore->totalSpace<0.10))
9797
{
98-
echo "<b>Free space: {$assetstore->freeSpaceText}. Almost full!!!</b>";
98+
echo "<b>Free space: {$assetstore->freeSpaceText}. Less than 10% free!</b>";
9999
}
100100
else
101101
{

0 commit comments

Comments
 (0)