Index: domain_content.admin.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain_content/domain_content.admin.inc,v retrieving revision 1.10 diff -u -r1.10 domain_content.admin.inc --- domain_content.admin.inc 25 Mar 2009 16:23:42 -0000 1.10 +++ domain_content.admin.inc 18 May 2009 16:46:35 -0000 @@ -58,6 +58,10 @@ $_domain['site_grant'] = TRUE; drupal_set_title(t('Content for all affiliate sites')); } + else if (!$all_affiliates && is_null($domain_id)) { + $_domain['site_grant'] = TRUE; + drupal_set_title(t('Assigned and available content')); + } // KILLSWITCH CASE: returns an error else { drupal_set_message(t('Invalid request'), 'error'); @@ -103,7 +107,7 @@ $filter['join'] .= " INNER JOIN {domain_access} dac ON dac.nid = n.nid "; $arg = arg(3); - if ($arg != 'all') { + if ($arg != 'all' && $arg != 'all_content') { // In this case, we must check the domain_id grant. // We use intval() here for security, since we are not filtering the query parameter otherwise. if (empty($filter['where'])) { @@ -113,7 +117,7 @@ $filter['where'] .= " AND dac.realm = 'domain_id' AND dac.gid = ". intval($_domain['domain_id']) ." "; } } - else { + else if ($arg != 'all_content') { // Or check the domain_site grant. if (empty($filter['where'])) { $filter['where'] = " WHERE dac.realm = 'domain_site' AND dac.gid = 0 "; @@ -145,16 +149,30 @@ if ($message) { $check[$node->nid] = TRUE; } - $form['title'][$node->nid] = array('#value' => l($node->title, 'node/'. $node->nid) .' '. theme('mark', node_mark($node->nid, $node->changed))); + + // Load the domain_access rules directly from domain_nodeapi(). + domain_nodeapi($node, 'load'); + + // The root domain is stored as -1, but cast as zero in the global variable. + $inv_key = ($_domain['domain_id'] == 0) ? -1 : $_domain['domain_id']; + + // If the current domain is present in the assigned domains for this node + // or if it's set to display on all affiliates, then add the 'domain-visible' class to the node link + if (in_array($inv_key, $node->domains) || $node->domain_site) { + $domain_visibility = "domain-visible"; + } else { + $domain_visibility = "domain-invisible"; + } + $attributes = array('class' => $domain_visibility); + + $form['title'][$node->nid] = array('#value' => l($node->title, 'node/'. $node->nid, array('attributes' => $attributes)) .' '. theme('mark', node_mark($node->nid, $node->changed))); $form['name'][$node->nid] = array('#value' => check_plain(node_get_types('name', $node))); $form['username'][$node->nid] = array('#value' => theme('username', $node)); $form['status'][$node->nid] = array('#value' => ($node->status ? t('published') : t('not published'))); - // This routine controls if the editor can see the 'edit' link. - // Load the domain_access rules directly from domain_nodeapi(). - domain_nodeapi($node, 'load'); $node_domains = array(); + // This routine controls if the editor can see the 'edit' link. if (!empty($node->domains)) { foreach ($node->domains as $domain) { // Can the user edit this node. We use += here since this is an array loop. Index: domain_content.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain_content/domain_content.module,v retrieving revision 1.27 diff -u -r1.27 domain_content.module --- domain_content.module 21 Feb 2009 15:45:37 -0000 1.27 +++ domain_content.module 18 May 2009 16:47:14 -0000 @@ -38,6 +38,15 @@ 'description' => 'View content assigned to all affiliate sites.', 'weight' => -10 ); + $items['admin/domain/content/all_content'] = array( + 'title' => 'Assigned and available content', + 'page callback' => 'domain_content_view', + 'page arguments' => array(NULL, FALSE), + 'access callback' => 'domain_content_menu_check', + 'file' => 'domain_content.admin.inc', + 'description' => 'View all content assigned or available to this domain.', + 'weight' => -9, + ); // Generate the list of active domains as menu items $domains = domain_domains(); foreach ($domains as $domain) { --- domain_content.css +++ domain_content.css @@ -0,0 +1,9 @@ +#domain-content-form a.domain-visible, +#domain-content-form a.domain-visible:hover { + color: green; +} + +#domain-content-form a.domain-invisible, +#domain-content-form a.domain-invisible:hover { + color: #5D5D5D; +}