Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Modified Files:

     repository.html  - added help buttons and changed hive buttons
     resource.class.php  - hive/makelink.php added version and format options
     hive/openhive.php  - obsolete
 Added Files:
     hive/hp-footer-hive-powered.gif - hive logo
     hive/openlitebrowse.php  - new openhive option
     hive/openlitesearch.php  - new openhive option
  • Loading branch information...
commit 94d78cc663b8d0e7a12c792cb228a2d3c03eec13 1 parent 5b561c2
mikewaters authored
View
BIN  mod/resource/type/repository/hive/hp-footer-hive-powered.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
16 mod/resource/type/repository/hive/makelink.php
@@ -12,14 +12,28 @@
$part = explode('=', $part);
$$part[0] = $part[1];
}
+ /// Generate the HIVE_REF parameter
+ $hive_ref = 'HIVE_REF=hii%3A'. $aliasid;
+ if ($latest != 'Y') {
+ $hive_ref = 'HIVE_REF=hdi%3A'. $itemid;
+ }
+ /// Generate the HIVE_RET parameter
+ $hive_ret = 'HIVE_RET=ORG';
+ if ($format != 'orig') {
+ $hive_ret = 'HIVE_RET=CNV';
+ }
+ $resource = $hive_ref.'&'. $hive_ret .'&HIVE_REQ=2113';
+
- $resource = 'HIVE_REF=hii%3A'. $aliasid .'&HIVE_RET=ORG&HIVE_REQ=2001';
?>
<script language="javascript" type="text/javascript">
<!--
opener.document.forms['form'].reference.value = '<?php echo addslashes($resource) ?>';
+ opener.document.forms['form'].name.value = '<?php echo addslashes(urldecode($title)) ?>';
+ opener.focus();
window.close();
-->
</script>
+
View
39 mod/resource/type/repository/hive/openhive.php
@@ -2,16 +2,44 @@
require_once("../../../../../config.php");
- print_header();
-
- if (empty($CFG->hivehost) or empty($CFG->hivehost) or empty($CFG->hivehost) or empty($CFG->hivehost)) {
+ if (empty($CFG->hivehost) or empty($CFG->hiveport) or empty($CFG->hiveprotocol) or empty($CFG->hivepath)) {
+ print_header();
notify('A Hive repository is not yet configured in Moodle. Please see Resource settings.');
+ print_footer();
die;
}
+ if (empty($SESSION->HIVE_SESSION)) {
+ print_header();
+ notify('You do not have access to the Hive repository. Moodle signs you into Hive when you log in. This process may have failed.');
+ close_window_button();
+ print_footer();
+ die;
+ }
+
+$query .= '&HISTORY=';
+$query .= '&hiveLanguage=en_AU';
+$query .= '&PUBCATEGORY_LIST=';
+$query .= '&CATEGORY_LIST=';
+$query .= '&HIDE_LOGOUT=Y';
+$query .= '&mkurl='.$CFG->wwwroot.'/mod/resource/type/repository/hive/makelink.php';
+$query .= '&HIDE_CHANGEUSERDETAILS=Y';
+$query .= '&HIVE_RET=ORG';
+$query .= '&HIVE_PAGE=Lite%20Browse';
+$query .= '&HIVE_REQ=2113';
+$query .= '&HIVE_ERRCODE=0';
+$query .= '&mklms=Doodle';
+$query .= '&HIVE_PROD=0';
+$query .= '&HIVE_REF=hin:hive@Hive%20Login%20HTML%20Template';
+$query .= '&HIVE_LITEMODE=liteBrowse';
+$query .= '&HIVE_SEREF='.$CFG->wwwroot.'/sso/hive/expired.php';
+$query .= '&HIVE_SESSION='.$SESSION->HIVE_SESSION;
+
+ redirect($CFG->hiveprotocol .'://'. $CFG->hivehost .':'. $CFG->hiveport .''. $CFG->hivepath .'?'.$query);
+/***********8
notify('Opening HarvestRoad Hive. Please wait. Contacting '. $CFG->hivehost );
- echo '<form name="OPEN_HIVE_FORM" action="'. $CFG->hiveprot .'://'. $CFG->hivehost .':'. $CFG->hiveport .''. $CFG->hivepath .'" method="post">';
+ echo '<form name="OPEN_HIVE_FORM" action="'. $CFG->hiveprotocol .'://'. $CFG->hivehost .':'. $CFG->hiveport .''. $CFG->hivepath .'" method="post">';
echo '<input type="hidden" name="HISTORY" value="">';
echo '<input type="hidden" name="hiveLanguage" value="en_AU">';
@@ -33,7 +61,8 @@
echo '</form>';
echo '<script language="javascript"/>';
echo 'document.OPEN_HIVE_FORM.submit();';
- echo 'history.go(-1);';
echo '</script>';
+ print_footer();
+*************/
?>
View
69 mod/resource/type/repository/hive/openlitebrowse.php
@@ -0,0 +1,69 @@
+<?php // $Id$
+
+ require_once("../../../../../config.php");
+
+ if (empty($CFG->hivehost) or empty($CFG->hiveport) or empty($CFG->hiveprotocol) or empty($CFG->hivepath)) {
+ print_header();
+ notify('A Hive repository is not yet configured in Moodle. Please see Resource settings.');
+ print_footer();
+ die;
+ }
+
+ if (empty($SESSION->HIVE_SESSION)) {
+ print_header();
+ notify('You do not have access to the Hive repository. Moodle signs you into Hive when you log in. This process may have failed.');
+ close_window_button();
+ print_footer();
+ die;
+ }
+
+// MW Redirect to the Hive page. No need for a self-posting form as there is no sensitive data.
+$query .= '&HISTORY=';
+$query .= '&hiveLanguage=en_AU';
+$query .= '&PUBCATEGORY_LIST=';
+$query .= '&CATEGORY_LIST=';
+$query .= '&HIDE_LOGOUT=Y';
+$query .= '&mkurl='.$CFG->wwwroot.'/mod/resource/type/repository/hive/makelink.php';
+$query .= '&HIDE_CHANGEUSERDETAILS=Y';
+$query .= '&HIVE_RET=ORG';
+$query .= '&HIVE_REQ=2113';
+$query .= '&HIVE_ERRCODE=0';
+$query .= '&mklms=Moodle';
+$query .= '&HIVE_PROD=0';
+$query .= '&HIVE_REF=hin:hive@Hive%20Login%20HTML%20Template';
+$query .= '&HIVE_LITEMODE=liteBrowse';
+$query .= '&HIVE_SEREF='.$CFG->wwwroot.'/sso/hive/expired.php';
+$query .= '&HIVE_SESSION='.$SESSION->HIVE_SESSION;
+
+ redirect($CFG->hiveprotocol .'://'. $CFG->hivehost .':'. $CFG->hiveport .''. $CFG->hivepath .'?'.$query);
+/***********
+// MW The original form
+ notify('Opening HarvestRoad Hive. Please wait. Contacting '. $CFG->hivehost );
+
+ echo '<form name="OPEN_HIVE_FORM" action="'. $CFG->hiveprotocol .'://'. $CFG->hivehost .':'. $CFG->hiveport .''. $CFG->hivepath .'" method="post">';
+
+ echo '<input type="hidden" name="HISTORY" value="">';
+ echo '<input type="hidden" name="hiveLanguage" value="en_AU">';
+ echo '<input type="hidden" name="PUBCATEGORY_LIST" value="">';
+ echo '<input type="hidden" name="CATEGORY_LIST" value="">';
+ echo '<input type="hidden" name="HIDE_LOGOUT" value="Y">';
+ echo '<input type="hidden" name="mkurl" value="'.$CFG->wwwroot.'/mod/resource/type/repository/hive/makelink.php">';
+ echo '<input type="hidden" name="HIDE_CHANGEUSERDETAILS" value="Y">';
+ echo '<input type="hidden" name="HIVE_RET" value="ORG">';
+ echo '<input type="hidden" name="HIVE_PAGE" value="Lite Browse">';
+ echo '<input type="hidden" name="HIVE_REQ" value="2113">';
+ echo '<input type="hidden" name="HIVE_ERRCODE" value="0">';
+ echo '<input type="hidden" name="mklms" value="Moodle">';
+ echo '<input type="hidden" name="HIVE_PROD" value="0">';
+ echo '<input type="hidden" name="HIVE_REF" value="hin:hive@Hive Login HTML Template">';
+ echo '<input type="hidden" name="HIVE_LITEMODE" value="liteBrowse">';
+ echo '<input type="hidden" name="HIVE_SEREF" value="'.$CFG->wwwroot.'/sso/hive/expired.php">';
+ echo '<input type="hidden" name="HIVE_SESSION" value="'.$SESSION->HIVE_SESSION.'">';
+ echo '</form>';
+ echo '<script language="javascript"/>';
+ echo 'document.OPEN_HIVE_FORM.submit();';
+ echo '</script>';
+
+ print_footer();
+*************/
+?>
View
69 mod/resource/type/repository/hive/openlitesearch.php
@@ -0,0 +1,69 @@
+<?php // $Id$
+
+ require_once("../../../../../config.php");
+
+ if (empty($CFG->hivehost) or empty($CFG->hiveport) or empty($CFG->hiveprotocol) or empty($CFG->hivepath)) {
+ print_header();
+ notify('A Hive repository is not yet configured in Moodle. Please see Resource settings.');
+ print_footer();
+ die;
+ }
+
+ if (empty($SESSION->HIVE_SESSION)) {
+ print_header();
+ notify('You do not have access to the Hive repository. Moodle signs you into Hive when you log in. This process may have failed.');
+ close_window_button();
+ print_footer();
+ die;
+ }
+
+// MW Redirect to the Hive page. No need for a self-posting form as there is no sensitive data.
+$query .= '&HISTORY=';
+$query .= '&hiveLanguage=en_AU';
+$query .= '&PUBCATEGORY_LIST=';
+$query .= '&CATEGORY_LIST=';
+$query .= '&HIDE_LOGOUT=Y';
+$query .= '&mkurl='.$CFG->wwwroot.'/mod/resource/type/repository/hive/makelink.php';
+$query .= '&HIDE_CHANGEUSERDETAILS=Y';
+$query .= '&HIVE_RET=ORG';
+$query .= '&HIVE_REQ=2113';
+$query .= '&HIVE_ERRCODE=0';
+$query .= '&mklms=Moodle';
+$query .= '&HIVE_PROD=0';
+$query .= '&HIVE_REF=hin:hive@Hive%20Login%20HTML%20Template';
+$query .= '&HIVE_LITEMODE=liteSearch';
+$query .= '&HIVE_SEREF='.$CFG->wwwroot.'/sso/hive/expired.php';
+$query .= '&HIVE_SESSION='.$SESSION->HIVE_SESSION;
+
+ redirect($CFG->hiveprotocol .'://'. $CFG->hivehost .':'. $CFG->hiveport .''. $CFG->hivepath .'?'.$query);
+/***********
+// MW The original form
+ notify('Opening HarvestRoad Hive. Please wait. Contacting '. $CFG->hivehost );
+
+ echo '<form name="OPEN_HIVE_FORM" action="'. $CFG->hiveprotocol .'://'. $CFG->hivehost .':'. $CFG->hiveport .''. $CFG->hivepath .'" method="post">';
+
+ echo '<input type="hidden" name="HISTORY" value="">';
+ echo '<input type="hidden" name="hiveLanguage" value="en_AU">';
+ echo '<input type="hidden" name="PUBCATEGORY_LIST" value="">';
+ echo '<input type="hidden" name="CATEGORY_LIST" value="">';
+ echo '<input type="hidden" name="HIDE_LOGOUT" value="Y">';
+ echo '<input type="hidden" name="mkurl" value="'.$CFG->wwwroot.'/mod/resource/type/repository/hive/makelink.php">';
+ echo '<input type="hidden" name="HIDE_CHANGEUSERDETAILS" value="Y">';
+ echo '<input type="hidden" name="HIVE_RET" value="ORG">';
+ echo '<input type="hidden" name="HIVE_PAGE" value="Lite Browse">';
+ echo '<input type="hidden" name="HIVE_REQ" value="2113">';
+ echo '<input type="hidden" name="HIVE_ERRCODE" value="0">';
+ echo '<input type="hidden" name="mklms" value="Moodle">';
+ echo '<input type="hidden" name="HIVE_PROD" value="0">';
+ echo '<input type="hidden" name="HIVE_REF" value="hin:hive@Hive Login HTML Template">';
+ echo '<input type="hidden" name="HIVE_LITEMODE" value="liteBrowse">';
+ echo '<input type="hidden" name="HIVE_SEREF" value="'.$CFG->wwwroot.'/sso/hive/expired.php">';
+ echo '<input type="hidden" name="HIVE_SESSION" value="'.$SESSION->HIVE_SESSION.'">';
+ echo '</form>';
+ echo '<script language="javascript"/>';
+ echo 'document.OPEN_HIVE_FORM.submit();';
+ echo '</script>';
+
+ print_footer();
+*************/
+?>
View
23 mod/resource/type/repository/repository.html
@@ -36,7 +36,28 @@
<td>
<?php
echo "<input type=\"text\" name=\"reference\" size=\"90\" value=\"$form->reference\" alt=\"reference\" /><br />";
- button_to_popup_window ('/mod/resource/type/repository/hive/openhive.php', 'Hive', 'Hive', 500, 750, $strchooseafile);
+//MW add image icon next to Hive... button
+ ?>
+ </td>
+ </tr>
+ <tr valign="top">
+ <td align="right" nowrap="nowrap">
+ <img src="<?php echo $CFG->wwwroot.'/mod/resource/type/repository/hive/hp-footer-hive-powered.gif' ?>" align="top" />
+ </td>
+ <td>
+ <?php
+//MW END
+//MW add controls to popup
+ $options = 'menubar,location,toolbar,scrollbars,resizable,width=750,height=500';
+ button_to_popup_window ('/mod/resource/type/repository/hive/openlitebrowse.php',
+ 'LiteBrowse', 'Browse for content in Hive', 500, 750,
+ 'Browse for content in the HarvestRoad Hive repository', $options);
+ button_to_popup_window ('/mod/resource/type/repository/hive/openlitesearch.php',
+ 'LiteSearch', 'Search for content in Hive ', 500, 750,
+ 'Search for content in the HarvestRoad Hive repository', $options);
+ helpbutton("hive", "HarvestRoad Hive", "resource/type", true);
+//MW END
+// button_to_popup_window ('/mod/resource/type/repository/hive/openhive.php', 'Hive', 'Hive', 500, 750, $strchooseafile);
?>
</td>
</tr>
View
19 mod/resource/type/repository/resource.class.php
@@ -256,7 +256,7 @@ function display() {
$inpopup = !empty($_GET["inpopup"]);
- $fullurl = $CFG->hiveprot .'://'. $CFG->hivehost .':'. $CFG->hiveport .''. $CFG->hivepath . '?'. $resource->reference . '&amp;HIVE_SESSION='.$SESSION->HIVE_SESSION;
+ $fullurl = $CFG->hiveprotocol .'://'. $CFG->hivehost .':'. $CFG->hiveport .''. $CFG->hivepath . '?'. $resource->reference . '&amp;HIVE_SESSION='.$SESSION->HIVE_SESSION;
if (!empty($querystring)) {
$urlpieces = parse_url($resource->reference);
@@ -267,6 +267,23 @@ function display() {
}
}
+ /// MW check that the HIVE_SESSION is there
+ if (empty($SESSION->HIVE_SESSION)) {
+ if ($inpopup) {
+ print_header($pagetitle, $course->fullname);
+ } else {
+ print_header($pagetitle, $course->fullname, "$this->navigation ".format_string($resource->name), "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
+ }
+ notify('You do not have access to HarvestRoad Hive. This resource is unavailable.');
+ if ($inpopup) {
+ close_window_button();
+ }
+ print_footer('none');
+ die;
+ }
+ /// MW END
+
+
/// Print a notice and redirect if we are trying to access a file on a local file system
/// and the config setting has been disabled
if (!$CFG->resource_allowlocalfiles and (strpos($resource->reference, RESOURCE_LOCALPATH) === 0)) {
Please sign in to comment.
Something went wrong with that request. Please try again.