define("TAB", "\t"); } // Shared include LS_ROOT_PATH . '/wp/scripts.php'; include LS_ROOT_PATH . '/wp/menus.php'; include LS_ROOT_PATH . '/wp/hooks.php'; include LS_ROOT_PATH . '/wp/widgets.php'; include LS_ROOT_PATH . '/wp/compatibility.php'; include LS_ROOT_PATH . '/wp/shortcodes.php'; include LS_ROOT_PATH . '/classes/class.ls.posts.php'; include LS_ROOT_PATH . '/classes/class.ls.sliders.php'; include LS_ROOT_PATH . '/classes/class.ls.sources.php'; // Add demo sliders and skins LS_Sources::addDemoSlider(LS_ROOT_PATH . '/demos/'); LS_Sources::addSkins(LS_ROOT_PATH . '/static/skins/'); LS_Sources::removeSkin('preview'); // Back-end only if (is_admin()) { include LS_ROOT_PATH . '/wp/activation.php'; include LS_ROOT_PATH . '/wp/tinymce.php'; include LS_ROOT_PATH . '/wp/help.php'; include LS_ROOT_PATH . '/wp/notices.php'; include LS_ROOT_PATH . '/wp/actions.php'; // Front-end only } else { } // Auto update if (!class_exists('KM_PluginUpdatesV3')) { require_once LS_ROOT_PATH . '/classes/class.km.autoupdate.plugins.v3.php'; } new KM_PluginUpdatesV3(array('repoUrl' => LS_REPO_BASE_URL, 'root' => LS_ROOT_FILE, 'version' => LS_PLUGIN_VERSION, 'itemID' => LS_MARKETPLACE_ID, 'codeKey' => 'layerslider-purchase-code', 'authKey' => 'layerslider-authorized-site', 'channelKey' => 'layerslider-release-channel'));
/** * Layerslider API */ function evolve_layerslider_ready() { if (class_exists('LS_Sources')) { LS_Sources::addSkins(get_template_directory() . '/library/plugins/ls-skins'); } }
<?php if (!defined('LS_ROOT_FILE')) { header('HTTP/1.0 403 Forbidden'); exit; } // Get all skins $skins = LS_Sources::getSkins(); $skin = !empty($_GET['skin']) && strpos($_GET['skin'], '..') === false ? $_GET['skin'] : ''; if (empty($skin)) { $skin = reset($skins); $skin = $skin['handle']; } $skin = LS_Sources::getSkin($skin); $file = $skin['file']; // Get screen options $lsScreenOptions = get_option('ls-screen-options', '0'); $lsScreenOptions = $lsScreenOptions == 0 ? array() : $lsScreenOptions; $lsScreenOptions = is_array($lsScreenOptions) ? $lsScreenOptions : unserialize($lsScreenOptions); // Defaults if (!isset($lsScreenOptions['showTooltips'])) { $lsScreenOptions['showTooltips'] = 'true'; } ?> <div id="ls-screen-options" class="metabox-prefs hidden"> <div id="screen-options-wrap" class="hidden"> <form id="ls-screen-options-form" action="<?php echo $_SERVER['REQUEST_URI']; ?> " method="post">
<input type="text" name="title" placeholder="<?php _e('e.g. Homepage slider', 'LayerSlider'); ?> "> <button class="button"><?php _e('Add slider', 'LayerSlider'); ?> </button> </div> </form> <!-- End of Add slider template --> <!-- Import sample sliders template --> <?php $demoSliders = LS_Sources::getDemoSliders(); ?> <div id="ls-import-samples-template" class="ls-pointer ls-box"> <span class="ls-mce-arrow"></span> <h3 class="header"><?php _e('Choose a demo slider to import', 'LayerSlider'); ?> </h3> <ul class="inner"> <?php foreach ($demoSliders as $item) { ?> <li> <a href="<?php echo wp_nonce_url('?page=layerslider&action=import_sample&slider=' . $item['handle'] . '', 'import-sample-sliders'); ?>
</tbody> <!-- Appearance --> <tbody> <tr> <td><?php _e('Skin', 'LayerSlider'); ?> </td> <td> <select name="skin"> <?php $slider['properties']['skin'] = empty($slider['properties']['skin']) ? $lsDefaults['slider']['skin']['value'] : $slider['properties']['skin']; ?> <?php $skins = LS_Sources::getSkins(); ?> <?php foreach ($skins as $skin) { ?> <?php $selected = $skin['handle'] == $slider['properties']['skin'] ? ' selected="selected"' : ''; ?> <option value="<?php echo $skin['handle']; ?> "<?php echo $selected; ?> > <?php
if (!empty($newDefaults) && is_array($newDefaults)) { $lsDefaults = $newDefaults; unset($newDefaults); } } // Hook to alter slider data *before* filtering with defaults if (has_filter('layerslider_pre_parse_defaults')) { $result = apply_filters('layerslider_pre_parse_defaults', $slides); if (!empty($result) && is_array($result)) { $slides = $result; } } // Filter slider data with defaults $slides['properties'] = apply_filters('ls_parse_defaults', $lsDefaults['slider'], $slides['properties']); $skin = !empty($slides['properties']['attrs']['skin']) ? $slides['properties']['attrs']['skin'] : $lsDefaults['slider']['skin']['value']; $slides['properties']['attrs']['skinsPath'] = dirname(LS_Sources::urlForSkin($skin)) . '/'; if (isset($slides['properties']['autoPauseSlideshow'])) { switch ($slides['properties']['autoPauseSlideshow']) { case 'auto': $slides['properties']['autoPauseSlideshow'] = 'auto'; break; case 'enabled': $slides['properties']['autoPauseSlideshow'] = true; break; case 'disabled': $slides['properties']['autoPauseSlideshow'] = false; break; } } // Slides and layers if (isset($slides['layers']) && is_array($slides['layers'])) {
/** * Layerslider API */ function avada_layerslider_ready() { if (class_exists('LS_Sources')) { LS_Sources::addSkins(get_template_directory() . '/includes/ls-skins'); } if (defined('LS_PLUGIN_BASE')) { remove_action('after_plugin_row_' . LS_PLUGIN_BASE, 'layerslider_plugins_purchase_notice', 10, 3); } }
/** * Adds an exported ZIP to the list of importable sample sliders. * * @since 5.3.0 * @access public * @param string $path Path to the .zip file * @return void */ public static function addDemoSlider($path) { $slidersPath = $sliders = array(); $path = rtrim($path, '/\\'); // It's a direct slider folder if (file_exists($path . '/slider.zip')) { $slidersPath = array($path); } else { // Get all children if it's a parent directory $slidersPath = glob($path . '/*', GLOB_ONLYDIR); } // Iterate over the sliders foreach ($slidersPath as $key => $path) { // Exclude non-valid demo sliders if (!file_exists($path . '/slider.zip')) { continue; } // Gather slider data $handle = strtolower(basename($path)); $sliders[$handle] = array('name' => $handle, 'handle' => $handle, 'dir' => $path, 'file' => $path . DIRECTORY_SEPARATOR . 'slider.zip'); // Get skin info (if any) if (file_exists($path . '/info.json')) { $sliders[$handle]['info'] = json_decode(file_get_contents($path . '/info.json'), true); $sliders[$handle]['name'] = $sliders[$handle]['info']['name']; } // Get preview (if any) if (file_exists($path . '/preview.png')) { $url = content_url() . str_replace(realpath(WP_CONTENT_DIR), '', $path) . '/preview.png'; $sliders[$handle]['preview'] = str_replace('\\', '/', $url); } } self::$sliders = array_merge(self::$sliders, $sliders); ksort(self::$sliders); }
} } foreach ($fonts as $key => $font) { if (!$font['font_name']) { unset($fonts[$key]); } } update_option('scalia_additionals_fonts', $fonts); } wp_redirect(admin_url('themes.php?page=fonts-manager')); } } } /* LAYERSLIDER SKIN */ if (scalia_is_plugin_active('LayerSlider/layerslider.php') && class_exists('LS_Sources')) { LS_Sources::addSkins(get_template_directory() . '/ls_skin/'); } function scalia_theme_rewrite_flush() { flush_rewrite_rules(); } add_action('after_switch_theme', 'scalia_theme_rewrite_flush'); /* ------------------------------------------------------------------- PERSONALIZED FUNCTIONS ---------------------------------------------------------------------- */ /** * Check to see if the current page has a parent or if the page itsel is a parent. * If current is a parent page, then it displays the child pages associated with it. * If current is a child page, then it displays all other child pages of its parent page. */ function list_child_pages()
<?php /** * Theme functions. Initializes the Vamtam Framework. * * @package wpv */ require_once 'vamtam/classes/framework.php'; new WpvFramework(array('name' => 'church-event', 'slug' => 'church-event')); // TODO remove next line when the editor is fully functional, to be packaged as a standalone module with no dependencies to the theme define('VAMTAM_EDITOR_IN_THEME', true); include_once THEME_DIR . 'vamtam-editor/editor.php'; if (class_exists('LS_Sources')) { LS_Sources::addDemoSlider(WPV_SAMPLES_DIR . 'layerslider'); }
function ls_save_user_skin() { // Error checking if (empty($_POST['skin']) || strpos($_POST['skin'], '..') !== false) { wp_die(__("It looks like you haven't selected any skin to edit.", "LayerSlider"), __('No skin selected.', 'LayerSlider'), array('back_link' => true)); } // Get skin file and contents $skin = LS_Sources::getSkin($_POST['skin']); $file = $skin['file']; // Attempt to write the file if (is_writable($file)) { file_put_contents($file, stripslashes($_POST['contents'])); header('Location: admin.php?page=ls-skin-editor&skin=' . $skin['handle'] . '&edited=1'); } else { wp_die(__("It looks like your files isn't writable, so PHP couldn't make any changes (CHMOD).", "LayerSlider"), __('Cannot write to file', 'LayerSlider'), array('back_link' => true)); } }