Plugin Directory

Changeset 3384714


Ignore:
Timestamp:
10/26/2025 12:19:58 PM (4 months ago)
Author:
owthub
Message:

Add Preview Page Link too Edit Book

Location:
library-management-system/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • library-management-system/trunk/README.txt

    r3384429 r3384714  
    6262### Free Version Features ###
    6363
    64 ➜ Manage Categories (Up to 40)
    65 ➜ Manage Bookcases (Up to 40)
    66 ➜ Manage Sections (Up to 15)
    67 ➜ Manage Books (Up to 15)
    68 ➜ Manage User Branches (Up to 40)
    69 ➜ Manage LMS Users (Up to 15)
     64➜ Manage Categories (Up to 30)
     65➜ Manage Bookcases (Up to 30)
     66➜ Manage Sections (Up to 30)
     67➜ Manage Books (Up to 40)
     68➜ Manage User Branches (Up to 30)
     69➜ Manage LMS Users (Up to 40)
    7070➜ Borrow a Single Book
    7171➜ Return Books
     
    203203* Updated "Upgrade to Pro" Screen
    204204* Added CSS for Single Book Page View
     205* Added WP_Editor for Textarea in Add / Edit Book
     206* Add Book Page View Preview Link to Edit Book Page
    205207
    206208= 3.2 =
  • library-management-system/trunk/admin/class-library-management-system-admin.php

    r3382981 r3384714  
    15831583                $book_language        = isset($_REQUEST['owt7_txt_book_language']) ? $this->owt7_clean_text($_REQUEST['owt7_txt_book_language']) : '';
    15841584                $total_pages          = isset($_REQUEST['owt7_txt_total_pages']) ? $this->owt7_clean_text($_REQUEST['owt7_txt_total_pages']) : '';
    1585                 $description          = isset($_REQUEST['owt7_txt_description']) ? $this->owt7_clean_text($_REQUEST['owt7_txt_description']) : '';
     1585                $description = isset($_REQUEST['owt7_txt_description']) ? wp_kses_post(wp_unslash($_REQUEST['owt7_txt_description'])) : '';
    15861586                $cover_image          = isset($_REQUEST['owt7_cover_image']) ? $this->owt7_clean_text($_REQUEST['owt7_cover_image']) : '';
    15871587                $edit_id              = isset($_REQUEST['edit_id']) ? absint($_REQUEST['edit_id']) : 0;
  • library-management-system/trunk/admin/views/books/owt7_library_add_book.php

    r3223054 r3384714  
    1313                <a href="admin.php?page=owt7_library_books&mod=category&fn=list&_wpnonce=<?php echo esc_attr($page_nonce); ?>" class="btn"><?php esc_html_e("List Category", "library-management-system"); ?></a>
    1414                <a href="admin.php?page=owt7_library_books" class="btn"><?php esc_html_e("List Book", "library-management-system"); ?></a>
     15                <?php
     16                // Show Preview button only when editing
     17                if (isset($_GET['opt']) && $_GET['opt'] === 'edit' && !empty($_GET['id'])) {
     18                    $book_id = base64_decode(sanitize_text_field($_GET['id']));
     19                    if (!empty($book_id)) {
     20                        $preview_url = home_url('wp-library-books/?bid=' . base64_encode($book_id));
     21                        ?>
     22                        <a href="<?php echo esc_url($preview_url); ?>" target="_blank" class="btn btn-preview">
     23                            <?php esc_html_e("Preview Book", "library-management-system"); ?>
     24                        </a>
     25                        <?php
     26                    }
     27                }
     28                ?>
    1529            </div>
    1630        </div>
     
    191205                    <div class="form-group">
    192206                        <label for="owt7_txt_description"><?php esc_html_e("Description", "library-management-system"); ?></label>
    193                         <textarea <?php echo isset($params['action']) && $params['action'] == 'view' ? 'disabled' : ''; ?> name="owt7_txt_description" id="owt7_txt_description" cols="50" rows="4" placeholder="..."><?php echo isset($params['book']['description']) ? esc_attr($params['book']['description']) : ''; ?></textarea>
     207                        <?php
     208                            $content   = isset($params['book']['description']) ? wp_kses_post($params['book']['description']) : '';
     209                            $editor_id = 'owt7_txt_description';
     210                            $settings  = array(
     211                                'textarea_name' => 'owt7_txt_description',
     212                                'textarea_rows' => 6,
     213                                'media_buttons' => false,
     214                                'teeny'         => true,
     215                                'quicktags'     => false,
     216                                'tinymce'       => array(
     217                                    'toolbar1' => 'bold,italic,underline,bullist,numlist,link,unlink,undo,redo',
     218                                    'toolbar2' => '',
     219                                ),
     220                                'readonly' => (isset($params['action']) && $params['action'] == 'view'),
     221                            );
     222
     223                            wp_editor($content, $editor_id, $settings);
     224                        ?>
    194225                    </div>
    195226                </div>
  • library-management-system/trunk/admin/views/lms/owt7_library_free_vs_pro.php

    r3384422 r3384714  
    1818                    <h2 class="comparison-title"><?php esc_html_e("Free Version", "library-management-system"); ?></h2>
    1919                    <ul class="feature-list">
    20                         <li><span class="icon">✔️</span> <?php esc_html_e("Manage Categories (Up to ".base64_decode(LMS_FREE_VERSION_LIMIT).")", "library-management-system"); ?></li>
    21                         <li><span class="icon">✔️</span> <?php esc_html_e("Manage Bookcases (Up to ".base64_decode(LMS_FREE_VERSION_LIMIT).")", "library-management-system"); ?></li>
    22                         <li><span class="icon">✔️</span> <?php esc_html_e("Manage Sections (Up to 15)", "library-management-system"); ?></li>
    23                         <li><span class="icon">✔️</span> <?php esc_html_e("Manage Books (Up to 15)", "library-management-system"); ?></li>
    24                         <li><span class="icon">✔️</span> <?php esc_html_e("Manage User Branches (Up to ".base64_decode(LMS_FREE_VERSION_LIMIT).")", "library-management-system"); ?></li>
    25                         <li><span class="icon">✔️</span> <?php esc_html_e("Manage LMS Users (Up to 15)", "library-management-system"); ?></li>
     20                        <li><span class="icon">✔️</span> <?php esc_html_e("Manage Categories (Up to ".(base64_decode(LMS_FREE_VERSION_LIMIT) - 10).")", "library-management-system"); ?></li>
     21                        <li><span class="icon">✔️</span> <?php esc_html_e("Manage Bookcases (Up to ".(base64_decode(LMS_FREE_VERSION_LIMIT) - 10).")", "library-management-system"); ?></li>
     22                        <li><span class="icon">✔️</span> <?php esc_html_e("Manage Sections", "library-management-system"); ?></li>
     23                        <li><span class="icon">✔️</span> <?php esc_html_e("Manage Books (Up to ".base64_decode(LMS_FREE_VERSION_LIMIT).")", "library-management-system"); ?></li>
     24                        <li><span class="icon">✔️</span> <?php esc_html_e("Manage User Branches (Up to ".(base64_decode(LMS_FREE_VERSION_LIMIT) - 10).")", "library-management-system"); ?></li>
     25                        <li><span class="icon">✔️</span> <?php esc_html_e("Manage LMS Users (Up to ".base64_decode(LMS_FREE_VERSION_LIMIT).")", "library-management-system"); ?></li>
    2626                        <li><span class="icon">✔️</span> <?php esc_html_e("Borrow a Single Book", "library-management-system"); ?></li>
    2727                        <li><span class="icon">✔️</span> <?php esc_html_e("Return Books", "library-management-system"); ?></li>
Note: See TracChangeset for help on using the changeset viewer.