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


PHP FLBuilderModel::node_templates_enabled方法代码示例

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


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

示例1: render_module_settings

 /**
  * Renders the settings lightbox for a module.
  *
  * @since 1.0
  * @param string $node_id The module node ID.
  * @param string $type The type of module.
  * @param string $parent_id The parent column node ID.
  * @param bool $return Whether to return the layout data or echo it.
  * @return void
  */
 public static function render_module_settings($node_id = null, $type = null, $parent_id = null, $return = false)
 {
     $post_data = FLBuilderModel::get_post_data();
     $node_id = isset($post_data['node_id']) ? $post_data['node_id'] : $node_id;
     $type = isset($post_data['type']) ? $post_data['type'] : $type;
     $parent_id = isset($post_data['parent_id']) ? $post_data['parent_id'] : $parent_id;
     $buttons = array();
     // Get the module and settings.
     if ($node_id) {
         $module = FLBuilderModel::get_module($node_id);
         $settings = $module->settings;
     } else {
         $module = FLBuilderModel::$modules[$type];
         $settings = FLBuilderModel::get_module_defaults($type);
     }
     // Is this module global?
     $global = FLBuilderModel::is_node_global($module);
     // Add the Save As button?
     if (!$global && !FLBuilderModel::is_post_node_template() && FLBuilderModel::node_templates_enabled()) {
         $buttons[] = 'save-as';
     }
     // Render the settings CSS/JS.
     if (file_exists($module->dir . 'css/settings.css')) {
         echo '<link class="fl-builder-settings-css" rel="stylesheet" href="' . $module->url . 'css/settings.css" />';
     }
     if (file_exists($module->dir . 'js/settings.js')) {
         echo '<script class="fl-builder-settings-js" src="' . $module->url . 'js/settings.js"></script>';
     }
     // Render the form.
     echo self::render_settings(array('class' => 'fl-builder-module-settings fl-builder-' . $type . '-settings', 'attrs' => 'data-node="' . $node_id . '" data-parent="' . $parent_id . '" data-type="' . $type . '"', 'title' => sprintf(_x('%s Settings', '%s stands for module name.', 'fl-builder'), $module->name), 'badges' => $global ? array('global' => _x('Global', 'Indicator for global node templates.', 'fl-builder')) : array(), 'tabs' => $module->form, 'buttons' => $buttons), $settings, $return);
 }
开发者ID:komcdo,项目名称:iSSNA-WordPress,代码行数:41,代码来源:class-fl-builder.php

示例2: render_module_settings

 /**
  * Renders the settings lightbox for a module.
  *
  * @since 1.0
  * @param string $node_id The module node ID.
  * @param string $type The type of module.
  * @param string $parent_id The parent column node ID.
  * @param bool $render_state Whether to render the preview state or not.
  * @return array
  */
 public static function render_module_settings($node_id = null, $type = null, $parent_id = null, $render_state = true)
 {
     $buttons = array();
     $assets = '';
     // Get the module and settings.
     if ($node_id) {
         $module = FLBuilderModel::get_module($node_id);
         $settings = $module->settings;
     } else {
         $module = FLBuilderModel::$modules[$type];
         $settings = FLBuilderModel::get_module_defaults($type);
     }
     // Is this module global?
     $global = FLBuilderModel::is_node_global($module);
     // Add the Save As button?
     if (!$global && !FLBuilderModel::is_post_node_template() && FLBuilderModel::node_templates_enabled()) {
         $buttons[] = 'save-as';
     }
     // Render the settings CSS/JS assets.
     if (file_exists($module->dir . 'css/settings.css')) {
         $assets .= '<link class="fl-builder-settings-css" rel="stylesheet" href="' . $module->url . 'css/settings.css" />';
     }
     if (file_exists($module->dir . 'js/settings.js')) {
         $assets .= '<script class="fl-builder-settings-js" src="' . $module->url . 'js/settings.js"></script>';
     }
     // Render the form.
     $rendered_settings = self::render_settings(array('class' => 'fl-builder-module-settings fl-builder-' . $type . '-settings', 'attrs' => 'data-node="' . $node_id . '" data-parent="' . $parent_id . '" data-type="' . $type . '"', 'title' => sprintf(_x('%s Settings', '%s stands for module name.', 'fl-builder'), $module->name), 'badges' => $global ? array('global' => _x('Global', 'Indicator for global node templates.', 'fl-builder')) : array(), 'tabs' => $module->form, 'buttons' => $buttons), $settings);
     // Return the HTML.
     return array('settings' => $assets . $rendered_settings['html'], 'state' => $render_state ? FLBuilderAJAXLayout::render($node_id) : null);
 }
开发者ID:Nirajjcu,项目名称:minime3d,代码行数:40,代码来源:class-fl-builder.php


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