コード例 #1
0
ファイル: editor.importexport.php プロジェクト: taeche/SoDoEx
    function import_template()
    {
        ob_start();
        $fileOpts = new EditorFileOpts();
        $show_child_import = $fileOpts->file_exists() ? true : false;
        ?>
		
		<label class="checklist-label media" for="page_tpl_import">
			<div class="img"><input name="page_tpl_import" id="page_tpl_import" type="checkbox" checked /></div>
			<div class="bd">
				<div class="ttl"><?php 
        _e('Import Page Templates', 'pagelines');
        ?>
				</div>
				<p><?php 
        _e('Add new templates and overwrite ones with the same name.', 'pagelines');
        ?>
				</p>
			</div>
		</label>
		<label class="checklist-label media" for="global_import">
			<div class="img"><input name="global_import" id="global_import" type="checkbox" checked /></div>
			<div class="bd">
				<div class="ttl"><?php 
        _e('Import New Global Settings', 'pagelines');
        ?>
				</div>
				<p><?php 
        _e('Overwrite global settings with ones from this import.', 'pagelines');
        ?>
				</p>
			</div>
		</label>
		<label class="checklist-label media" for="type_import">
			<div class="img"><input name="type_import" id="type_import" type="checkbox" checked /></div>
			<div class="bd">
				<div class="ttl"><?php 
        _e('Import Post Type Settings', 'pagelines');
        ?>
				</div>
				<p><?php 
        _e('Overwrite post type settings with ones from this import.', 'pagelines');
        ?>
				</p>
			</div>
		</label>
		
	
	
		
		<label><?php 
        _e('DMS Config Import', 'pagelines');
        ?>
		</label>
		
		<span class="btn btn-success fileinput-button import-button">
	        <i class="icon icon-plus"></i>
	        <span><?php 
        _e('Select config file (.json)', 'pagelines');
        ?>
	        </span>
	        <!-- The file input field used as target for the file upload widget -->
	        <input id="fileupload" type="file" name="files[]" multiple>
	    </span>
	
	
		<?php 
        if ($show_child_import) {
            ?>

			<label><?php 
            _e('Child Theme Config Import', 'pagelines');
            ?>
			</label>

			<div class="child-import">
				<a href="#" data-action="reset_global_child" class="btn settings-action btn-warning"><i class="icon icon-download"></i> <?php 
            _e('Load Child Theme Config', 'pagelines');
            ?>
</a>

				<div class="help-block">
					<?php 
            _e('Reset theme settings using custom config file from child theme.<br />
					<strong>Note:</strong> Once you have completed this action, you may want to publish these changes to your live site.', 'pagelines');
            ?>
					
				</div>
			</div>
		<?php 
        }
        ?>
	
	
		<?php 
        return ob_get_clean();
    }
コード例 #2
0
 function reset_global_child($opts)
 {
     $fileOpts = new EditorFileOpts();
     if ($fileOpts->file_exists()) {
         $fileOpts->import($fileOpts->file_exists(), $opts);
     }
 }