Skip to Content.
Sympa Menu

comanage-dev - [comanage-dev] r570 - in registry/trunk/app: Config Config/Schema Controller Lib Model View/CoNavigationLinks View/Elements

Subject: COmanage Developers List

List archive

[comanage-dev] r570 - in registry/trunk/app: Config Config/Schema Controller Lib Model View/CoNavigationLinks View/Elements


Chronological Thread 
  • From:
  • To:
  • Subject: [comanage-dev] r570 - in registry/trunk/app: Config Config/Schema Controller Lib Model View/CoNavigationLinks View/Elements
  • Date: Tue, 23 Jul 2013 04:34:53 -0400

Author: marie
Date: 2013-07-23 04:34:53 -0400 (Tue, 23 Jul 2013)
New Revision: 570

Added:
registry/trunk/app/Controller/NavigationLinksController.php
registry/trunk/app/Model/NavigationLink.php
Modified:
registry/trunk/app/Config/Schema/schema.xml
registry/trunk/app/Config/routes.php
registry/trunk/app/Controller/AppController.php
registry/trunk/app/Controller/CoNavigationLinksController.php
registry/trunk/app/Lib/lang.php
registry/trunk/app/View/CoNavigationLinks/fields.inc
registry/trunk/app/View/CoNavigationLinks/index.ctp
registry/trunk/app/View/Elements/dropMenu.ctp
registry/trunk/app/View/Elements/links.ctp
Log:
co627 - CMP-level navigation links

Modified: registry/trunk/app/Config/Schema/schema.xml
===================================================================
--- registry/trunk/app/Config/Schema/schema.xml 2013-07-23 08:34:15 UTC (rev
569)
+++ registry/trunk/app/Config/Schema/schema.xml 2013-07-23 08:34:53 UTC (rev
570)
@@ -864,4 +864,18 @@
<field name="ordr" type="I" />
<field name="location" type="C" size="32" />
</table>
+
+ <table name="navigation_links">
+ <field name="id" type="I">
+ <key />
+ <autoincrement />
+ </field>
+ <field name="description" type="C" size="256" />
+ <field name="title" type="C" size="256" >
+ <notnull />
+ </field>
+ <field name="url" type="C" size="256" />
+ <field name="ordr" type="I" />
+ <field name="location" type="C" size="32" />
+ </table>
</schema>

Modified: registry/trunk/app/Config/routes.php
===================================================================
--- registry/trunk/app/Config/routes.php 2013-07-23 08:34:15 UTC (rev
569)
+++ registry/trunk/app/Config/routes.php 2013-07-23 08:34:53 UTC (rev
570)
@@ -77,6 +77,7 @@
'email_addresses',
'history_records',
'identifiers',
+ 'navigation_links',
'org_identities',
'organizations',
'telephone_numbers'

Modified: registry/trunk/app/Controller/AppController.php
===================================================================
--- registry/trunk/app/Controller/AppController.php 2013-07-23 08:34:15
UTC (rev 569)
+++ registry/trunk/app/Controller/AppController.php 2013-07-23 08:34:53
UTC (rev 570)
@@ -264,7 +264,7 @@
&& $this->Session->check('Auth.User.org_identities')) {
$this->menuAuth();
$this->menuContent();
- $this->getCoNavLinks();
+ $this->getNavLinks();
}
}

@@ -999,25 +999,44 @@
* @since COmanage Registry v0.8.2
*/

- function getCoNavLinks() {
- // Determine this CO's navigation links
- $coid = $this->parseCOID();
+ function getNavLinks() {

- $this->loadModel('CoNavigationLink');
+ // Get CMP-level navigation links
+ $this->loadModel('NavigationLink');

- $params = array('conditions' => array('CoNavigationLink.co_id' => $coid),
- 'fields' => array('CoNavigationLink.title',
'CoNavigationLink.url'),
- 'order' => array('CoNavigationLink.ordr')
+ $params = array('fields' => array('NavigationLink.title',
'NavigationLink.url'),
+ 'order' => array('NavigationLink.ordr')
);
- $colinkdata = $this->CoNavigationLink->find('all', $params);
+ $linkdata = $this->NavigationLink->find('all', $params);

// Build variable to set for view
- $vv_CoNavLinks = array();
+ $vv_NavLinks = array();

- foreach ($colinkdata as $l) {
- $vv_CoNavLinks[] = $l;
+ foreach ($linkdata as $l) {
+ $vv_NavLinks[] = $l;
}
- $this->set('vv_CoNavLinks', $vv_CoNavLinks);
+ $this->set('vv_NavLinks', $vv_NavLinks);
+
+ // Determine this CO's navigation links
+ $coid = $this->parseCOID();
+
+ if(!empty($coid)) {
+ $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);
+ }
}

/**

Modified: registry/trunk/app/Controller/CoNavigationLinksController.php
===================================================================
--- registry/trunk/app/Controller/CoNavigationLinksController.php
2013-07-23 08:34:15 UTC (rev 569)
+++ registry/trunk/app/Controller/CoNavigationLinksController.php
2013-07-23 08:34:53 UTC (rev 570)
@@ -52,7 +52,7 @@

// Pass the location options
$link_location_options = array(LinkLocationEnum::topBar => $cm_texts[
$cm_lang ]['en.nav.location'][LinkLocationEnum::topBar]);
- $this->set('vv_link_location_options', $link_location_options);
+ $this->set('vv_co_link_location_options', $link_location_options);

parent::beforeRender();
}

Modified: registry/trunk/app/Lib/lang.php
===================================================================
--- registry/trunk/app/Lib/lang.php 2013-07-23 08:34:15 UTC (rev 569)
+++ registry/trunk/app/Lib/lang.php 2013-07-23 08:34:53 UTC (rev 570)
@@ -96,6 +96,8 @@
'ct.history_records.pl' => 'History Records',
'ct.identifiers.1' => 'Identifier',
'ct.identifiers.pl' => 'Identifiers',
+ 'ct.navigation_links.1' => 'Navigation Link',
+ 'ct.navigation_links.pl' => 'Navigation Links',
'ct.org_identities.1' => 'Organizational Identity',
'ct.org_identities.se' => 'Organizational Identity Search',
'ct.org_identities.pl' => 'Organizational Identities',

Modified: registry/trunk/app/View/CoNavigationLinks/fields.inc
===================================================================
--- registry/trunk/app/View/CoNavigationLinks/fields.inc 2013-07-23
08:34:15 UTC (rev 569)
+++ registry/trunk/app/View/CoNavigationLinks/fields.inc 2013-07-23
08:34:53 UTC (rev 570)
@@ -87,9 +87,9 @@
<td>
<?php
if($e) {
- if (!empty($this->viewVars['vv_link_location_options'] )) {
- // Print dropdown selector with COU options
- print $this->Form->select('location',
$this->viewVars['vv_link_location_options']);
+ if (!empty($this->viewVars['vv_co_link_location_options'] )) {
+ // Print dropdown selector with location options
+ print $this->Form->select('location',
$this->viewVars['vv_co_link_location_options']);
}
}
else {

Modified: registry/trunk/app/View/CoNavigationLinks/index.ctp
===================================================================
--- registry/trunk/app/View/CoNavigationLinks/index.ctp 2013-07-23 08:34:15
UTC (rev 569)
+++ registry/trunk/app/View/CoNavigationLinks/index.ctp 2013-07-23 08:34:53
UTC (rev 570)
@@ -34,7 +34,7 @@
';
?>

-<table id="cous" class="ui-widget">
+<table id="co_navigation_links" class="ui-widget">
<thead>
<tr class="ui-widget-header">
<th><?php print $this->Paginator->sort('title',
_txt('fd.link.title')); ?></th>

Modified: registry/trunk/app/View/Elements/dropMenu.ctp
===================================================================
--- registry/trunk/app/View/Elements/dropMenu.ctp 2013-07-23 08:34:15
UTC (rev 569)
+++ registry/trunk/app/View/Elements/dropMenu.ctp 2013-07-23 08:34:53
UTC (rev 570)
@@ -299,6 +299,16 @@
print
$this->Html->link(_txt('ct.cmp_enrollment_configurations.pl'), $args);
?>
</li>
+ <li>
+ <?php
+ $args = array();
+ $args['plugin'] = null;
+ $args['controller'] = 'navigation_links';
+ $args['action'] = 'index';
+
+ print $this->Html->link(_txt('ct.navigation_links.pl'), $args);
+ ?>
+ </li>
<?php render_plugin_menus($this->Html, $plugins, 'cmp',
$menuCoId); ?>
</ul>
</li>

Modified: registry/trunk/app/View/Elements/links.ctp
===================================================================
--- registry/trunk/app/View/Elements/links.ctp 2013-07-23 08:34:15 UTC (rev
569)
+++ registry/trunk/app/View/Elements/links.ctp 2013-07-23 08:34:53 UTC (rev
570)
@@ -29,6 +29,12 @@
<li><a href="#">Help</a></li>

<?php
+ if(isset($vv_NavLinks)) {
+ foreach($vv_NavLinks as $l){
+ print '<li><a href="' . $l['NavigationLink']['url'] . '">' .
$l['NavigationLink']['title'] . '</a>';
+ }
+ }
+
if(isset($vv_CoNavLinks)) {
foreach($vv_CoNavLinks as $l){
print '<li><a href="' . $l['CoNavigationLink']['url'] . '">' .
$l['CoNavigationLink']['title'] . '</a>';



  • [comanage-dev] r570 - in registry/trunk/app: Config Config/Schema Controller Lib Model View/CoNavigationLinks View/Elements, svnlog, 07/23/2013

Archive powered by MHonArc 2.6.16.

Top of Page