Plugin Directory

Changeset 2685668


Ignore:
Timestamp:
02/27/2022 10:01:24 PM (4 years ago)
Author:
rimplates
Message:

1.0.5

  • Ability to change color & add html in footer copyright text.
Location:
rimplates/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • rimplates/trunk/README.txt

    r2679357 r2685668  
    44Tags: user-dashboard, admin-dashboard, frontend-dashboard, portal-maker, user-menu, menu, admin, user, profile, templates, dashboard
    55Requires at least: 3.0.1
    6 Tested up to: 5.9
    7 Stable tag: 1.0.4
     6Tested up to: 5.9.1
     7Stable tag: 1.0.5
    88Requires PHP: 5.6
    99License: GPLv2 or later
     
    6262== Changelog ==
    6363
     64= 1.0.5 =
     65* Added Ability to change color & add html in footer copyright text.
    6466= 1.0.4 =
    6567* Automatically Create Page when creating Dasboard.
     
    7072== Upgrade Notice ==
    7173
     74= 1.0.5 =
     75* Ability to change template color &  add html in footer copyright text.
    7276= 1.0.4 =
    7377* Automatically Create Page when creating Dasboard.
  • rimplates/trunk/admin/class-admin-template-settings.php

    r2679357 r2685668  
    1313        //save meta value with save post hook when Template Settings is POSTED
    1414        add_action('save_post_rimplates',  array($this,'save_settings'), 10,3 );
     15        add_action('save_rp_color_settings',  array($this,'save_rp_color_settings'), 10,4 );
    1516       
    1617    }
     
    2728    function rimplates_template_register_meta_box() {
    2829       
    29         add_meta_box( 'rimplenet-admin-wallet-settings-meta-box', esc_html__( 'Templates Settings', 'rimplates' ),   array($this,'rimplenet_admin_wallet_meta_box_callback'), 'rimplates', 'normal', 'high' );
    30         add_meta_box( 'rimplenet-admin-wallet-balance-shortcode-meta-box', esc_html__( 'Template Shortcode', 'rimplates' ),   array($this,'rimplenet_admin_wallet_balance_shortcode_meta_box_callback'), 'rimplates', 'side', 'high' ); 
    31        
    32     }
    33    
    34     function rimplenet_admin_wallet_meta_box_callback( $meta_id ) {
     30        add_meta_box( 'rimplates-admin-basic-settings-meta-box', esc_html__( 'Templates Settings', 'rimplates' ),   array($this,'rimplates_admin_basic_settings_meta_box_callback'), 'rimplates', 'normal', 'high' );
     31        add_meta_box( 'rimplates-admin-template-details-meta-box', esc_html__( 'Shortcode / Template Details', 'rimplates' ),   array($this,'rimplates_template_details_meta_box_callback'), 'rimplates', 'side', 'high' ); 
     32       
     33        add_meta_box( 'rimplates-admin-template-color-meta-box', esc_html__( 'Color Settings', 'rimplates' ),   array($this,'rimplates_template_color_meta_box_callback'), 'rimplates', 'side', 'high' ); 
     34       
     35    }
     36   
     37    function rimplates_admin_basic_settings_meta_box_callback( $meta_id ) {
    3538       
    3639       include_once plugin_dir_path( dirname( __FILE__ ) ) . '/admin/partials/metabox-template-settings.php';
     
    3841     }
    3942   
    40     function rimplenet_admin_wallet_balance_shortcode_meta_box_callback($meta_id) {
     43    //Color Settings Metabox Function
     44    function rimplates_template_color_meta_box_callback($meta_id) {
     45       
     46        $post_id = $meta_id->ID;
     47        $template_id = $post_id;
     48        $shortcode  = "[rimplates-template id=$template_post_id]";
     49       
     50        $rp_primary_color_bg = get_post_meta($template_id, 'rp_primary_color_bg', true);
     51        if(empty($rp_primary_color_bg)){ $rp_primary_color_bg = "#4463dc"; }
     52        $rp_primary_color_text = get_post_meta($template_id, 'rp_primary_color_text', true);
     53        if(empty($rp_primary_color_text)){ $rp_primary_color_text = "#ffffff"; }
     54       
     55        $rp_secondary_color_bg = get_post_meta($template_id, 'rp_secondary_color_bg', true);
     56        if(empty($rp_secondary_color_bg)){ $rp_secondary_color_bg = "#212529"; }
     57        $rp_secondary_color_text = get_post_meta($template_id, 'rp_secondary_color_text', true);
     58        if(empty($rp_secondary_color_text)){ $rp_secondary_color_text = "#ffffff"; }
     59       
     60       
     61       
     62        ?>
     63       
     64         <!-- Primary Colors -->
     65         <div id="rimplates-primary-colors" class="rp-colors">
     66            <p>
     67                <strong>Primary Colors</strong>
     68                <span class="dashicons dashicons-editor-help rimplates-admin-tooltip" title="Primary color is used on the sidebar & some other places"></span>
     69            </p>
     70           
     71            <label for="rp_primary_color_bg">Background</label>
     72            <input type="color" id="rp_primary_color_bg" name="rp_primary_color_bg" value="<?php echo $rp_primary_color_bg; ?>">
     73           
     74            <label for="rp_primary_color_text">Text</label>
     75            <input type="color" id="rp_primary_color_text" name="rp_primary_color_text" value="<?php echo $rp_primary_color_text; ?>">
     76           
     77         </div>
     78         
     79         <!-- Secondary Colors -->
     80         <div id="rimplates-secondary-colors" class="rp-colors">
     81            <p>
     82                <strong>Secondary Colors</strong>
     83                <span class="dashicons dashicons-editor-help rimplates-admin-tooltip" title="Secondary color is used in footer & collapse button"></span>
     84            </p>
     85           
     86            <label for="rp_secondary_color_bg">Background</label>
     87            <input type="color" id="rp_secondary_color_bg" name="rp_secondary_color_bg" value="<?php echo $rp_secondary_color_bg; ?>">
     88           
     89            <label for="rp_secondary_color_text">Text</label>
     90            <input type="color" id="rp_secondary_color_text" name="rp_secondary_color_text" value="<?php echo $rp_secondary_color_text; ?>">
     91           
     92         </div>
     93       
     94        <?php
     95          //Hook for displaying rimplates color settings
     96          do_action("rp_color_settings",$template_id);
     97       
     98     }
     99     
     100    function rimplates_template_details_meta_box_callback($meta_id) {
    41101       
    42102        $post_id = $meta_id->ID;
     
    64124   
    65125     }
    66      
     126   
     127   
     128    //Save Color Settings Hook
    67129    function save_settings($post_id, $post, $update){
    68        
     130      $template_id = $post_id;
     131     
    69132      $rimplates_template = sanitize_text_field($_POST['rimplates_template']);
     133      do_action("save_rp_color_settings", $template_id, $rimplates_template, $post, $update);
     134     
    70135
    71136      if(!empty($rimplates_template)){
     
    80145        $rimplates_template_header_text = sanitize_text_field( $_POST['rimplates_template_header_text'] );     
    81146       
    82         $rimplates_template_footer_text = sanitize_text_field( $_POST['rimplates_template_footer_text'] );
     147        $rimplates_template_footer_text = wp_kses_post( $_POST['rimplates_template_footer_text'] );
    83148     
    84 if($create_rimplate_page==true){
    85       $page_content = "[rimplates-template id=$post_id]";
    86       $args_page = array(
    87             'post_title' => $post->post_title,
    88             'post_content' => $page_content,
    89             'post_status' => 'publish',
    90             'post_type' => "page",
    91             'page_template'  => 'template-blank-page.php'
    92            ) ; 
    93     $linked_rimplate_page_id = wp_insert_post($args_page);
    94 }
    95 else{
    96     $linked_rimplate_page_id = get_post_meta($post_id, 'linked_rimplate_page_id', true);     
    97 }
    98           $metas = array(
     149        if($create_rimplate_page==true){
     150              $page_content = "[rimplates-template id=$post_id]";
     151              $args_page = array(
     152                    'post_title' => $post->post_title,
     153                    'post_content' => $page_content,
     154                    'post_status' => 'publish',
     155                    'post_type' => "page",
     156                    'page_template'  => 'template-blank-page.php'
     157                   ) ; 
     158            $linked_rimplate_page_id = wp_insert_post($args_page);
     159        }
     160        else{
     161            $linked_rimplate_page_id = get_post_meta($post_id, 'linked_rimplate_page_id', true);     
     162        }
     163       
     164        $metas = array(
    99165              'template' => $template,
    100166              'linked_rimplate_page_id' => $linked_rimplate_page_id,
     
    106172             );
    107173           
    108          foreach ($metas as $key => $value) {
     174        foreach ($metas as $key => $value) {
    109175          update_post_meta($post_id, $key, $value);
    110176         }
     
    112178       }
    113179    }
     180   
     181    //Save Color Settings Function
     182    function save_rp_color_settings($template_id, $rimplates_template, $post, $update){
     183       
     184      if(!empty($rimplates_template)){
     185         
     186        $rp_primary_color_bg = sanitize_text_field( $_POST['rp_primary_color_bg'] );
     187        $rp_primary_color_text = sanitize_text_field( $_POST['rp_primary_color_text'] );
     188       
     189        $rp_secondary_color_bg = sanitize_text_field( $_POST['rp_secondary_color_bg'] );
     190        $rp_secondary_color_text = sanitize_text_field( $_POST['rp_secondary_color_text'] );
     191       
     192        $metas = array(
     193              'rp_primary_color_bg' => $rp_primary_color_bg,
     194              'rp_primary_color_text' => $rp_primary_color_text,
     195              'rp_secondary_color_bg' => $rp_secondary_color_bg,
     196              'rp_secondary_color_text' => $rp_secondary_color_text,
     197             );
     198           
     199        foreach ($metas as $key => $value) {
     200          update_post_meta($template_id, $key, $value);
     201         }
     202       
     203       
     204      }
     205     
     206    }
     207   
    114208 
    115209       
  • rimplates/trunk/admin/css/rimplates-admin.css

    r2677631 r2685668  
    33 * included in this file.
    44 */
     5 .rp-colors:nth-of-type(n+2) {
     6  margin-top: 1.4rem;
     7  border-top: 1px solid #ccc;
     8}
  • rimplates/trunk/public/class-rimplates-public.php

    r2677631 r2685668  
    5656        add_action('wp', array($this, 'LoadTemplateFunctions'));
    5757        add_action('init', array($this, 'LoadTemplateServiceFunctions'));
    58        
     58        add_action('display_rimplates_css_inline',  array($this,'display_rimplates_css'), 10, 2 );
     59    }
     60   
     61       
     62    public function display_rimplates_css($template_id, $user_id) {
     63       
     64         $rp_primary_color_bg = get_post_meta($template_id,"rp_primary_color_bg",true);
     65         $rp_primary_color_text = get_post_meta($template_id,"rp_primary_color_text",true);
     66         $rp_secondary_color_bg = get_post_meta($template_id,"rp_secondary_color_bg",true);
     67         $rp_secondary_color_text = get_post_meta($template_id,"rp_secondary_color_text",true);
     68         ?>
     69         <style>
     70             .rp-primary{
     71                 -class-pri-bg: #0076A5;
     72                 background:<?php echo $rp_primary_color_bg; ?>;
     73                 color:<?php echo $rp_primary_color_text; ?>;
     74             }
     75             .rp-secondary{
     76                 background:<?php echo $rp_secondary_color_bg; ?>;
     77                 color:<?php echo $rp_secondary_color_text; ?>;
     78             }
     79             .rp-primary ul li a {
     80                 color: <?php echo $rp_primary_color_text; ?>;
     81             }
     82             .rp-primary ul li.active > a, .rp-primary a[aria-expanded="true"] {
     83                  background: <?php echo $rp_secondary_color_bg; ?>;
     84                }
     85               
     86            button.rp-secondary{
     87                 background: <?php echo $rp_secondary_color_bg; ?>!important;
     88                 color: <?php echo $rp_secondary_color_text; ?>!important;
     89            }
     90           
     91            button.rp-secondary:hover{
     92                 background:<?php echo $rp_primary_color_bg; ?>!important;
     93                 color:<?php echo $rp_primary_color_text; ?>!important;
     94            }
     95           
     96            button.rp-secondary:focus{
     97                 box-shadow: none !important;
     98            }
     99           
     100            .copyright-rimplates {
     101                  background: <?php echo $rp_secondary_color_bg; ?>;
     102                  color: <?php echo $rp_secondary_color_text; ?>;
     103                  border-top: 1px solid <?php echo $rp_secondary_color_bg; ?>;;
     104                }
     105             
     106         </style>
     107         
     108         
     109         <?php
     110       
    59111    }
    60112   
     
    123175             $template_id = "default";
    124176         }
    125              
     177         
     178         do_action("display_rimplates_css_inline", $template_id, $user_id);   
    126179         
    127180         $template_folder = get_post_meta($template_id, 'template',true);
  • rimplates/trunk/public/templates/default/assets/css/style.css

    r2677631 r2685668  
    130130
    131131.profile-bg {
    132     border: 1px solid #5d7cf7;
    133132    border-left: none;
    134133    border-right: none;
  • rimplates/trunk/public/templates/default/assets/css/style4.css

    r2677631 r2685668  
    8282    min-width: 250px;
    8383    max-width: 250px;
    84     background: #4c6ef5;
    85     color: #fff;
    8684    transition: all 0.3s;
    8785}
     
    9088    font-size: 2.3em;
    9189    letter-spacing: 3px;
    92     color: #fff;
     90    color: inherit;
    9391    text-shadow: 2px 2px 3px #39393a;
    9492}
     
    157155#sidebar .sidebar-header {
    158156    padding: 20px;
    159     background: #4463dc;
     157    background: inherit;
    160158}
    161159
     
    175173    letter-spacing: 0.6px;
    176174    display: block;
    177     color: #fff;
    178175    font-weight: 400;
    179176}
     
    192189#sidebar a[aria-expanded="true"] {
    193190    color: #fff;
    194     background: #4463dc;
    195191}
    196192
  • rimplates/trunk/public/templates/default/footer.php

    r2677631 r2685668  
    1111    if(!empty($footer_copyright_text)){
    1212?>
    13 <div class="copyright-w3layouts py-xl-3 py-2 mt-xl-5 mt-4 text-center">
     13<div class="copyright-rimplates py-xl-3 py-2 mt-xl-5 mt-4 text-center">
    1414    <p> <?php echo do_shortcode($footer_copyright_text); ?></p>
    1515</div>
     
    2222       
    2323        (function( $ ) {
    24             'use strict';
    25             //paste this code under head tag or in a seperate js file.
    26            
     24            'use strict';
     25            //paste this code under head tag or in a seperate js file.
     26           
    2727            <!-- loading-gif Js -->
    2828                // Wait for window load
  • rimplates/trunk/public/templates/default/header.php

    r2677631 r2685668  
    1919
    2020                    <div class="navbar-header">
    21                         <button type="button" id="sidebarCollapse" class="btn btn-info navbar-btn">
     21                        <button type="button" id="sidebarCollapse" class="btn navbar-btn rp-secondary">
    2222                            <i class="fas fa-bars"></i>
    2323                        </button>
     
    3030                 
    3131                </div>
    32              </nav> 
     32</nav> 
  • rimplates/trunk/public/templates/default/sidebar.php

    r2678086 r2685668  
    2424?>
    2525   
    26     <nav id="sidebar" class="">
     26    <nav id="sidebar" class="rp-primary">
    2727        <div class="sidebar-header">
    2828            <h1>
  • rimplates/trunk/rimplates.php

    r2679357 r2685668  
    1717 * Plugin URI:        https://rimplates.com
    1818 * Description:       Rimplates is a dashboard maker for wordpress. Using this Plugin is simple, install it, RIMPLATES will appear on your admin dashboard menu (with ability to add / create templates, dashboard ~ it supports both admin dashboard & user dashboard). You display the created templates/dashboard with shortcode, Use shortcode [rimplenet-template id=ID], E.g if your ID is 5 , your valid shortcode will be [rimplenet-template id=5]
    19  * Version:           1.0.4
     19 * Version:           1.0.5
    2020 * Author:            rimplates
    2121 * Author URI:        https://profiles.wordpress.org/rimplates/
     
    3636 * Rename this for your plugin and update it as you release new versions.
    3737 */
    38 define( 'RIMPLATES_VERSION', '1.0.4' );
     38define( 'RIMPLATES_VERSION', '1.0.5' );
    3939
    4040/**
Note: See TracChangeset for help on using the changeset viewer.