當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WPFB_Core::load_js方法代碼示例

本文整理匯總了PHP中WPFB_Core::load_js方法的典型用法代碼示例。如果您正苦於以下問題:PHP WPFB_Core::load_js方法的具體用法?PHP WPFB_Core::load_js怎麽用?PHP WPFB_Core::load_js使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WPFB_Core的用法示例。


在下文中一共展示了WPFB_Core::load_js方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: initFileTreeView

    private static function initFileTreeView($id = null, $base = 0)
    {
        WPFB_Core::$load_js = true;
        // see Core::EnqueueScripts(), where scripts are enqueued if late script loading is disabled
        wp_print_scripts('jquery-treeview-async');
        wp_print_styles('jquery-treeview');
        if ($id == null) {
            return;
        }
        if (is_object($base)) {
            $base = $base->GetId();
        }
        $ajax_data = array('action' => 'tree', 'type' => 'browser', 'base' => intval($base));
        if (is_admin()) {
            $ajax_data['is_admin'] = true;
        }
        $jss = md5($id);
        ?>
<script type="text/javascript">
//<![CDATA[
function wpfb_initfb<?php 
        echo $jss;
        ?>
() {	jQuery("#<?php 
        echo $id;
        ?>
").treeview(wpfb_fbsets<?php 
        echo $jss;
        ?>
={url: "<?php 
        echo WPFB_Core::$ajax_url;
        ?>
",
ajax:{data:<?php 
        echo json_encode($ajax_data);
        ?>
,type:"post",error:function(x,status,error){if(error) alert(error);},complete:function(x,status){if(typeof(wpfb_setupLinks)=='function')wpfb_setupLinks();}},
animated: "medium"}).data("settings",wpfb_fbsets<?php 
        echo $jss;
        ?>
);
}
jQuery(document).ready(function(){
	var fel=jQuery("#<?php 
        echo $id;
        ?>
");
	if('function' != typeof fel.treeview) {
		jQuery.when(
<?php 
        global $wp_scripts;
        $treeview_scripts = array('jquery-treeview', 'jquery-treeview-edit', 'jquery-treeview-async');
        foreach ($treeview_scripts as $ts) {
            ?>
			 jQuery.getScript('<?php 
            echo esc_js($wp_scripts->registered[$ts]->src);
            ?>
'),
<?php 
        }
        ?>
			 jQuery.Deferred(function( deferred ){ jQuery( deferred.resolve ); })
		).done(function(){ wpfb_initfb<?php 
        echo $jss;
        ?>
(); });
	} else {	wpfb_initfb<?php 
        echo $jss;
        ?>
();	}
});
//]]>
</script>
<?php 
    }
開發者ID:parsonsc,項目名稱:dofe,代碼行數:75,代碼來源:Output.php

示例2: array

 function GenTpl2($tpl_tag = null, $load_js = true)
 {
     static $tpl_funcs = array('file' => array(), 'cat' => array());
     if (empty($tpl_tag)) {
         $tpl_tag = 'default';
     }
     if ($load_js) {
         WPFB_Core::$load_js = true;
     }
     $type = $this->is_file ? 'file' : 'cat';
     if (empty($tpl_funcs[$type][$tpl_tag])) {
         $parsed_tpl = WPFB_Core::GetParsedTpl($this->is_file ? 'file' : 'cat', $tpl_tag);
         if (empty($parsed_tpl)) {
             return "Template {$type} :: {$tpl_tag} does not exist!";
         }
         $tpl_funcs[$type][$tpl_tag] = WPFB_Core::CreateTplFunc($parsed_tpl);
     }
     self::$tpl_uid = defined('DOING_AJAX') && DOING_AJAX ? $this->GetId() . '' . round(microtime() * 1000) % 1000 : self::$tpl_uid + 1;
     return $tpl_funcs[$type][$tpl_tag]($this);
 }
開發者ID:bruno-barros,項目名稱:w.eloquent.light,代碼行數:20,代碼來源:Item.php

示例3: array

 function GenTpl2($tpl_tag = null, $load_js = true)
 {
     static $tpl_funcs = array('file' => array(), 'cat' => array());
     if (empty($tpl_tag)) {
         $tpl_tag = 'default';
     }
     if ($load_js) {
         WPFB_Core::$load_js = true;
     }
     $type = $this->is_file ? 'file' : 'cat';
     if (empty($tpl_funcs[$type][$tpl_tag])) {
         $parsed_tpl = WPFB_Core::GetParsedTpl($this->is_file ? 'file' : 'cat', $tpl_tag);
         if (empty($parsed_tpl)) {
             return "Template {$type} :: {$tpl_tag} does not exist!";
         }
         $tpl_funcs[$type][$tpl_tag] = WPFB_Core::CreateTplFunc($parsed_tpl);
     }
     self::$tpl_uid++;
     return $tpl_funcs[$type][$tpl_tag]($this);
 }
開發者ID:Seravo,項目名稱:WP-Filebase,代碼行數:20,代碼來源:Item.php


注:本文中的WPFB_Core::load_js方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。