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

Commit f7a0bbc

Browse files
author
Charles Marion
committed
ENH: added user menu
1 parent 80deed2 commit f7a0bbc

File tree

16 files changed

+214
-119
lines changed

16 files changed

+214
-119
lines changed

core/configs/application.local.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ processing=cron
1515

1616

1717
[module]
18-
helloworld=true
18+
helloworld=false
1919
task=true
2020

2121

core/controllers/AdminajaxController.php renamed to core/controllers/AdminController.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,17 @@
33
/**
44
* AJAX request for the admin Controller
55
*/
6-
class AdminajaxController extends AppController
6+
class AdminController extends AppController
77
{
88
public $_models=array();
99
public $_daos=array();
1010
public $_components=array();
1111

12+
/** index*/
13+
function indexAction()
14+
{
15+
16+
}
1217
/**
1318
* \fn serversidefilechooser()
1419
* \brief called by the server-side file chooser

core/controllers/UserController.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,18 @@ public function validentryAction()
164164
}
165165
} //end valid entry
166166

167-
167+
/** settings page action*/
168+
public function settingsAction()
169+
{
170+
if(!$this->logged)
171+
{
172+
$this->_helper->viewRenderer->setNoRender();
173+
return false;
174+
}
175+
$this->_helper->layout->disableLayout();
176+
177+
}
178+
168179
/** user page action*/
169180
public function userpageAction()
170181
{

core/controllers/forms/UserForm.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,37 @@ public function createRegisterForm()
8383

8484
return $form;
8585
}
86+
87+
88+
/** acount form */
89+
public function createAccountForm()
90+
{
91+
$form = new Zend_Form;
92+
$form->setAction($this->webroot.'/user/settings')
93+
->setMethod('post');
94+
95+
$firstname = new Zend_Form_Element_Text('firstname');
96+
$firstname
97+
->setRequired(true)
98+
->addValidator('NotEmpty', true)
99+
->addValidator(new Zend_Validate_Alnum());
100+
101+
$lastname = new Zend_Form_Element_Text('lastname');
102+
$lastname
103+
->setRequired(true)
104+
->addValidator('NotEmpty', true)
105+
->addValidator(new Zend_Validate_Alnum());
106+
107+
$compagny = new Zend_Form_Element_Text('lastname');
108+
$compagny
109+
->addValidator(new Zend_Validate_Alnum());
110+
111+
$submit = new Zend_Form_Element_Submit('submit');
112+
$submit ->setLabel($this->t("Save"));
113+
114+
$form->addElements(array($firstname,$lastname,$compagny,$submit));
115+
116+
return $form;
117+
}
86118
} // end class
87119
?>

core/layouts/layout.phtml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,21 @@
6969
<?php
7070
if($this->logged)
7171
{
72-
echo '<b><a href="'.$this->webroot.'/user/'.$this->userDao->getUserId().'" >'.$this->userDao->getFullName().'</a></b>';
72+
echo '
73+
<b><a href="'.$this->webroot.'/user/'.$this->userDao->getUserId().'" >'.$this->userDao->getFullName().' <img class="arrowUser" src="'.$this->webroot.'/public/images/icons/arrow-user.gif" alt ="" /></a> </b>
74+
<ul>
75+
<li onclick="location.replace(\''.$this->webroot.'/user/userpage\');"><a>'.$this->t('My Page').'</a></li>
76+
<li class="myAccountLink"><a>'.$this->t('My Account').'</a></li>
77+
<li class="settingsLink"><a>'.$this->t('Settings').'</a></li>
78+
<li class="modulesLink"><a>'.$this->t('Modules').'</a></li>';
79+
if($this->userDao->isAdmin())
80+
{
81+
echo '
82+
<li onclick="location.replace(\''.$this->webroot.'/admin\');"><a>'.$this->t('Administration').'</a></li>';
83+
}
84+
echo '
85+
</ul>
86+
';
7387
}
7488
else
7589
{

core/views/admin/index.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
admin

core/views/element/serversidefilechooser.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
throw new Zend_Exception("variable id is not set");
2222
}
2323

24-
if( !isset($this->script) ) $this->script = $this->webroot.'/adminajax/serversidefilechooser';
24+
if( !isset($this->script) ) $this->script = $this->webroot.'/admin/serversidefilechooser';
2525
if( !isset($this->width) ) $this->width = 400;
2626
if( !isset($this->height) ) $this->height = 400;
2727
if( !isset($this->fileFilter) ) $this->fileFilter = '';

core/views/user/settings.phtml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
echo '<script type="text/javascript" src="' . $this->webroot . '/public/js/user/user.settings.js"></script>';
3+
?>
4+
<link type="text/css" rel="stylesheet" href="<?php echo $this->webroot?>/public/css/user/user.settings.css" />
5+
6+
<div id="tabsSettings">
7+
<ul>
8+
<li><a href="#tabs-1"><?php echo $this->t('My Account') ?></a></li>
9+
<li><a href="#tabs-2"><?php echo $this->t('Password') ?></a></li>
10+
<li><a href="#tabs-3"><?php echo $this->t('Settings') ?></a></li>
11+
<li><a href="#tabs-4"><?php echo $this->t('Modules') ?></a></li>
12+
</ul>
13+
<div id="tabs-1">
14+
Account
15+
</div>
16+
<div id="tabs-2">
17+
Password
18+
</div>
19+
<div id="tabs-3">
20+
Settings
21+
</div>
22+
<div id="tabs-4">
23+
Module
24+
</div>
25+
</div>

library/MIDAS/controller/GlobalController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ public function __construct(Zend_Controller_Request_Abstract $request, Zend_Cont
1616
{
1717
$this->_controllerTimer = microtime(true);
1818
}
19-
2019
$this->loadElements();
2120
parent::__construct($request, $response, $invokeArgs);
2221
}

modules/helloworld_1/constant/module.php

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)