SproutCMS

This is the code documentation for the SproutCMS project

class Preview

Somewhat complicated preview system which copies existing data into
temporary tables, then renders the preview via a front-end method call

Source code (9 results)

/sprout/Controllers/Admin/PageAdminController.php   Highlighted file source

Line 54: use Sprout\Helpers\Preview;
Line 570: * Preview the pages which will be created
Line 572: public function importPreviewAjax()
Line 578: echo '<div class="info highlight-confirm">This is a preview of the pages which will be created</div>';
Line 600: self::renderPreviewTreenode($child);
Line 612: * Render a single node for the preview tree we return in `import_preview_ajax`
Line 614: private static function renderPreviewTreenode($node)
Line 621: self::renderPreviewTreenode($child);
Line 863: $view->preview_url = Subsites::getAbsRootAdmin() . 'admin/call/page/preview/' . $item_id;
Line 1374: // Pretend there's an existing revision when going a page preview
Line 1646: if (empty($this->in_preview)) {
Line 1771: if (empty($this->in_preview)) Notification::confirm('Page type has been changed.');
Line 1782: if (empty($this->in_preview)) {
Line 2743: public function preview($item_id = 0) {
Line 2758: // Make sure the resulting revision is live so it's the revision displayed in the preview, even though it might
Line 2759: // be saved under a different status once the current administrator is happy with the preview
Line 2762: $this->in_preview = true;
Line 2763: $item_id = Preview::load($this, $tables, $item_id);
Line 2766: Preview::run($ctlr, 'viewById', [$item_id]);

/sprout/Controllers/AdminController.php   Highlighted file source

Line 930: * Use a special entry with a key of "_preview" and a value of the
Line 931: * preview URL to set up a preview button
Line 941: if ($key === '_preview') continue;
Line 1144: if (!empty($sub_actions['_preview'])) {
Line 1145: $content .= '<a href="' . Enc::html($sub_actions['_preview']) . '" class="save-changes-preview-button button button-regular button-blue icon-after icon-remove_red_eye">Preview</a>';
Line 1321: if (!empty($sub_actions['_preview'])) {
Line 1322: $content .= '<a href="' . Enc::html($sub_actions['_preview']) . '" class="save-changes-preview-button button button-regular button-blue icon-after icon-remove_red_eye">Preview</a>';
Line 1627: if (!empty($sub_actions['_preview'])) {
Line 1628: $content .= '<a href="' . Enc::html($sub_actions['_preview']) . '" class="save-changes-preview-button button button-regular button-blue icon-after icon-remove_red_eye">Preview</a>';

/sprout/Helpers/Preview.php   Highlighted file source

Line 23: * Somewhat complicated preview system which copies existing data into
Line 24: * temporary tables, then renders the preview via a front-end method call
Line 26: class Preview {
Line 29: * Loads a preview by creating temporary tables in SQL, calling a
Line 33: * @param ManagedAdminController $ctlr The controller with the preview method
Line 39: * the record which will be previewed.
Line 61: $new_pf = "preview_{$rand}_";
Line 111: * Run a controller method using the preview data.
Line 112: * This injects the word 'PREVIEW' into the page title
Line 127: '<title>PREVIEW - $1</title>',

/sprout/views/admin/file_add_dragdrop_form.php   Highlighted file source

Line 125: <!-- Preview column -->
Line 142: echo '<img class="file-upload__preview-img" src="data:image/png;base64,', Enc::html($shrunk_img['encoded_thumbnail']), '">';
Line 147: <audio class="file-upload__preview-sound" src="admin/call/file/downloadTemp/<?= Enc::html($tmp_file); ?>"
Line 153: <video class="file-upload__preview-video" src="admin/call/file/downloadTemp/<?= Enc::html($tmp_file); ?>"
Line 158: <!-- END preview column -->

/sprout/views/admin/file_edit.php   Highlighted file source

Line 103: <!-- Preview -->
Line 105: <h3>Preview</h3>
Line 108: <img src="<?php echo Enc::html(File::resizeUrl($data['filename'], 'r200x0')); ?>" alt="preview">
Line 139: <?= Fb::heading('Preview'); ?>
Line 140: <pre><?php echo Enc::html($preview); ?></pre>
Line 177: <img src="SITE/admin/call/file/previewTransform/none/<?php echo Enc::html($data['filename']); ?>" alt="" id="manipulate-preview">
Line 206: <div id="focal-point-preview" style="display: none;">
Line 207: <h3>Preview</h3>
Line 211: <p><span id="focal-point-preview-image"></span></p>

/sprout/views/admin/file_selector_popup.php   Highlighted file source

Line 71: <div id="file-selector-preview"><p class="preview-title">Preview image</p><div class="preview-box"></div></div>

/sprout/views/admin/page_edit_save.php   Highlighted file source

Line 63: <a class="save-changes-preview-button button button-regular button-blue icon-after icon-remove_red_eye" href="<?php echo Enc::html($preview_url); ?>">Preview</a>

/sprout/views/admin/style_guide/richtext.php   Highlighted file source

Line 15: var $pre = $('.preview');
Line 16: function updatePreview() {
Line 19: mce.on('change keyup', _.throttle(updatePreview, 250));
Line 20: updatePreview();
Line 33: <pre class="preview"></pre>

A total of 60 lines in 9 files were found