本文整理汇总了PHP中html::script方法的典型用法代码示例。如果您正苦于以下问题:PHP html::script方法的具体用法?PHP html::script怎么用?PHP html::script使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类html
的用法示例。
在下文中一共展示了html::script方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: head
static function head($theme)
{
// Load fotomoto's js file on photo and album pages.
if ($theme->page_subtype == "photo" || $theme->page_subtype == "album") {
return html::script('http://widget.fotomoto.com/stores/script/' . module::get_var("fotomotorw", "fotomoto_site_key") . '.js?api=true');
}
}
示例2: header
public static function header($form = array())
{
if (isset($form['template'])) {
form::$template = arr::take('template', $form);
}
$attrs['class'] = isset($form['class']) ? $form['class'] : 'form';
$attrs['method'] = isset($form['method']) ? $form['method'] : 'post';
$attrs['action'] = isset($form['action']) ? $form['action'] : url::current();
//加载表头
$html[] = '';
$html[] = '<form' . html::attributes($attrs) . '>';
$html[] = field::hidden(array('name' => '_REFERER', 'value' => request::referer()));
$html[] = field::hidden(array('name' => '_FORMHASH', 'value' => form::hash()));
//加载常用js
$html[] = html::script(url::common() . '/js/jquery.validate.js');
$html[] = html::script(url::common() . '/js/jquery.validate.additional.js');
$html[] = html::script(url::common() . '/js/jquery.form.js');
//表单头部
if (isset($form['title']) || isset($form['description'])) {
$html[] = '<div class="form-header clearfix">';
$html[] = isset($form['icon']) ? ' <div class="form-icon"></div>' : '';
$html[] = isset($form['title']) ? ' <div class="form-title">' . $form['title'] . '</div>' : '';
$html[] = isset($form['description']) ? ' <div class="form-description">' . $form['description'] . '</div>' : '';
$html[] = '</div>';
}
//表单body部分开始
$html[] = '<div class="form-body">';
echo implode("\n", $html);
}
示例3: codemirror
function codemirror($attrs)
{
$url = zotop::module('codemirror', 'url');
$options = new stdClass();
$options->path = $url . '/codemirror/js/';
$options->parserfile = array('parsexml.js');
$options->stylesheet = array($url . '/codemirror/css/xmlcolors.css');
$options->height = is_numeric($attrs['height']) ? $attrs['height'] . 'px' : $attrs['height'];
$options->width = is_numeric($attrs['width']) ? $width . 'px' : $attrs['width'];
$options->continuousScanning = 500;
$options->autoMatchParens = true;
if ($attrs['linenumbers'] !== false) {
$options->lineNumbers = true;
$options->textWrapping = false;
}
if ($attrs['tabmode'] == '') {
$options->tabMode = 'shift';
}
$html = array();
$html[] = html::script($url . '/codemirror/js/codemirror.js');
$html[] = html::stylesheet($url . '/codemirror/css/codemirror.css');
$html[] = ' ' . field::textarea($attrs);
$html[] = '<script type="text/javascript">';
$html[] = ' var editor = CodeMirror.fromTextArea("' . $attrs['name'] . '", ' . json_encode($options) . ');';
$html[] = '$(function(){';
$html[] = ' $("form").submit(function(){';
$html[] = ' $("textarea[name=+' . $attrs['name'] . '+]").val(editor.getCode());';
$html[] = ' });';
$html[] = '})';
$html[] = '</script>';
return implode("\n", $html);
}
示例4: admin_head
static function admin_head($theme)
{
$head = array();
if (strpos(Router::$current_uri, "admin/users") !== false) {
$head[] = html::script("lib/gallery.panel.js");
}
return implode("\n", $head);
}
示例5: init
/**
* Initializes Facebook Connect
*/
public static function init()
{
widget::add('foot', html::script(array('js/fbconnect.js', 'http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US')));
widget::add('foot', html::script_source("FB.init('" . FB::$config['api_key'] . "');"));
// Add logged in Facebook user id to session for easier access
if ($logged_in = FB::instance()->get_loggedin_user()) {
$_SESSION['fb_uid'] = $logged_in;
}
}
示例6: head
static function head($theme)
{
// @tdo remove the addition css and organize.js (just here to test)
$script[] = html::script("modules/organize/js/organize_init.js");
$script[] = html::script("modules/organize/js/organize.js");
$script[] = "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("modules/organize/css/organize.css") . "\" />";
return implode("\n", $script);
//return html::script("modules/organize/js/organize_init.js");
}
示例7: render
public function render($template = "forge_template", $custom = false)
{
$script = array();
if (!empty($this->data["url"])) {
$script[] = html::script($this->data["url"]);
}
if (!empty($this->data["text"])) {
$script[] = "<script type=\"text/javascript\">\n{$this->data['text']}\n</script>\n";
}
return implode("\n", $script);
}
示例8: render
public static function render($print = FALSE)
{
$output = '';
foreach (self::$scripts as $script) {
$output .= html::script($script);
}
if ($print) {
echo $output;
}
return $output;
}
示例9: source
public static function source($attrs)
{
$html = array();
$html[] = '';
$html[] = '<div style="height:460px;overflow:hidden;">';
$html[] = '<div id="SourceEditorPannel">正在加载编辑器,请稍后……</div>';
$html[] = html::script(url::common() . '/js/swfobject.js');
$html[] = html::script(url::module() . '/admin/js/file.js');
$html[] = field::textarea($attrs);
$html[] = '</div>';
return implode("\n", $html);
}
示例10: head
static function head($theme)
{
$buf = "";
if (Session::instance()->get("debug")) {
$buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("core/css/debug.css") . "\" />";
}
if ($theme->page_type == "album" && access::can("edit", $theme->item())) {
$buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("core/css/quick.css") . "\" />";
$buf .= html::script("core/js/quick.js");
}
return $buf;
}
示例11: header
public static function header($header = array())
{
$attrs['class'] = isset($header['class']) ? $header['class'] : 'form';
$attrs['method'] = isset($header['method']) ? $header['method'] : 'post';
$attrs['action'] = isset($header['action']) ? $header['action'] : url::current();
$html[] = '';
$html[] = '<form' . html::attributes($attrs) . '>';
$html[] = isset($header['title']) ? '<div class="form-title">' . $header['title'] . '</div>' : '';
$html[] = isset($header['title']) ? '<div class="form-description">' . $header['description'] . '</div>' : '';
$html[] = html::script(url::theme() . '/js/jquery.form.js');
$html[] = html::script(url::theme() . '/js/zotop.form.js');
echo implode("\n", $html);
}
示例12: admin_head
static function admin_head($theme)
{
$head = array();
if (strpos(Router::$current_uri, "admin/server_add") !== false) {
$head[] = "<link media=\"screen, projection\" rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("lib/jquery.autocomplete.css") . "\" />";
$base = url::site("__ARGS__");
$csrf = access::csrf_token();
$head[] = "<script> var base_url = \"{$base}\"; var csrf = \"{$csrf}\";</script>";
$head[] = html::script("lib/jquery.autocomplete.js");
$head[] = html::script("modules/server_add/js/admin.js");
}
return implode("\n", $head);
}
示例13: admin_head
static function admin_head($theme)
{
$session = Session::instance();
$buf = "";
if ($session->get("debug")) {
$buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("modules/gallery/css/debug.css") . "\" />";
}
if ($session->get("l10n_mode", false)) {
$buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("modules/gallery/css/l10n_client.css") . "\" />";
$buf .= html::script("lib/jquery.cookie.js");
$buf .= html::script("modules/gallery/js/l10n_client.js");
}
return $buf;
}
示例14: add
/**
* Adds all the events to the main Ushahidi application
*/
public function add()
{
// Add JS for Map Settings Page
$api_url_all = Kohana::config('settings.api_url_all');
$api_url_all .= html::script(url::base().'plugins/cloudmade/views/js/cloudmade.js');
Kohana::config_set('settings.api_url_all', $api_url_all);
// Add a Sub-Nav Link
Event::add('ushahidi_filter.map_base_layers', array($this, '_add_layer'));
// Reconfigure the default map api
if (Kohana::config('settings.default_map') == "cloudmade")
{
Kohana::config_set('settings.api_url', "<script type=\"text/javascript\" src=\"".url::base()."plugins/cloudmade/views/js/cloudmade.js\"></script>" );
}
}
示例15: header
public static function header($header = array())
{
if (isset($header['template'])) {
form::$template = arr::take('template', $header);
}
$attrs['class'] = isset($header['class']) ? $header['class'] : 'form';
$attrs['method'] = isset($header['method']) ? $header['method'] : 'post';
$attrs['action'] = isset($header['action']) ? $header['action'] : url::current();
$html[] = '';
$html[] = '<form' . html::attributes($attrs) . '>';
$html[] = isset($header['title']) ? '<div class="form-title">' . $header['title'] . '</div>' : '';
$html[] = isset($header['description']) ? '<div class="form-description">' . $header['description'] . '</div>' : '';
$html[] = field::hidden(array('name' => '_REFERER', 'value' => request::referer()));
$html[] = html::script(url::common() . '/js/jquery.validate.js');
$html[] = html::script(url::common() . '/js/jquery.validate.additional.js');
$html[] = html::script(url::common() . '/js/jquery.form.js');
$html[] = html::script(url::common() . '/js/zotop.form.js');
echo implode("\n", $html);
}