Example #1
0
function preview_block()
{
    ?>

	<div id="ac_preview" style="display:none;">

		<div class="preview_theme_select">
			<li class="selector-title"><?php 
    _e('Themes');
    ?>
</li>
			<?php 
    global $themes;
    foreach ($themes as $theme => $title) {
        echo '<li id="' . $theme . '" class="preview-theme">' . $title . '</li>';
    }
    if ($custom = get_option('archivesCalendarThemer')) {
        $i = 1;
        foreach ($custom as $filename => $css) {
            if ($css) {
                echo '<li id="' . $filename . '" class="preview-theme">' . __('Custom') . ' ' . $i . '</li>';
                $i++;
            }
        }
    }
    ?>
		</div>
		<div class="arcw-preview-container">
			<div class="arcw preview-zone">
				<?php 
    year_preview_html();
    month_preview_html();
    ?>
			</div>
			<p class="preview-note">
				<span
					class="description"><?php 
    _e("The theme's CSS file is not included in administration, this preview may be different from the website rendering.", 'arwloc');
    ?>
</span>
			</p>

			<div class="modal-buttons">
				<button class="button-primary ok_theme"><?php 
    _e('Select');
    ?>
</button>
				<button class="button cancel_theme"><?php 
    _e('Close');
    ?>
</button>
			</div>
		</div>
	</div>

	<?php 
}
Example #2
0
function archivesCalendar_themer()
{
    include 'admin/preview.php';
    $custom = get_option('archivesCalendarThemer');
    ?>
	<style id="arwprev">
		<?php 
    echo $custom['arw-theme1'];
    ?>
	</style>

	<div ng-app="calendarEditorApp" ng-controller="editorCtrl">
		<div id="post-body" class="metabox-holder columns-2">
			<div id="arcw-themer" class="tab active-tab">

				<div id="post-body-content">
					<div class="card new">
						<h2>Theme Editor</h2>
						<img id="themer-logo" src="<?php 
    echo plugins_url('', __FILE__);
    ?>
/admin/images/themer.png"
							 alt="ARCW Theme Editor"/>
						Simple UI to create your own theme for Archives Calendar Widget.<br/>
						<strong>No code knowledge needed.</strong>

						<p>
							<a href="http://arcw.alek.be" target="_blank"
							   class="button-primary button-big button-green">
								Open theme editor
							</a>
							<span>&nbsp; &nbsp;</span>
							<button id="import-theme" class="button-primary">Import Theme CSS</button>
							<input class="hidden" type="file" id="files" name="files" accept=".css"/>
							<br/>
							<span class="description">The editor is an external tool and will be opened a new tab/window.</span>
						</p>

					</div>

					<div id="theme-css-editor">
						<input id="tab-index" type="hidden" name="editor-tab" value="0"/>
                        <textarea class="hidden" name="archivesCalendarThemer[arw-theme1]"
								  id="codesource1"><?php 
    echo $custom['arw-theme1'];
    ?>
</textarea>
                        <textarea class="hidden" name="archivesCalendarThemer[arw-theme2]"
								  id="codesource2"><?php 
    echo $custom['arw-theme2'];
    ?>
</textarea>

						<h2 class="nav-tab-wrapper custom">
							<a href="#theme1" class="nav-tab nav-tab-active"><?php 
    _e('Theme');
    ?>
 1</a>
							<a href="#theme2" class="nav-tab"><?php 
    _e('Theme');
    ?>
 2</a>
						</h2>

						<div class="tabs">
							<div id="theme1" class="tab active-tab">

<pre id="editor1">
<?php 
    echo $custom['arw-theme1'];
    ?>
</pre>

							</div>
							<div id="theme2" class="tab">

<pre id="editor2">
<?php 
    echo $custom['arw-theme2'];
    ?>
</pre>

							</div>
						</div>
					</div>
				</div>

				<div id="postbox-container-1" class="postbox-container">
					<div class="col-wrap">

						<div class="arcw card">
							<h2><?php 
    _e('Preview', 'arwloc');
    ?>
</h2>
							<?php 
    year_preview_html();
    month_preview_html();
    ?>
						</div>

						<p>
							<input name="Submit" type="submit" class="button-primary"
								   value="<?php 
    _e('Save Changes');
    ?>
">
						</p>

					</div>
				</div>
			</div>
		</div>
	</div>

	<?php 
}