Skip to Content.
Sympa Menu

comanage-dev - [comanage-dev] r281 - in registry/trunk/app: Controller Lib View/Elements View/Layouts webroot/css webroot/img

Subject: COmanage Developers List

List archive

[comanage-dev] r281 - in registry/trunk/app: Controller Lib View/Elements View/Layouts webroot/css webroot/img


Chronological Thread 
  • From:
  • To:
  • Subject: [comanage-dev] r281 - in registry/trunk/app: Controller Lib View/Elements View/Layouts webroot/css webroot/img
  • Date: Fri, 13 Apr 2012 01:01:19 -0400

Author: marie
Date: 2012-04-13 01:01:18 -0400 (Fri, 13 Apr 2012)
New Revision: 281

Added:
registry/trunk/app/View/Elements/dropMenu.ctp
registry/trunk/app/View/Elements/footer.ctp
registry/trunk/app/View/Elements/links.ctp
registry/trunk/app/View/Elements/secondaryMenu.ctp
registry/trunk/app/webroot/css/menubar.css
registry/trunk/app/webroot/img/comanage-logo.png
registry/trunk/app/webroot/img/header_bg.jpg
Modified:
registry/trunk/app/Controller/AppController.php
registry/trunk/app/Controller/CmpEnrollmentConfigurationsController.php
registry/trunk/app/Controller/CoNsfDemographicsController.php
registry/trunk/app/Controller/CoPeopleController.php
registry/trunk/app/Controller/CousController.php
registry/trunk/app/Controller/OrgIdentitiesController.php
registry/trunk/app/Lib/lang.php
registry/trunk/app/View/Layouts/default.ctp
registry/trunk/app/webroot/css/comanage.css
Log:
co80 menu improvements

Modified: registry/trunk/app/Controller/AppController.php
===================================================================
--- registry/trunk/app/Controller/AppController.php 2012-04-12 13:27:20
UTC (rev 280)
+++ registry/trunk/app/Controller/AppController.php 2012-04-13 05:01:18
UTC (rev 281)
@@ -153,6 +153,25 @@
$this->Auth->allow('*');
}
}
+
+ /**
+ * Callback before views are rendered.
+ * - precondition: None
+ * - postcondition: content and permissions for menu are set
+ *
+ * @since COmanage Registry v0.5
+ */
+
+ function beforeRender() {
+
+ // Determine what is shown for menus
+ // Called before each render in case permissions change
+ if($this->restful != true
+ && $this->Session->check('Auth.User.org_identities')) {
+ $this->menuAuth();
+ $this->menuContent();
+ }
+ }

/**
* Determine which COmanage platform roles the current user has.
@@ -1034,4 +1053,103 @@

$this->response->statusCode($status);
}
+
+ /**
+ * Called from beforeRender to set permissions for display in menus
+ * - precondition: Session.Auth holds data used for authz decisions
+ * - postcondition: permissions for menu are set
+ *
+ * @since COmanage Registry v0.5
+ */
+
+ function menuAuth() {
+ $cmr = $this->calculateCMRoles();
+
+ // Construct the permission set for this user, which will also be passed
to the view.
+ $p = array();
+
+ // If permissions already exist, don't overwrite them
+ if(isset($this->viewVars['permissions']))
+ $p = $this->viewVars['permissions'];
+
+ // Determine what menu options this user can see
+
+ // View own (Org) profile?
+ $p['menu']['orgprofile'] = $cmr['user'];
+
+ // View/Edit own (CO) profile?
+ $p['menu']['coprofile'] = $cmr['user'];
+
+ // View/Edit CO groups?
+ $p['menu']['cogroups'] = $cmr['user'];
+
+ // Manage org identity data?
+ $p['menu']['orgidentities'] = $cmr['admin'] || $cmr['subadmin'];
+
+ // Manage any CO (or COU) population?
+ $p['menu']['cos'] = $cmr['admin'] || $cmr['subadmin'];
+
+ // Manage any CO (or COU) population?
+ $p['menu']['petitions'] = $cmr['admin'] || $cmr['subadmin'];
+
+ // Manage CO extended attributes?
+ $p['menu']['extattrs'] = $cmr['admin'];
+
+ // Manage COU definitions?
+ $p['menu']['cous'] = $cmr['admin'];
+
+ // Manage CO enrollment flow definitions?
+ $p['menu']['coef'] = $cmr['admin'];
+
+ // Admin COmanage?
+ $p['menu']['admin'] = $cmr['cmadmin'];
+
+ // Manage NSF Demographics?
+ $p['menu']['co_nsf_demographics'] = $cmr['cmadmin'];
+
+ // View/Edit own Demographics profile?
+ $p['menu']['nsfdemoprofile'] = $cmr['user'];
+
+ $this->set('permissions', $p);
+ }
+
+ /**
+ * Called from beforeRender to set content for display in menus
+ * - precondition: Session.Auth holds data used for authz decisions
+ * - postcondition: content for menu are set
+ *
+ * @since COmanage Registry v0.5
+ */
+
+ function menuContent() {
+ // Get org identity ID
+ $orgIDs = $this->Session->read('Auth.User.org_identities');
+
+ // Find name associated with that ID
+ $this->loadModel('OrgIdentity');
+ $orgName = $this->OrgIdentity->read('o',$orgIDs[0]['org_id']);
+
+ // Set for home ID name in menu
+ $menu['orgName'] = $orgName['OrgIdentity']['o'];
+
+ // Set the COs for display
+ if($this->viewVars['permissions']['menu']['admin']) {
+ // Show all active COs for admins
+ $this->loadModel('Co');
+ $params = array('conditions' => array('Co.status' => 'A'),
+ 'fields' => array('Co.id', 'Co.name'),
+ 'recursive' => false
+ );
+ $codata = $this->Co->find('all', $params);
+
+ foreach($codata as $data)
+ $menu['cos'][ $data['Co']['id'] ] = $data['Co']['name'];
+ } elseif($this->Session->check('Auth.User.cos')) {
+ // Show only COs that a user is a member of
+ foreach($this->Session->read('Auth.User.cos') as $name => $data)
+ $menu['cos'][ $data['co_id'] ] = $data['co_name'];
+ }
+
+ $this->set('menuContent', $menu);
+ }
}

Modified:
registry/trunk/app/Controller/CmpEnrollmentConfigurationsController.php
===================================================================
--- registry/trunk/app/Controller/CmpEnrollmentConfigurationsController.php
2012-04-12 13:27:20 UTC (rev 280)
+++ registry/trunk/app/Controller/CmpEnrollmentConfigurationsController.php
2012-04-13 05:01:18 UTC (rev 281)
@@ -51,6 +51,7 @@
// Set the list of attribute order for the view to render

$this->set('cmp_ef_attribute_order',
$this->CmpEnrollmentConfiguration->getStandardAttributeOrder());
+ parent::beforeRender();
}

/**

Modified: registry/trunk/app/Controller/CoNsfDemographicsController.php
===================================================================
--- registry/trunk/app/Controller/CoNsfDemographicsController.php
2012-04-12 13:27:20 UTC (rev 280)
+++ registry/trunk/app/Controller/CoNsfDemographicsController.php
2012-04-13 05:01:18 UTC (rev 281)
@@ -85,6 +85,7 @@
$this->set('co_nsf_demographics', $factoredDemo);
}
}
+ parent::beforeRender();
}

/**

Modified: registry/trunk/app/Controller/CoPeopleController.php
===================================================================
--- registry/trunk/app/Controller/CoPeopleController.php 2012-04-12
13:27:20 UTC (rev 280)
+++ registry/trunk/app/Controller/CoPeopleController.php 2012-04-13
05:01:18 UTC (rev 281)
@@ -92,6 +92,7 @@
$this->loadModel('CoEnrollmentFlow');
$this->set('co_enrollment_flows', $this->CoEnrollmentFlow->find('all',
$args));
}
+ parent::beforeRender();
}

/**

Modified: registry/trunk/app/Controller/CousController.php
===================================================================
--- registry/trunk/app/Controller/CousController.php 2012-04-12 13:27:20
UTC (rev 280)
+++ registry/trunk/app/Controller/CousController.php 2012-04-13 05:01:18
UTC (rev 281)
@@ -63,6 +63,7 @@

$this->set('parent_options', $options);
}
+ parent::beforeRender();
}

/**

Modified: registry/trunk/app/Controller/OrgIdentitiesController.php
===================================================================
--- registry/trunk/app/Controller/OrgIdentitiesController.php 2012-04-12
13:27:20 UTC (rev 280)
+++ registry/trunk/app/Controller/OrgIdentitiesController.php 2012-04-13
05:01:18 UTC (rev 281)
@@ -101,6 +101,8 @@

function beforeRender() {
$this->set('cmp_ef_attribute_order',
$this->CmpEnrollmentConfiguration->getStandardAttributeOrder());
+
+ parent::beforeRender();
}

/**

Modified: registry/trunk/app/Lib/lang.php
===================================================================
--- registry/trunk/app/Lib/lang.php 2012-04-12 13:27:20 UTC (rev 280)
+++ registry/trunk/app/Lib/lang.php 2012-04-13 05:01:18 UTC (rev 281)
@@ -382,6 +382,15 @@
'fd.valid.u.desc' => '(leave blank for indefinite validity)',
'fd.yes' => 'Yes',

+ // Menu
+ 'me.account' => 'My Account',
+ 'me.changepassword' => 'Change Password',
+ 'me.for' => 'For ',
+ 'me.identity' => 'Identity',
+ 'me.label' => 'Manage:',
+ 'me.platform' => 'Platform',
+ 'me.population' => 'My Population',
+
// Operations
'op.add' => 'Add',
'op.add-a' => 'Add "%1$s"',

Modified: registry/trunk/app/View/Layouts/default.ctp
===================================================================
--- registry/trunk/app/View/Layouts/default.ctp 2012-04-12 13:27:20 UTC (rev
280)
+++ registry/trunk/app/View/Layouts/default.ctp 2012-04-13 05:01:18 UTC (rev
281)
@@ -35,13 +35,15 @@

<!-- Include the gears and jquery style sheets -->
<?php print $this->Html->css('comanage'); ?>
-
- <?php print
$this->Html->css('jquery/ui/css/start/jquery-ui-1.8.16.custom.css'); ?>
+ <?php print $this->Html->css('body'); ?>
+ <?php print
$this->Html->css('jquery/ui/css/custom-theme/jquery-ui-1.8.18.custom'); ?>
+ <?php print $this->Html->css('jquery/superfish-1.4.8/css/superfish'); ?>
+ <?php print $this->Html->css('menubar'); ?>

<!-- Get jquery code -->
<?php print $this->Html->script('jquery/ui/js/jquery-1.6.2.min.js'); ?>
-
<?php print
$this->Html->script('jquery/ui/js/jquery-ui-1.8.16.custom.min.js'); ?>
+ <?php print
$this->Html->script('jquery/superfish-1.4.8/js/superfish.js'); ?>

<!-- Common script code -->
<script type="text/javascript">
@@ -269,131 +271,103 @@
<!-- Include external files and scripts -->
<?php print $scripts_for_layout ?>
</head>
-
+
<body onload="js_onload_call_hooks()">
- <table width="100%">
- <tr>
- <td width="50%">
- <?php
- print $this->Html->image('comanage-logo.jpg',
- array('alt' => 'COmanage',
- 'height' => 42,
- 'width' => 227));
- ?>
- <font face="verdana">Registry</font>
- </td>
- <td width="50%">
- <div class="right">
- <table id="userlabel" class="ui-widget ui-widget-content
ui-corner-all">
- <thead>
- <tr class="ui-widget-header">
- <th style="font-size:62.5%;">
- <?php
- if($this->Session->check('Auth.User'))
- {
- print "<div style='text-align:right'>" .
generateCn($this->Session->read('Auth.User.name'));
- if(isset($cur_co))
- print " (" . $cur_co['Co']['name'] . ")";
- print "</div>\n";
- }
- else
- print _txt('au.not');
- ?>
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- <?php
- if($this->Session->check('Auth.User')) {
- if($this->params['controller'] != 'pages' &&
$this->params['action'] != 'menu') {
- print $this->Html->link(_txt('op.menu'),
- "/",
- array('class' =>
'menubutton'));
- }
-
- print $this->Html->link(_txt('op.logout'),
- array('controller' =>
'auth', 'action' => 'logout'),
- array('class' =>
'logoutbutton'));
- }
- else {
- print $this->Html->link(_txt('op.login'),
- array('controller' =>
'auth', 'action' => 'login'),
- array('class' =>
'logoutbutton'));
- }
- ?>
- </td>
- </tr>
- </tbody>
- </table>
+ <div class="header">
+ <div id="row1">
+ <div class="contentWidth">
+ <?php print $this->element('links'); ?>
+ <?php print $this->element('secondaryMenu'); ?>
+ </div>
+ </div>
+
+ <div id="row2" class="ui-widget-header">
+ <div class="contentWidth">
+ <div class="headerLeft">
+ <?php
+ if($this->Session->check('Auth.User'))
+ print $this->element('dropMenu');
+ ?>
</div>
- </td>
- </tr>
- <tr>
- <td colspan="2">
- <?php
- $f = $this->Session->flash('error');
-
- if($f && $f != "")
- {
- print '
- <div class="ui-widget">
- <div class="ui-state-error ui-corner-all"
style="margin-top: 20px; padding: 0 .7em;">
- <p><span class="ui-icon ui-icon-alert" style="float:
left; margin-right: .3em;"></span>
- ' . $f . '
- </p>
- </div>
- </div>
- ';
- }
+ <div class="headerRight">
+ <?php
+ // Clicking on the logo will take us to the front page
+ print $this->Html->link($this->Html->image('comanage-logo.png',
+ array('alt' =>
'COmanage','height' => 50)),
+ '/',
+ array('escape' => false));
+ ?>
+ </div>
+ </div>
+ </div>
+ </div>

- $f = $this->Session->flash('info');
-
- if($f && $f != "")
- {
- print '
- <div class="ui-widget">
- <div class="ui-state-highlight ui-corner-all"
style="margin-top: 20px; padding: 0 .7em;">
- <p><span class="ui-icon ui-icon-info" style="float:
left; margin-right: .3em;"></span>
- ' . $f . '
- </p>
- </div>
- </div>
- ';
- }
-
- $f = $this->Session->flash('success');
-
- if($f && $f != "")
- {
- print '
- <div class="ui-widget">
- <div class="ui-state-active ui-corner-all"
style="margin-top: 20px; padding: 0 .7em;">
- <p><span class="ui-icon ui-icon-circle-check"
style="float: left; margin-right: .3em;"></span>
- ' . $f . '
- </p>
- </div>
- </div>
- ';
- }
- ?>
+ <div id="content">
+ <div>
+ <?php
+ $f = $this->Session->flash('error');
+
+ if($f && $f != "") {
+ print '
+ <div class="ui-widget">
+ <div class="ui-state-error ui-corner-all" style="margin-top:
20px; padding: 0 .7em;">
+ <p>
+ <span class="ui-icon ui-icon-alert" style="float: left;
margin-right: .3em;"></span>
+ ' . $f . '
+ </p>
+ </div>
+ </div>
+ ';
+ }

- <?php print_r($this->Session->error()); ?>
- <!-- Display view content -->
- <?php print $content_for_layout ?>
- </td>
- </tr>
- </table>
+ $f = $this->Session->flash('info');
+
+ if($f && $f != "") {
+ print '
+ <div class="ui-widget">
+ <div class="ui-state-highlight ui-corner-all"
style="margin-top: 20px; padding: 0 .7em;">
+ <p><span class="ui-icon ui-icon-info" style="float: left;
margin-right: .3em;"></span>
+ ' . $f . '
+ </p>
+ </div>
+ </div>
+ ';
+ }
+
+ $f = $this->Session->flash('success');
+
+ if($f && $f != "") {
+ print '
+ <div class="ui-widget">
+ <div class="ui-state-active ui-corner-all"
style="margin-top: 20px; padding: 0 .7em;">
+ <p><span class="ui-icon ui-icon-circle-check"
style="float: left; margin-right: .3em;"></span>
+ ' . $f . '
+ </p>
+ </div>
+ </div>
+ ';
+ }
+ ?>
+
+ <?php print_r($this->Session->error()); ?>
+ <!-- Display view content -->
+ <?php print $content_for_layout ?>
+ </div>
+ </div>
<?php if(Configure::read('debug') > 0) print $this->element('sql_dump');
?>

<!-- Common UI components -->
-
+
<div id="dialog" title="Confirm">
<p>
<span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px
20px 0;"></span>
<span id="dialog-text"><?php print _txt('op.proceed.ok'); ?></span>
</p>
</div>
+
+ <div class="contentWidth">
+ <?php print $this->element('footer'); ?>
+ </div>
+
</body>
-</html>
\ No newline at end of file
+</html>

Modified: registry/trunk/app/webroot/css/comanage.css
===================================================================
--- registry/trunk/app/webroot/css/comanage.css 2012-04-12 13:27:20 UTC (rev
280)
+++ registry/trunk/app/webroot/css/comanage.css 2012-04-13 05:01:18 UTC (rev
281)
@@ -2,9 +2,9 @@
* COmanage Gears Style Sheet
*
* Version: $Revision: 111 $
- * Date: $Date: 2011-11-01 13:05:17 -0400 (Tue, 01 Nov 2011) $
+ * Date: $Date: 2011-11-01 10:05:17 -0700 (Tue, 01 Nov 2011) $
*
- * Copyright (C) 2010-2011 University Corporation for Advanced Internet
Development, Inc.
+ * Copyright (C) 2010-2012 University Corporation for Advanced Internet
Development, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with
* the License. You may obtain a copy of the License at
@@ -26,7 +26,7 @@
.hidden {
display: none;
}
-
+
.largefont {
font: 200% "Trebuchet MS", sans-serif;
}
@@ -51,14 +51,15 @@
.required {
color: red;
}
-
+
.right {
float: right;
}

body {
font: 75% "Trebuchet MS", sans-serif;
- margin: 50px;
+ width: auto;
+ margin: -12px auto 0 auto;
}

input.text {
@@ -77,7 +78,75 @@
margin-top:25px;
}

-.error-message {
- color: red;
- font-style: italic;
+
+/* Header */
+
+#content {
+ width:960px;
+ margin-left:auto;
+ margin-right:auto;
}
+
+.headerLeft {
+ float:left;
+ padding: 10px 0 0 0;
+}
+
+.headerRight {
+ float:right;
+ width:auto;
+}
+
+.header span {
+ float:left;
+ color:white;
+}
+
+.header .ui-icon {
+ position: relative;
+ top: -3px;
+}
+
+/* Footer */
+
+.footer {
+ margin:20px 0 0 0;
+ padding:10px;
+}
+
+.poweredByComanage {
+ padding:10px;
+ margin: 10px;
+ float:right;
+}
+
+.poweredText {
+ margin:10px;
+ float:left;
+}
+
+/* For enrollment form */
+#formbox {
+ background-color: #F3F4F3;
+ width:300px;
+ margin:10px;
+ padding:10px;
+}
+
+#formbox .title {
+ font-size:14px;
+}
+
+#CoPersonAddForm {
+ padding: 10px;
+ margin:10px;
+}
+
+#CoPersonAddForm div {
+ margin: 5px;
+ height: 20px;
+}
+
+#CoPersonAddForm input {
+ float:right;
+}


Property changes on: registry/trunk/app/webroot/img/comanage-logo.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream


Property changes on: registry/trunk/app/webroot/img/header_bg.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream



  • [comanage-dev] r281 - in registry/trunk/app: Controller Lib View/Elements View/Layouts webroot/css webroot/img, svnlog, 04/13/2012

Archive powered by MHonArc 2.6.16.

Top of Page