/**
  *
  * @TODO document
  *
  */
 function __construct()
 {
     if (!VPRO && 'pagelines' == basename(pl_get_uri(false))) {
         update_option(PAGELINES_SETTINGS, pagelines_settings_defaults());
         update_option(PAGELINES_TEMPLATE_MAP, the_template_map());
     }
     /**
      * Insure the correct default logo is being displayed after import.
      */
     if (!VPRO && 'logo-platform.png' == basename(ploption('pagelines_custom_logo'))) {
         plupop('pagelines_custom_logo', PL_IMAGES . '/logo.png');
     }
     /**
      * Fix broken repeated excerpt problem on pagelines.com
      */
     if (!VPRO && 'pagelines' == basename(pl_get_uri(false))) {
         if (!isset($a['content_blog']) || true != $a['content_blog']) {
             plupop('content_blog', true);
         }
         if (!isset($a['content_blog']) || true == $a['excerpt_blog']) {
             plupop('excerpt_blog', false);
         }
         /**
          * Fix broken templates
          */
         $t = (array) get_option(PAGELINES_TEMPLATE_MAP, the_template_map());
         $s = (array) get_option(PAGELINES_SPECIAL);
         $t['main']['templates']['posts']['sections'] = array('PageLinesQuickSlider', 'PageLinesBoxes');
         $s['posts']['_pagelines_layout_mode'] = 'fullwidth';
         update_option(PAGELINES_SPECIAL, $s);
         update_option(PAGELINES_TEMPLATE_MAP, $t);
         plupop('pagelines_version', CORE_VERSION);
     }
     /**
      * Upgrade from Platform(pro) to PageLines and import settings.
      */
     $pagelines = get_option(PAGELINES_SETTINGS);
     $platform = get_option(PAGELINES_SETTINGS_LEGACY);
     if (is_array($pagelines)) {
         if (!isset($settings['pagelines_version'])) {
             plupop('pagelines_version', CORE_VERSION);
         }
         // were done.
         return;
     }
     if (is_array($platform)) {
         $this->upgrade($platform);
     }
 }
Beispiel #2
0
function get_unavailable_section_areas()
{
    $unavailable_section_areas = array();
    foreach (the_template_map() as $top_section_area) {
        if (isset($top_section_area['version']) && $top_section_area['version'] == 'pro') {
            $unavailable_section_areas[] = $top_section_area['name'];
        }
        if (isset($top_section_area['templates'])) {
            foreach ($top_section_area['templates'] as $section_area_template) {
                if (isset($section_area_template['version']) && $section_area_template['version'] == 'pro') {
                    $unavailable_section_areas[] = $section_area_template['name'];
                }
            }
        }
    }
    return $unavailable_section_areas;
}
Beispiel #3
0
 function reset_templates_to_default()
 {
     update_option('pagelines_template_map', the_template_map());
 }
Beispiel #4
0
	function reset_templates_to_default(){
		update_option('epanel_template_map', the_template_map());
	}
Beispiel #5
0
/**
 * 
 *
 *  Template Builder (Sections Drag & Drop)
 *
 *
 *  @package EPANEL_WP Core
 *  @subpackage Options
 *  @since 4.0
 *
 */
function _get_template_builder(){
	
		global $epanel_template;
		global $unavailable_section_areas;
		$dtoggle = (get_option('pl_section_desc_toggle')) ? get_option('pl_section_desc_toggle') : 'hide'; 
	?>
	<input type="hidden" value="<?php echo $dtoggle;?>" id="describe_toggle" class="describe_toggle" name="describe_toggle"  />	
	<div class="confirm_save">Template Configuration Saved!</div>
	<label for="tselect" class="tselect_label">Select Template Area</label>
	<select name="tselect" id="tselect" class="template_select" >
<?php 	foreach(the_template_map() as $hook => $hook_info):?>
	
	 <?php if(isset($hook_info['templates'])): ?>
		
				<optgroup label="<?php echo $hook_info['name'];?>" class="selectgroup_header">
			<?php foreach($hook_info['templates'] as $template => $tfield):
					if(!isset($tfield['version']) || ($tfield['version'] == 'pro' && VPRO)):
			?>				
						<option value="<?php echo $hook . '-' . $template;?>"><?php echo $tfield['name'];?></option>
				<?php endif;?>
				<?php endforeach;?>
				</optgroup>
			<?php else: ?>
		
		<?php 
				if(!isset($hook_info['version']) || ($hook_info['version'] == 'pro' && VPRO)):
?>
			<option value="<?php echo $hook;?>" <?php if($hook == 'default') echo 'selected="selected"';?>><?php echo $hook_info['name'];?></option>
<?php endif; ?>
			<?php endif;?>
		
	<?php endforeach;?>
	</select>
	<div class="the_template_builder">
		<?php 
		foreach($epanel_template->map as $hook_id => $hook_info){
			 if(isset($hook_info['templates'])){
				foreach($hook_info['templates'] as $template_id => $template_info ){
					$this->_sortable_section($template_id, $template_info, $hook_id, $hook_info);
				}
			} else {
				$this->_sortable_section($hook_id, $hook_info);
			}

		}?>
	</div>
	<?php 
	
}
 /**
  * Callback for resetting the options to default
  */
 function reset_templates_to_default()
 {
     update_option(PAGELINES_TEMPLATES, array());
     update_option(PAGELINES_TEMPLATE_MAP, the_template_map());
 }
    /**
     * 
     *
     *  Template Builder (Sections Drag & Drop)
     *
     *
     *  @package PageLines Core
     *  @subpackage Options
     *  @since 4.0
     *
     */
    function _get_template_builder()
    {
        global $pagelines_template;
        global $unavailable_section_areas;
        ?>
	<div class="confirm_save">Template Configuration Saved!</div>
	<label for="tselect" class="tselect_label">Select Template</label>
	<select name="tselect" id="tselect" class="template_select" >
<?php 
        foreach (the_template_map() as $hook => $hook_info) {
            ?>
	
	 <?php 
            if (isset($hook_info['templates'])) {
                ?>
		
				<optgroup label="<?php 
                echo $hook_info['name'];
                ?>
" class="selectgroup_header">
			<?php 
                foreach ($hook_info['templates'] as $template => $tfield) {
                    if (!isset($tfield['version']) || $tfield['version'] == 'pro' && VPRO) {
                        ?>
				
						<option value="<?php 
                        echo $hook . '-' . $template;
                        ?>
"><?php 
                        echo $tfield['name'];
                        ?>
</option>
				<?php 
                    }
                    ?>
				<?php 
                }
                ?>
				</optgroup>
			<?php 
            } else {
                ?>
		
		<?php 
                if (!isset($hook_info['version']) || $hook_info['version'] == 'pro' && VPRO) {
                    ?>
			<option value="<?php 
                    echo $hook;
                    ?>
" <?php 
                    if ($hook == 'default') {
                        echo 'selected="selected"';
                    }
                    ?>
><?php 
                    echo $hook_info['name'];
                    ?>
</option>
<?php 
                }
                ?>
			<?php 
            }
            ?>
		
	<?php 
        }
        ?>
	</select>
	<div class="the_template_builder">
		<?php 
        foreach ($pagelines_template->map as $hook_id => $hook_info) {
            if (isset($hook_info['templates'])) {
                foreach ($hook_info['templates'] as $template_id => $template_info) {
                    $this->_sortable_section($template_id, $template_info, $hook_id, $hook_info);
                }
            } else {
                $this->_sortable_section($hook_id, $hook_info);
            }
        }
        ?>
	</div>
	<?php 
    }