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

Commit

Permalink
ENH: Some style fixes
Browse files Browse the repository at this point in the history
ENH: Added User page
BUG: 9679: Data/Données should be renamed "Explore"
  • Loading branch information
Julien Jomier committed May 28, 2011
1 parent 25b71ad commit 7c6b139
Show file tree
Hide file tree
Showing 18 changed files with 200 additions and 37 deletions.
20 changes: 10 additions & 10 deletions core/controllers/CommunityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function init()
}
} // end init()

/** manage community*/
/** Manage community*/
function manageAction()
{
if(!$this->logged)
Expand Down Expand Up @@ -214,7 +214,7 @@ function manageAction()
}//end manageAction


/** index*/
/** Index */
function indexAction()
{
$this->view->header = $this->t("Communities");
Expand All @@ -235,12 +235,12 @@ function indexAction()
$this->Component->Sortdao->field = 'name';
$this->Component->Sortdao->order = 'asc';
usort($communities, array($this->Component->Sortdao, 'sortByName'));
$communities = $this->Component->Sortdao->arrayUniqueDao($communities );
$communities = $this->Component->Sortdao->arrayUniqueDao($communities);

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

/** view a community*/
/** View a community*/
function viewAction()
{
$this->view->Date = $this->Component->Date;
Expand Down Expand Up @@ -313,7 +313,7 @@ function viewAction()

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

/** Delete a community*/
function deleteAction()
Expand All @@ -337,7 +337,7 @@ function deleteAction()
$this->_redirect('/');
}//end delete

/** Invit user to a community*/
/** Invite a user to a community*/
function invitationAction()
{
$this->_helper->layout->disableLayout();
Expand Down Expand Up @@ -376,9 +376,9 @@ function invitationAction()
}
}
}
}//end delete
}//end invite

/** create a community (ajax)*/
/** Create a community (ajax)*/
function createAction()
{
if(!$this->logged)
Expand All @@ -404,9 +404,9 @@ function createAction()
$this->_helper->layout->disableLayout();
$this->view->form = $this->getFormAsArray($form);
}
}//end index
}//end create

/** valid entries (ajax)*/
/** Validate entries (ajax)*/
public function validentryAction()
{
if(!$this->getRequest()->isXmlHttpRequest())
Expand Down
43 changes: 32 additions & 11 deletions core/controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,30 @@ function init()
}
} // end init()

/** Index */
function indexAction()
{
$this->view->header = $this->t("Users");
$this->view->json['user']['createCommunity'] = $this->t('Create a community');
$this->view->json['user']['titleCreateLogin'] = $this->t('Please log in');
$this->view->json['user']['contentCreateLogin'] = $this->t('You need to be logged in to be able to create a community.');

if($this->logged && $this->userSession->Dao->isAdmin())
{
$users = $this->User->getAll();
}
else
{
$users = $this->User->getPublicUsers();
}

$this->Component->Sortdao->field = 'name';
$this->Component->Sortdao->order = 'asc';
usort($users, array($this->Component->Sortdao, 'sortByName'));
$users = $this->Component->Sortdao->arrayUniqueDao($users);

$this->view->users = $users;
} //end index

/** Recover the password (ajax) */
function recoverpasswordAction()
Expand Down Expand Up @@ -77,7 +101,6 @@ function make_seed_recoverpass()

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


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

Expand All @@ -100,7 +123,7 @@ function make_seed_recoverpass()
}
} // end recoverpassword

/** logout an user*/
/** Logout a user */
function logoutAction()
{
$this->userSession->Dao = null;
Expand All @@ -110,7 +133,7 @@ function logoutAction()
} //end logoutAction


/** register an user*/
/** Register a user */
function registerAction()
{
$form = $this->Form->User->createRegisterForm();
Expand All @@ -132,8 +155,7 @@ function registerAction()
));
} //end register


/** check log in action*/
/** Login action */
function loginAction()
{
$this->Form->User->uri = $this->getRequest()->getRequestUri();
Expand All @@ -159,7 +181,6 @@ function loginAction()
$authLdap = false;
}


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


/** term of service */
/** Term of service */
public function termofserviceAction()
{
if($this->getRequest()->isXmlHttpRequest())
Expand All @@ -217,7 +238,7 @@ public function termofserviceAction()
} // end term of service


/** valid entries (ajax)*/
/** Valid entries (ajax) */
public function validentryAction()
{
if(!$this->getRequest()->isXmlHttpRequest() && !$this->isTestingEnv())
Expand Down Expand Up @@ -274,7 +295,7 @@ public function validentryAction()
}
} //end valid entry

/** settings page action*/
/** Settings page action */
public function settingsAction()
{
if(!$this->logged)
Expand Down Expand Up @@ -470,7 +491,7 @@ public function settingsAction()
$this->view->customTabs = Zend_Registry::get('notifier')->notify(MIDAS_NOTIFY_GET_CONFIG_TABS, array());
}

/** user page action*/
/** User page action*/
public function userpageAction()
{
$this->view->Date = $this->Component->Date;
Expand Down Expand Up @@ -521,7 +542,7 @@ public function userpageAction()
$this->view->information = array();
}

/** manage files page action*/
/** Manage files page action*/
public function manageAction()
{
$this->view->Date = $this->Component->Date;
Expand Down
11 changes: 6 additions & 5 deletions core/layouts/layout.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ echo $this->doctype()
}
if($this->highNumberError)
{
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/>';
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/>';
}
?>
<div class=SubWrapper">
Expand All @@ -177,15 +177,16 @@ echo $this->doctype()
<div class="SideBar">
<ul>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>

<?php
if($this->showUploadedLink)
{
?>
<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>
<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>
<?php
}
?>
Expand Down
4 changes: 4 additions & 0 deletions core/models/base/UserModelBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ abstract function getUserCommunities($userDao);
abstract function getByUuid($uuid);
/** Returns a user given its folder (either public,private or base folder) */
abstract function getByFolder($folder);
/** Returns all the public users. Limited to 20 by default. */
abstract function getPublicUsers($limit = 20);
/** Returns all the users */
abstract function getAll();

/** save */
public function save($dao)
Expand Down
10 changes: 4 additions & 6 deletions core/models/pdo/CommunityModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,10 @@ function getAll()
$return[] = $this->initDao('Community', $row);
}
return $return;
} // end getByName()
} // end getAll()

/** get public Communities
*
* @return Array of Community Dao
*/
/** Get public Communities
* @return Array of Community Dao */
function getPublicCommunities($limit = 20)
{
if(!is_numeric($limit))
Expand All @@ -86,7 +84,7 @@ function getPublicCommunities($limit = 20)
$return[] = $this->initDao('Community', $row);
}
return $return;
}
} // end getPublicCommunities()

/** Return a list of communities corresponding to the search */
function getCommunitiesFromSearch($search, $userDao, $limit = 14, $group = true, $order = 'view')
Expand Down
34 changes: 34 additions & 0 deletions core/models/pdo/UserModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,40 @@ public function getUserCommunities($userDao)
return $return;
} // end getUserCommunities

/** Get all */
function getAll()
{
$rowset = $this->database->fetchAll($this->database->select());
$return = array();
foreach($rowset as $row)
{
$return[] = $this->initDao('User', $row);
}
return $return;
} // end getAll()

/** Get public users
* @return Array of Users Dao */
function getPublicUsers($limit = 20)
{
if(!is_numeric($limit))
{
throw new Zend_Exception("Error parameter.");
}
$sql = $this->database->select()->from($this->_name)
->where('privacy = ?', MIDAS_USER_PUBLIC)
->limit($limit);

$rowset = $this->database->fetchAll($sql);
$return = array();
foreach($rowset as $row)
{
$return[] = $this->initDao('User', $row);
}
return $return;
} // end getPublicUsers()


/** Returns a user given its folder (either public,private or base folder) */
function getByFolder($folder)
{
Expand Down
6 changes: 5 additions & 1 deletion core/public/css/item/item.view.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@ table#browseTable{

table#metadataTable{
display: table!important;
}
}

div.genericInfo .genericCompany {
font-size: 10px;
}
23 changes: 23 additions & 0 deletions core/public/css/user/user.index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
div.userList{

}

div.userList div{
border-bottom: 1px dotted grey;
padding-top: 5px;
padding-bottom: 5px;
}

div.userList a.userTitle{
font-weight: bold;
font-size: 14px;
}

div.userList span{
padding-left: 15px;
}

div.userBlock:hover{
background-color: #F6F9FE;
cursor: pointer;
}
Binary file added core/public/images/icons/community2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added core/public/images/icons/explore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added core/public/images/icons/user.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added core/public/images/icons/users.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion core/public/js/layout/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ $(function() {
});

$('#menuUserInfo').click(function(){
globalAuthAsk(json.global.webroot+'/user/userpage#tabs-3');
globalAuthAsk(json.global.webroot+'/user/userpage');
});
$("div.TopDynamicBar .closeButton").click(function()
{
Expand Down
8 changes: 8 additions & 0 deletions core/public/js/user/user.index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$(document).ready(function() {

$('.userBlock').click(function(){
$(location).attr('href',($('> .userTitle',this).attr('href')));
})

});

4 changes: 3 additions & 1 deletion core/translation/fr-main.csv
Original file line number Diff line number Diff line change
Expand Up @@ -238,4 +238,6 @@ Step 3: Where do you want to upload your files;Etape 3: Ou voulez vous ajouter d
Save Link;Sauver Lien
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:
Not registered yet?;Pas encore enregistr�?
Register here;Enregistrez vous ici
Register here;Enregistrez vous ici
My profile;Mon profile
My uploads;Mes uploads
2 changes: 1 addition & 1 deletion core/views/admin/index.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ $this->headScript()->appendFile($this->coreWebroot . '/public/js/admin/admin.ind
echo "Total space: {$assetstore->totalSpaceText}<br/>";
if(($assetstore->freeSpace/$assetstore->totalSpace<0.10))
{
echo "<b>Free space: {$assetstore->freeSpaceText}. Almost full!!!</b>";
echo "<b>Free space: {$assetstore->freeSpaceText}. Less than 10% free!</b>";
}
else
{
Expand Down
Loading

0 comments on commit 7c6b139

Please sign in to comment.