本文整理汇总了PHP中FLBuilderModel::is_post_node_template方法的典型用法代码示例。如果您正苦于以下问题:PHP FLBuilderModel::is_post_node_template方法的具体用法?PHP FLBuilderModel::is_post_node_template怎么用?PHP FLBuilderModel::is_post_node_template使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FLBuilderModel
的用法示例。
在下文中一共展示了FLBuilderModel::is_post_node_template方法的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);
}
示例2: render_global_nodes_custom_code
/**
* Renders the custom CSS or JS for all global nodes in a layout.
*
* @since 1.7
*/
public static function render_global_nodes_custom_code($type = 'css')
{
$code = '';
$rendered = array();
if (!FLBuilderModel::is_post_node_template()) {
$nodes = FLBuilderModel::get_layout_data();
$node_status = FLBuilderModel::get_node_status();
foreach ($nodes as $node_id => $node) {
$template_post_id = FLBuilderModel::is_node_global($node);
if ($template_post_id && !in_array($template_post_id, $rendered)) {
$rendered[] = $template_post_id;
$code .= FLBuilderModel::get_layout_settings($node_status, $template_post_id)->{$type};
}
}
}
return $code;
}