From: stronk7 Date: Mon, 24 Apr 2006 23:55:29 +0000 (+0000) Subject: Apply latest changes from resource type to repository X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=206548dc4b94c72e71469a4cf5cb154a4f76a233;p=moodle.git Apply latest changes from resource type to repository (double head out, cool resize javascript, XHTML and navigation menu) TODO: Fix the 'deploy all' button --- diff --git a/mod/resource/type/ims/finder.php b/mod/resource/type/ims/finder.php index 125b160bc7..d05b46210d 100644 --- a/mod/resource/type/ims/finder.php +++ b/mod/resource/type/ims/finder.php @@ -74,7 +74,7 @@ foreach ($items as $item) { if ($item->type == 'deployed') { - echo "
  • $item->name (\"IMS $item->name (type == 'not deployed') { /// Only displays non-deployed IMS CP's if admin user. if (isadmin()) { - echo "
  • $item->path - $strnotdeployed (path\">$strdeploy)
  • \n"; + echo "
  • \"IMS $item->path - $strnotdeployed (path\">$strdeploy)
  • \n"; } } else if ($item->type == 'directory') { - echo "
  • path\">$item->name
  • \n"; + echo "
  • \"IMS path\">$item->name
  • \n"; } } } @@ -111,13 +111,13 @@ return; } else { - $output = "$strrepository » "; + $output = "$strrepository » "; } $itemdir = ''; foreach ($arr as $item) { if ($item == '') continue; $itemdir .= '/'.$item; - $output .= "$item » "; + $output .= "$item » "; } $output .= $last; echo $output; diff --git a/mod/resource/type/ims/preview.php b/mod/resource/type/ims/preview.php index 7ba697177a..d3c67b1e85 100644 --- a/mod/resource/type/ims/preview.php +++ b/mod/resource/type/ims/preview.php @@ -45,90 +45,46 @@ $direction = ' dir="ltr"'; } -/// The output here - - echo "\n"; - echo "\n"; - echo ''; - echo ''; - echo " - - - - "; - echo "Preview\n"; /// moodle header print_header(); /// content - this produces everything else /// adds side navigation bar if needed. must also adjust width of iframe to accomodate - echo "
    "; preview_buttons($directory, $items['title']); echo preview_ims_generate_toc($items, $directory); echo "
    "; + echo "
    "; preview_buttons($directory, $items['title']); echo preview_ims_generate_toc($items, $directory, 0, $page); echo "
    "; $fullurl = "$CFG->repositorywebroot/$directory/".$items[$page]->href; /// prints iframe filled with $fullurl ;width:".$iframewidth." missing also height=\"420px\" - echo ""; //Content frame + echo ""; //Content frame /// moodle footer - echo ""; + echo ""; /*** This function will generate the TOC file for the package * from an specified parent to be used in the view of the IMS */ - function preview_ims_generate_toc($items, $directory, $page=0) { + function preview_ims_generate_toc($items, $directory, $page=0, $selected_page) { global $CFG; $contents = ''; /// Configure links behaviour - $fullurl = '?directory='.$directory.'&page='; + $fullurl = '?directory='.$directory.'&page='; /// Iterate over items to build the menu $currlevel = 0; $currorder = 0; $endlevel = 0; + $openlielement = false; foreach ($items as $item) { if (!is_object($item)) { continue; @@ -152,20 +108,28 @@ /// Start Level if ($item->level > $currlevel) { $contents .= '
      '; + $openlielement = false; } /// End Level if ($item->level < $currlevel) { + $contents .= ''; $contents .= '
    '; } + /// If we have some openlielement, just close it + if ($openlielement) { + $contents .= ''; + } /// Add item $contents .= '
  • '; if (!empty($item->href)) { + if ($item->id == $selected_page) $contents .= '
    '; $contents .= ''.$item->title.''; + if ($item->id == $selected_page) $contents .= '
    '; } else { $contents .= $item->title; } - $contents .= '
  • '; $currlevel = $item->level; + $openlielement = true; continue; } /// We have reached endlevel, exit @@ -173,7 +137,11 @@ break; } } - $contents .= ''; + /// Close up to $endlevel + for ($i=$currlevel;$i>$endlevel;$i--) { + $contents .= ''; + $contents .= ''; + } return $contents; } @@ -195,4 +163,4 @@ \">$strchoose)"; } -?> \ No newline at end of file +?>