Plugin Directory

Changeset 561951


Ignore:
Timestamp:
06/21/2012 07:33:03 PM (14 years ago)
Author:
dgilfoy
Message:

Cleaned up settings page, added help

Location:
page-specific-sidebars
Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • page-specific-sidebars/tags/2.0/views/page-sidebar-options-view.php

    r509987 r561951  
    1 <div class="wrap" id="avalara-settings">
     1<div class="wrap" id="page-specific-sidebar-settings">
    22<div id="icon-options-general" class="icon32"></div>
    3     <h2>Page Specific Sidebar Settings</h2>
    4     <?php if( $_SERVER['REQUEST_METHOD'] == "POST" ) echo "<div id='message' class='updated'>Page Sidebars Settings Successfully Saved!</div>"; ?>
    5     <?php //parent::fprint_r( $this->valid->all_formdata() ); ?>
    6     <form action="" method="post">
    7         <ul>
    8             <li><label for="primary-slug">Primary Sidebar Slug</label></li>
    9             <li><input id="primary-slug" type="text" name="primary_sidebar_slug" value="<?php echo $this->widget_name; ?>"/></li>
    10             <li><label for="home-id">Home Page ID *</label></li>
    11             <li><input id="home-id" type="text" name="home_page_id" value="<?php echo $this->home_id; ?>"/></li>
    12             <li>* - Home page with blog posts have issues with the page ID being overridden.  This ensures that the right page ID is being used. (optional)</li>
    13             <li><button type="submit" name="save_page_data">Update Settings</button></li>
    14         </ul>
    15     </form>
     3    <h2>Page Specific Sidebar Plugin</h2>
     4    <div id="body-wrap" class="meta-box-sortables ui-sortable">
     5        <div id="metabox_desc" class="postbox">
     6            <div class="handlediv" title="Click to toggle">
     7                <br>
     8            </div>
     9            <div class="hndle">
     10                <h3><ul class="top-menu clearfix">
     11                    <li class="current-menu-tab menu-item"><a href="#settings">Settings</a></li>
     12                    <li class="menu-item"><a href="#help">Help</a></li>
     13                </ul></h3>
     14            </div>
     15            <div class="group settings current-tab inside">
     16                <?php if( $_SERVER['REQUEST_METHOD'] == "POST" ) echo "<div id='message' class='updated'>Page Sidebars Settings Successfully Saved!</div>"; ?>
     17                <?php //parent::fprint_r( $this->valid->all_formdata() ); ?>
     18                <form action="" method="post">
     19                    <ul>
     20                        <li><label for="primary-slug">Primary Sidebar Slug</label></li>
     21                        <li><input id="primary-slug" type="text" name="primary_sidebar_slug" value="<?php echo $this->widget_name; ?>"/></li>
     22                        <li><label for="home-id">Home Page ID *</label></li>
     23                        <li><input id="home-id" type="text" name="home_page_id" value="<?php echo $this->home_pg_id; ?>"/></li>
     24                        <li>* - Home page with blog posts have issues with the page ID being overridden.  This ensures that the right page ID is being used. (optional)</li>
     25                        <li><button type="submit" name="save_page_data">Update Settings</button></li>
     26                    </ul>
     27                </form>
     28            </div>
     29            <div class="group help inside">
     30                <p>To use this plugin, simply got to a page you wish to overwrite or extend the sidebar on, and select the apropriate checkbox:</p>
     31                <img src="<?php echo DGSIDEBAR_URL . '/screenshot-1.png'; ?>"/>
     32                <p>Add the Widgets to the sidebar as you wish:</p>
     33                <img src="<?php echo DGSIDEBAR_URL . '/screenshot-2.png'; ?>"/>
     34                <p>
     35                    This Plugin is theme sensitive. That means the sidebar naming is dependant on the theme.  Some themes name the primary sidebar
     36                    "sidebar-primary", others name it "sidebar-1".  To find the name of the sidebar, simply right click on the primary sidebar (widget page)
     37                    and view the page source. See image below:
     38                </p>
     39                <img src="<?php echo DGSIDEBAR_URL . '/screenshot-3.png'; ?>"/>
     40                <p>
     41                    Homepage ID is the post_id of your Homepage.  To find the page id, simply go to Pages->Home (orwhatever your home page is named) and click edit.
     42                    In the address bar of your browser, you'll see something like mysite.com/wp-admin/post.php?post=x  where x is some number.  That is the Page ID.
     43                </p>
     44            </div>
     45        </div>
     46    </div>
     47    <div id="sidebar-wrap">
     48            <?php require_once 'desc.php'; ?>
     49    </div>
    1650</div>
  • page-specific-sidebars/trunk/Read.ME

    r509979 r561951  
    33Tags: widgets, sidebar, role based
    44Requires at least: 3.0
    5 Tested up to: 3.1
    6 Stable tag:  2.0
     5Tested up to: 3.4
     6Stable tag:  2.1
    77
    88==Short Description ==
     
    5050== Changelog ==
    5151
    52 
     522012-06-21 - Added help to settings page.
    5353
    5454== Upgrade Notice ==
  • page-specific-sidebars/trunk/page-sidebar.php

    r509979 r561951  
    66 *  Description: Allows a page to be assigned a special sidebar.  Either overwrites the generic sidebar call or adds. For targeting Sidebars by name, see plugin option page
    77 *  to the existing generic sidebar
    8  *  Version: 2.0
     8 *  Version: 2.1
    99 **/
    1010
     
    3030
    3131if( !defined( 'DGSIDEBAR_DIR' ) ) define( 'DGSIDEBAR_DIR', dirname( __FILE__ ) ) ;
     32if( !defined( 'DGSIDEBAR_URL' ) ) define( 'DGSIDEBAR_URL', str_replace( ABSPATH, site_url( '/' ), DGSIDEBAR_DIR ) ) ;
     33
    3234class DGPageSidebarCustom{
    3335   
     
    4850*/
    4951    public function options_page_init(){
    50          if( !current_user_can( 'administrator' ) ) return;
    51             add_options_page(__('Page Sidebar Settings'), __('Page Sidebar Settings'), 'read', 'page-sidebar-settings', array($this, 'option_page'));
     52        if( !current_user_can( 'administrator' ) ) return;
     53        $hooks = array();
     54        $hooks[] = add_options_page( __( 'Page Sidebar Settings' ), __( 'Page Sidebar Settings' ), 'read', 'page-sidebar-settings', array( $this, 'option_page' ) );
     55         foreach( $hooks as $hook ) add_action( "admin_print_styles-{$hook}", array($this, 'load_assets' ) );
     56    }
     57   
     58    public function load_assets(){
     59         wp_enqueue_style( 'page-spec-sidebar-css', DGSIDEBAR_URL . '/assets/page_spec_styles.css' );
     60         wp_enqueue_script( 'page-spec-sidebar-js', DGSIDEBAR_URL . '/assets/page-spec_scripts.js' );
    5261    }
    5362 
Note: See TracChangeset for help on using the changeset viewer.