Locations : common/include/RBAC.php
Description: Called when a role is removed to an user.
+ Hook Name : alt_representations
+ Parameters : $params['script_name'] contains the SCRIPT_NAME (filtered to work only on /projects or /users for the moment)
+ Description: returns alternate representations for a particular page in $params['results'] which is populated by the hook users
+
TODO (nerville) : document display_hierarchy
TODO (lolando ?) : document role_normalize, role_translate_strings, role_has_permission, role_get_setting, list_roles_by_permission
TODO : document project_link_with_tooltip
$this->text = "DoaPRDF!"; // To show in the tabs, use...
$this->_addHook("script_accepted_types");
$this->_addHook("content_negociated_project_home");
+ $this->_addHook("alt_representations");
}
$params['content'] = $doc;
}
}
+
+ /**\r
+ * Declares a link to itself in the link+meta HTML headers\r
+ * @param unknown_type $params\r
+ */\r
+ function alt_representations (&$params) {\r
+ $script_name = $params['script_name'];
+ if ($script_name == '/projects') {
+ $params['return'][] = '<link rel="meta" type="application/rdf+xml" title="DOAP RDF Data" href=""/>';
+ }
+ }\r
+
}
// Local Variables:
$this->headerCSS();
$this->headerJS();
$this->headerForgepluckerMeta();
+ $this->headerLinkedDataAutodiscovery();
?>
</head>
<?php
}
}
+ /**
+ * headerLinkedDataAutodiscovery() - creates the link+meta links to alternate
+ * representations for Linked Data autodiscovery
+ */
+ function headerLinkedDataAutodiscovery() {
+ // Only activated for /projects or /users for the moment
+ $script_name = getStringFromServer('SCRIPT_NAME');
+
+ if ($script_name == '/projects' || $script_name == '/users') {
+
+ // invoke the 'alt_representations' hook
+ $params = array('script_name' => $script_name,
+ 'return' => array());
+
+ plugin_hook_by_reference('alt_representations', $params);
+
+ foreach($params['return'] as $link) {
+ echo " $link"."\n";
+ }
+ }
+ }
+
function headerForgepluckerMeta() {
/*-
* Forge-Identification Meta Header, Version 1.0