From fa73873105c18f27ebd5a3bbd5c7bdfa2d2111af Mon Sep 17 00:00:00 2001 From: skodak Date: Thu, 4 Jan 2007 18:23:55 +0000 Subject: [PATCH] MDL-8050 1.2 Remove all target="_top" - refactoring of previous commit --- admin/auth.php | 7 +- admin/auth_config.php | 7 +- admin/dbperformance.php | 8 +- admin/enrol.php | 8 +- admin/enrol_config.php | 8 +- admin/lang.php | 12 +- admin/pagelib.php | 8 +- blog/blogpage.php | 8 +- calendar/lib.php | 8 +- filter/activitynames/filter.php | 8 +- lib/weblib.php | 124 ++++-------------- mod/assignment/lib.php | 20 +-- mod/chat/pagelib.php | 7 +- mod/data/filter.php | 7 +- mod/data/pagelib.php | 8 +- mod/forum/lib.php | 8 +- mod/hotpot/index.php | 2 +- mod/hotpot/lib.php | 2 +- mod/hotpot/view.php | 5 +- mod/lesson/locallib.php | 8 +- mod/quiz/pagelib.php | 8 +- mod/resource/filter.php | 8 +- mod/resource/lib.php | 12 +- mod/resource/type/file/resource.class.php | 7 +- mod/resource/type/ims/deploy.php | 11 +- .../type/repository/resource.class.php | 7 +- mod/scorm/locallib.php | 2 +- mod/scorm/player.php | 10 +- mod/scorm/view.php | 10 +- mod/workshop/assess.php | 2 +- mod/workshop/submissions.php | 2 +- mod/workshop/view.php | 2 +- theme/chameleon/footer.html | 7 +- 33 files changed, 73 insertions(+), 288 deletions(-) diff --git a/admin/auth.php b/admin/auth.php index 4c34e95c81..0b2d3f7323 100644 --- a/admin/auth.php +++ b/admin/auth.php @@ -216,12 +216,7 @@ foreach ($displayauths as $auth => $name) { admin_externalpage_print_header($adminroot); print_simple_box(get_string('configauthenticationplugins', 'admin'), 'center', '700'); -if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; -} else { - $target = ' target="'.$CFG->framename.'"'; -} -echo ""; +echo "
frametarget name=\"authmenu\" method=\"post\" action=\"auth.php\">"; echo "sesskey."\">"; print_table($table); diff --git a/admin/auth_config.php b/admin/auth_config.php index f7ce683392..47e2516e22 100644 --- a/admin/auth_config.php +++ b/admin/auth_config.php @@ -61,13 +61,8 @@ asort($options); // output configuration form admin_externalpage_print_header($adminroot); -if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; -} else { - $target = ' target="'.$CFG->framename.'"'; -} // choose an authentication method -echo "\n"; +echo "frametarget name=\"authmenu\" method=\"post\" action=\"auth_config.php\">\n"; echo "sesskey."\">\n"; echo "

\n"; echo get_string('chooseauthmethod').': '; diff --git a/admin/dbperformance.php b/admin/dbperformance.php index 5d6e62d514..77316aca5d 100644 --- a/admin/dbperformance.php +++ b/admin/dbperformance.php @@ -19,14 +19,8 @@ $site = get_site(); if (!empty($topframe)) { - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - print_header("$site->shortname: $strdatabaseperformance", "$site->fullname", - "$stradministration -> Database performance"); + "frametarget href=\"index.php\">$stradministration -> Database performance"); exit; } diff --git a/admin/enrol.php b/admin/enrol.php index 973b18440d..6d07cdd939 100644 --- a/admin/enrol.php +++ b/admin/enrol.php @@ -52,13 +52,7 @@ print_simple_box(get_string('configenrolmentplugins', 'admin'), 'center', '700'); - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - - echo ""; + echo "frametarget name=\"enrolmenu\" method=\"post\" action=\"enrol.php\">"; echo "sesskey."\" />"; $table = new stdClass(); diff --git a/admin/enrol_config.php b/admin/enrol_config.php index 0ae37e81ae..925546cab8 100644 --- a/admin/enrol_config.php +++ b/admin/enrol_config.php @@ -44,13 +44,7 @@ admin_externalpage_print_header($adminroot); - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - - echo ""; + echo "frametarget name=\"enrolmenu\" method=\"post\" action=\"enrol_config.php\">"; echo "sesskey."\">"; echo "

"; diff --git a/admin/lang.php b/admin/lang.php index ea3fafe5a4..83a4e06fd3 100644 --- a/admin/lang.php +++ b/admin/lang.php @@ -89,26 +89,20 @@ $currentlang = current_language(); - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - switch ($mode) { case "missing": // Missing array keys are not bugs here but missing strings error_reporting(E_ALL ^ E_NOTICE); $navigation = "$strlanguage -> $strmissingstrings"; $title = $strmissingstrings; - $button = ''. + $button = 'frametarget.' method="get" action="'.$CFG->wwwroot.'/'.$CFG->admin.'/lang.php">'. ''. ''; break; case "compare": $navigation = "$strlanguage -> $streditstrings"; $title = $streditstrings; - $button = '

'. + $button = 'frametarget.' method="get" action="'.$CFG->wwwroot.'/'.$CFG->admin.'/lang.php">'. ''. ''; break; @@ -352,7 +346,7 @@ echo ' '; helpbutton('langswitchstorage', $strfilestoredinhelp, 'moodle'); - echo ''. + echo '
frametarget.' method="get" action="'.$CFG->wwwroot.'/'.$CFG->admin.'/lang.php">'. ''. ''. ''. diff --git a/admin/pagelib.php b/admin/pagelib.php index f8d3b8a466..5832e91a67 100644 --- a/admin/pagelib.php +++ b/admin/pagelib.php @@ -110,13 +110,7 @@ class page_admin extends page_base { // if not, print_header() has to be called with a $section parameter if ($this->user_allowed_editing()) { - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - - $buttons = '
'. + $buttons = '' . diff --git a/blog/blogpage.php b/blog/blogpage.php index 4d56086379..c760e56ad8 100644 --- a/blog/blogpage.php +++ b/blog/blogpage.php @@ -186,13 +186,7 @@ class page_blog extends page_base { $paramstring .= ''; } - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - - $editformstring = '' + $editformstring = '
frametarget.' method="get" action="'.$this->url_get_path().'">' .$paramstring.''; } diff --git a/calendar/lib.php b/calendar/lib.php index 5a6700a79d..bb5a64ac89 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -1265,13 +1265,7 @@ function calendar_preferences_button() { return ''; } - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - - return "frametarget method=\"get\" ". " action=\"$CFG->wwwroot/calendar/preferences.php\">". ""; } diff --git a/filter/activitynames/filter.php b/filter/activitynames/filter.php index d421844c14..8ab80466b5 100644 --- a/filter/activitynames/filter.php +++ b/filter/activitynames/filter.php @@ -29,12 +29,6 @@ //Sort modinfo by name length usort($modinfo,'comparemodulenamesbylength'); - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - foreach ($modinfo as $activity) { //Exclude labels and hidden items if ($activity->mod != "label" && $activity->visible) { @@ -42,7 +36,7 @@ /// Avoid empty or unlinkable activity names if (!empty($title)) { $title = str_replace('"', "'", $title); - $href_tag_begin = "wwwroot/mod/$activity->mod/view.php?id=$activity->cm\"$target>"; + $href_tag_begin = "wwwroot/mod/$activity->mod/view.php?id=$activity->cm\" $CFG->frametarget>"; $currentname = urldecode($activity->name); if ($currentname = trim($currentname)) { $activitylist[] = new filterobject($currentname, $href_tag_begin, '', false, true); diff --git a/lib/weblib.php b/lib/weblib.php index cd21c2aba9..a4e026bf55 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -950,17 +950,11 @@ function popup_form($common, $options, $formid, $selected='', $nothing='choose', $nothing = $choose.'...'; } - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - // changed reference to document.getElementById('id_abc') instead of document.abc // MDL-7861 $output = '
frametarget. ' id="'.$formid.'"'. ' class="popupform">'; if ($help) { @@ -2332,12 +2326,6 @@ function print_header_simple($title='', $heading='', $navigation='', $focus='', function print_footer($course=NULL, $usercourse=NULL, $return=false) { global $USER, $CFG, $THEME; - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - /// Course links if ($course) { if (is_string($course) && $course == 'none') { // Don't print any links etc @@ -2351,13 +2339,13 @@ function print_footer($course=NULL, $usercourse=NULL, $return=false) { '
moodlelogo'; $home = true; } else { - $homelink = ''; $home = false; } } else { $course = get_site(); // Set course as site course by default - $homelink = ''; + $homelink = ''; $home = false; } @@ -2664,16 +2652,10 @@ function user_login_string($course=NULL, $user=NULL) { $course = $SITE; } - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - if (isset($user->realuser)) { if ($realuser = get_record('user', 'id', $user->realuser)) { $fullname = fullname($realuser, true); - $realuserinfo = " [wwwroot/course/loginas.php?id=$course->id&return=1\">$fullname] "; } } else { @@ -2693,28 +2675,28 @@ function user_login_string($course=NULL, $user=NULL) { $context = get_context_instance(CONTEXT_COURSE, $course->id); $fullname = fullname($user, true); - $username = "wwwroot/user/view.php?id=$user->id&course=$course->id\">$fullname"; + $username = "frametarget href=\"$CFG->wwwroot/user/view.php?id=$user->id&course=$course->id\">$fullname"; if (is_mnet_remote_user($user) and $idprovider = get_record('mnet_host', 'id', $user->mnethostid)) { - $username .= " from wwwroot}\">{$idprovider->name}"; + $username .= " from frametarget href=\"{$idprovider->wwwroot}\">{$idprovider->name}"; } if (isset($user->username) && $user->username == 'guest') { $loggedinas = $realuserinfo.get_string('loggedinasguest'). - " (".get_string('login').')'; + " (frametarget href=\"$wwwroot/login/index.php\">".get_string('login').')'; } else if (!empty($user->switchrole[$context->id])) { $rolename = ''; if ($role = get_record('role', 'id', $user->switchrole[$context->id])) { $rolename = ': '.format_string($role->name); } $loggedinas = get_string('loggedinas', 'moodle', $username).$rolename. - " (frametarget href=\"$CFG->wwwroot/course/view.php?id=$course->id&switchrole=0&sesskey=".sesskey()."\">".get_string('switchrolereturn').')'; } else { $loggedinas = $realuserinfo.get_string('loggedinas', 'moodle', $username).' '. - " (wwwroot/login/logout.php\">".get_string('logout').')'; + " (frametarget href=\"$CFG->wwwroot/login/logout.php\">".get_string('logout').')'; } } else { $loggedinas = get_string('loggedinnot', 'moodle'). - " (".get_string('login').')'; + " (frametarget href=\"$wwwroot/login/index.php\">".get_string('login').')'; } return '
'.$loggedinas.'
'; } @@ -2779,12 +2761,6 @@ function print_navigation ($navigation, $separator=0, $return=false) { $separator = ''. $separator .''; } - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - if ($navigation) { //Accessibility: breadcrumb links now in a list, » replaced with a 'silent' character. $nav_text = get_string('youarehere','access'); @@ -2793,7 +2769,7 @@ function print_navigation ($navigation, $separator=0, $return=false) { $site->shortname = get_string('home'); } $navigation = "
  • $separator ". str_replace('->', "
  • \n
  • $separator", $navigation) ."
  • \n"; - $output .= '
  • frametarget.' href="'. $CFG->wwwroot.((!has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID)) && !empty($USER->id) && !empty($CFG->mymoodleredirect) && !isguest()) ? '/my' : '') .'/">'. $site->shortname ."
  • \n". $navigation; $output .= "\n"; } @@ -3846,13 +3822,7 @@ function update_course_icon($courseid) { $edit = '1'; } - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - - return "wwwroot/course/view.php\">
    ". + return "frametarget method=\"get\" action=\"$CFG->wwwroot/course/view.php\">
    ". "". "". "". @@ -3920,13 +3890,7 @@ function update_mymoodle_icon() { $edit = '1'; } - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - - return "wwwroot/my/index.php\">". + return "frametarget method=\"get\" action=\"$CFG->wwwroot/my/index.php\">". "". ""; } @@ -3944,13 +3908,7 @@ function update_module_button($moduleid, $courseid, $string) { if (has_capability('moodle/course:manageactivities', get_context_instance(CONTEXT_MODULE, $moduleid))) { $string = get_string('updatethis', '', $string); - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - - return "wwwroot/course/mod.php\">". + return "
    frametarget method=\"get\" action=\"$CFG->wwwroot/course/mod.php\">". "". "". "". @@ -3981,13 +3939,7 @@ function update_category_button($categoryid) { $edit = 'on'; } - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - - return "wwwroot/course/category.php\">". + return "frametarget method=\"get\" action=\"$CFG->wwwroot/course/category.php\">". "". "". "sesskey\" />". @@ -4014,13 +3966,7 @@ function update_categories_button() { $categoryedit = 'on'; } - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - - return "wwwroot/course/index.php\">". + return "frametarget method=\"get\" action=\"$CFG->wwwroot/course/index.php\">". ''. ''. ''; @@ -4046,13 +3992,7 @@ function update_categories_search_button($search,$page,$perpage) { $edit = "on"; } - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - - return "wwwroot/course/search.php\">". + return "
    frametarget method=\"get\" action=\"$CFG->wwwroot/course/search.php\">". "". "sesskey\" />". "". @@ -4077,13 +4017,7 @@ function update_group_button($courseid, $groupid) { if (has_capability('moodle/course:managegroups', get_context_instance(CONTEXT_GROUP, $groupid))) { $string = get_string('editgroupprofile'); - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - - return "wwwroot/course/group.php\">". + return "frametarget method=\"get\" action=\"$CFG->wwwroot/course/group.php\">". ''. ''. ''. @@ -4112,13 +4046,7 @@ function update_groups_button($courseid) { $edit = 'on'; } - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - - return "wwwroot/course/groups.php\">". + return "frametarget method=\"get\" action=\"$CFG->wwwroot/course/groups.php\">". "". "". ""; @@ -4284,15 +4212,9 @@ function navmenu($course, $cm=NULL, $targetwindow='self') { //Accessibility: added Alt text, replaced > < with 'silent' character and 'accesshide' text. check_theme_arrows(); - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - if ($selectmod and has_capability('moodle/site:viewreports', $context)) { $logstext = get_string('alllogs'); - $logslink = 'frametarget.' href="'. $CFG->wwwroot.'/course/report/log/index.php?chooselog=1&user=0&date=0&id='. $course->id.'&modid='.$selectmod->cm.'">'. ''.$logstext.''; @@ -4300,14 +4222,14 @@ function navmenu($course, $cm=NULL, $targetwindow='self') { } if ($backmod) { $backtext= get_string('activityprev', 'access'); - $backmod = '
    '. + $backmod = 'frametarget.'>
    '. ''. '
    '; } if ($nextmod) { $nexttext= get_string('activitynext', 'access'); - $nextmod = '
    '. + $nextmod = 'frametarget.'>
    '. ''. '
    '; diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index 7896641acf..ed2edba39b 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -77,17 +77,11 @@ class assignment_base { $this->strsubmissions = get_string('submissions', 'assignment'); $this->strlastmodified = get_string('lastmodified'); - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - if ($this->course->id != SITEID) { - $this->navigation = "wwwroot/course/view.php?id={$this->course->id}\">{$this->course->shortname} -> ". - "course->id}\">$this->strassignments ->"; + $this->navigation = "frametarget href=\"$CFG->wwwroot/course/view.php?id={$this->course->id}\">{$this->course->shortname} -> ". + "frametarget href=\"index.php?id={$this->course->id}\">$this->strassignments ->"; } else { - $this->navigation = "course->id}\">$this->strassignments ->"; + $this->navigation = "frametarget href=\"index.php?id={$this->course->id}\">$this->strassignments ->"; } $this->pagetitle = strip_tags($this->course->shortname.': '.$this->strassignment.': '.format_string($this->assignment->name,true)); @@ -150,13 +144,7 @@ class assignment_base { global $CFG; if ($subpage) { - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - - $extranav = ''. + $extranav = 'frametarget.' href="view.php?id='.$this->cm->id.'">'. format_string($this->assignment->name,true).' -> '.$subpage; } else { $extranav = ' '.format_string($this->assignment->name,true); diff --git a/mod/chat/pagelib.php b/mod/chat/pagelib.php index 8014cf9b2c..db4d9635b7 100644 --- a/mod/chat/pagelib.php +++ b/mod/chat/pagelib.php @@ -65,12 +65,7 @@ class page_chat extends page_generic_activity { if(empty($morebreadcrumbs) && $this->user_allowed_editing()) { $buttons = '
    frametarget.' method="get" action="' . $this->url_get_path() . '">'. ''. ''. '
    '; if(!empty($CFG->showblocksonmodpages)) { - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - $buttons .= ''; diff --git a/mod/data/filter.php b/mod/data/filter.php index 924e06ff05..c019304127 100644 --- a/mod/data/filter.php +++ b/mod/data/filter.php @@ -47,11 +47,6 @@ $contentlist = array(); - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } foreach ($datacontents as $datacontent) { $currentcontent = trim($datacontent->content); $strippedcontent = strip_tags($currentcontent); @@ -62,7 +57,7 @@ '', + '&rid='. $datacontent->recordid .'" '.$CFG->frametarget.'>', '', false, true); } } // End foreach diff --git a/mod/data/pagelib.php b/mod/data/pagelib.php index 059e17a987..2b84d2597a 100755 --- a/mod/data/pagelib.php +++ b/mod/data/pagelib.php @@ -68,13 +68,7 @@ class page_data extends page_generic_activity { if(empty($morebreadcrumbs) && $this->user_allowed_editing()) { $buttons = '
    '.update_module_button($this->modulerecord->id, $this->courserecord->id, get_string('modulename', 'chat')).''. + $buttons .= '
    frametarget.' method="get" action="view.php">'. ''. ''. '
    '; if(!empty($CFG->showblocksonmodpages)) { - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - - $buttons .= ''; diff --git a/mod/forum/lib.php b/mod/forum/lib.php index a831de4352..93d2fdbb5f 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -3674,13 +3674,7 @@ function forum_update_subscriptions_button($courseid, $forumid) { $edit = "on"; } - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - - return "wwwroot/mod/forum/subscribers.php\">". + return "
    frametarget method=\"get\" action=\"$CFG->wwwroot/mod/forum/subscribers.php\">". "". "". ""; diff --git a/mod/hotpot/index.php b/mod/hotpot/index.php index 3be9cd0af4..18a76ddfb7 100644 --- a/mod/hotpot/index.php +++ b/mod/hotpot/index.php @@ -363,7 +363,7 @@ if (has_capability('moodle/course:manageactivities', $coursecontext)) { $updatebutton = '' - . '
    ' + . 'frametarget.'" method="get" action="'.$CFG->wwwroot.'/course/mod.php">' . '' . $sesskey . '' diff --git a/mod/hotpot/lib.php b/mod/hotpot/lib.php index 19f9a825dc..e540b9b60d 100644 --- a/mod/hotpot/lib.php +++ b/mod/hotpot/lib.php @@ -1708,7 +1708,7 @@ class hotpot_xml_quiz extends hotpot_xml_tree { $replace .= '\\2'; } if ($form_name) { - $replace = ''.$replace.''; + $replace = '
    frametarget.'">'.$replace.''; } if ($center) { $replace = '
    '.$replace.'
    '; diff --git a/mod/hotpot/view.php b/mod/hotpot/view.php index b3beb2ed9d..7ca9bc0d42 100644 --- a/mod/hotpot/view.php +++ b/mod/hotpot/view.php @@ -42,10 +42,9 @@ // header strings $title = strip_tags($course->shortname.': '.$hotpot->name); $heading = "$course->fullname"; - $target = empty($CFG->framename) ? '' : ' target="'.$CFG->framename.'"'; - $navigation = ''.get_string("modulenameplural", "hotpot")." -> $hotpot->name"; + $navigation = 'frametarget.' href="'.$CFG->wwwroot.'/mod/hotpot/index.php?id='.$course->id.'">'.get_string("modulenameplural", "hotpot")." -> $hotpot->name"; if ($course->id != SITEID) { - $navigation = ''.$course->shortname.' -> '.$navigation; + $navigation = 'frametarget.' href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">'.$course->shortname.' -> '.$navigation; } $button = update_module_button($cm->id, $course->id, get_string("modulename", "hotpot").'" style="font-size:0.75em;'); $loggedinas = ''.user_login_string($course, $USER).''; diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php index 7f387ee348..20d6af37fb 100644 --- a/mod/lesson/locallib.php +++ b/mod/lesson/locallib.php @@ -242,15 +242,9 @@ function lesson_print_header($cm, $course, $lesson, $currenttab = '') { $pageid = get_field('lesson_pages', 'id', 'lessonid', $lesson->id, 'prevpageid', 0); } if (!empty($pageid) and $pageid != LESSON_EOL) { - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - $button = '
    '.update_module_button($this->modulerecord->id, $this->courserecord->id, get_string('modulename', 'data')).''. + $buttons .= '
    frametarget.' method="get" action="view.php">'. ''. ''. '
    '.$button. ''. - ''. + '
    frametarget.' method="get" action="'. $CFG->wwwroot .'/mod/lesson/lesson.php">'. ''. ''. ''. diff --git a/mod/quiz/pagelib.php b/mod/quiz/pagelib.php index 957cf4eb32..74df0efaa5 100644 --- a/mod/quiz/pagelib.php +++ b/mod/quiz/pagelib.php @@ -67,13 +67,7 @@ class page_quiz extends page_generic_activity { $buttons = ''; if(!empty($CFG->showblocksonmodpages)) { - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - - $buttons .= ''; diff --git a/mod/resource/filter.php b/mod/resource/filter.php index 845d918967..8f28f9b5ac 100644 --- a/mod/resource/filter.php +++ b/mod/resource/filter.php @@ -32,12 +32,6 @@ $resourcelist = array(); - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - foreach ($resources as $resource) { $currentname = trim($resource->name); $strippedname = strip_tags($currentname); @@ -45,7 +39,7 @@ if (!empty($strippedname)) { $resourcelist[] = new filterobject($currentname, '', + $CFG->wwwroot.'/mod/resource/view.php?r='.$resource->id.'" '.$CFG->frametarget.'>', '', false, true); } } diff --git a/mod/resource/lib.php b/mod/resource/lib.php index 1dc735e1bd..7ad7334d23 100644 --- a/mod/resource/lib.php +++ b/mod/resource/lib.php @@ -113,17 +113,11 @@ function resource_base($cmid=0) { $this->strresource = get_string("modulename", "resource"); $this->strresources = get_string("modulenameplural", "resource"); - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - if ($this->course->id != SITEID) { - $this->navigation = "wwwroot/course/view.php?id={$this->course->id}\">{$this->course->shortname} -> ". - "course->id}\">$this->strresources ->"; + $this->navigation = "frametarget href=\"$CFG->wwwroot/course/view.php?id={$this->course->id}\">{$this->course->shortname} -> ". + "frametarget href=\"index.php?id={$this->course->id}\">$this->strresources ->"; } else { - $this->navigation = "course->id}\">$this->strresources ->"; + $this->navigation = "frametarget href=\"index.php?id={$this->course->id}\">$this->strresources ->"; } if (!$this->cm->visible and !has_capability('moodle/course:viewhiddenactivities', get_context_instance(CONTEXT_MODULE, $this->cm->id))) { diff --git a/mod/resource/type/file/resource.class.php b/mod/resource/type/file/resource.class.php index 738a30de1a..1ba435270d 100644 --- a/mod/resource/type/file/resource.class.php +++ b/mod/resource/type/file/resource.class.php @@ -399,12 +399,7 @@ function display() { if ($inpopup) { print_header($pagetitle); } else { - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - print_header($pagetitle, $course->fullname, "$this->navigation ".format_string($resource->name,true)."", "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm, "self")); + print_header($pagetitle, $course->fullname, "$this->navigation frametarget title=\"$strdirectlink\" href=\"$fullurl\"> ".format_string($resource->name,true)."", "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm, "self")); } diff --git a/mod/resource/type/ims/deploy.php b/mod/resource/type/ims/deploy.php index 2be033ca8c..086899dec3 100644 --- a/mod/resource/type/ims/deploy.php +++ b/mod/resource/type/ims/deploy.php @@ -54,16 +54,11 @@ /// Instantiate a resource_ims object and modify its navigation $resource_obj = new resource_ims ($cmid); - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } if ($resource_obj->course->id != SITEID) { - $resource_obj->navigation = "wwwroot/course/view.php?id={$course->id}\">{$course->shortname} -> ". - "wwwroot/mod/resource/index.php?id={$course->id}\">$resource_obj->strresources -> "; + $resource_obj->navigation = "frametarget href=\"$CFG->wwwroot/course/view.php?id={$course->id}\">{$course->shortname} -> ". + "frametarget href=\"$CFG->wwwroot/mod/resource/index.php?id={$course->id}\">$resource_obj->strresources -> "; } else { - $resource_obj->navigation = "wwwroot/mod/resource/index.php?id={$course->id}\">$resource_obj->strresources -> "; + $resource_obj->navigation = "frametarget href=\"$CFG->wwwroot/mod/resource/index.php?id={$course->id}\">$resource_obj->strresources -> "; } /// Print the header of the page diff --git a/mod/resource/type/repository/resource.class.php b/mod/resource/type/repository/resource.class.php index 10e8f34b93..248e78cc10 100644 --- a/mod/resource/type/repository/resource.class.php +++ b/mod/resource/type/repository/resource.class.php @@ -382,12 +382,7 @@ function display() { if ($inpopup) { print_header($pagetitle); } else { - if (empty($CFG->framename) or $CFG->framename=='_top') { - $target = ''; - } else { - $target = ' target="'.$CFG->framename.'"'; - } - print_header($pagetitle, $course->fullname, "$this->navigation ".format_string($resource->name,true)."", "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm, "self")); + print_header($pagetitle, $course->fullname, "$this->navigation frametarget title=\"$strdirectlink\" href=\"$fullurl\"> ".format_string($resource->name,true)."", "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm, "self")); } diff --git a/mod/scorm/locallib.php b/mod/scorm/locallib.php index c18044ce75..ba4eba024d 100755 --- a/mod/scorm/locallib.php +++ b/mod/scorm/locallib.php @@ -496,7 +496,7 @@ function scorm_course_format_display($user,$course) { $trackedusers = get_record('scorm_scoes_track', 'scormid', $scorm->id, '', '', '', '', 'count(distinct(userid)) as c'); if ($trackedusers->c > 0) { $headertext .= '
    '. update_module_button($this->modulerecord->id, $this->courserecord->id, get_string('modulename', 'quiz')).''. + $buttons .= 'frametarget.' method="get" action="view.php">'. ''. ''. '