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


PHP FLBuilderModel::get_modules方法代码示例

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


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

示例1: render_css

 /**
  * Renders and caches the CSS for a builder layout.
  *
  * @since 1.0
  * @return void
  */
 public static function render_css()
 {
     // Delete the old file.
     FLBuilderModel::delete_asset_cache('css');
     // Get info on the new file.
     $nodes = FLBuilderModel::get_categorized_nodes();
     $global_settings = FLBuilderModel::get_global_settings();
     $asset_info = FLBuilderModel::get_asset_info();
     $post_id = FLBuilderModel::get_post_id();
     $post = get_post($post_id);
     $compiled = array();
     // Global css
     $css = file_get_contents(FL_BUILDER_DIR . '/css/fl-builder-layout.css');
     // Global RTL css
     if (is_rtl()) {
         $css .= file_get_contents(FL_BUILDER_DIR . '/css/fl-builder-layout-rtl.css');
     }
     // Responsive css
     if ($global_settings->responsive_enabled) {
         $css .= '@media (max-width: ' . $global_settings->medium_breakpoint . 'px) { ';
         $css .= file_get_contents(FL_BUILDER_DIR . '/css/fl-builder-layout-medium.css');
         $css .= ' }';
         $css .= '@media (max-width: ' . $global_settings->responsive_breakpoint . 'px) { ';
         $css .= file_get_contents(FL_BUILDER_DIR . '/css/fl-builder-layout-responsive.css');
         if (!isset($global_settings->auto_spacing) || $global_settings->auto_spacing) {
             $css .= file_get_contents(FL_BUILDER_DIR . '/css/fl-builder-layout-auto-spacing.css');
         }
         $css .= ' }';
     }
     // Global row margins
     $css .= '.fl-row-content-wrap { margin: ' . $global_settings->row_margins . 'px; }';
     // Global row padding
     $css .= '.fl-row-content-wrap { padding: ' . $global_settings->row_padding . 'px; }';
     // Global row width
     $css .= '.fl-row-fixed-width { max-width: ' . $global_settings->row_width . 'px; }';
     // Global module margins
     $css .= '.fl-module-content { margin: ' . $global_settings->module_margins . 'px; }';
     // Loop through rows
     foreach ($nodes['rows'] as $row) {
         // Instance row css
         ob_start();
         include FL_BUILDER_DIR . 'includes/row-css.php';
         $css .= ob_get_clean();
         // Instance row margins
         $css .= self::render_row_margins($row);
         // Instance row padding
         $css .= self::render_row_padding($row);
     }
     // Loop through the columns.
     foreach ($nodes['columns'] as $col) {
         // Instance column css
         ob_start();
         include FL_BUILDER_DIR . 'includes/column-css.php';
         $css .= ob_get_clean();
         // Instance column margins
         $css .= self::render_column_margins($col);
         // Instance column padding
         $css .= self::render_column_padding($col);
         // Get the modules in this column.
         $modules = FLBuilderModel::get_modules($col);
     }
     // Loop through the modules.
     foreach ($nodes['modules'] as $module) {
         // Global module css
         $file = $module->dir . 'css/frontend.css';
         $file_responsive = $module->dir . 'css/frontend.responsive.css';
         // Only include global module css that hasn't been included yet.
         if (!in_array($module->settings->type, $compiled)) {
             // Add to the compiled array so we don't include it again.
             $compiled[] = $module->settings->type;
             // Get the standard module css.
             if (file_exists($file)) {
                 $css .= file_get_contents($file);
             }
             // Get the responsive module css.
             if ($global_settings->responsive_enabled && file_exists($file_responsive)) {
                 $css .= '@media (max-width: ' . $global_settings->responsive_breakpoint . 'px) { ';
                 $css .= file_get_contents($file_responsive);
                 $css .= ' }';
             }
         }
         // Instance module css
         $file = $module->dir . 'includes/frontend.css.php';
         $settings = $module->settings;
         $id = $module->node;
         if (file_exists($file)) {
             ob_start();
             include $file;
             $css .= ob_get_clean();
         }
         // Instance module margins
         $css .= self::render_module_margins($module);
         if (!isset($global_settings->auto_spacing) || $global_settings->auto_spacing) {
             $css .= self::render_responsive_module_margins($module);
//.........这里部分代码省略.........
开发者ID:komcdo,项目名称:iSSNA-WordPress,代码行数:101,代码来源:class-fl-builder.php

示例2: render_modules

 /**
  * Renders the markup for all modules in a column.
  *
  * @since 1.0
  * @param string $parent_id A column node ID.
  * @return void
  */
 public static function render_modules($parent_id)
 {
     $modules = FLBuilderModel::get_modules($parent_id);
     foreach ($modules as $module) {
         $settings = $module->settings;
         include FL_BUILDER_DIR . 'includes/module.php';
     }
 }
开发者ID:karthikakamalanathan,项目名称:wp-cookieLawInfo,代码行数:15,代码来源:class-fl-builder.php


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