Beispiel #1
0
 /**
  * Gets the direction icon for the sortable field within this table
  *
  * @param core_renderer $output
  * @param string $field
  * @return string
  */
 protected function get_direction_icon($output, $field)
 {
     $direction = self::DEFAULTSORTDIRECTION;
     if ($this->sort == $field) {
         $direction = $this->sortdirection;
     }
     if ($direction === 'ASC') {
         return html_writer::empty_tag('img', array('alt' => '', 'src' => $output->pix_url('t/down')));
     } else {
         return html_writer::empty_tag('img', array('alt' => '', 'src' => $output->pix_url('t/up')));
     }
 }
 /**
  * Initialise with the bits of JavaScript that every Moodle page should have.
  *
  * @param moodle_page $page
  * @param core_renderer $output
  */
 protected function init_requirements_data(moodle_page $page, core_renderer $renderer)
 {
     global $CFG;
     // JavaScript should always work with $CFG->httpswwwroot rather than $CFG->wwwroot.
     // Otherwise, in some situations, users will get warnings about insecure content
     // on secure pages from their web browser.
     $this->M_cfg = array('wwwroot' => $CFG->httpswwwroot, 'sesskey' => sesskey(), 'loadingicon' => $renderer->pix_url('i/loading_small', 'moodle')->out(false), 'themerev' => theme_get_revision(), 'theme' => $page->theme->name, 'jsrev' => (empty($CFG->cachejs) or empty($CFG->jsrev)) ? -1 : $CFG->jsrev);
     if (debugging('', DEBUG_DEVELOPER)) {
         $this->M_cfg['developerdebug'] = true;
         $this->yui2_lib('logger');
     }
     // accessibility stuff
     $this->skip_link_to('maincontent', get_string('tocontent', 'access'));
     // to be removed soon
     $this->yui2_lib('dom');
     // at least javascript-static.js needs to be migrated to YUI3
     $this->string_for_js('confirmation', 'admin');
     $this->string_for_js('cancel', 'moodle');
     $this->string_for_js('yes', 'moodle');
     if ($page->pagelayout === 'frametop') {
         $this->js_init_call('M.util.init_frametop');
     }
 }
 /**
  * Initialise with the bits of JavaScript that every Moodle page should have.
  *
  * @param moodle_page $page
  * @param core_renderer $renderer
  */
 protected function init_requirements_data(moodle_page $page, core_renderer $renderer)
 {
     global $CFG;
     // JavaScript should always work with $CFG->httpswwwroot rather than $CFG->wwwroot.
     // Otherwise, in some situations, users will get warnings about insecure content
     // on secure pages from their web browser.
     $this->M_cfg = array('wwwroot' => $CFG->httpswwwroot, 'sesskey' => sesskey(), 'loadingicon' => $renderer->pix_url('i/loading_small', 'moodle')->out(false), 'themerev' => theme_get_revision(), 'slasharguments' => (int) (!empty($CFG->slasharguments)), 'theme' => $page->theme->name, 'jsrev' => (empty($CFG->cachejs) or empty($CFG->jsrev)) ? -1 : $CFG->jsrev, 'svgicons' => $page->theme->use_svg_icons());
     if (debugging('', DEBUG_DEVELOPER)) {
         $this->M_cfg['developerdebug'] = true;
     }
     if (defined('BEHAT_SITE_RUNNING')) {
         $this->M_cfg['behatsiterunning'] = true;
     }
     // Accessibility stuff.
     $this->skip_link_to('maincontent', get_string('tocontent', 'access'));
     // Add strings used on many pages.
     $this->string_for_js('confirmation', 'admin');
     $this->string_for_js('cancel', 'moodle');
     $this->string_for_js('yes', 'moodle');
     // Alter links in top frame to break out of frames.
     if ($page->pagelayout === 'frametop') {
         $this->js_init_call('M.util.init_frametop');
     }
     // Include block drag/drop if editing is on
     if ($page->user_is_editing()) {
         $params = array('courseid' => $page->course->id, 'pagetype' => $page->pagetype, 'pagelayout' => $page->pagelayout, 'subpage' => $page->subpage, 'regions' => $page->blocks->get_regions(), 'contextid' => $page->context->id);
         if (!empty($page->cm->id)) {
             $params['cmid'] = $page->cm->id;
         }
         $page->requires->yui_module('moodle-core-blocks', 'M.core_blocks.init_dragdrop', array($params), null, true);
     }
 }
 /**
  * Initialise with the bits of JavaScript that every Moodle page should have.
  *
  * @param moodle_page $page
  * @param core_renderer $renderer
  */
 protected function init_requirements_data(moodle_page $page, core_renderer $renderer)
 {
     global $CFG;
     // JavaScript should always work with $CFG->httpswwwroot rather than $CFG->wwwroot.
     // Otherwise, in some situations, users will get warnings about insecure content
     // on secure pages from their web browser.
     $this->M_cfg = array('wwwroot' => $CFG->httpswwwroot, 'sesskey' => sesskey(), 'loadingicon' => $renderer->pix_url('i/loading_small', 'moodle')->out(false), 'themerev' => theme_get_revision(), 'slasharguments' => (int) (!empty($CFG->slasharguments)), 'theme' => $page->theme->name, 'jsrev' => (empty($CFG->cachejs) or empty($CFG->jsrev)) ? -1 : $CFG->jsrev);
     if (debugging('', DEBUG_DEVELOPER)) {
         $this->M_cfg['developerdebug'] = true;
     }
     // Accessibility stuff.
     $this->skip_link_to('maincontent', get_string('tocontent', 'access'));
     // Add strings used on many pages.
     $this->string_for_js('confirmation', 'admin');
     $this->string_for_js('cancel', 'moodle');
     $this->string_for_js('yes', 'moodle');
     // Alter links in top frame to break out of frames.
     if ($page->pagelayout === 'frametop') {
         $this->js_init_call('M.util.init_frametop');
     }
 }