本文整理汇总了PHP中block_base::get_required_javascript方法的典型用法代码示例。如果您正苦于以下问题:PHP block_base::get_required_javascript方法的具体用法?PHP block_base::get_required_javascript怎么用?PHP block_base::get_required_javascript使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类block_base
的用法示例。
在下文中一共展示了block_base::get_required_javascript方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
function get_required_javascript()
{
parent::get_required_javascript();
$this->page->requires->jquery();
$this->page->requires->jquery_plugin('ui');
$this->page->requires->jquery_plugin('ui-css');
}
示例2: get_required_javascript
public function get_required_javascript()
{
global $PAGE;
$PAGE->requires->yui_module('moodle-block_databasebookmarks-bookmark', 'M.block_databasebookmarks.bookmark.init');
$PAGE->requires->strings_for_js(array('deletebookmark', 'bookmark', 'bookmarkname', 'bookmarkheader'), 'block_databasebookmarks');
$PAGE->requires->strings_for_js(array('buttons'), 'mod_data');
return parent::get_required_javascript();
}
示例3: get_required_javascript
public function get_required_javascript()
{
parent::get_required_javascript();
$this->page->requires->jquery();
$this->page->requires->jquery_plugin('ui');
$this->page->requires->jquery_plugin('ui-css');
$this->page->requires->js('/blocks/slideshow/js/jquery.cycle2.min.js');
$this->page->requires->js('/blocks/slideshow/js/spectrum.js');
}
示例4: get_required_javascript
/**
* The block depends upon a React app (which should only be loaded once).
* Unfortunately, it is necessary to use the Moodle page requirements manager.
* It is also necessary to hide RequireJS from the React app.
*/
public function get_required_javascript()
{
parent::get_required_javascript();
// if debugging, load unminified script
$script_src = 'build/activity_tree.min.js';
if (debugging()) {
$script_src = str_replace('.min.js', '.js', $script_src);
}
/** @var page_requirements_manager $prm */
$prm = $this->page->requires;
$prm->js('/blocks/activity_tree/static/js/other/requirejs_hide.js');
$prm->js(new moodle_url('/blocks/activity_tree/static/js/' . $script_src));
$prm->js('/blocks/activity_tree/static/js/other/requirejs_show.js');
}
示例5: array
/**
* Gets Javascript that may be required for navigation
*/
function get_required_javascript()
{
global $CFG;
parent::get_required_javascript();
$limit = 20;
if (!empty($CFG->navcourselimit)) {
$limit = $CFG->navcourselimit;
}
$expansionlimit = 0;
if (!empty($this->config->expansionlimit)) {
$expansionlimit = $this->config->expansionlimit;
}
$arguments = array('id' => $this->instance->id, 'instance' => $this->instance->id, 'candock' => $this->instance_can_be_docked(), 'courselimit' => $limit, 'expansionlimit' => $expansionlimit);
$this->page->requires->string_for_js('viewallcourses', 'moodle');
$this->page->requires->yui_module('moodle-block_navigation-navigation', 'M.block_navigation.init_add_tree', array($arguments));
}
示例6: array
function get_required_javascript()
{
global $PAGE;
$adminnodeid = null;
$adminnode = $PAGE->settingsnav->find('siteadministration', navigation_node::TYPE_SITE_ADMIN);
if (!empty($adminnode)) {
$adminnodeid = $adminnode->id;
}
parent::get_required_javascript();
$arguments = array('id' => $this->instance->id, 'instance' => $this->instance->id, 'candock' => $this->instance_can_be_docked());
$this->page->requires->js_call_amd('block_settings/settingsblock', 'init', array($adminnodeid));
}
示例7: array
function get_required_javascript()
{
global $PAGE;
$adminnode = $PAGE->settingsnav->find('siteadministration', navigation_node::TYPE_SITE_ADMIN);
parent::get_required_javascript();
$arguments = array('instanceid' => $this->instance->id, 'adminnodeid' => $adminnode ? $adminnode->id : null);
$this->page->requires->js_call_amd('block_settings/settingsblock', 'init', $arguments);
}
示例8: array
/**
* Gets Javascript that may be required for navigation
*/
function get_required_javascript()
{
parent::get_required_javascript();
$arguments = array('instanceid' => $this->instance->id);
$this->page->requires->string_for_js('viewallcourses', 'moodle');
$this->page->requires->js_call_amd('block_navigation/navblock', 'init', $arguments);
}
示例9: get_required_javascript
public function get_required_javascript()
{
global $CFG;
parent::get_required_javascript();
$this->page->requires->jquery();
$this->page->requires->jquery_plugin('ui');
$this->page->requires->jquery_plugin('ui-css');
$this->page->requires->js('/blocks/playlyfe/js/plupload.full.min.js');
$this->page->requires->js('/blocks/playlyfe/block_playlyfe.js');
$this->page->requires->js_init_call('init_cfg', array(array('root' => $CFG->wwwroot)));
}
示例10: array
function get_required_javascript()
{
parent::get_required_javascript();
$arguments = array('id' => $this->instance->id, 'instance' => $this->instance->id, 'candock' => $this->instance_can_be_docked());
$this->page->requires->yui_module('moodle-block_navigation-navigation', 'M.block_navigation.init_add_tree', array($arguments));
}
示例11: array
/**
* Gets Javascript that may be required for navigation
*/
function get_required_javascript()
{
parent::get_required_javascript();
$this->page->requires->string_for_js('viewallcourses', 'moodle');
$this->page->requires->js_call_amd('block_navigation/navblock', 'init', array());
}