/** * Generator popup form */ public static function popup() { // Get cache $output = get_transient('su/generator/popup'); if ($output && SU_ENABLE_CACHE) { echo $output; } else { ob_start(); ?> <div id="su-generator-wrap" style="display:none"> <div id="su-generator"> <div id="su-generator-header"> <div id="su-generator-choices" class="su-generator-clearfix"> <?php // Choices loop foreach ((array) Su_Data::shortcodes() as $name => $shortcode) { $icon = isset($shortcode['icon']) ? $shortcode['icon'] : 'puzzle-piece'; $shortcode['name'] = isset($shortcode['name']) ? $shortcode['name'] : $name; echo '<span data-name="' . $shortcode['name'] . '" data-shortcode="' . $name . '" title="' . esc_attr($shortcode['desc']) . '" data-desc="' . esc_attr($shortcode['desc']) . '" data-group="' . $shortcode['group'] . '">' . Su_Tools::icon($icon) . $shortcode['name'] . '</span>' . "\n"; } ?> </div> </div> <div id="su-generator-settings"></div> <input type="hidden" name="su-generator-selected" id="su-generator-selected" value="<?php echo get_template_directory_uri() . '/functions/sc_generator/'; ?> " /> <input type="hidden" name="su-generator-url" id="su-generator-url" value="<?php echo get_template_directory_uri() . '/functions/sc_generator/'; ?> " /> <input type="hidden" name="su-compatibility-mode-prefix" id="su-compatibility-mode-prefix" value="<?php echo su_compatibility_mode_prefix(); ?> " /> <div id="su-generator-result" style="display:none"></div> </div> </div> <?php $output = ob_get_contents(); set_transient('su/generator/popup', $output, 2 * DAY_IN_SECONDS); ob_end_clean(); echo $output; } }
/** * Generator popup form */ public static function popup() { // Get cache $output = get_transient('su/generator/popup'); if ($output && SU_ENABLE_CACHE) { echo $output; } else { ob_start(); $tools = apply_filters('su/generator/tools', array('<a href="' . admin_url('admin.php?page=shortcodes-ultimate') . '#tab-1" target="_blank" title="' . __('Settings', 'su') . '">' . __('Plugin settings', 'su') . '</a>', '<a href="http://gndev.info/shortcodes-ultimate/" target="_blank" title="' . __('Plugin homepage', 'su') . '">' . __('Plugin homepage', 'su') . '</a>', '<a href="http://wordpress.org/support/plugin/shortcodes-ultimate/" target="_blank" title="' . __('Support forums', 'su') . '">' . __('Support forums', 'su') . '</a>')); // Add add-ons links if (!defined('SUE_PLUGIN_FILE') || !defined('SUS_PLUGIN_FILE') || !defined('SUM_PLUGIN_FILE')) { $tools[] = '<a href="' . admin_url('admin.php?page=shortcodes-ultimate-addons') . '" target="_blank" title="' . __('Add-ons', 'su') . '" class="su-add-ons">' . __('Add-ons', 'su') . '</a>'; } ?> <div id="su-generator-wrap" style="display:none"> <div id="su-generator"> <div id="su-generator-header"> <div id="su-generator-tools"><?php echo implode(' <span></span> ', $tools); ?> </div> <input type="text" name="su_generator_search" id="su-generator-search" value="" placeholder="<?php _e('Search for shortcodes', 'su'); ?> " /> <div id="su-generator-filter"> <strong><?php _e('Filter by type', 'su'); ?> </strong> <?php foreach ((array) Su_Data::groups() as $group => $label) { echo '<a href="#" data-filter="' . $group . '">' . $label . '</a>'; } ?> </div> <div id="su-generator-choices" class="su-generator-clearfix"> <?php // Choices loop foreach ((array) Su_Data::shortcodes() as $name => $shortcode) { $icon = isset($shortcode['icon']) ? $shortcode['icon'] : 'puzzle-piece'; $shortcode['name'] = isset($shortcode['name']) ? $shortcode['name'] : $name; echo '<span data-name="' . $shortcode['name'] . '" data-shortcode="' . $name . '" title="' . esc_attr($shortcode['desc']) . '" data-desc="' . esc_attr($shortcode['desc']) . '" data-group="' . $shortcode['group'] . '">' . Su_Tools::icon($icon) . $shortcode['name'] . '</span>' . "\n"; } ?> </div> </div> <div id="su-generator-settings"></div> <input type="hidden" name="su-generator-selected" id="su-generator-selected" value="<?php echo plugins_url('', SU_PLUGIN_FILE); ?> " /> <input type="hidden" name="su-generator-url" id="su-generator-url" value="<?php echo plugins_url('', SU_PLUGIN_FILE); ?> " /> <input type="hidden" name="su-compatibility-mode-prefix" id="su-compatibility-mode-prefix" value="<?php echo su_compatibility_mode_prefix(); ?> " /> <div id="su-generator-result" style="display:none"></div> </div> </div> <?php $output = ob_get_contents(); set_transient('su/generator/popup', $output, 2 * DAY_IN_SECONDS); ob_end_clean(); echo $output; } }
/** * Shortcut for su_compatibility_mode_prefix() */ function su_cmpt() { return su_compatibility_mode_prefix(); }
<?php foreach ((array) Su_Data::groups() as $group => $label) { echo '<a href="#" data-filter="' . $group . '">' . $label . '</a>'; } ?> </div> <div id="su-generator-choices" class="su-generator-clearfix"> <?php // Choices loop foreach ((array) Su_Data::shortcodes() as $name => $shortcode) { $icon = isset($shortcode['icon']) ? $shortcode['icon'] : 'puzzle-piece'; $badge = isset($shortcode['badge']) ? '<strong class="sug-badge badge-' . strtolower($shortcode['badge']) . '">' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODE_' . $shortcode['badge']) . '</strong>' : ''; $shortcode['name'] = isset($shortcode['name']) ? $shortcode['name'] : $name; $visible = isset($shortcode['visible']) ? $shortcode['visible'] : true; if ($visible == true) { echo '<span data-name="' . $shortcode['name'] . '" data-shortcode="' . $name . '" title="' . $shortcode['desc'] . '" data-desc="' . $shortcode['desc'] . '" data-group="' . $shortcode['group'] . '">' . Su_Tools::icon($icon) . $shortcode['name'] . $badge . '</span>' . "\n"; } } ?> </div> </div> <input type="hidden" name="su-generator-selected" id="su-generator-selected" value="" /> <input type="hidden" name="su-generator-url" id="su-generator-url" value="" /> <input type="hidden" name="su-compatibility-mode-prefix" id="su-compatibility-mode-prefix" value="<?php echo su_compatibility_mode_prefix(); ?> " /> <div id="su-generator-settings"></div> <div id="su-generator-result" style="display:none"></div> </div> </div>