* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with FusionForge; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+require_once('common/include/rdfutils.php');
+
class oslcPlugin extends Plugin {
public function __construct($id=0) {
$this->Plugin($id) ;
$this->_addHook("userisactivecheckbox"); // The "use ..." checkbox in user account
$this->_addHook("userisactivecheckboxpost"); //
$this->_addHook("project_admin_plugins"); // to show up in the admin page fro group
+ $this->_addHook("project_rdf_metadata"); // will provide some RDF metadata for the project's DOAP profile to 'doaprdf' plugin
}
- function CallHook ($hookname, $params) {
+ function CallHook ($hookname, &$params) {
global $use_oslcplugin,$G_SESSION,$HTML;
if ($hookname == "usermenu") {
$text = $this->text; // this is what shows in the tab
if ($G_SESSION->usesPlugin("oslc")) {
$param = '?type=user&id=' . $G_SESSION->getId() . "&pluginname=" . $this->name; // we indicate the part we're calling is the user one
- echo ' | ' . $HTML->PrintSubMenu (array ($text),
- array ('/plugins/oslc/index.php' . $param ));
+ echo $HTML->PrintSubMenu (array ($text),
+ array ('/plugins/oslc/index.php' . $param ));
}
} elseif ($hookname == "groupmenu") {
$group_id=$params['group'];
}
if ( $project->usesPlugin ( $this->name ) ) {
$params['TITLES'][]=$this->text;
- $params['DIRS'][]=util_make_uri('/plugins/oslc/index.php?type=group&id=' . $group_id . "&pluginname=" . $this->name) ; // we indicate the part we're calling is the project one
+ $params['DIRS'][]=util_make_uri('/plugins/oslc/');
+ $params['ADMIN'][]='';
} else {
$params['TITLES'][]=$this->text." is [Off]";
$params['DIRS'][]='';
- }
+ $params['ADMIN'][]='';
+ }
(($params['toptab'] == $this->name) ? $params['selected']=(count($params['TITLES'])-1) : '' );
} elseif ($hookname == "groupisactivecheckbox") {
//Check if the group is active
echo '<p>'.util_make_link ("/plugins/oslc/admin/index.php?id=".$group->getID().'&type=admin&pluginname='.$this->name,
_('oslc Admin')).'</p>' ;
}
- }
+ }
+ elseif($hookname == "project_rdf_metadata") {
+
+ # TODO : create another resource
+ $group_id=$params['group'];
+
+ if (! isset($params['prefixes']['http://open-services.net/ns/core#'])) {
+ $params['prefixes']['http://open-services.net/ns/core#'] = 'oslc';
+ }
+
+ $serviceprovider = util_make_url ("/plugins/oslc/cm/oslc-cm-services/".$group_id);
+
+ $res = $params['in_Resource'];
+
+ rdfutils_setPropToUri($res, 'oslc:serviceProvider', $serviceprovider);
+
+ $params['out_Resources'][] = $res;
+
+ }
elseif ($hookname == "blahblahblah") {
// ...
- }
+ }
}
}