Exemplo n.º 1
0
/**
 * Display the composer panels in active editing mode
 *
 * @since 1.0
 */
function dslc_display_composer()
{
    global $dslc_active;
    $screen = get_current_screen();
    if ($screen->id != 'toplevel_page_livecomposer_editor') {
        return;
    }
    // Reset the query ( because some devs leave their queries non-reseted ).
    wp_reset_query();
    // Show the composer to users who are allowed to view it.
    // $dslc_active &&
    if (is_user_logged_in() && current_user_can(DS_LIVE_COMPOSER_CAPABILITY)) {
        $default_section = dslc_get_option('lc_default_opts_section', 'dslc_plugin_options_other');
        if (empty($default_section)) {
            $default_section = 'functionality';
        }
        ?>

			<div class="dslca-container dslca-state-off" data-post-id="<?php 
        echo $_GET['page_id'];
        ?>
">

				<div class="dslca-header dslc-clearfix" data-default-section="<?php 
        echo $default_section;
        ?>
">

					<!-- Currently Editing -->
					<span class="dslca-currently-editing"><span class="dslca-icon dslc-icon-info"></span>You Are Editing: <strong></strong></span>

					<!-- Tabs -->
					<a href="#" class="dslca-go-to-section-hook dslca-go-to-section-modules dslca-active" data-section=".dslca-modules"><span class="dslca-icon dslc-icon-th-large"></span></a>
					<a href="#" class="dslca-go-to-section-hook dslca-go-to-section-templates" data-section=".dslca-templates"><span class="dslca-icon dslc-icon-cloud"></span></a>

					<!-- Module Option filters -->
					<span class="dslca-options-filter-hook" data-section="functionality"><span class="dslca-icon dslc-icon-cog"></span> <?php 
        _e('Functionality', 'live-composer-page-builder');
        ?>
</span>
					<span class="dslca-options-filter-hook" data-section="styling"><span class="dslca-icon dslc-icon-tint"></span> <?php 
        _e('Styling', 'live-composer-page-builder');
        ?>
</span>
					<span class="dslca-options-filter-hook" data-section="responsive"><span class="dslca-icon dslc-icon-mobile-phone"></span> <?php 
        _e('Responsive', 'live-composer-page-builder');
        ?>
</span>

					<!-- Module Options Actions -->
					<div class="dslca-module-edit-actions">
						<a href="#" class="dslca-module-edit-save"><?php 
        _e('Confirm', 'live-composer-page-builder');
        ?>
</a>
						<a href="#" class="dslca-module-edit-cancel"><?php 
        _e('Cancel', 'live-composer-page-builder');
        ?>
</a>
					</div><!-- .dslca-module-edit-actions -->

					<!-- Row Options Filters -->
					<?php 
        /*
        <span class="dslca-row-options-filter-hook" data-section="styling"><span class="dslca-icon dslc-icon-tint"></span> <?php _e( 'STYLING', 'live-composer-page-builder' ); ?></span>
        <span class="dslca-row-options-filter-hook" data-section="responsive"><span class="dslca-icon dslc-icon-mobile-phone"></span> <?php _e( 'RESPONSIVE', 'live-composer-page-builder' ); ?></span>
        */
        ?>

					<!-- Row Options Actions -->
					<div class="dslca-row-edit-actions">
						<span class="dslca-row-edit-save"><?php 
        _e('Confirm', 'live-composer-page-builder');
        ?>
</span>
						<span class="dslca-row-edit-cancel"><?php 
        _e('Cancel', 'live-composer-page-builder');
        ?>
</span>
					</div><!-- .dslca-row-edit-actions -->

				</div><!-- .dslca-header -->

				<div class="dslca-actions">

					<!-- Save Composer -->
					<a href="#" class="dslca-save-composer dslca-save-composer-hook">
						<span class="dslca-save-composer-helptext"><?php 
        _e('Publish Changes', 'live-composer-page-builder');
        ?>
</span>
						<span class="dslca-save-composer-icon"><span class="dslca-icon dslc-icon-ok"></span></span>
					</a><!-- .dslca-save-composer -->

					<a href="#" class="dslca-save-draft-composer dslca-save-draft-composer-hook">
						<span class="dslca-save-draft-composer-helptext"><?php 
        _e('Save As Draft', 'live-composer-page-builder');
        ?>
</span>
						<span class="dslca-save-draft-composer-icon"><span class="dslca-icon dslc-icon-save"></span></span>
					</a><!-- .dslca-save-draft-composer -->

					<!-- Hide/Show -->
					<a href="#" class="dslca-show-composer-hook"><span class="dslca-icon dslc-icon-arrow-up"></span><?php 
        _e('Show Editor', 'live-composer-page-builder');
        ?>
</a>
					<a href="#" class="dslca-hide-composer-hook"><span class="dslca-icon dslc-icon-arrow-down"></span><?php 
        _e('Hide Editor', 'live-composer-page-builder');
        ?>
</a>

					<!-- Disable -->
					<a href="<?php 
        the_permalink($_GET['page_id']);
        ?>
" class="dslca-close-composer-hook"><span class="dslca-icon dslc-icon-remove"></span><?php 
        _e('Disable Editor', 'live-composer-page-builder');
        ?>
</a>

					<div class="dslc-clear"></div>

				</div><!-- .dslca-actions -->

				<div class="dslca-sections">

					<!-- Modules Listing -->
					<div class="dslca-section dslca-modules" data-bg="#4A7AC3">

						<div class="dslca-section-title">
							<div class="dslca-section-title-filter">
								<span class="dslca-section-title-filter-curr"><?php 
        _e('Elements', 'live-composer-page-builder');
        ?>
</span>
								<span class="dslca-icon dslc-icon-angle-up"></span>
								<div class="dslca-section-title-filter-options"></div>
							</div><!-- .dslca-section-title-filter -->
						</div><!-- .dslca-section-title -->

						<div class="dslca-section-scroller">
							<div class="dslca-section-scroller-inner">
								<div class="dslca-section-scroller-content">
									<?php 
        dslc_display_modules();
        ?>
								</div><!-- .dslca-section-scroller-content -->
							</div><!-- .dslca-section-scroller-inner -->
						</div><!-- .dslca-section-scroller-content -->

						<div class="dslca-section-scroller-fade"></div>

						<div class="dslca-section-scroller-nav">
							<a href="#" class="dslca-section-scroller-prev"><span class="dslca-icon dslc-icon-angle-left"></span></a>
							<a href="#" class="dslca-section-scroller-next"><span class="dslca-icon dslc-icon-angle-right"></span></a>
						</div><!-- .dslca-section-scroller -->

					</div><!-- .dslca-modules -->

					<!-- Module Edit -->

					<div class="dslca-section dslca-module-edit" data-bg="#5890e5">

						<form class="dslca-module-edit-form">
							<?php 
        do_action('dslc_options_prepend');
        ?>
							<div class="dslca-module-edit-options dslc-clearfix">
								<div class="dslca-module-edit-options-tabs dslc-clearfix"></div>
								<?php 
        /*
        <!-- Add clear styling button -->
        <span class="dslca-clear-styling-button">Clear Styling</span>
        */
        ?>

								<div class="dslca-module-edit-options-inner"></div>
							</div>
							<?php 
        do_action('dslc_options_append');
        ?>
						</form>

					</div><!-- .dslca-module-edit -->

					<!-- Module Section Edit -->

					<div class="dslca-section dslca-modules-section-edit" data-bg="#5890e5">
						<form class="dslca-modules-section-edit-form">
							<div class="dslca-modules-section-edit-options dslc-clearfix">
								<div class="dslca-modules-section-edit-options-inner">
									<div class="dslca-modules-section-edit-options-wrapper dslc-clearfix">

										<?php 
        dslc_row_display_options();
        ?>

									</div><!-- .dslca-modules-section-edit-options-wrapper -->
								</div><!-- .dslca-modules-section-edit-options-inner -->
							</div><!-- .dslca-modules-section-edit-options -->
						</form><!-- .dslca-modules-section-edit-form -->
					</div><!-- .dslca-module-section-edit -->

					<!-- Module Templates -->

					<div class="dslca-section dslca-templates dslc-clearfix">

						<div class="dslca-section-title">
							<?php 
        _e('Designs', 'live-composer-page-builder');
        ?>
						</div><!-- .dslca-section-title -->

						<a href="#" class="dslca-go-to-section-hook" data-section=".dslca-templates-load"><span class="dslca-icon dslc-icon-circle-arrow-down"></span><?php 
        _e('Load Page Design', 'live-composer-page-builder');
        ?>
</a>
						<a href="#" class="dslca-open-modal-hook" data-modal=".dslca-modal-templates-save"><span class="dslca-icon dslc-icon-save"></span><?php 
        _e('Save Page Design', 'live-composer-page-builder');
        ?>
</a>
						<a href="#" class="dslca-open-modal-hook" data-modal=".dslca-modal-templates-import"><span class="dslca-icon dslc-icon-download-alt"></span><?php 
        _e('Import Page Code', 'live-composer-page-builder');
        ?>
</a>
						<a href="#" class="dslca-open-modal-hook" data-modal=".dslca-modal-templates-export"><span class="dslca-icon dslc-icon-upload-alt"></span><?php 
        _e('Export Page Code', 'live-composer-page-builder');
        ?>
</a>

						<div class="dslca-modal dslca-modal-templates-save">

							<form class="dslca-template-save-form">
								<input type="text" id="dslca-save-template-title" placeholder="<?php 
        _e('Name of the template', 'live-composer-page-builder');
        ?>
">
								<span class="dslca-submit"><?php 
        _e('Save', 'live-composer-page-builder');
        ?>
</span>
								<span class="dslca-cancel dslca-close-modal-hook" data-modal=".dslca-modal-templates-save"><?php 
        _e('Cancel', 'live-composer-page-builder');
        ?>
</span>
							</form>

						</div><!-- .dslca-modal -->

						<div class="dslca-modal dslca-modal-templates-export">

							<form class="dslca-template-export-form">
								<textarea id="dslca-export-code"></textarea>
								<span class="dslca-cancel dslca-close-modal-hook" data-modal=".dslca-modal-templates-export"><?php 
        _e('Close', 'live-composer-page-builder');
        ?>
</span>
							</form>

						</div><!-- .dslca-modal -->

						<div class="dslca-modal dslca-modal-templates-import">

							<form class="dslca-template-import-form">
								<textarea id="dslca-import-code" placeholder="<?php 
        _e('Enter the exported code heree', 'live-composer-page-builder');
        ?>
"></textarea>
								<span class="dslca-submit">
									<span class="dslca-modal-title"><?php 
        _e('Import', 'live-composer-page-builder');
        ?>
</span>
									<div class="dslca-loading followingBallsGWrap">
										<div class="followingBallsG_1 followingBallsG"></div>
										<div class="followingBallsG_2 followingBallsG"></div>
										<div class="followingBallsG_3 followingBallsG"></div>
										<div class="followingBallsG_4 followingBallsG"></div>
									</div>
								</span>
								<span class="dslca-cancel dslca-close-modal-hook" data-modal=".dslca-modal-templates-import"><?php 
        _e('Cancel', 'live-composer-page-builder');
        ?>
</span>
							</form>

						</div><!-- .dslca-modal -->

					</div><!-- .dslca-section-templates -->

					<!-- Module Template Load -->

					<div class="dslca-section dslca-templates-load dslc-clearfix">

						<a href="#" class="dslca-go-to-section-hook dslca-section-back" data-section=".dslca-templates"><span class="dslca-icon dslc-icon-reply"></span></a>

						<div class="dslca-section-title">
							<div class="dslca-section-title-filter">
								<span class="dslca-section-title-filter-curr"><?php 
        _e('All Templates', 'live-composer-page-builder');
        ?>
</span>
								<span class="dslca-icon dslc-icon-angle-up"></span>
								<div class="dslca-section-title-filter-options"></div>
							</div><!-- .dslca-section-title-filter -->
						</div><!-- .dslca-section-title -->

						<div class="dslca-section-scroller">
							<div class="dslca-section-scroller-inner">
								<div class="dslca-section-scroller-content">
									<?php 
        dslc_display_templates();
        ?>
								</div>
							</div>
						</div>

						<div class="dslca-section-scroller-nav">
							<a href="#" class="dslca-section-scroller-prev"><span class="dslca-icon dslc-icon-angle-left"></span></a>
							<a href="#" class="dslca-section-scroller-next"><span class="dslca-icon dslc-icon-angle-right"></span></a>
						</div><!-- .dslca-section-scroller -->

					</div><!-- .dslca-templates-load -->

				</div><!-- .dslca-sections -->

				<!-- Module Template Export -->
				<textarea id="dslca-code"></textarea>
				<textarea id="dslca-content-for-search"></textarea>

				<div class="dslca-container-loader">
					<div class="dslca-container-loader-inner followingBallsGWrap">
						<div class="followingBallsG_1 followingBallsG"></div>
						<div class="followingBallsG_2 followingBallsG"></div>
						<div class="followingBallsG_3 followingBallsG"></div>
						<div class="followingBallsG_4 followingBallsG"></div>
					</div>
				</div>

			</div><!-- .dscla-container -->

			<div class="dslca-prompt-modal">

				<div class="dslca-prompt-modal-content">

					<div class="dslca-prompt-modal-msg">

						Message goes here

					</div><!-- .dslca-prompt-modal-msg -->

					<div class="dslca-prompt-modal-actions">

						<a href="#" class="dslca-prompt-modal-confirm-hook"><span class="dslc-icon dslc-icon-ok"></span><?php 
        _e('Confirm', 'live-composer-page-builder');
        ?>
</a>
						<a href="#" class="dslca-prompt-modal-cancel-hook"><span class="dslc-icon dslc-icon-remove"></span><?php 
        _e('Cancel', 'live-composer-page-builder');
        ?>
</a>

					</div>

				</div><!-- .dslca-prompt-modal-content -->

			</div><!-- .dslca-prompt-modal -->

			<div class="dslca-module-edit-field-icon-ttip">
				<?php 
        echo __('Icons used by default are from "Font Awesome" set.', 'live-composer-page-builder') . '<br>' . '<a href="https://livecomposerplugin.com/downloads/linecons-icons-add-on/?utm_source=lc-ui&utm_medium=module-options&utm_campaign=more_icons" class="dslca-link" target="_blank">You can add more icons.</a>';
        ?>
				<span class="dslca-module-edit-field-ttip-close"><span class="dslc-icon dslc-icon-remove"></span></span>
			</div>

			<div class="dslca-module-edit-field-ttip">
				<span class="dslca-module-edit-field-ttip-close"><span class="dslc-icon dslc-icon-remove"></span></span>
				<div class="dslca-module-edit-field-ttip-inner"></div>
			</div>

			<div class="dslca-module-edit-field-icon-switch-sets">
				<?php 
        global $dslc_var_icons;
        foreach ($dslc_var_icons as $key => $value) {
            ?>
<span data-set="<?php 
            echo $key;
            ?>
"><?php 
            echo $key;
            ?>
</span><?php 
        }
        ?>
			</div>

			<div class="dslca-invisible-overlay"></div>

		<?php 
    }
}
/**
 * Display the composer
 *
 * @since 1.0
 */
function dslc_display_composer()
{
    global $dslc_active;
    // Reset the query ( because some devs leave their queries non-reseted )
    wp_reset_query();
    // Show the composer to users who are allowed to view it
    if ($dslc_active && is_user_logged_in() && current_user_can(DS_LIVE_COMPOSER_CAPABILITY)) {
        $default_section = dslc_get_option('lc_default_opts_section', 'dslc_plugin_options_other');
        if (empty($default_section)) {
            $default_section = 'functionality';
        }
        ?>

			<div class="dslca-container dslca-state-off" data-post-id="<?php 
        the_ID();
        ?>
">

				<div class="dslca-header dslc-clearfix" data-default-section="<?php 
        echo $default_section;
        ?>
">

					<!-- Currently Editing -->
					<span class="dslca-currently-editing"><span class="dslca-icon dslc-icon-info"></span>Currently Editing: <strong></strong></span>

					<!-- Tabs -->
					<span class="dslca-go-to-section-hook dslca-go-to-section-modules dslca-active" data-section=".dslca-modules"><span class="dslca-icon dslc-icon-list"></span></span>
					<span class="dslca-go-to-section-hook dslca-go-to-section-templates" data-section=".dslca-templates"><span class="dslca-icon dslc-icon-bookmark"></span></span>

					<!-- Module Option filters -->
					<span class="dslca-options-filter-hook" data-section="functionality"><span class="dslca-icon dslc-icon-cog"></span> <?php 
        _e('FUNCTIONALITY', 'live-composer-page-builder');
        ?>
</span>
					<span class="dslca-options-filter-hook" data-section="styling"><span class="dslca-icon dslc-icon-tint"></span> <?php 
        _e('STYLING', 'live-composer-page-builder');
        ?>
</span>
					<span class="dslca-options-filter-hook" data-section="responsive"><span class="dslca-icon dslc-icon-mobile-phone"></span> <?php 
        _e('RESPONSIVE', 'live-composer-page-builder');
        ?>
</span>

					<!-- Module Options Actions -->
					<div class="dslca-module-edit-actions">
						<span class="dslca-module-edit-save"><?php 
        _e('CONFIRM', 'live-composer-page-builder');
        ?>
</span>
						<span class="dslca-module-edit-cancel"><?php 
        _e('CANCEL', 'live-composer-page-builder');
        ?>
</span>
					</div><!-- .dslca-module-edit-actions -->

					<!-- Row Options Filters -->
					<?php 
        /*
        <span class="dslca-row-options-filter-hook" data-section="styling"><span class="dslca-icon dslc-icon-tint"></span> <?php _e( 'STYLING', 'live-composer-page-builder' ); ?></span>
        <span class="dslca-row-options-filter-hook" data-section="responsive"><span class="dslca-icon dslc-icon-mobile-phone"></span> <?php _e( 'RESPONSIVE', 'live-composer-page-builder' ); ?></span>
        */
        ?>

					<!-- Row Options Actions -->
					<div class="dslca-row-edit-actions">
						<span class="dslca-row-edit-save"><?php 
        _e('CONFIRM', 'live-composer-page-builder');
        ?>
</span>
						<span class="dslca-row-edit-cancel"><?php 
        _e('CANCEL', 'live-composer-page-builder');
        ?>
</span>
					</div><!-- .dslca-row-edit-actions -->

				</div><!-- .dslca-header -->

				<div class="dslca-actions">

					<!-- Save Composer -->
					<div class="dslca-save-composer dslca-save-composer-hook">
						<span class="dslca-save-composer-helptext"><?php 
        _e('PUBLISH CHANGES', 'live-composer-page-builder');
        ?>
</span>
						<span class="dslca-save-composer-icon"><span class="dslca-icon dslc-icon-ok"></span></span>
					</div><!-- .dslca-save-composer -->

					<div class="dslca-save-draft-composer dslca-save-draft-composer-hook">
						<span class="dslca-save-draft-composer-helptext"><?php 
        _e('SAVE AS DRAFT', 'live-composer-page-builder');
        ?>
</span>
						<span class="dslca-save-draft-composer-icon"><span class="dslca-icon dslc-icon-save"></span></span>
					</div><!-- .dslca-save-draft-composer -->

					<!-- Hide/Show -->
					<span class="dslca-show-composer-hook"><span class="dslca-icon dslc-icon-arrow-up"></span><?php 
        _e('SHOW EDITOR', 'live-composer-page-builder');
        ?>
</span>
					<span class="dslca-hide-composer-hook"><span class="dslca-icon dslc-icon-arrow-down"></span><?php 
        _e('HIDE EDITOR', 'live-composer-page-builder');
        ?>
</span>

					<!-- Disable -->
					<a href="<?php 
        the_permalink();
        ?>
" class="dslca-close-composer-hook"><span class="dslca-icon dslc-icon-remove"></span><?php 
        _e('DISABLE EDITOR', 'live-composer-page-builder');
        ?>
</a>

					<div class="dslc-clear"></div>

				</div><!-- .dslca-actions -->

				<div class="dslca-sections">

					<!-- Modules Listing -->
					<div class="dslca-section dslca-modules" data-bg="#5890e5">

						<div class="dslca-section-title">
							<div class="dslca-section-title-filter">
								<span class="dslca-section-title-filter-curr"><?php 
        _e('ALL MODULES', 'live-composer-page-builder');
        ?>
</span>
								<span class="dslca-icon dslc-icon-angle-up"></span>
								<div class="dslca-section-title-filter-options"></div>
							</div><!-- .dslca-section-title-filter -->
						</div><!-- .dslca-section-title -->

						<div class="dslca-section-scroller">
							<div class="dslca-section-scroller-inner">
								<div class="dslca-section-scroller-content">
									<?php 
        dslc_display_modules();
        ?>
								</div><!-- .dslca-section-scroller-content -->
							</div><!-- .dslca-section-scroller-inner -->
						</div><!-- .dslca-section-scroller-content -->

						<div class="dslca-section-scroller-fade"></div>

						<div class="dslca-section-scroller-nav">
							<a href="#" class="dslca-section-scroller-prev"><span class="dslca-icon dslc-icon-angle-left"></span></a>
							<a href="#" class="dslca-section-scroller-next"><span class="dslca-icon dslc-icon-angle-right"></span></a>
						</div><!-- .dslca-section-scroller -->

					</div><!-- .dslca-modules -->

					<!-- Module Edit -->

					<div class="dslca-section dslca-module-edit" data-bg="#5890e5">

						<form class="dslca-module-edit-form">
							<?php 
        do_action('dslc_options_prepend');
        ?>
							<div class="dslca-module-edit-options dslc-clearfix">
								<div class="dslca-module-edit-options-tabs"></div>
								<div class="dslca-module-edit-options-inner"></div>
							</div>
							<?php 
        do_action('dslc_options_append');
        ?>
						</form>

					</div><!-- .dslca-module-edit -->

					<!-- Module Section Edit -->

					<div class="dslca-section dslca-modules-section-edit" data-bg="#5890e5">

						<form class="dslca-modules-section-edit-form">

							<div class="dslca-modules-section-edit-options dslc-clearfix">

								<div class="dslca-modules-section-edit-options-inner">

									<div class="dslca-modules-section-edit-options-wrapper dslc-clearfix">

										<?php 
        dslc_row_display_options();
        ?>

									</div><!-- .dslca-modules-section-edit-options-wrapper -->

								</div><!-- .dslca-modules-section-edit-options-inner -->

							</div><!-- .dslca-modules-section-edit-options -->

						</form><!-- .dslca-modules-section-edit-form -->

					</div><!-- .dslca-module-section-edit -->

					<!-- Module Templates -->

					<div class="dslca-section dslca-templates dslc-clearfix" data-bg="#ca564f">

						<div class="dslca-section-title">
							<?php 
        _e('TEMPLATES', 'live-composer-page-builder');
        ?>
						</div><!-- .dslca-section-title -->

						<span class="dslca-go-to-section-hook" data-section=".dslca-templates-load"><span class="dslca-icon dslc-icon-circle-arrow-down"></span><?php 
        _e('Load', 'live-composer-page-builder');
        ?>
</span>
						<span class="dslca-open-modal-hook" data-modal=".dslca-modal-templates-save"><span class="dslca-icon dslc-icon-save"></span><?php 
        _e('Save', 'live-composer-page-builder');
        ?>
</span>
						<span class="dslca-open-modal-hook" data-modal=".dslca-modal-templates-import"><span class="dslca-icon dslc-icon-download-alt"></span><?php 
        _e('Import', 'live-composer-page-builder');
        ?>
</span>
						<span class="dslca-open-modal-hook" data-modal=".dslca-modal-templates-export"><span class="dslca-icon dslc-icon-upload-alt"></span><?php 
        _e('Export', 'live-composer-page-builder');
        ?>
</span>

						<div class="dslca-modal dslca-modal-templates-save" data-bg="#ca564f">

							<form class="dslca-template-save-form">
								<input type="text" id="dslca-save-template-title" placeholder="<?php 
        _e('Name of the template', 'live-composer-page-builder');
        ?>
">
								<span class="dslca-submit"><?php 
        _e('SAVE', 'live-composer-page-builder');
        ?>
</span>
								<span class="dslca-cancel dslca-close-modal-hook" data-modal=".dslca-modal-templates-save"><?php 
        _e('CANCEL', 'live-composer-page-builder');
        ?>
</span>
							</form>

						</div><!-- .dslca-modal -->

						<div class="dslca-modal dslca-modal-templates-export" data-bg="#ca564f">

							<form class="dslca-template-export-form">
								<textarea id="dslca-export-code"></textarea>
								<span class="dslca-cancel dslca-close-modal-hook" data-modal=".dslca-modal-templates-export"><?php 
        _e('CLOSE', 'live-composer-page-builder');
        ?>
</span>
							</form>

						</div><!-- .dslca-modal -->

						<div class="dslca-modal dslca-modal-templates-import" data-bg="#ca564f">

							<form class="dslca-template-import-form">
								<textarea id="dslca-import-code" placeholder="<?php 
        _e('Enter the exported code heree', 'live-composer-page-builder');
        ?>
"></textarea>
								<span class="dslca-submit">
									<span class="dslca-modal-title"><?php 
        _e('IMPORT', 'live-composer-page-builder');
        ?>
</span>
									<div class="dslca-loading followingBallsGWrap">
										<div class="followingBallsG_1 followingBallsG"></div>
										<div class="followingBallsG_2 followingBallsG"></div>
										<div class="followingBallsG_3 followingBallsG"></div>
										<div class="followingBallsG_4 followingBallsG"></div>
									</div>
								</span>
								<span class="dslca-cancel dslca-close-modal-hook" data-modal=".dslca-modal-templates-import"><?php 
        _e('CANCEL', 'live-composer-page-builder');
        ?>
</span>
							</form>

						</div><!-- .dslca-modal -->

					</div><!-- .dslca-section-templates -->

					<!-- Module Template Load -->

					<div class="dslca-section dslca-templates-load dslc-clearfix" data-bg="#ca564f">

						<span class="dslca-go-to-section-hook dslca-section-back" data-section=".dslca-templates"><span class="dslca-icon dslc-icon-reply"></span></span>

						<div class="dslca-section-title">
							<div class="dslca-section-title-filter">
								<span class="dslca-section-title-filter-curr"><?php 
        _e('ALL TEMPLATES', 'live-composer-page-builder');
        ?>
</span>
								<span class="dslca-icon dslc-icon-angle-up"></span>
								<div class="dslca-section-title-filter-options"></div>
							</div><!-- .dslca-section-title-filter -->
						</div><!-- .dslca-section-title -->

						<div class="dslca-section-scroller">
							<div class="dslca-section-scroller-inner">
								<div class="dslca-section-scroller-content">
									<?php 
        dslc_display_templates();
        ?>
								</div>
							</div>
						</div>

						<div class="dslca-section-scroller-nav">
							<span class="dslca-section-scroller-prev"><span class="dslca-icon dslc-icon-angle-left"></span></span>
							<span class="dslca-section-scroller-next"><span class="dslca-icon dslc-icon-angle-right"></span></span>
						</div><!-- .dslca-section-scroller -->

					</div><!-- .dslca-templates-load -->

				</div><!-- .dslca-sections -->

				<!-- Module Template Export -->

				<textarea id="dslca-code"></textarea>
				<div class="dslca-module-options-front-backup"></div>

				<div class="dslca-container-loader">
					<div class="dslca-container-loader-inner followingBallsGWrap">
						<div class="followingBallsG_1 followingBallsG"></div>
						<div class="followingBallsG_2 followingBallsG"></div>
						<div class="followingBallsG_3 followingBallsG"></div>
						<div class="followingBallsG_4 followingBallsG"></div>
					</div>
				</div>

			</div><!-- .dscla-container -->

			<div class="dslca-prompt-modal">

				<div class="dslca-prompt-modal-content">

					<div class="dslca-prompt-modal-msg">

						Message goes here

					</div><!-- .dslca-prompt-modal-msg -->

					<div class="dslca-prompt-modal-actions">

						<a href="#" class="dslca-prompt-modal-confirm-hook"><span class="dslc-icon dslc-icon-ok"></span><?php 
        _e('Confirm', 'live-composer-page-builder');
        ?>
</a>
						<span class="dslca-prompt-modal-cancel-hook"><span class="dslc-icon dslc-icon-remove"></span><?php 
        _e('Cancel', 'live-composer-page-builder');
        ?>
</span>

					</div>

				</div><!-- .dslca-prompt-modal-content -->

			</div><!-- .dslca-prompt-modal -->

			<div class="dslca-module-edit-field-icon-ttip">
				<?php 
        _e('Icons used in this plugin are from "Font Awesome".<br><a href="http://livecomposerplugin.com/icons-listing/" class="dslca-link" target="_blank">View full list of icons.</a>', 'live-composer-page-builder');
        ?>
				<span class="dslca-module-edit-field-ttip-close"><span class="dslc-icon dslc-icon-remove"></span></span>
			</div>

			<div class="dslca-module-edit-field-ttip">
				<span class="dslca-module-edit-field-ttip-close"><span class="dslc-icon dslc-icon-remove"></span></span>
				<div class="dslca-module-edit-field-ttip-inner"></div>
			</div>

			<div class="dslca-module-edit-field-icon-switch-sets">
				<?php 
        global $dslc_var_icons;
        foreach ($dslc_var_icons as $key => $value) {
            ?>
<span data-set="<?php 
            echo $key;
            ?>
"><?php 
            echo $key;
            ?>
</span><?php 
        }
        ?>
			</div>

			<div class="dslca-invisible-overlay"></div>

		<?php 
    }
    global $dslc_var_templates_pt;
    // Get the position of the activation button
    $activate_button_position = dslc_get_option('lc_module_activate_button_pos', 'dslc_plugin_options_other');
    if (empty($activate_button_position)) {
        $activate_button_position = 'right';
    }
    // LC and WP Customizer do not work well together, don't proceed if customizer active
    if (!function_exists('is_customize_preview') || !is_customize_preview()) {
        // If editor not active and user can access the editor
        if (!DS_LIVE_COMPOSER_ACTIVE && is_user_logged_in() && current_user_can(DS_LIVE_COMPOSER_CAPABILITY)) {
            // If a singular page ( posts and pages )
            if (is_singular()) {
                // If a page or a template go ahead normally
                if (is_page() || get_post_type() == 'dslc_templates' || !isset($dslc_var_templates_pt[get_post_type()])) {
                    ?>
<a href="<?php 
                    echo add_query_arg(array('dslc' => 'active'), get_permalink());
                    ?>
" class="dslca-activate-composer-hook dslca-position-<?php 
                    echo $activate_button_position;
                    ?>
"><?php 
                    _e('ACTIVATE EDITOR', 'live-composer-page-builder');
                    ?>
</a><?php 
                    // If not a page or a template post type
                } else {
                    // Check if it has a template attached to it
                    $template = dslc_st_get_template_ID(get_the_ID());
                    if ($template) {
                        ?>
<a target="_blank" href="<?php 
                        echo add_query_arg(array('dslc' => 'active'), get_permalink($template));
                        ?>
" class="dslca-activate-composer-hook"><?php 
                        _e('EDIT TEMPLATE', 'live-composer-page-builder');
                        ?>
</a><?php 
                    } else {
                        ?>
<a target="_blank" href="<?php 
                        echo admin_url('post-new.php?post_type=dslc_templates');
                        ?>
" class="dslca-activate-composer-hook"><?php 
                        _e('CREATE TEMPLATE', 'live-composer-page-builder');
                        ?>
</a><?php 
                    }
                }
                // If a 404 page
            } elseif (is_404()) {
                // Get ID of the page set to power the 404 page
                $template_ID = dslc_get_option('404_page', 'dslc_plugin_options_archives');
                // If there is a page that powers it
                if ($template_ID != 'none') {
                    // Output the button
                    ?>
<a href="<?php 
                    echo add_query_arg(array('dslc' => 'active'), get_permalink($template_ID));
                    ?>
" class="dslca-activate-composer-hook dslca-position-<?php 
                    echo $activate_button_position;
                    ?>
"><?php 
                    _e('ACTIVATE EDITOR', 'live-composer-page-builder');
                    ?>
</a><?php 
                }
                // If a search results page
            } elseif (is_search()) {
                // Get ID of the page set to power the search results page
                $template_ID = dslc_get_option('search_results', 'dslc_plugin_options_archives');
                // If there is a page that powers it
                if ($template_ID != 'none') {
                    // Output the button
                    ?>
<a href="<?php 
                    echo add_query_arg(array('dslc' => 'active'), get_permalink($template_ID));
                    ?>
" class="dslca-activate-composer-hook dslca-position-<?php 
                    echo $activate_button_position;
                    ?>
"><?php 
                    _e('ACTIVATE EDITOR', 'live-composer-page-builder');
                    ?>
</a><?php 
                }
                // If authors archives page
            } elseif (is_author()) {
                // Get ID of the page set to power the author archives
                $template_ID = dslc_get_option('author', 'dslc_plugin_options_archives');
                // If there is a page that powers it
                if ($template_ID != 'none') {
                    // Output the button
                    ?>
<a href="<?php 
                    echo add_query_arg(array('dslc' => 'active'), get_permalink($template_ID));
                    ?>
" class="dslca-activate-composer-hook dslca-position-<?php 
                    echo $activate_button_position;
                    ?>
"><?php 
                    _e('ACTIVATE EDITOR', 'live-composer-page-builder');
                    ?>
</a><?php 
                }
                // If other archives ( not author )
            } elseif (is_archive()) {
                // Get ID of the page set to power the archives of the shown post type
                $template_ID = dslc_get_option(get_post_type(), 'dslc_plugin_options_archives');
                // If there is a page that powers it
                if ($template_ID != 'none') {
                    // Output the button
                    ?>
<a href="<?php 
                    echo add_query_arg(array('dslc' => 'active'), get_permalink($template_ID));
                    ?>
" class="dslca-activate-composer-hook dslca-position-<?php 
                    echo $activate_button_position;
                    ?>
"><?php 
                    _e('ACTIVATE EDITOR', 'live-composer-page-builder');
                    ?>
</a><?php 
                }
            }
        }
    }
}
Exemplo n.º 3
0
/**
 * Display the composer
 *
 * @since 1.0
 */
function dslc_display_composer()
{
    global $dslc_active;
    // Reset the query ( because some devs leave their queries non-reseted )
    wp_reset_query();
    // Show the composer to users who are allowed to view it
    if ($dslc_active && is_user_logged_in() && current_user_can(DS_LIVE_COMPOSER_CAPABILITY)) {
        $default_section = dslc_get_option('lc_default_opts_section', 'dslc_plugin_options_other');
        if (empty($default_section)) {
            $default_section = 'functionality';
        }
        ?>

			<div class="dslca-container dslca-state-off" data-post-id="<?php 
        the_ID();
        ?>
">

				<div class="dslca-header dslc-clearfix" data-default-section="<?php 
        echo $default_section;
        ?>
">
					
					<!-- Tabs -->
					<span class="dslca-go-to-section-hook dslca-go-to-section-modules dslca-active" data-section=".dslca-modules"><span class="dslca-icon dslc-icon-list"></span></span>
					<span class="dslca-go-to-section-hook dslca-go-to-section-templates" data-section=".dslca-templates"><span class="dslca-icon dslc-icon-bookmark"></span></span>
					
					<!-- Option filters -->
					<span class="dslca-options-filter-hook" data-section="functionality"><span class="dslca-icon dslc-icon-cog"></span> <?php 
        _e('FUNCTIONALITY', 'dslc_string');
        ?>
</span>
					<span class="dslca-options-filter-hook" data-section="styling"><span class="dslca-icon dslc-icon-tint"></span> <?php 
        _e('STYLING', 'dslc_string');
        ?>
</span>
					<span class="dslca-options-filter-hook" data-section="responsive"><span class="dslca-icon dslc-icon-mobile-phone"></span> <?php 
        _e('RESPONSIVE', 'dslc_string');
        ?>
</span>

					<div class="dslca-module-edit-actions">
						<span class="dslca-module-edit-save"><?php 
        _e('CONFIRM', 'dslc_string');
        ?>
</span>
						<span class="dslca-module-edit-cancel"><?php 
        _e('CANCEL', 'dslc_string');
        ?>
</span>
					</div><!-- .dslca-module-edit-actions -->

				</div><!-- .dslca-header -->

				<div class="dslca-actions">

					<!-- Save Composer -->
					<div class="dslca-save-composer dslca-save-composer-hook">
						<span class="dslca-save-composer-helptext"><?php 
        _e('PUBLISH CHANGES', 'dslc_string');
        ?>
</span>
						<span class="dslca-save-composer-icon"><span class="dslca-icon dslc-icon-ok"></span></span>
					</div><!-- .dslca-save-composer -->

					<!-- Hide/Show -->
					<span class="dslca-show-composer-hook"><span class="dslca-icon dslc-icon-arrow-up"></span><?php 
        _e('SHOW EDITOR', 'dslc_string');
        ?>
</span>
					<span class="dslca-hide-composer-hook"><span class="dslca-icon dslc-icon-arrow-down"></span><?php 
        _e('HIDE EDITOR', 'dslc_string');
        ?>
</span>

					<!-- Disable -->
					<a href="<?php 
        the_permalink();
        ?>
" class="dslca-close-composer-hook"><span class="dslca-icon dslc-icon-remove"></span><?php 
        _e('DISABLE EDITOR', 'dslc_string');
        ?>
</a>

					<div class="dslc-clear"></div>

				</div><!-- .dslca-actions -->

				<div class="dslca-sections">

					<!-- Modules Listing -->
					<div class="dslca-section dslca-modules" data-bg="#5890e5">
						
						<div class="dslca-section-title">
							<div class="dslca-section-title-filter">
								<span class="dslca-section-title-filter-curr"><?php 
        _e('ALL MODULES', 'dslc_string');
        ?>
</span>
								<span class="dslca-icon dslc-icon-angle-up"></span>
								<div class="dslca-section-title-filter-options"></div>
							</div><!-- .dslca-section-title-filter -->
						</div><!-- .dslca-section-title -->

						<div class="dslca-section-scroller">
							<div class="dslca-section-scroller-inner">
								<div class="dslca-section-scroller-content">
									<?php 
        dslc_display_modules();
        ?>
								</div><!-- .dslca-section-scroller-content -->
							</div><!-- .dslca-section-scroller-inner -->
						</div><!-- .dslca-section-scroller-content -->
						
						<div class="dslca-section-scroller-fade"></div>

						<div class="dslca-section-scroller-nav">
							<a href="#" class="dslca-section-scroller-prev"><span class="dslca-icon dslc-icon-angle-left"></span></a>
							<a href="#" class="dslca-section-scroller-next"><span class="dslca-icon dslc-icon-angle-right"></span></a>
						</div><!-- .dslca-section-scroller -->

					</div><!-- .dslca-modules -->

					<!-- Module Edit -->
					
					<div class="dslca-section dslca-module-edit" data-bg="#5890e5">

						<form class="dslca-module-edit-form">
							<?php 
        do_action('dslc_options_prepend');
        ?>
							<div class="dslca-module-edit-options dslc-clearfix"></div>
							<?php 
        do_action('dslc_options_append');
        ?>
						</form>

					</div><!-- .dslca-module-edit -->

					<!-- Module Section Edit -->

					<div class="dslca-section dslca-modules-section-edit" data-bg="#5890e5">

						<form class="dslca-modules-section-edit-form">

							<div class="dslca-modules-section-edit-options dslc-clearfix">

								<div class="dslca-modules-section-edit-options-inner">
										
									<div class="dslca-modules-section-edit-options-wrapper dslc-clearfix">

										<?php 
        dslc_row_display_options();
        ?>

									</div><!-- .dslca-modules-section-edit-options-wrapper -->

								</div><!-- .dslca-modules-section-edit-options-inner -->

							</div><!-- .dslca-modules-section-edit-options -->

						</form><!-- .dslca-modules-section-edit-form -->

					</div><!-- .dslca-module-section-edit -->

					<!-- Module Templates -->

					<div class="dslca-section dslca-templates dslc-clearfix" data-bg="#ca564f">
						
						<div class="dslca-section-title">
							<?php 
        _e('TEMPLATES', 'dslc_string');
        ?>
						</div><!-- .dslca-section-title -->
						
						<span class="dslca-go-to-section-hook" data-section=".dslca-templates-load"><span class="dslca-icon dslc-icon-circle-arrow-down"></span><?php 
        _e('Load', 'dslc_string');
        ?>
</span>
						<span class="dslca-open-modal-hook" data-modal=".dslca-modal-templates-save"><span class="dslca-icon dslc-icon-save"></span><?php 
        _e('Save', 'dslc_string');
        ?>
</span>
						<span class="dslca-open-modal-hook" data-modal=".dslca-modal-templates-import"><span class="dslca-icon dslc-icon-download-alt"></span><?php 
        _e('Import', 'dslc_string');
        ?>
</span>
						<span class="dslca-open-modal-hook" data-modal=".dslca-modal-templates-export"><span class="dslca-icon dslc-icon-upload-alt"></span><?php 
        _e('Export', 'dslc_string');
        ?>
</span>

						<div class="dslca-modal dslca-modal-templates-save" data-bg="#ca564f">
							
							<form class="dslca-template-save-form">
								<input type="text" id="dslca-save-template-title" placeholder="<?php 
        _e('Name of the template', 'dslc_string');
        ?>
">
								<span class="dslca-submit"><?php 
        _e('SAVE', 'dslc_string');
        ?>
</span>
								<span class="dslca-cancel dslca-close-modal-hook" data-modal=".dslca-modal-templates-save"><?php 
        _e('CANCEL', 'dslc_string');
        ?>
</span>
							</form>

						</div><!-- .dslca-modal -->

						<div class="dslca-modal dslca-modal-templates-export" data-bg="#ca564f">

							<form class="dslca-template-export-form">
								<textarea id="dslca-export-code"></textarea>
								<span class="dslca-cancel dslca-close-modal-hook" data-modal=".dslca-modal-templates-export"><?php 
        _e('CLOSE', 'dslc_string');
        ?>
</span>
							</form>

						</div><!-- .dslca-modal -->

						<div class="dslca-modal dslca-modal-templates-import" data-bg="#ca564f">
							
							<form class="dslca-template-import-form">
								<textarea id="dslca-import-code" placeholder="<?php 
        _e('Enter the exported code heree', 'dslc_string');
        ?>
"></textarea>
								<span class="dslca-submit">
									<span class="dslca-modal-title"><?php 
        _e('IMPORT', 'dslc_string');
        ?>
</span>
									<div class="dslca-loading followingBallsGWrap">
										<div class="followingBallsG_1 followingBallsG"></div>
										<div class="followingBallsG_2 followingBallsG"></div>
										<div class="followingBallsG_3 followingBallsG"></div>
										<div class="followingBallsG_4 followingBallsG"></div>
									</div>
								</span>
								<span class="dslca-cancel dslca-close-modal-hook" data-modal=".dslca-modal-templates-import"><?php 
        _e('CANCEL', 'dslc_string');
        ?>
</span>
							</form>

						</div><!-- .dslca-modal -->

					</div><!-- .dslca-section-templates -->

					<!-- Module Template Load -->

					<div class="dslca-section dslca-templates-load dslc-clearfix" data-bg="#ca564f">
							
						<span class="dslca-go-to-section-hook dslca-section-back" data-section=".dslca-templates"><span class="dslca-icon dslc-icon-reply"></span></span>

						<div class="dslca-section-title">
							<div class="dslca-section-title-filter">
								<span class="dslca-section-title-filter-curr"><?php 
        _e('ORIGINAL TEMPLATES', 'dslc_string');
        ?>
</span>
								<span class="dslca-icon dslc-icon-angle-up"></span>
								<div class="dslca-section-title-filter-options"></div>
							</div><!-- .dslca-section-title-filter -->
						</div><!-- .dslca-section-title -->
						
						<div class="dslca-section-scroller">
							<div class="dslca-section-scroller-inner">
								<div class="dslca-section-scroller-content">
									<?php 
        dslc_display_templates();
        ?>
								</div>
							</div>
						</div>

						<div class="dslca-section-scroller-nav">
							<span class="dslca-section-scroller-prev"><span class="dslca-icon dslc-icon-angle-left"></span></span>
							<span class="dslca-section-scroller-next"><span class="dslca-icon dslc-icon-angle-right"></span></span>
						</div><!-- .dslca-section-scroller -->

					</div><!-- .dslca-templates-load -->

				</div><!-- .dslca-sections -->

				<!-- Module Template Export -->

				<textarea id="dslca-code"></textarea>
				<div class="dslca-module-options-front-backup"></div>

				<div class="dslca-container-loader">
					<div class="dslca-container-loader-inner followingBallsGWrap">
						<div class="followingBallsG_1 followingBallsG"></div>
						<div class="followingBallsG_2 followingBallsG"></div>
						<div class="followingBallsG_3 followingBallsG"></div>
						<div class="followingBallsG_4 followingBallsG"></div>
					</div>
				</div>

			</div><!-- .dscla-container -->

			<div class="dslca-prompt-modal">
				
				<div class="dslca-prompt-modal-content">

					<div class="dslca-prompt-modal-msg">

						Message goes here

					</div><!-- .dslca-prompt-modal-msg -->

					<div class="dslca-prompt-modal-actions">

						<a href="#" class="dslca-prompt-modal-confirm-hook"><span class="dslc-icon dslc-icon-ok"></span><?php 
        _e('Confirm', 'dslc_string');
        ?>
</a>
						<span class="dslca-prompt-modal-cancel-hook"><span class="dslc-icon dslc-icon-remove"></span><?php 
        _e('Cancel', 'dslc_string');
        ?>
</span>

					</div>

				</div><!-- .dslca-prompt-modal-content -->

			</div><!-- .dslca-prompt-modal -->

			<div class="dslca-module-edit-field-icon-ttip">
				<?php 
        _e('Icons used in this plugin are from "Font Awesome".<br><a href="http://livecomposerplugin.com/icons-listing/" class="dslca-link" target="_blank">View full list of icons.</a>', 'dslc_string');
        ?>
				<span class="dslca-module-edit-field-ttip-close"><span class="dslc-icon dslc-icon-remove"></span></span>
			</div>

			<div class="dslca-module-edit-field-ttip">
				<span class="dslca-module-edit-field-ttip-close"><span class="dslc-icon dslc-icon-remove"></span></span>
				<div class="dslca-module-edit-field-ttip-inner"></div>
			</div>

			<div class="dslca-invisible-overlay"></div>

		<?php 
    }
    global $dslc_var_templates_pt;
    // Show composer activation button
    if (is_singular() && !$dslc_active && is_user_logged_in() && current_user_can(DS_LIVE_COMPOSER_CAPABILITY)) {
        // If is a page or a template go ahead normally
        if (is_page() || get_post_type() == 'dslc_templates' || !isset($dslc_var_templates_pt[get_post_type()])) {
            ?>
<a href="<?php 
            echo add_query_arg(array('dslc' => 'active'), get_permalink());
            ?>
" class="dslca-activate-composer-hook"><?php 
            _e('ACTIVATE EDITOR', 'dslc_string');
            ?>
</a><?php 
            // If not a page or a template
        } else {
            // Check if it has a template attached to it
            $template = dslc_st_get_template_ID(get_the_ID());
            if ($template) {
                ?>
<a target="_blank" href="<?php 
                echo add_query_arg(array('dslc' => 'active'), get_permalink($template));
                ?>
" class="dslca-activate-composer-hook"><?php 
                _e('EDIT TEMPLATE', 'dslc_string');
                ?>
</a><?php 
            } else {
                ?>
<a target="_blank" href="<?php 
                echo admin_url('post-new.php?post_type=dslc_templates');
                ?>
" class="dslca-activate-composer-hook"><?php 
                _e('CREATE TEMPLATE', 'dslc_string');
                ?>
</a><?php 
            }
        }
    }
}