当前位置: 首页>>代码示例>>PHP>>正文


PHP JS::loadjQuery方法代码示例

本文整理汇总了PHP中JS::loadjQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP JS::loadjQuery方法的具体用法?PHP JS::loadjQuery怎么用?PHP JS::loadjQuery使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JS的用法示例。


在下文中一共展示了JS::loadjQuery方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: render

 /**
  * Outputs the code and content for the accordion
  * @return string
  */
 public function render()
 {
     global $SITE, $CONFIG;
     JS::loadjQuery();
     JS::raw('$(function() {$(".ui-accordion-container").accordion({ header: "h3" ' . ($this->params ? ',' . $this->params : '') . '});});');
     Head::add($CONFIG->UI->jQuery_theme . '/jquery-ui-*', 'css-lib');
     Head::add('.ui-accordion-container li {width: 100%;}', 'css-raw');
     $r = '<ol class="ui-accordion-container">';
     $mode = 0;
     $title = false;
     $selected = false;
     $i = 0;
     foreach ($this->tabs as $arg) {
         if ($mode == 0) {
             $title = $arg;
             $mode = 1;
         } else {
             $r .= '
                 <li>
                     <h3><a href="#">' . $title . '</a></h3>
                     <div>' . $arg . '</div>
                 </li>';
             $mode = 0;
             $selected = false;
             $title = false;
             $i++;
         }
     }
     return $r . '</ol>';
 }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:34,代码来源:Accordion.php

示例2: imageEditor

 function imageEditor()
 {
     JS::loadjQuery();
     JS::lib('jquery/jquery.imgareaselect-*');
     JS::lib('imgTools');
     $size = getimagesize($this->that->path);
     return Form::quick(false, __('Save'), new Input(__('Filename'), 'filename', $_POST['filename'] ? $_POST['filename'] : $this->that->basename), new Hidden('cropimgx', $_POST['cropimgx']), new Hidden('cropimgy', $_POST['cropimgy']), new Hidden('cropimgw', $_POST['cropimgw']), new Hidden('cropimgh', $_POST['cropimgh']), new Tabber('img', new Tab(__('Cropping'), '<div id="imgcropper"><img style="float: left" id="originalImage" src="?id=' . $this->that->ID . '&amp;w=400" /><div style="clear: both;"></div></div>'), new Tab(__('Resize'), '<div id="imgresize"><div id="resval" style="clear: right;"><input name="resimgx" id="resimgx" size="4" value="' . $size[0] . '" />x<input name="resimgy" id="resimgy" size="4" value="' . $size[1] . '" /></div></div>'), new Tab(__('Rotate'), new Select(__('Specify rotation (CCW)'), 'imgrot', array('0' => __('None'), '90' => '90 &deg;', '180' => '180 &deg;', '270' => '270 &deg;'), $_REQUEST['imgrot']))));
 }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:8,代码来源:ImageEditor.php

示例3: render

 function render()
 {
     JS::loadjQuery();
     JS::lib('viewslider');
     JS::raw('$(function(){$("div.viewslider-view").closest(".formdiv").viewslider();});');
     Head::add('viewslider/viewslider', 'css-lib');
     return '<div class="formsection viewslider-view"><h3>' . $this->header . '</h3>' . implode('', flatten($this->elements)) . '</div>';
 }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:8,代码来源:Formsection.php

示例4: render

 function render()
 {
     $id = idfy($this->name);
     JS::loadjQuery();
     Head::add('$(function(){$(".sortable_list").sortable({axis:"y"});});', 'js-raw');
     $val = (array) $this->value;
     array_walk($val, array($this, 'addHiddenFormField'));
     return '<span class="formelem">' . ($this->label === false ? '' : '<label for"' . $id . '">' . $this->label . '</label>') . listify($val, 'sortable_list' . ($this->validate ? ' ' . $this->validate : '')) . (strpos($this->validate, 'required') !== false ? '<span class="reqstar">*</span>' : '') . ($this->description ? '<span class="description">' . $this->description . '</span>' : '') . '</span>';
 }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:9,代码来源:Sortable.php

示例5: render

 function render()
 {
     $id = idfy($this->name);
     JS::loadjQuery(false);
     JS::lib('imgPicker');
     JS::raw('setupPreview("' . $id . '");');
     //FIXME: Flytta styling till stylesheet!
     return '<span class="formelem">' . ($this->label === false ? '' : '<label for="' . $id . '">' . $this->label . '</label>') . '<input name="' . $this->name . '" id="' . $id . '" class="text' . ($this->validate ? ' ' . $this->validate : '') . '" value="' . $this->value . '" type="hidden" />' . '<div class="tools">' . icon('small/cross', __('Remove'), "javascript:removePreview('{$id}');", $id . "remicon") . icon('small/folder_picture', __('Browse picture'), "javascript:explore('{$id}', " . ($this->dir ? $this->dir : 'false') . ");") . '</div>' . (strpos($this->validate, 'required') !== false ? '<span class="reqstar">*</span>' : '') . ($this->description ? '<span class="description">' . $this->description . '</span>' : '') . ($this->preview ? '<div id="' . $id . 'prev" style="margin:10px 0 5px 150px;"><img id="' . $id . 'img" src="index.php?id=' . $this->value . '&mw=300" /></div>' : '') . '</span>';
 }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:9,代码来源:ImagePicker.php

示例6: render

 function render()
 {
     $id = idfy($this->name);
     if (is_array($this->value)) {
         $value = Short::parseDateAndTime($this->value);
     }
     global $CONFIG;
     JS::loadjQuery(true);
     JS::lib('jquery/jquery.timePicker');
     Head::add('timePicker', 'css-lib');
     Head::add('$(function(){$("input.time").timePicker();});', 'js-raw');
     return '<span class="formelem">' . ($this->label === false ? '' : '<label for="' . $id . '">' . $this->label . '</label>') . '<input name="' . $this->name . '" id="' . $id . '" class="time' . ($this->validate ? ' ' . $this->validate : '') . ($this->class ? ' ' . $this->class : '') . '" value="' . (is_numeric($this->value) ? date('H:i', $this->value) : $this->value) . '" />' . (strpos($this->validate, 'required') !== false ? '<span class="reqstar">*</span>' : '') . ($this->description ? '<span class="description">' . $this->description . '</span>' : '') . '</span>';
 }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:13,代码来源:Timepickr.php

示例7: render

 function render()
 {
     $id = idfy($this->name);
     JS::loadjQuery(false);
     if ($this->available_values) {
         JS::lib('jquery/jquery.bgiframe.min');
         JS::lib('jquery/jquery-plugin-ajaxqueue');
         JS::lib('jquery/jquery.autocomplete.min');
         Head::add('jquery.autocomplete', 'css-lib');
         JS::raw('$(function(){$("#' . $id . '").autocomplete(["' . join('","', $this->available_values) . '"], {width: 320,max: 4,highlight: false,multiple: true,multipleSeparator: " ",scroll: true,scrollHeight: 300})});');
     }
     $r = ($this->label === false ? '' : '<label for="' . $id . '">' . $this->label . '</label>') . '<input name="' . $this->name . '" id="' . $id . '" class="text tags' . ($this->validate ? ' ' . $this->validate : '') . '" value="' . $this->value . '" />' . ($this->description ? '<span class="description">' . $this->description . '</span>' : '');
     return '<span class="formelem">' . $r . '</span>';
 }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:14,代码来源:TagInput.php

示例8: popup

 function popup($URL, $window_name = false, $settings = false)
 {
     if ($settings) {
         $settings_ = $settings;
         $settings = '';
         foreach ($settings_ as $key => $opt) {
             $settings .= $key . '=' . $opt . ',';
         }
     }
     if (!$window_name) {
         $window_name = self::$currentWindowHandle;
     } else {
         self::$currentWindowHandle = $window_name;
     }
     $id = idfy($URL);
     JS::loadjQuery();
     Head::add('$(function(){$("' . $id . '").click(function(){});});', 'js-raw');
     return '<a href="' . url($URL) . '" id="' . $id . '"';
 }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:19,代码来源:JS.php

示例9: safeEmailsHelper

 /**
  * Replaces the emails with a flash text with the email
  * @param $match preg_replace match
  * @return string Flash html-code
  */
 function safeEmailsHelper($match)
 {
     JS::lib('flashurl', false, false);
     JS::loadjQuery(false, false);
     static $i = 0;
     $i++;
     if (count($match) == 2) {
         $url = $match[0];
         $label = false;
     } else {
         $url = $match[1];
         $label = $match[2];
         if (isEmail($label)) {
             $label = false;
         }
     }
     $url = base64_encode($url);
     return '<span class="flashurl"><object id="flashurl' . $i . '" type="application/x-shockwave-flash" data="lib/swf/flashurl.swf"><param name="FlashVars" value="divID=flashurl' . $i . '&amp;encURL=' . urlencode($url) . ($label ? '&amp;urlLabel=' . $label : '') . '" /><param name="movie" value="/lib/swf/flashurl.swf" /><param name="wmode" value="transparent" /></object></span>';
 }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:24,代码来源:SafeEmails.php

示例10: render

 function render()
 {
     $id = idfy($this->name);
     JS::loadjQuery();
     /*
             Head::add('3rdParty/tiny_mce/tiny_mce_gzip.js', 'js-url', true, false, false);
     */
     /*
             Head::add('tinyMCEGZinit', 'js-lib', true, false, false);
     */
     //Head::add('3rdParty/tiny_mce/tiny_mce.js', 'js-url', true, false, false);
     /*
             Head::add('tinyMCEinit', 'js-lib', true, false, false);
     */
     //testar ny editor
     Head::add('3rdParty/ckeditor/ckeditor.js', 'js-url', false, false);
     Head::add('3rdParty/ckeditor/adapters/jquery.js', 'js-url', false, false);
     JS::raw('CKEDITOR.replace("' . $id . '",{customConfig : "/3rdParty/ckeditor/config.js"});');
     return '<span class="formelem">' . ($this->label === false ? '' : '<label for="' . $id . '">' . $this->label . '</label>') . '<textarea id="' . $id . '" name="' . $this->name . '" class="textarea mceEditor' . ($this->validate ? ' ' . $this->validate : '') . ($this->validate ? ' ' : '') . $this->class . '" rows="8" cols="70">' . $this->value . '</textarea>' . (strpos($this->validate, 'required') !== false ? '<span class="reqstar">*</span>' : '') . ($this->description ? '<span class="description">' . $this->description . '</span>' : '') . '</span>';
 }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:20,代码来源:HTMLField.php

示例11: display

 /**
  * Display all flashes
  * @return HTML
  */
 static function display()
 {
     if (isset($_SESSION['__FLASHES']) && is_array($_SESSION['__FLASHES'])) {
         self::$__FLASHES = $_SESSION['__FLASHES'] + self::$__FLASHES;
         unset($_SESSION['__FLASHES']);
     }
     if (!empty(self::$__FLASHES)) {
         echo '<div class="flash_container">';
         foreach (self::$__FLASHES as $type => $flashes) {
             echo '<div class="flash flash_type_' . $type . '"><div class="icon"></div><ul>';
             foreach ($flashes as $flash) {
                 echo '<li>' . $flash . '</li>';
             }
             echo '</ul></div>';
         }
         //FIXME: Add function for yes/no buttons
         echo '</div>';
         JS::loadjQuery(true);
         JS::raw('$(function(){' . '$(".flash_container").dialog({modal:true,buttons:{Ok:function(){$(this).dialog("close");}}});' . '});');
     }
 }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:25,代码来源:Flash.php

示例12: render

 /**
  * (non-PHPdoc)
  * @see solidbase/lib/__FormField#render()
  */
 function render()
 {
     $id = idfy($this->name);
     if ($this->value === false) {
         $sel = $this->interval;
     } else {
         $sel = (array) $this->value;
         if (count($sel) == 1) {
             $sel[1] = $sel[0];
         }
     }
     Head::add(JQUERY_THEME . '/jquery-ui-1.8.7.custom', 'css-lib');
     if (!$this->nojs) {
         JS::loadjQuery(true);
         JS::raw('$(function(){$("#' . $id . ' .slider").slider({' . 'range:' . ($this->return_interval ? 'true' : 'false') . ',' . 'min:' . $this->interval[0] . ',' . 'max:' . $this->interval[1] . ',' . 'values:[' . ($this->return_interval ? $sel[0] . ',' . $sel[1] : $sel[0]) . '],' . 'slide:function(event,ui){' . '$(event.target).closest(".slidercontainer")' . '
                 .find(".val_low").text(ui.values[0]).end()' . ($this->return_interval ? '
                 .find(".val_high").text(ui.values[1]).end()' : '') . '
                 .find(".sliderfield").val(ui.values[0]' . ($this->return_interval ? '+":"+ui.values[1]' : '') . '
                 );' . '}});});');
     }
     JS::raw('$(".sliderfield").hide();');
     return '<span class="formelem"><div id="' . $id . '" class="slidercontainer">' . ($this->label === false ? '' : '<label for="' . $id . '">' . $this->label . '</label>') . '<input name="' . $this->name . '" id="' . $id . '_value" class="sliderfield' . ($this->validate ? ' ' . $this->validate : '') . ($this->class ? ' ' . $this->class : '') . '" value="' . ($this->return_interval ? $sel[0] . ":" . $sel[1] : $sel[0]) . '" />' . '<div class="slidervalues">' . '<span class="slidertext val_low">' . $sel[0] . '</span>' . ($this->return_interval ? '<span class="slidertext sliderdash">-</span><span class="slidertext val_high">' . $sel[1] . '</span>' : '') . '</div>' . '<div class="slider"></div>' . (strpos($this->validate, 'required') !== false ? '<span class="reqstar">*</span>' : '') . ($this->description ? '<span class="description">' . $this->description . '</span>' : '') . '</div></span>';
 }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:27,代码来源:Slider.php

示例13: render

    /**
     * Renders the HTML and loads the libraries needed to view the tabs
     * @return void
     */
    public function render()
    {
        global $SITE, $CONFIG;
        static $tabnames = array();
        JS::loadjQuery();
        JS::raw('$(function() {$(".ui-tabs-dohide").addClass("ui-tabs-hide");$(".ui-tabs").tabs({show:function(event,ui){
        id = $(ui.tab.hash).attr("id");
        obj = $(ui.tab.hash).attr("id", ""); //So the browser doesnt jump to the object
        window.location.hash=ui.tab.hash;
        obj.attr("id", id);

    }});
    //if(window.location.hash) {
        //$(window.location.hash).parent(".ui-tabs").tabs("select", document.location.hash);
    //}
    });');
        Head::add($CONFIG->UI->jQuery_theme . '/jquery-ui-*', 'css-lib');
        $r = '<div class="ui-tabs"><ul class="ui-tabs-nav">';
        foreach ($this->tabs as $id => $tab) {
            $a = $tab->id;
            $i = 0;
            while (in_array($a, $tabnames)) {
                $i++;
                $a = $tab->id . $i;
            }
            $tabnames[] = $tab->id = $a;
            $classes = implode(' ', array_filter(array($tab->selected ? 'ui-tabs-selected' : false, $tab->disabled ? 'ui-tabs-disabled' : false)));
            $r .= '<li class="' . $classes . '">' . '<a href="#tab' . $this->uniqid . (!is_numeric($id) ? $id : ($tab->id ? $tab->id : $id)) . '"><span>' . $tab->name . '</span></a></li>';
        }
        $r .= '</ul>';
        foreach ($this->tabs as $id => $tab) {
            $id = $this->uniqid . (!is_numeric($id) ? $id : ($tab->id ? $tab->id : $id));
            $r .= '<div id="tab' . $id . '" class="ui-tabs-panel' . (!$tab->selected ? ' ui-tabs-dohide' : '') . '">' . str_replace('#::tab-id::#', 'tab' . $id, $tab->render()) . '</div>';
        }
        return $r . '</div>';
    }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:40,代码来源:Tabber.php

示例14: Menu

new Menu('main_menu', 1, false, false, false, true);
new Box('newLogin');
/* 		if($PAGE->mayI(EDIT)) echo '<div class="admin"><a href="'.url(array('id' => 'admin_area')).'">Admin<span>av sidan</span></a></div>';  */
?>
    </div>
    <div class="login_test">test</div>

</div>

<?php 
new Box('feedback');
/* $Controller->newObj('Report')->setAlias('Report'); */
?>

<?php 
JS::loadjQuery(false);
JS::lib('jquery/jquery.keynav.1.1');
JS::lib('globalsearch');
/* 	JS::lib('jquery/jquery.backgroundPosition'); */
JS::lib('jquery/jquery.lavalamp-1.3.4b2');
JS::lib('jquery/jquery.easing.1.3');
/* 	Head::add('$(document).ready(function() { $("#username").focus();});','js-raw'); */
/*
    JS::raw('
        $(".topnav li a, .topnav div.admin a")
            .css({backgroundPosition:"0 -50px"})
            .mouseover(function() {
                $(this).stop(true)
                    .animate({backgroundPosition:"0 0"},"fast")
                })
            .mouseout(function() {
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:31,代码来源:header.php

示例15: run

 function run()
 {
     global $Templates, $DB, $Controller;
     if (!$this->mayI(READ | EDIT)) {
         errorPage('401');
         return false;
     }
     $_REQUEST->setType('add', 'string');
     $_REQUEST->setType('edit', 'numeric');
     $_REQUEST->setType('del', 'numeric');
     $_REQUEST->setType('module', 'string');
     $_REQUEST->setType('type', 'string');
     $_REQUEST->setType('size', 'string');
     $_REQUEST->setType('content', 'string');
     $_REQUEST->setType('row', 'numeric');
     $_REQUEST->setType('place', 'numeric');
     //FIXME: Tillsvidare: Id på sidan som editeras
     $pID = 8;
     if ($_REQUEST['add']) {
         $newModule = $Controller->newObj('PageModule');
         $newModule->addData($pID, $_REQUEST['add']);
     } elseif ($_REQUEST['edit']) {
         $module = $Controller->{$_REQUEST['edit']};
         if ($_REQUEST['module']) {
             $module->module = $_REQUEST['module'];
         } elseif ($_REQUEST['size']) {
             $module->size = $_REQUEST['size'];
         } elseif ($_REQUEST['type']) {
             $module->type = $_REQUEST['type'];
         } elseif ($_REQUEST['row'] !== false && $_REQUEST['place'] !== false) {
             $module->move($_REQUEST['row'], $_REQUEST['place']);
         } elseif ($_REQUEST['content']) {
             $module->content = $_REQUEST['content'];
         }
     } elseif ($_REQUEST['del']) {
         $Controller->{$_REQUEST['del']}->delete();
     }
     /* Get numbers of rows on page*/
     $rowNum = $DB->pagelayout->getCell(array('pid' => $pID), "MAX(ROW)");
     $pagecontent = false;
     /* Get modules from each row */
     for ($row = 0; $row <= $rowNum; $row++) {
         $moduleIDs = $DB->pagelayout->asList(array('pid' => $pID, 'row' => $row), 'id', false, false, 'place');
         $rowContent = array();
         foreach ($moduleIDs as $mID) {
             $moduleObj = $Controller->{$mID};
             $rowContent[] = $moduleObj;
         }
         $pagecontent[$row] = $rowContent;
     }
     JS::loadjQuery();
     JS::lib('pagelayoutedit');
     $this->header = __('Page Layout');
     $this->setContent('main', '<h1>Page Layout</h1>' . $this->displayEditor($pagecontent));
     $Templates->admin->render();
 }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:56,代码来源:PageLayoutEditor.php


注:本文中的JS::loadjQuery方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。