예제 #1
2
 function import_revslider($other_data)
 {
     $is_import = false;
     if ($handle = opendir(THEME_DIR . "assets" . DIRECTORY_SEPARATOR . "data-demo" . DIRECTORY_SEPARATOR . "revslider")) {
         $arr_other_data = explode('||', $other_data);
         while (false !== ($entry = readdir($handle))) {
             if (in_array($entry, $arr_other_data)) {
                 continue;
             }
             if ($entry != "." && $entry != "..") {
                 $rev_import_file = THEME_DIR . "assets" . DIRECTORY_SEPARATOR . "data-demo" . DIRECTORY_SEPARATOR . "revslider" . DIRECTORY_SEPARATOR . $entry;
                 if (class_exists('RevSlider')) {
                     $slider = new RevSlider();
                     $response = $slider->importSliderFromPost(true, true, $rev_import_file);
                     /*if (is_array($response) && isset($response['success']) && !$response['success']) {
                     			return $other_data;
                     		}*/
                     if (!empty($other_data)) {
                         $other_data .= '||';
                     }
                     $other_data .= $entry;
                     $is_import = true;
                     break;
                 } else {
                     return 'done';
                 }
             }
         }
         closedir($handle);
     } else {
         return 'done';
     }
     if ($is_import) {
         return $other_data;
     }
     return 'done';
 }
예제 #2
0
 function ot_type_revslider_select($args = array())
 {
     extract($args);
     $has_desc = $field_desc ? true : false;
     echo '<div class="format-setting type-revslider-select ' . ($has_desc ? 'has-desc' : 'no-desc') . '">';
     echo $has_desc ? '<div class="description">' . htmlspecialchars_decode($field_desc) . '</div>' : '';
     echo '<div class="format-setting-inner">';
     // Add This only if RevSlider is Activated
     if (class_exists('RevSliderAdmin')) {
         echo '<select name="' . esc_attr($field_name) . '" id="' . esc_attr($field_id) . '" class="option-tree-ui-select ' . $field_class . '">';
         /* get revolution array */
         $slider = new RevSlider();
         $arrSliders = $slider->getArrSlidersShort();
         /* has slides */
         if (!empty($arrSliders)) {
             echo '<option value="">-- ' . __('Choose One', 'option-tree') . ' --</option>';
             foreach ($arrSliders as $rev_id => $rev_slider) {
                 echo '<option value="' . esc_attr($rev_id) . '"' . selected($field_value, $rev_id, false) . '>' . esc_attr($rev_slider) . '</option>';
             }
         } else {
             echo '<option value="">' . __('No Sliders Found', 'option-tree') . '</option>';
         }
         echo '</select>';
     } else {
         echo '<span style="color: red;">' . __('Sorry! Revolution Slider is not Installed or Activated', 'ventus') . '</span>';
     }
     echo '</div>';
     echo '</div>';
 }
    /**
     * Adds custom meta field into the essential grid meta box for post/pages
     */
    public function add_eg_additional_meta_field($values)
    {
        $sld = new RevSlider();
        $sliders = $sld->getArrSliders();
        $shortcodes = array();
        if (!empty($sliders)) {
            $first = true;
            foreach ($sliders as $slider) {
                $name = $slider->getParam('shortcode', 'false');
                if ($name != 'false') {
                    $shortcodes[$slider->getID()] = $name;
                    $first = false;
                }
            }
        }
        $selected_slider = isset($values['eg_sources_revslider']) ? $values['eg_sources_revslider'] : '';
        if ($selected_slider == '') {
            $selected_slider[0] = '';
        }
        ?>

		<p>
			<strong style="font-size:14px"><?php 
        _e('Choose Revolution Slider', REVSLIDER_TEXTDOMAIN);
        ?>
</strong>
		</p>
		<p>
			<select name="eg_sources_revslider" id="eg_sources_revslider">
				<option value=""<?php 
        selected($selected_slider[0], '');
        ?>
><?php 
        _e('--- Choose Slider ---', REVSLIDER_TEXTDOMAIN);
        ?>
</option>
				<?php 
        if (!empty($shortcodes)) {
            foreach ($shortcodes as $id => $name) {
                ?>

						<option value="<?php 
                echo $id;
                ?>
"<?php 
                selected($selected_slider[0], $id);
                ?>
><?php 
                echo $name;
                ?>
</option>
						<?php 
            }
        }
        ?>

			</select>
		</p>
		<?php 
    }
예제 #4
0
파일: panels.php 프로젝트: JalpMi/v2contact
function zenite_contingut_stripe($post)
{
    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), 'zenite_noncename');
    // The actual fields for data entry
    echo '<label for="zenite_white">';
    _e("Show WhiteStripe?:", 'zenite');
    echo '</label> ';
    echo '<input type="checkbox" id="zenite_white" name="zenite_white" value="on"';
    if (get_post_meta($post->ID, 'zenite_whitestripe', true) == 'on') {
        echo ' checked="checked"';
    }
    echo ' /><br><br>';
    echo '<label for="zenite_slider">';
    _e("Slider:", 'zenite');
    echo '</label> ';
    echo '<select name="zenite_slider" id="zenite_slider"><option value="0">No Slider</option>';
    if (class_exists('RevSlider')) {
        $slider = new RevSlider();
        $arrSliders = $slider->getArrSliders();
        foreach ($arrSliders as $revSlider) {
            //		$revolutionslider[$revSlider->getAlias()] = $revSlider->getTitle();
            echo '<option value="' . $revSlider->getAlias() . '"';
            if (get_post_meta($post->ID, 'zenite_slider', true) == $revSlider->getAlias()) {
                echo " selected='selected'";
            }
            echo '>' . $revSlider->getTitle() . '</option>';
        }
    }
    echo '</select>';
}
예제 #5
0
 function register()
 {
     // Init Post Type
     $post = new SpyropressCustomPostType('Page');
     $menus = wp_get_nav_menus();
     $menu_options = array();
     if (isset($menus) && count($menus) > 0) {
         foreach ($menus as $menu) {
             $menu_options[$menu->term_id] = $menu->name;
         }
     }
     // Add Meta Boxes
     $meta_fields['options'] = array(array('label' => __('Slider', 'spyropress'), 'type' => 'heading', 'slug' => 'options'), array('label' => __('OnePage Navigation Menu', 'spyropress'), 'id' => 'onepage_menu', 'type' => 'select', 'class' => 'page_template one-page-php', 'options' => $menu_options), array('label' => __('Slider', 'spyropress'), 'type' => 'sub_heading'), array('label' => __('Slider Type', 'spyropress'), 'id' => 'slider', 'type' => 'select', 'class' => 'enable_changer', 'options' => array('nivo' => __('Nivo Slider', 'spyropress'), 'rev' => __('Revolution Slider', 'spyropress'))), array('label' => __('Nivo Slider', 'spyropress'), 'id' => 'nivo_slider', 'type' => 'select', 'class' => 'slider nivo', 'options' => spyropress_get_sliders()));
     if (class_exists('RevSlider')) {
         $slider = new RevSlider();
         $arrSliders = $slider->getArrSlidersShort();
         $meta_fields['options'][] = array('label' => __('Revolution Slider', 'spyropress'), 'id' => 'rev_slider', 'type' => 'select', 'class' => 'slider rev', 'options' => $arrSliders);
         $meta_fields['options'][] = array('label' => __('Revolution Slider Skin', 'spyropress'), 'id' => 'rev_slider_skin', 'type' => 'select', 'class' => 'slider rev', 'options' => array('dark' => __('Dark', 'spyropress'), 'light' => __('Light', 'spyropress'), 'full' => __('FullScreen', 'spyropress'), 'dark dark-video' => __('Video - Dark', 'spyropress'), 'light dark-light' => __('Video - Light', 'spyropress')), 'std' => 'dark');
     }
     $meta_fields['options'][] = array('label' => __('Header', 'spyropress'), 'type' => 'sub_heading');
     $meta_fields['options'][] = array('label' => __('Header Type', 'spyropress'), 'id' => 'top_header', 'type' => 'select', 'class' => 'enable_changer', 'options' => array('none' => __('None', 'spyropress'), 'default' => __('Default', 'spyropress'), 'custom' => __('Custom Header', 'spyropress')), 'std' => 'default');
     $meta_fields['options'][] = array('label' => __('Custom Header Bucket', 'spyropress'), 'id' => 'bucket', 'type' => 'select', 'class' => 'top_header custom', 'desc' => __('Either use Bucket or Content', 'spyropress'), 'options' => spyropress_get_buckets());
     $meta_fields['options'][] = array('label' => __('Custom Header Content', 'spyropress'), 'id' => 'header_content', 'type' => 'editor', 'desc' => __('Either use Bucket or Content', 'spyropress'), 'class' => 'top_header custom');
     $meta_fields['options'][] = array('label' => __('Custom Header Background', 'spyropress'), 'id' => 'background', 'type' => 'background', 'class' => 'top_header custom');
     $meta_fields['options'][] = array('label' => __('Top Border color', 'spyropress'), 'id' => 'border_top', 'type' => 'colorpicker', 'class' => 'top_header custom');
     $meta_fields['options'][] = array('label' => __('Bottom Border color', 'spyropress'), 'id' => 'border_bottom', 'type' => 'colorpicker', 'class' => 'top_header custom');
     $meta_fields['options'][] = array('label' => __('Layout', 'spyropress'), 'type' => 'sub_heading');
     $meta_fields['options'][] = array('label' => __('Layout Type', 'spyropress'), 'id' => 'layout_type', 'type' => 'select', 'options' => array('full' => __('Full Width', 'spyropress'), 'left' => __('Left Sidebar', 'spyropress'), 'right' => __('Right Sidebar', 'spyropress')), 'std' => 'full');
     $post->add_meta_box('page_options', __('Page Options', 'spyropress'), $meta_fields, '_page_options', false, 'normal', 'high');
 }
    public static function my_print_shortcodes_in_js()
    {
        $sld = new RevSlider();
        $sliders = $sld->getArrSliders();
        $shortcodes = '';
        if (!empty($sliders)) {
            $first = true;
            foreach ($sliders as $slider) {
                $shortcode = $slider->getParam('shortcode', 'false');
                if ($shortcode != 'false') {
                    if (!$first) {
                        $shortcodes .= ',';
                    }
                    $shortcodes .= "'" . $shortcode . "'";
                    $first = false;
                }
            }
        }
        ?>

		<script type="text/javascript">
			var revslider_shortcodes = [<?php 
        echo $shortcodes;
        ?>
];
		</script>
		<?php 
    }
 public function getRevSlider()
 {
     if (!$this->slider && ($alias = $this->getParam('activeRevSlider'))) {
         $this->slider = new RevSlider();
         $this->slider->initByMixed($alias);
     }
     return $this->slider;
 }
예제 #8
0
파일: oneclick.php 프로젝트: kautzar/drpp4
 public function revSliderCharityDataImport() {
 	if (class_exists('RevSlider')) {
 		$slider = new RevSlider();
 		$response = $slider->importSliderFromPost(true, true, CHY_THEME_DIR . '/vendor/data/home_slder2.zip');
 		$response = $slider->importSliderFromPost(true, true, CHY_THEME_DIR . '/vendor/data/home_slder3.zip');
 		$response = $slider->importSliderFromPost(true, true, CHY_THEME_DIR . '/vendor/data/home_slder1.zip');
 		$response = $slider->importSliderFromPost(true, true, CHY_THEME_DIR . '/vendor/data/ShopLandingSlider.zip');
 	}
 }
예제 #9
0
파일: Edit.php 프로젝트: perseusl/kingdavid
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $revSliderAdmin = Mage::getSingleton('RevSliderAdmin');
     $revSliderAdmin->requireSettings("slider_settings");
     $settingsMain = $revSliderAdmin->getSettings("slider_main");
     $settingsParams = $revSliderAdmin->getSettings("slider_params");
     $settingsSliderMain = new RevSliderSettingsProduct();
     $settingsSliderParams = new UniteSettingsProductSidebarRev();
     //get taxonomies with cats
     $postTypesWithCats = RevOperations::getPostTypesWithCatsForClient();
     $jsonTaxWithCats = UniteFunctionsRev::jsonEncodeForClientSide($postTypesWithCats);
     //check existing slider data:
     $sliderID = $this->getRequest()->getParam('id');
     if (!empty($sliderID)) {
         $slider = new RevSlider();
         $slider->initByID($sliderID);
         //get setting fields
         $settingsFields = $slider->getSettingsFields();
         $arrFieldsMain = $settingsFields["main"];
         $arrFieldsParams = $settingsFields["params"];
         //modify arrows type for backword compatability
         $arrowsType = UniteFunctionsRev::getVal($arrFieldsParams, "navigation_arrows");
         switch ($arrowsType) {
             case "verticalcentered":
                 $arrFieldsParams["navigation_arrows"] = "solo";
                 break;
         }
         //set custom type params values:
         $settingsMain = RevSliderSettingsProduct::setSettingsCustomValues($settingsMain, $arrFieldsParams, $postTypesWithCats);
         //set setting values from the slider
         $settingsMain->setStoredValues($arrFieldsParams);
         $settingsParams->setStoredValues($arrFieldsParams);
         //update short code setting
         $shortcode = $slider->getShortcode();
         $settingsMain->updateSettingValue("shortcode", htmlentities($shortcode));
         $linksEditSlides = $this->helper("adminhtml")->getUrl('adminhtml/nwdrevslider/slides/id/' . $sliderID);
         $settingsSliderParams->init($settingsParams);
         $settingsSliderMain->init($settingsMain);
         $settingsSliderParams->isAccordion(true);
         $this->assign('sliderID', $sliderID);
         $this->assign('linksEditSlides', $linksEditSlides);
         $this->assign('arrFieldsParams', $arrFieldsParams);
         $this->setTemplate('nwdthemes/revslider/templates/slider_edit.phtml');
     } else {
         //set custom type params values:
         $settingsMain = RevSliderSettingsProduct::setSettingsCustomValues($settingsMain, array(), $postTypesWithCats);
         $settingsSliderParams->init($settingsParams);
         $settingsSliderMain->init($settingsMain);
         $settingsSliderParams->isAccordion(true);
         $this->setTemplate('nwdthemes/revslider/templates/slider_new.phtml');
     }
     $this->assign('sliderTemplate', $this->_sliderTemplate);
     $this->assign('settingsSliderMain', $settingsSliderMain);
     $this->assign('settingsSliderParams', $settingsSliderParams);
     $this->assign('jsonTaxWithCats', $jsonTaxWithCats);
 }
예제 #10
0
파일: config.php 프로젝트: zgomotos/Bazar
function yit_get_revolution_sliders()
{
    global $wpdb;
    if (!yit_if_thereis_revslider()) {
        return array();
    }
    $tableName = GlobalsRevSlider::$table_sliders;
    $slider = new RevSlider();
    return $slider->getArrSlidersShort();
}
 function wbc_extended_example($demo_active_import, $demo_directory_path)
 {
     reset($demo_active_import);
     $current_key = key($demo_active_import);
     /************************************************************************
      * Import slider(s) for the current demo being imported
      *************************************************************************/
     if (class_exists('RevSlider')) {
         //If it's demo3 or demo5
         $wbc_sliders_array = array('demo1' => 'newslider2014.zip');
         if (isset($demo_active_import[$current_key]['directory']) && !empty($demo_active_import[$current_key]['directory']) && array_key_exists($demo_active_import[$current_key]['directory'], $wbc_sliders_array)) {
             $wbc_slider_import = $wbc_sliders_array[$demo_active_import[$current_key]['directory']];
             if (file_exists($demo_directory_path . $wbc_slider_import)) {
                 $slider = new RevSlider();
                 $slider->importSliderFromPost(true, true, $demo_directory_path . $wbc_slider_import);
             }
         }
     }
     /************************************************************************
      * Setting Menus
      *************************************************************************/
     // If it's demo1 - demo6
     $wbc_menu_array = array('demo1');
     if (isset($demo_active_import[$current_key]['directory']) && !empty($demo_active_import[$current_key]['directory']) && in_array($demo_active_import[$current_key]['directory'], $wbc_menu_array)) {
         $top_menu = get_term_by('name', 'Top Menu', 'nav_menu');
         $main_menu = get_term_by('name', 'Header Menu', 'nav_menu');
         $footer_menu = get_term_by('name', 'Footer Menu', 'nav_menu');
         if (isset($top_menu->term_id)) {
             set_theme_mod('nav_menu_locations', array('top-menu' => $top_menu->term_id, 'primary-menu' => $main_menu->term_id, 'footer-menu' => $footer_menu->term_id));
         }
     }
     /************************************************************************
      * Set HomePage
      *************************************************************************/
     // array of demos/homepages to check/select from
     $wbc_home_pages = array('demo1' => 'Home');
     $wbc_blog_pages = array('demo1' => 'Blog');
     if (isset($demo_active_import[$current_key]['directory']) && !empty($demo_active_import[$current_key]['directory']) && array_key_exists($demo_active_import[$current_key]['directory'], $wbc_home_pages)) {
         $page = get_page_by_title($wbc_home_pages[$demo_active_import[$current_key]['directory']]);
         if (isset($page->ID)) {
             update_option('page_on_front', $page->ID);
             update_option('show_on_front', 'page');
             //Update Widgets Switch to On
             $all_widgets_on = 'a:34:{s:6:"button";b:1;s:10:"google-map";b:1;s:5:"image";b:1;s:6:"slider";b:1;s:13:"post-carousel";b:1;s:6:"editor";b:1;s:12:"alert-widget";b:1;s:14:"counter-widget";b:1;s:21:"featured-block-widget";b:1;s:19:"gallery-grid-widget";b:1;s:4:"icon";b:1;s:15:"carousel-widget";b:1;s:17:"posts-list-widget";b:1;s:18:"progressbar-widget";b:1;s:19:"sermons-list-widget";b:1;s:21:"sermons-albums-widget";b:1;s:17:"staff-grid-widget";b:1;s:13:"spacer-widget";b:1;s:11:"tabs-widget";b:1;s:8:"taxonomy";b:1;s:13:"toggle-widget";b:1;s:11:"testimonial";b:1;s:30:"upcoming-events-listing-widget";b:1;s:5:"video";b:1;s:14:"simple-masonry";b:1;s:20:"social-media-buttons";b:1;s:11:"price-table";b:1;s:13:"layout-slider";b:1;s:10:"image-grid";b:1;s:4:"hero";b:1;s:8:"headline";b:1;s:8:"features";b:1;s:7:"contact";b:1;s:3:"cta";b:1;}';
             $all_widgets_on = unserialize($all_widgets_on);
             update_option('siteorigin_widgets_active', $all_widgets_on);
         }
     }
     if (isset($demo_active_import[$current_key]['directory']) && !empty($demo_active_import[$current_key]['directory']) && array_key_exists($demo_active_import[$current_key]['directory'], $wbc_blog_pages)) {
         $bpage = get_page_by_title($wbc_blog_pages[$demo_active_import[$current_key]['directory']]);
         if (isset($bpage->ID)) {
             update_option('page_for_posts', $bpage->ID);
         }
     }
 }
예제 #12
0
 public function toOptionArray()
 {
     new RevSliderAdmin();
     $slider = new RevSlider();
     $arrSliders = $slider->getArrSliders();
     $options = array();
     foreach ($arrSliders as $item) {
         $options[] = array('value' => $item->getAlias(), 'label' => $item->getAlias());
     }
     return $options;
 }
예제 #13
0
function ac_get_revsliders()
{
    $rev_sliders = array();
    if (ac_revslider_is_installed()) {
        $slider = new RevSlider();
        $arrSliders = $slider->getArrSliders();
        foreach ($arrSliders as $arrSlider) {
            $rev_sliders[$arrSlider->getAlias()] = $arrSlider->getTitle();
        }
    }
    return $rev_sliders;
}
 public function import_revsliders($file)
 {
     if (!file_exists($file)) {
         return 'Revolution Slider file not found';
         return;
     }
     if (class_exists('RevSlider')) {
         ob_start();
         $rev = new RevSlider();
         $response = $rev->importSliderFromPost(false, false, $file);
         ob_end_clean();
         return 'Revolution Slider imported';
     }
 }
예제 #15
0
function x_revolution_slider_get_slider_meta()
{
    $rs = new RevSlider();
    $sliders = $rs->getArrSliders();
    $data = array();
    foreach ($sliders as $s) {
        $key = 'x-slider-rs-' . $s->getID();
        $data[$key]['id'] = $s->getID();
        $data[$key]['slug'] = $s->getAlias();
        $data[$key]['name'] = $s->getTitle();
        $data[$key]['source'] = 'Revolution Slider';
    }
    return $data;
}
 public function controls()
 {
     $found = array();
     if (class_exists('RevSlider')) {
         $new_rev_slider = new RevSlider();
         $rev_sliders = $new_rev_slider->getArrSliders();
         foreach ($rev_sliders as $rs) {
             $found[] = array('value' => $rs->getAlias(), 'label' => $rs->getTitle());
         }
     }
     if (empty($found)) {
         $found[] = array('value' => 'none', 'label' => __('No Slider Available', csl18n()), 'disabled' => true);
     }
     $this->addControl('alias', 'select', __('Select Slider', csl18n()), __('Choose from Revolution Slider elements that have already been created.', csl18n()), $found[0]['value'], array('choices' => $found));
 }
예제 #17
0
 function import_revslider($folder = '')
 {
     if (!class_exists('RevSliderAdmin')) {
         require_once RS_PLUGIN_PATH . '/admin/revslider-admin.class.php';
     }
     $rev_files = glob(get_template_directory() . '/library/import/files/' . $folder . '/revslider/*.zip');
     if (!empty($rev_files)) {
         foreach ($rev_files as $rev_file) {
             $_FILES['import_file']['error'] = UPLOAD_ERR_OK;
             $_FILES['import_file']['tmp_name'] = $rev_file;
             $slider = new RevSlider();
             $slider->importSliderFromPost(true, 'none');
         }
     }
 }
 /**
  * 
  * the form
  */
 public function form($instance)
 {
     $slider = new RevSlider();
     $arrSliders = $slider->getArrSlidersShort();
     $sliderID = UniteFunctionsRev::getVal($instance, "rev_slider");
     if (empty($arrSliders)) {
         echo __("No sliders found, Please create a slider", tk_theme_name);
     } else {
         $field = "rev_slider";
         $fieldID = $this->get_field_id($field);
         $fieldName = $this->get_field_name($field);
         $select = UniteFunctionsRev::getHTMLSelect($arrSliders, $sliderID, 'name="' . $fieldName . '" id="' . $fieldID . '"', true);
     }
     echo "Choose slider: ";
     echo $select;
 }
예제 #19
0
 /**
  * Mapping settings for lean method.
  *
  * @since 4.9
  *
  * @param $tag
  *
  * @return array
  */
 public function addShortcodeSettings($tag)
 {
     $slider = new RevSlider();
     $arrSliders = $slider->getArrSliders();
     $revsliders = array();
     if ($arrSliders) {
         foreach ($arrSliders as $slider) {
             /** @var $slider RevSlider */
             $revsliders[$slider->getTitle()] = $slider->getAlias();
         }
     } else {
         $revsliders[__('No sliders found', 'js_composer')] = 0;
     }
     // Add fixes for frontend editor to regenerate id
     return array('base' => $tag, 'name' => __('Revolution Slider', 'js_composer'), 'icon' => 'icon-wpb-revslider', 'category' => __('Content', 'js_composer'), 'description' => __('Place Revolution slider', 'js_composer'), 'params' => array(array('type' => 'textfield', 'heading' => __('Widget title', 'js_composer'), 'param_name' => 'title', 'description' => __('Enter text used as widget title (Note: located above content element).', 'js_composer')), array('type' => 'dropdown', 'heading' => __('Revolution Slider', 'js_composer'), 'param_name' => 'alias', 'admin_label' => true, 'value' => $revsliders, 'save_always' => true, 'description' => __('Select your Revolution Slider.', 'js_composer')), array('type' => 'textfield', 'heading' => __('Extra class name', 'js_composer'), 'param_name' => 'el_class', 'description' => __('Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer'))));
 }
예제 #20
0
 private function import_sliders()
 {
     $dir = opendir($this->dir);
     ob_start();
     while ($file = readdir($dir)) {
         if ($file != '.' && $file != '..' && preg_match('/\\.zip$/', $file)) {
             $filepath = $this->dir . '/' . $file;
             if (!isset($_FILES["import_file"])) {
                 $_FILES["import_file"] = array();
             }
             $_FILES["import_file"]["tmp_name"] = $filepath;
             $slider = new RevSlider();
             $response = $slider->importSliderFromPost();
         }
     }
     ob_end_clean();
 }
예제 #21
0
/**
 * Return list of Revolution Slider items
 *
 * @since 1.3.0
 *
 * @return array [alias => title]
 */
function appica_get_revslider_items()
{
    $not_found = array(0 => __('No sliders found', 'appica'));
    if (!class_exists('RevSlider', false)) {
        return $not_found;
    }
    $revslider = new RevSlider();
    $sliders = $revslider->getArrSliders();
    if ($sliders) {
        $_sliders = array();
        foreach ($sliders as $slider) {
            $_sliders[$slider->getAlias()] = $slider->getTitle();
        }
        unset($slider);
        return $_sliders;
    }
    return $not_found;
}
예제 #22
0
    /**
     * 
     * the form
     */
    public function form($instance)
    {
        $slider = new RevSlider();
        $arrSliders = $slider->getArrSlidersShort();
        if (empty($arrSliders)) {
            echo __("No sliders found, Please create a slider");
        } else {
            $sliderID = UniteFunctionsRev::getVal($instance, "rev_slider");
            $homepage = UniteFunctionsRev::getVal($instance, "rev_slider_homepage");
            $field = "rev_slider";
            $fieldID = $this->get_field_id($field);
            $fieldName = $this->get_field_name($field);
            $select = UniteFunctionsRev::getHTMLSelect($arrSliders, $sliderID, 'name="' . $fieldName . '" id="' . $fieldID . '"', true);
            $fieldCheck = "rev_slider_homepage";
            $fieldID_check = $this->get_field_id($fieldCheck);
            $fieldName_check = $this->get_field_name($fieldCheck);
            $checked = "";
            if ($homepage == "on") {
                $checked = "checked='checked'";
            }
            ?>
			Choose Slider: <?php 
            echo $select;
            ?>
			<div style="padding-top:10px;"></div>
			<label for="<?php 
            echo $fieldID_check;
            ?>
">Home Page Only:</label>
			<input type="checkbox" name="<?php 
            echo $fieldName_check;
            ?>
" id="<?php 
            echo $fieldID_check;
            ?>
" <?php 
            echo $checked;
            ?>
 >
			<div style="padding-top:10px;"></div>
		<?php 
        }
        //else
    }
예제 #23
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $orders = false;
     $orderst = false;
     $_ot = $this->getRequest()->getParam('ot');
     $_order = $this->getRequest()->getParam('order');
     $_type = $this->getRequest()->getParam('type');
     if ($_ot && $_order && $_type) {
         $order = array();
         switch ($_ot) {
             case 'alias':
                 $order['alias'] = $_order == 'asc' ? 'ASC' : 'DESC';
                 break;
             case 'name':
             default:
                 $order['title'] = $_order == 'asc' ? 'ASC' : 'DESC';
                 break;
         }
         if ($_type != 'reg') {
             $orderst = $order;
         } else {
             $orders = $order;
         }
     }
     $slider = new RevSlider();
     $arrSliders = $slider->getArrSliders(false, $orders);
     $arrSlidersTemplates = $slider->getArrSliders(true, $orderst);
     $exampleID = 'slider1';
     if (!empty($arrSliders)) {
         $exampleID = $arrSliders[0]->getAlias();
     }
     $outputTemplates = false;
     $latest_version = Mage::helper('nwdrevslider')->getVersion();
     if (version_compare($latest_version, GlobalsRevSlider::SLIDER_REVISION, '>')) {
         //neue version existiert
     } else {
         //up to date
     }
     $this->assign('arrSliders', $arrSliders);
     $this->assign('arrSlidersTemplates', $arrSlidersTemplates);
     $this->assign('exampleID', $exampleID);
     $this->assign('latest_version', $latest_version);
 }
예제 #24
0
function virtue_all_rev_sliders_in_array()
{
    if (class_exists('RevSlider')) {
        $theslider = new RevSlider();
        $arrSliders = $theslider->getArrSliders();
        $arrA = array();
        $arrT = array();
        foreach ($arrSliders as $slider) {
            $arrA[] = $slider->getAlias();
            $arrT[] = $slider->getTitle();
        }
        if (!empty($arrT)) {
            $result = array_combine($arrA, $arrT);
        } else {
            $result = '';
        }
        return $result;
    }
}
예제 #25
0
 function wbc_extended_example($demo_active_import, $demo_directory_path)
 {
     reset($demo_active_import);
     $current_key = key($demo_active_import);
     /************************************************************************
      * Import slider(s) for the current demo being imported
      * *********************************************************************** */
     if (class_exists('RevSlider')) {
         //If it's demo3 or demo5
         $wbc_sliders_array = array('demo1' => 'portfolio.zip', 'demo5' => 'anotherslider.zip');
         if (isset($demo_active_import[$current_key]['directory']) && !empty($demo_active_import[$current_key]['directory']) && array_key_exists($demo_active_import[$current_key]['directory'], $wbc_sliders_array)) {
             $wbc_slider_import = $wbc_sliders_array[$demo_active_import[$current_key]['directory']];
             if (file_exists($demo_directory_path . $wbc_slider_import)) {
                 $slider = new RevSlider();
                 $slider->importSliderFromPost(true, true, $demo_directory_path . $wbc_slider_import);
             }
         }
     }
     /************************************************************************
      * Setting Menus
      * *********************************************************************** */
     // If it's demo1 - demo6
     $wbc_menu_array = array('Business-onepage', 'Portfolio', 'Creative', 'Creative-onepage');
     if (isset($demo_active_import[$current_key]['directory']) && !empty($demo_active_import[$current_key]['directory']) && in_array($demo_active_import[$current_key]['directory'], $wbc_menu_array)) {
         $top_menu = get_term_by('name', 'Temp Menu', 'nav_menu');
         if (isset($top_menu->term_id)) {
             set_theme_mod('nav_menu_locations', array('theme-primary' => $top_menu->term_id, 'theme-footer' => $top_menu->term_id));
         }
     }
     /* * **********************************************************************
      * Set HomePage
      * *********************************************************************** */
     // array of demos/homepages to check/select from
     $wbc_home_pages = array('Business-onepage' => 'Home', 'Portfolio' => 'Home', 'Creative' => 'Home', 'Creative-onepage' => 'Home');
     if (isset($demo_active_import[$current_key]['directory']) && !empty($demo_active_import[$current_key]['directory']) && array_key_exists($demo_active_import[$current_key]['directory'], $wbc_home_pages)) {
         $page = get_page_by_title($wbc_home_pages[$demo_active_import[$current_key]['directory']]);
         if (isset($page->ID)) {
             update_option('page_on_front', $page->ID);
             update_option('show_on_front', 'page');
         }
     }
 }
예제 #26
0
 /**
  * Method to get the field input markup.
  *
  * @return	string	The field input markup.
  * @since	1.6
  */
 protected function getInput()
 {
     $this->requireFramework();
     $slider = new RevSlider();
     $arrSliders = $slider->getArrSlidersShort();
     $selectedID = $this->value;
     if (empty($selectedID)) {
         $selectedID = JRequest::getCmd("sliderid");
     }
     $html = "<select id='{$this->id}_id' name='{$this->name}'>";
     foreach ($arrSliders as $id => $title) {
         $selected = "";
         if ($id == $selectedID) {
             $selected = 'selected="selected"';
         }
         $html .= "<option value='{$id}' {$selected}>{$title}</option>";
     }
     $html .= "</select>";
     return $html;
 }
예제 #27
0
 public function pageControls()
 {
     global $post;
     $sliders = array(array('value' => '', 'label' => __('Deactivated', csl18n())));
     if (class_exists('RevSlider')) {
         $rev_slider = new RevSlider();
         $rev_sliders = $rev_slider->getArrSliders();
         foreach ($rev_sliders as $slider) {
             $sliders[] = array('value' => $slider->getAlias(), 'label' => $slider->getTitle());
         }
     }
     $default_slider = get_post_meta($post->ID, '_x_slider_above', true);
     $this->addControl('x_slider_above', 'select', __('Slider', csl18n()), __('To activate your slider, select an option from the dropdown. To deactivate your slider, set the dropdown back to "Deactivated."', csl18n()), $default_slider, array('choices' => $sliders, 'notLive' => 'settings-theme-changed'));
     $this->addControl('x_slider_above_bg_video', 'text', __('Optional Background Video', csl18n()), __('Include your video URL(s) here. If using multiple sources, separate them using the pipe character (|) and place fallbacks towards the end (i.e. .webm then .mp4 then .ogv).', csl18n()), get_post_meta($post->ID, '_x_slider_above_bg_video', true), array('notLive' => 'settings-theme-changed'));
     $this->addControl('x_slider_above_bg_video_poster', 'text', __('Video Poster Image (For Mobile)', csl18n()), __('Click the button to upload your video poster image to show on mobile devices, or enter it in manually using the text field above. Only select one image for this field. To clear, delete the image URL from the text field and save your page.', csl18n()), get_post_meta($post->ID, '_x_slider_above_bg_video_poster', true), array('notLive' => 'settings-theme-changed'));
     $this->addControl('x_slider_above_scroll_bottom_anchor_enable', 'toggle', __('Enable Scroll Bottom Anchor', csl18n()), __('Select to enable the scroll bottom anchor for your slider.', csl18n()), 'on' == get_post_meta($post->ID, '_x_slider_above_scroll_bottom_anchor_enable', true), array('notLive' => 'settings-theme-changed'));
     $alignments = array(array('value' => 'top left', 'label' => 'Top Left'), array('value' => 'top center', 'label' => 'Top Center'), array('value' => 'top right', 'label' => 'Top Right'), array('value' => 'bottom left', 'label' => 'Bottom Left'), array('value' => 'bottom center', 'label' => 'Bottom Center'), array('value' => 'bottom right', 'label' => 'Bottom Right'));
     $this->addControl('x_slider_above_scroll_bottom_anchor_alignment', 'select', __('Scroll Bottom Anchor Alignment', csl18n()), __('Select the alignment of the scroll bottom anchor for your slider.', csl18n()), get_post_meta($post->ID, '_x_slider_above_scroll_bottom_anchor_alignment', true), array('choices' => $alignments, 'notLive' => 'settings-theme-changed'));
     $this->addControl('x_slider_above_scroll_bottom_anchor_color', 'text', __('Scroll Bottom Anchor Color', csl18n()), __('Select the color of the scroll bottom anchor for your slider.', csl18n()), get_post_meta($post->ID, '_x_slider_above_scroll_bottom_anchor_color', true), array('notLive' => 'settings-theme-changed'));
     $this->addControl('x_slider_above_scroll_bottom_anchor_color_hover', 'text', __('Scroll Bottom Anchor Color Hover', csl18n()), __('Select the hover color of the scroll bottom anchor for your slider.', csl18n()), get_post_meta($post->ID, '_x_slider_above_scroll_bottom_anchor_color_hover', true), array('notLive' => 'settings-theme-changed'));
 }
예제 #28
0
 /**
  * @since 4.3
  */
 public function buildShortcode()
 {
     if (class_exists('RevSlider')) {
         $slider = new RevSlider();
         $arrSliders = $slider->getArrSliders();
         $revsliders = array();
         if ($arrSliders) {
             foreach ($arrSliders as $slider) {
                 /** @var $slider RevSlider */
                 $revsliders[$slider->getTitle()] = $slider->getAlias();
             }
         } else {
             $revsliders[__('No sliders found', 'js_composer')] = 0;
         }
         // add shortcode to visual composer
         $this->mapShortcode($revsliders);
         // Add fixes for frontend editor to regenerate id
         if (vc_is_frontend_ajax() || vc_is_frontend_editor()) {
             add_filter('vc_revslider_shortcode', array(&$this, 'setId'));
         }
     }
 }
예제 #29
0
/**
 * Local function that returns field that allows to select revolution slider.
 *
 * @return assoc
 */
function _adventure_tours_hsm_get_slider_selector()
{
    $isRevoSliderInstalled = class_exists('RevSlider');
    $revoSlidersList = array();
    if ($isRevoSliderInstalled) {
        $slider = new RevSlider();
        if ($arrSliders = $slider->getArrSlidersShort()) {
            foreach ($arrSliders as $sid => $stitle) {
                $revoSlidersList[] = array('value' => $sid, 'label' => $stitle);
            }
        }
    }
    $descriptionNoticeText = '';
    if (!$isRevoSliderInstalled) {
        $descriptionNoticeText = esc_html__('Please install and activate the Slider Revolution plugin.', 'adventure-tours');
    } else {
        if (empty($revoSlidersList)) {
            $descriptionNoticeText = esc_html__('Please go to Slider Revolution plugin and create a slider.', 'adventure-tours');
        }
    }
    return array('label' => esc_html__('Choose Slider', 'adventure-tours'), 'type' => 'select', 'name' => 'slider_alias', 'description' => $descriptionNoticeText ? '<span style="color:#EE0000">' . $descriptionNoticeText . '</span>' : '', 'items' => $revoSlidersList, 'dependency' => array('field' => 'section_mode', 'function' => 'adventure_tours_vp_header_section_is_slider'));
}
예제 #30
0
 /**
  * Editor Element - this function defines the visual appearance of an element on the AviaBuilder Canvas
  * Most common usage is to define some markup in the $params['innerHtml'] which is then inserted into the drag and drop container
  * Less often used: $params['data'] to add data attributes, $params['class'] to modify the className
  *
  *
  * @param array $params this array holds the default values for $content and $args. 
  * @return $params the return array usually holds an innerHtml key that holds item specific markup.
  */
 function editor_element($params)
 {
     //fetch all registered slides and save them to the slides array
     $slider = new RevSlider();
     $arrSliders = $slider->getArrSlidersShort();
     $slides = array_flip($arrSliders);
     if (empty($params['args']['id']) && is_array($slides)) {
         $params['args']['id'] = reset($slides);
     }
     $element = array('subtype' => $slides, 'type' => 'select', 'std' => $params['args']['id'], 'class' => 'avia-recalc-shortcode', 'data' => array('attr' => 'id'));
     $inner = "<img src='" . $this->config['icon'] . "' title='" . $this->config['name'] . "' />";
     if (empty($slides)) {
         $inner .= "<div><a target='_blank' href='" . admin_url('admin.php?page=revslider') . "'>" . __('No Revolution Slider Found. Click here to create one', 'avia_framework') . "</a></div>";
     } else {
         $inner .= "<div class='avia-element-label'>" . $this->config['name'] . "</div>";
         $inner .= AviaHtmlHelper::render_element($element);
         $inner .= "<a target='_blank' href='" . admin_url('admin.php?page=revslider') . "'>" . __('Edit Revolution Slider here', 'avia_framework') . "</a>";
     }
     $params['class'] = "av_sidebar";
     $params['content'] = NULL;
     $params['innerHtml'] = $inner;
     return $params;
 }