Skip to Content.
Sympa Menu

comanage-dev - [comanage-dev] r564 - in registry/trunk/app: Controller Lib Model View/Elements

Subject: COmanage Developers List

List archive

[comanage-dev] r564 - in registry/trunk/app: Controller Lib Model View/Elements


Chronological Thread 
  • From:
  • To:
  • Subject: [comanage-dev] r564 - in registry/trunk/app: Controller Lib Model View/Elements
  • Date: Fri, 19 Jul 2013 04:51:08 -0400

Author: marie
Date: 2013-07-19 04:51:08 -0400 (Fri, 19 Jul 2013)
New Revision: 564

Added:
registry/trunk/app/Controller/CoNavigationLinksController.php
registry/trunk/app/Model/CoNavigationLink.php
Modified:
registry/trunk/app/Controller/AppController.php
registry/trunk/app/Lib/enum.php
registry/trunk/app/Lib/lang.php
registry/trunk/app/View/Elements/dropMenu.ctp
registry/trunk/app/View/Elements/links.ctp
Log:
co222 menu bar link configuration system

Modified: registry/trunk/app/Controller/AppController.php
===================================================================
--- registry/trunk/app/Controller/AppController.php 2013-07-17 01:51:29
UTC (rev 563)
+++ registry/trunk/app/Controller/AppController.php 2013-07-19 08:51:08
UTC (rev 564)
@@ -264,6 +264,7 @@
&& $this->Session->check('Auth.User.org_identities')) {
$this->menuAuth();
$this->menuContent();
+ $this->getCoNavLinks();
}
}

@@ -989,6 +990,35 @@

return($s);
}
+
+ /**
+ * Called from beforeRender to set CO-specific links
+ * - precondition: Session.Auth holds data used for authz decisions
+ * - postcondition: vv_CoNavLinks set
+ *
+ * @since COmanage Registry v0.8.2
+ */
+
+ function getCoNavLinks() {
+ // Determine this CO's navigation links
+ $coid = $this->parseCOID();
+
+ $this->loadModel('CoNavigationLink');
+
+ $params = array('conditions' => array('CoNavigationLink.co_id' => $coid),
+ 'fields' => array('CoNavigationLink.title',
'CoNavigationLink.url'),
+ 'order' => array('CoNavigationLink.ordr')
+ );
+ $colinkdata = $this->CoNavigationLink->find('all', $params);
+
+ // Build variable to set for view
+ $vv_CoNavLinks = array();
+
+ foreach ($colinkdata as $l) {
+ $vv_CoNavLinks[] = $l;
+ }
+ $this->set('vv_CoNavLinks', $vv_CoNavLinks);
+ }

/**
* Called from beforeRender to set permissions for display in menus
@@ -1047,7 +1077,10 @@

// Manage CO enrollment flow definitions?
$p['menu']['coef'] = $roles['admin'];
-
+
+ // Manage CO Links?
+ $p['menu']['conavigationlinks'] = $roles['admin'];
+
// Manage CO provisioning targets?
$p['menu']['coprovtargets'] = $roles['admin'];


Modified: registry/trunk/app/Lib/enum.php
===================================================================
--- registry/trunk/app/Lib/enum.php 2013-07-17 01:51:29 UTC (rev 563)
+++ registry/trunk/app/Lib/enum.php 2013-07-19 08:51:08 UTC (rev 564)
@@ -192,6 +192,11 @@
const UID = 'uid';
}

+class LinkLocationEnum
+{
+ const topBar = 'topbar';
+}
+
class NameEnum
{
const Author = 'A';

Modified: registry/trunk/app/Lib/lang.php
===================================================================
--- registry/trunk/app/Lib/lang.php 2013-07-17 01:51:29 UTC (rev 563)
+++ registry/trunk/app/Lib/lang.php 2013-07-19 08:51:08 UTC (rev 564)
@@ -72,6 +72,8 @@
'ct.co_groups.1' => 'Group',
'ct.co_groups.pl' => 'Groups',
'ct.co_invites.1' => 'Invite',
+ 'ct.co_navigation_links.1' => 'Navigation Link',
+ 'ct.co_navigation_links.pl' => 'Navigation Links',
'ct.co_invites.pl' => 'Invites',
'ct.co_nsf_demographics.1' => 'NSF Demographic Record',
'ct.co_nsf_demographics.pl' => 'NSF Demographic Records',
@@ -247,6 +249,9 @@
SuspendableStatusEnum::Suspended => 'Suspended'
),

+ // Navigation links
+ 'en.nav.location' => array(LinkLocationEnum::topBar => 'Top Bar'),
+
// Demographics
'en.nsf.gender' => array(NSFGenderEnum::Female => 'Female',
NSFGenderEnum::Male => 'Male'),
@@ -497,6 +502,10 @@
'fd.inv.for' => 'Invitation for %1$s',
'fd.inv.to' => 'Invitation to %1$s',
'fd.lan.desc' => 'Lowercase alphanumeric characters only',
+ 'fd.link.location' => 'Link Location',
+ 'fd.link.order' => 'Link Order',
+ 'fd.link.title' => 'Link Title',
+ 'fd.link.url' => 'Link URL',
'fd.members' => 'Members',
'fd.modified' => 'Modified',
'fd.name' => 'Name',

Modified: registry/trunk/app/View/Elements/dropMenu.ctp
===================================================================
--- registry/trunk/app/View/Elements/dropMenu.ctp 2013-07-17 01:51:29
UTC (rev 563)
+++ registry/trunk/app/View/Elements/dropMenu.ctp 2013-07-19 08:51:08
UTC (rev 564)
@@ -232,6 +232,18 @@
print
$this->Html->link(_txt('ct.co_provisioning_targets.pl'), $args);
print "</li>";
}
+
+ if(isset($permissions['menu']['conavigationlinks'])) {
+ print "<li>";
+ $args = array();
+ $args['plugin'] = null;
+ $args['controller'] = 'co_navigation_links';
+ $args['action'] = 'index';
+ $args['co'] = $menuCoId;
+
+ print
$this->Html->link(_txt('ct.co_navigation_links.pl'), $args);
+ print "</li>";
+ }

render_plugin_menus($this->Html, $plugins, 'coconfig',
$menuCoId);


Modified: registry/trunk/app/View/Elements/links.ctp
===================================================================
--- registry/trunk/app/View/Elements/links.ctp 2013-07-17 01:51:29 UTC (rev
563)
+++ registry/trunk/app/View/Elements/links.ctp 2013-07-19 08:51:08 UTC (rev
564)
@@ -27,6 +27,15 @@
<li><a href="#">Support</a></li>
<li><a href="/directory">Directory</a></li>
<li><a href="#">Help</a></li>
+
+ <?php
+ if(isset($vv_CoNavLinks)) {
+ foreach($vv_CoNavLinks as $l){
+ print '<li><a href="' . $l['CoNavigationLink']['url'] . '">' .
$l['CoNavigationLink']['title'] . '</a>';
+ }
+ }
+ ?>
+
</ul>
</div>




  • [comanage-dev] r564 - in registry/trunk/app: Controller Lib Model View/Elements, svnlog, 07/19/2013

Archive powered by MHonArc 2.6.16.

Top of Page