]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19787 Upgraded calls to link_to_popup_window()
authornicolasconnault <nicolasconnault>
Thu, 20 Aug 2009 13:13:50 +0000 (13:13 +0000)
committernicolasconnault <nicolasconnault>
Thu, 20 Aug 2009 13:13:50 +0000 (13:13 +0000)
admin/lang.php
admin/mnet/mnet_themes.html
admin/roles/lib.php

index 1bf52f880e7104a31f244b5b3f2307781246899b..d0856d6f21469e746c9d1378ee5dd0bfdfd52983 100644 (file)
                 echo '</form>';
                 $preview_url = lang_help_preview_url($currentfile, !$uselocal);
                 if ($preview_url) {
-                    link_to_popup_window($preview_url, 'popup', get_string('preview'));
+                    $link = html_link::make($preview_url, get_string('preview'));
+                    $link->add_action(new popup_action('click', $link->url));
+                    echo $OUTPUT->link($link);                    
                 }
                 echo '</fieldset>';
             }
                 echo "</textarea>\n</div>\n";
                 $preview_url = lang_help_preview_url($currentfile, $uselocal);
                 if ($preview_url) {
-                    link_to_popup_window($preview_url, 'popup', get_string('preview'));
+                    $link = html_link::make($preview_url, get_string('preview'));
+                    $link->add_action(new popup_action('click', $link->url));
+                    echo $OUTPUT->link($link);                    
                 }
                 echo '</fieldset>';
             }
                 echo "</textarea>\n</div>\n";
                 $preview_url = lang_help_preview_url($currentfile, true, 'en_utf8');   // do not display en_utf8_local
                 if ($preview_url) {
-                    link_to_popup_window($preview_url, 'popup', get_string('preview'));
+                    $link = html_link::make($preview_url, get_string('preview'));
+                    $link->add_action(new popup_action('click', $link->url));
+                    echo $OUTPUT->link($link);                    
                 }
                 echo '</fieldset>';
             }
index 67de832256a7d7fd89e3c7c8320ac6bdbfb5ad0c..f7b5d9d34c9697f307a687db9646c0892defae2e 100644 (file)
@@ -67,10 +67,14 @@ print_tabs(array($tabs), 'mnetthemes');
 
         if (file_exists($CFG->themedir.'/'.$theme.'/README.html')) {
             $readme =  '<li>'.
-            link_to_popup_window($CFG->themewww .'/'. $theme .'/README.html', $theme, $strinfo, 400, 500, '', 'none', true).'</li>';
+            $link = html_link::make($CFG->themewww .'/'. $theme .'/README.html', $strinfo);
+            $link->add_action(new popup_action('click', $link->url, $theme, array('height' => 400, 'width' => 500)));
+            echo $OUTPUT->link($link);                    
         } else if (file_exists($CFG->themedir.'/'.$theme.'/README.txt')) {
             $readme =  '<li>'.
-            link_to_popup_window($CFG->themewww .'/'. $theme .'/README.txt', $theme, $strinfo, 400, 500, '', 'none', true).'</li>';
+            $link = html_link::make($CFG->themewww .'/'. $theme .'/README.txt', $strinfo);
+            $link->add_action(new popup_action('click', $link->url, $theme, array('height' => 400, 'width' => 500)));
+            echo $OUTPUT->link($link);                    
         }
         if (file_exists("$theme/screenshot.png")) {
             $screenshotpath = "$theme/screenshot.png";
index ef8e1595e4d073c2b6defe0411e05590900b5adf..5264bd552dc88e373aae9af7f5ecbf10dddcbf1d 100644 (file)
@@ -238,6 +238,7 @@ class explain_capability_table extends capability_table_base {
     }
 
     protected function add_row_cells($capability) {
+        global $OUTPUT;
         if ($this->hascap) {
             $result = $this->stryes;
             $tooltip = 'whydoesuserhavecap';
@@ -251,8 +252,12 @@ class explain_capability_table extends capability_table_base {
         $a->context = $this->contextname;
         echo '<td>' . $result . '</td>';
         echo '<td>';
-        link_to_popup_window($this->baseurl . $capability->name, 'hascapabilityexplanation',
-                $this->strexplanation, 600, 600, get_string($tooltip, 'role', $a));
+
+        $link = html_link::make($this->baseurl . $capability->name, $this->strexplanation);
+        $link->add_action(new popup_action('click', $link->url, 'hascapabilityexplanation', array('height' => 600, 'width' => 600)));
+        $link->title = get_string($tooltip, 'role', $a);
+        echo $OUTPUT->link($link);                    
+
         echo '</td>';
     }
 }
@@ -417,9 +422,12 @@ abstract class capability_table_with_risks extends capability_table_base {
         global $OUTPUT;
         if (!isset($this->riskicons[$type])) {
             $iconurl = $OUTPUT->old_icon_url('i/' . str_replace('risk', 'risk_', $type));
-            $this->riskicons[$type] = link_to_popup_window($this->risksurl, 'docspopup', 
-                    '<img src="' . $iconurl . '" alt="' . get_string($type . 'short', 'admin') . '" />',
-                    0, 0, get_string($type, 'admin'), null, true);
+            
+            $link = html_link::make($this->risksurl, 'docspopup', '<img src="' . $iconurl . '" alt="' . get_string($type . 'short', 'admin') . '" />');
+            $link->add_action(new popup_action('click', $link->url, 'docspopup'));
+            $link->title = get_string($type, 'admin');
+            
+            $this->riskicons[$type] = $OUTPUT->link($link);
         }
         return $this->riskicons[$type];
     }
@@ -658,6 +666,7 @@ class define_role_table_advanced extends capability_table_with_risks {
     }
 
     protected function print_field($name, $caption, $field) {
+        global $OUTPUT;
         // Attempt to generate HTML like formslib.
         echo '<div class="fitem">';
         echo '<div class="fitemtitle">';
@@ -676,7 +685,7 @@ class define_role_table_advanced extends capability_table_with_risks {
         }
         echo '<div class="felement' . $extraclass . '">';
         if (isset($this->errors[$name])) {
-            formerr($this->errors[$name]);
+            echo $OUTPUT->error_text($this->errors[$name]);
         }
         echo $field;
         echo '</div>';