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


PHP FLBuilderModel::get_nodes方法代码示例

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


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

示例1: render_js

 /**
  * Renders and caches the JavaScript for a builder layout.
  *
  * @since 1.0
  * @return void
  */
 public static function render_js()
 {
     // Delete the old file.
     FLBuilderModel::delete_asset_cache('js');
     // Get info on the new file.
     $nodes = FLBuilderModel::get_categorized_nodes();
     $global_settings = FLBuilderModel::get_global_settings();
     $rows = FLBuilderModel::get_nodes('row');
     $asset_info = FLBuilderModel::get_asset_info();
     $compiled = array();
     $js = '';
     // Layout config object.
     ob_start();
     include FL_BUILDER_DIR . 'includes/layout-js-config.php';
     $js .= ob_get_clean();
     // Main JS
     $js .= file_get_contents(FL_BUILDER_DIR . 'js/fl-builder-layout.js');
     // Loop through the rows.
     foreach ($nodes['rows'] as $row) {
         // Setup row vars
         $settings = $row->settings;
         $id = $row->node;
         // Include the row instance JS
         ob_start();
         include FL_BUILDER_DIR . 'includes/row-js.php';
         $js .= ob_get_clean();
     }
     // Loop through the modules.
     foreach ($nodes['modules'] as $module) {
         // Global module JS
         $file = $module->dir . 'js/frontend.js';
         if (file_exists($file) && !in_array($module->settings->type, $compiled)) {
             $js .= "\n" . file_get_contents($file);
             $compiled[] = $module->settings->type;
         }
         // Instance module JS
         $file = $module->dir . 'includes/frontend.js.php';
         $settings = $module->settings;
         $id = $module->node;
         if (file_exists($file)) {
             ob_start();
             include $file;
             $js .= ob_get_clean();
         }
     }
     // Add the path legacy vars (FLBuilderLayoutConfig.paths should be used instead).
     $js .= "var wpAjaxUrl = '" . admin_url('admin-ajax.php') . "';";
     $js .= "var flBuilderUrl = '" . FL_BUILDER_URL . "';";
     // Call the FLBuilder._renderLayoutComplete method if we're currently editing.
     if (stristr($asset_info['js'], '-draft.js') || stristr($asset_info['js'], '-preview.js')) {
         $js .= "; if(typeof FLBuilder !== 'undefined' && typeof FLBuilder._renderLayoutComplete !== 'undefined') FLBuilder._renderLayoutComplete();";
     }
     // Include FLJSMin
     if (!class_exists('FLJSMin')) {
         include FL_BUILDER_DIR . 'classes/class-fl-jsmin.php';
     }
     // Save the js
     if (!empty($js)) {
         file_put_contents($asset_info['js'], FLJSMin::minify($js));
     }
 }
开发者ID:komcdo,项目名称:iSSNA-WordPress,代码行数:67,代码来源:class-fl-builder.php

示例2: render_js

 /**
  * Renders and caches the JavaScript for a builder layout.
  *
  * @since 1.0
  * @return void
  */
 public static function render_js()
 {
     // Delete the old file.
     FLBuilderModel::delete_asset_cache('js');
     // Get info on the new file.
     $nodes = FLBuilderModel::get_categorized_nodes();
     $global_settings = FLBuilderModel::get_global_settings();
     $layout_settings = FLBuilderModel::get_layout_settings();
     $rows = FLBuilderModel::get_nodes('row');
     $asset_info = FLBuilderModel::get_asset_info();
     $compiled = array();
     $js = '';
     // Layout config object.
     ob_start();
     include FL_BUILDER_DIR . 'includes/layout-js-config.php';
     $js .= ob_get_clean();
     // Main JS
     $js .= file_get_contents(FL_BUILDER_DIR . 'js/fl-builder-layout.js');
     // Loop through the rows.
     foreach ($nodes['rows'] as $row) {
         $js .= self::render_row_js($row);
     }
     // Loop through the modules.
     foreach ($nodes['modules'] as $module) {
         $js .= self::render_module_js($module, $compiled);
     }
     // Add the global and layout settings JS.
     $js .= $global_settings->js;
     $js .= self::render_global_nodes_custom_code('js');
     $js .= $layout_settings->js;
     // Add the path legacy vars (FLBuilderLayoutConfig.paths should be used instead).
     $js .= "var wpAjaxUrl = '" . admin_url('admin-ajax.php') . "';";
     $js .= "var flBuilderUrl = '" . FL_BUILDER_URL . "';";
     // Call the FLBuilder._renderLayoutComplete method if we're currently editing.
     if (stristr($asset_info['js'], '-draft.js') || stristr($asset_info['js'], '-preview.js')) {
         $js .= "; if(typeof FLBuilder !== 'undefined' && typeof FLBuilder._renderLayoutComplete !== 'undefined') FLBuilder._renderLayoutComplete();";
     }
     // Include FLJSMin
     if (!class_exists('FLJSMin')) {
         include FL_BUILDER_DIR . 'classes/class-fl-jsmin.php';
     }
     // Save the js
     if (!empty($js)) {
         if (!defined('WP_DEBUG') || !WP_DEBUG) {
             $js = FLJSMin::minify($js);
         }
         file_put_contents($asset_info['js'], $js);
     }
 }
开发者ID:Nirajjcu,项目名称:minime3d,代码行数:55,代码来源:class-fl-builder.php


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