dangermoose

classy-options.php

Mar 27th, 2012
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 15.66 KB | None | 0 0
  1. <?php
  2. /**
  3. * Initializes the Response Theme Options
  4. *
  5. * Author: Tyler Cunningham
  6. * Copyright: © 2012
  7. * {@link http://cyberchimps.com/ CyberChimps LLC}
  8. *
  9. * Released under the terms of the GNU General Public License.
  10. * You should have received a copy of the GNU General Public License,
  11. * along with this software. In the main directory, see: /licensing/
  12. * If not, see: {@link http://www.gnu.org/licenses/}.
  13. *
  14. * @package Response
  15. * @since 1.0.4
  16. */
  17.  
  18. require( get_template_directory() . '/core/classy-options/classy-options-framework/classy-options-framework.php');
  19.  
  20. add_action('init', 'chimps_init_options');
  21.  
  22. function chimps_init_options() {
  23.  
  24. global $options, $themeslug, $themename, $themenamefull;
  25. $options = new ClassyOptions($themename, $themenamefull." Options");
  26.  
  27. $terms2 = get_terms('category', 'hide_empty=0');
  28.  
  29.     $blogoptions = array();
  30.                                    
  31.     $blogoptions['all'] = "All";
  32.  
  33.         foreach($terms2 as $term) {
  34.  
  35.             $blogoptions[$term->slug] = $term->name;
  36.  
  37.         }
  38. $options
  39.     ->section("Welcome")
  40.         ->info("<h1>Response</h1>
  41.        
  42. <p><strong>A Free Responsive Starter WordPress Theme Framework</strong></p>
  43.  
  44. <p><a href='http://cyberchimps.com/responsepro/' target='_blank'>Upgrade to Response Pro for just $25!</a></p>
  45.  
  46. <p>Response includes a Responsive Design (which magically adjusts to mobile devices such as the iPhone and iPad), Responsive Slider, Drag & Drop Header Elements, Page and Blog Elements, simplified Theme Options, and is built with HTML5 and CSS3. Upgrade to Response Pro for even more Drag & Drop Elements.</p>
  47.  
  48. <p>To get started simply work your way through the options below, add your content, and always remember to hit save after making any changes.</p>
  49.  
  50. <p>The Response Slider options are under the Response Page Options which are available below the Page content entry area in WP-Admin when you edit a page. This way you can configure each page individually. You will also find the Drag & Drop Page Elements editor within the response Pro Page Options as well.</p>
  51.  
  52. <p>We tried to make Response as easy to use as possible, but if you still need help please read the <a href='http://cyberchimps.com/response/docs/' target='_blank'>documentation</a>, and visit our <a href='http://cyberchimps.com/forum/' target='_blank'>support forum</a>.</p>
  53.  
  54. <p>Thank you for using Response.</p>
  55. ")
  56.     ->section("Design")
  57.         ->subsection("Typography")
  58.             ->select($themeslug."_font", "Choose a Font", array( 'options' => array("Arial" => "Arial (default)", "Courier New" => "Courier New", "Georgia" => "Georgia", "Helvetica" => "Helvetica", "Lucida Grande" => "Lucida Grande", "Tahoma" => "Tahoma", "Times New Roman" => "Times New Roman", "Verdana" => "Verdana", "Maven+Pro" => "Maven Pro", "Ubuntu" => "Ubuntu")))
  59.         ->subsection_end()
  60.         ->open_outersection()
  61.                 ->textarea($themeslug."_css_options", "Custom CSS")
  62.             ->close_outersection()
  63.         ->section("Header")
  64.         ->open_outersection()
  65.             ->section_order("header_section_order", "Drag & Drop Header Elements", array('options' => array("response_logo_icons" => "Logo + Icons", "response_banner" => "Banner", "response_custom_header_element" => "Custom", "response_navigation" => "Menu"), 'default' => 'response_logo_icons,response_navigation'))
  66.             ->upload($themeslug."_banner", "Banner Image")
  67.             ->text($themeslug."_banner_url", "Banner URL", array('default' => home_url()))
  68.             ->textarea($themeslug."_custom_header_element", "Custom HTML")
  69.         ->close_outersection()
  70.             ->subsection("Header Options")
  71.             ->checkbox($themeslug."_custom_logo", "Custom Logo" , array('default' => true))
  72.             ->upload($themeslug."_logo", "Logo", array('default' => array('url' => TEMPLATE_URL . '/images/responselogo.png')))
  73.             ->upload($themeslug."_favicon", "Custom Favicon")
  74.         ->subsection_end()
  75.         ->subsection("Social")
  76.             ->images($themeslug."_icon_style", "Icon set", array( 'options' => array('legacy' => TEMPLATE_URL . '/images/social/thumbs/icons-classic.png', 'default' =>
  77. TEMPLATE_URL . '/images/social/thumbs/icons-default.png' ), 'default' => 'default' ) )
  78.             ->text($themeslug."_twitter", "Twitter Icon URL", array('default' => 'http://twitter.com'))
  79.             ->checkbox($themeslug."_hide_twitter_icon", "Hide Twitter Icon", array('default' => true))
  80.             ->text($themeslug."_facebook", "Facebook Icon URL", array('default' => 'http://facebook.com'))
  81.             ->checkbox($themeslug."_hide_facebook_icon", "Hide Facebook Icon" , array('default' => true))
  82.             ->text($themeslug."_gplus", "Google + Icon URL", array('default' => 'http://plus.google.com'))
  83.             ->checkbox($themeslug."_hide_gplus_icon", "Hide Google + Icon" , array('default' => true))
  84.             ->text($themeslug."_flickr", "Flickr Icon URL", array('default' => 'http://flikr.com'))
  85.             ->checkbox($themeslug."_hide_flickr", "Hide Flickr Icon")
  86.             ->text($themeslug."_linkedin", "LinkedIn Icon URL", array('default' => 'http://linkedin.com'))
  87.             ->checkbox($themeslug."_hide_linkedin", "Hide LinkedIn Icon")
  88.             ->text($themeslug."_youtube", "YouTube Icon URL", array('default' => 'http://youtube.com'))
  89.             ->checkbox($themeslug."_hide_youtube", "Hide YouTube Icon")
  90.             ->text($themeslug."_googlemaps", "Google Maps Icon URL", array('default' => 'http://maps.google.com'))
  91.             ->checkbox($themeslug."_hide_googlemaps", "Hide Google maps Icon")
  92.             ->text($themeslug."_email", "Email Address")
  93.             ->checkbox($themeslug."_hide_email", "Hide Email Icon")
  94.             ->text($themeslug."_rsslink", "RSS Icon URL")
  95.             ->checkbox($themeslug."_hide_rss_icon", "Hide RSS Icon" , array('default' => true))
  96.         ->subsection_end()
  97.         ->subsection("Tracking and Scripts")
  98.             ->textarea($themeslug."_ga_code", "Google Analytics Code")
  99.             ->textarea($themeslug."_custom_header_scripts", "Custom Header Scripts")
  100.         ->subsection_end()
  101.     ->section("Home")
  102.     ->open_outersection()
  103.             ->section_order($themeslug."_home_section_order", "Drag & Drop Home Elements", array('options' => array("response_index" => "Post Page", "response_home_slider" => "Feature Slider",  "response_callout_section" => "Callout Section"), "default" => 'response_home_slider,response_index'))
  104.         ->close_outersection()
  105.         ->subsection("Home Options")
  106.             ->images($themeslug."_home_sidebar", "Sidebar Options", array( 'options' => array("none" => TEMPLATE_URL . '/images/options/none.png',"two-right" => TEMPLATE_URL . '/images/options/tworight.png', "right-left" => TEMPLATE_URL . '/images/options/rightleft.png', "left" => TEMPLATE_URL . '/images/options/left.png',  "right" => TEMPLATE_URL . '/images/options/right.png'), 'default' => 'right'))
  107.             ->checkbox($themeslug."_post_formats", "Post Format Icons",  array('default' => true))
  108.             ->checkbox($themeslug."_show_excerpts", "Post Excerpts")
  109.             ->text($themeslug."_excerpt_link_text", "Excerpt Link Text", array('default' => '(More)…'))
  110.             ->text($themeslug."_excerpt_length", "Excerpt Character Length", array('default' => '55'))
  111.             ->checkbox($themeslug."_show_featured_images", "Featured Images")
  112.             ->select($themeslug."_featured_image_align", "Featured Image Alignment", array( 'options' => array("key1" => "Left", "key2" => "Center", "key3" => "Right")))
  113.             ->text($themeslug."_featured_image_height", "Featured Image Height", array('default' => '100'))
  114.             ->text($themeslug."_featured_image_width", "Featured Image Width", array('default' => '100'))  
  115.             ->multicheck($themeslug."_hide_byline", "Post Byline Elements", array( 'options' => array($themeslug."_hide_author" => "Author" , $themeslug."_hide_categories" => "Categories", $themeslug."_hide_date" => "Date", $themeslug."_hide_comments" => "Comments", $themeslug."_hide_share" => "Share", $themeslug."_hide_tags" => "Tags"), 'default' => array( $themeslug."_hide_tags" => true, $themeslug."_hide_share" => true, $themeslug."_hide_author" => true, $themeslug."_hide_date" => true, $themeslug."_hide_comments" => true, $themeslug."_hide_categories" => true ) ) )
  116.         ->subsection_end()     
  117. ->subsection("Feature Slider")
  118. ->upload($themeslug."_home_slide_one_image", "Slide One Image", array('default' => array('url' => TEMPLATE_URL . '/images/responseslider.jpg')))
  119. ->text($themeslug."_home_slide_one_url", "Slide One Link", array('default' => 'http://cyberchimps.com'))
  120. ->upload($themeslug."_home_slide_two_image", "Slide Two", array('default' => array('url' => TEMPLATE_URL . '/images/responseslider.jpg')))
  121. ->text($themeslug."_home_slide_two_url", "Slide Two Link", array('default' => 'http://cyberchimps.com'))
  122. ->upload($themeslug."_home_slide_three_image", "Slide Three", array('default' => array('url' => TEMPLATE_URL . '/images/responseslider.jpg')))
  123. ->text($themeslug."_home_slide_three_url", "Slide Three Link", array('default' => 'http://cyberchimps.com'))
  124. ->subsection_end()
  125. ->subsection("Callout Options")
  126.             ->textarea($themeslug."_home_callout_text", "Enter your Callout text")
  127.         ->subsection_end()     
  128.     ->section("Blog")
  129.         ->open_outersection()
  130.             ->section_order($themeslug."_blog_section_order", "Drag & Drop Blog Elements", array('options' => array("response_index" => "Post Page", "response_blog_slider" => "Feature Slider",  "response_callout_section" => "Callout Section"), "default" => 'response_blog_slider,response_index'))
  131.         ->close_outersection()
  132.         ->subsection("Blog Options")
  133.             ->images($themeslug."_blog_sidebar", "Sidebar Options", array( 'options' => array("none" => TEMPLATE_URL . '/images/options/none.png',"two-right" => TEMPLATE_URL . '/images/options/tworight.png', "right-left" => TEMPLATE_URL . '/images/options/rightleft.png', "left" => TEMPLATE_URL . '/images/options/left.png',  "right" => TEMPLATE_URL . '/images/options/right.png'), 'default' => 'right'))
  134.             ->checkbox($themeslug."_post_formats", "Post Format Icons",  array('default' => true))
  135.             ->checkbox($themeslug."_show_excerpts", "Post Excerpts")
  136.             ->text($themeslug."_excerpt_link_text", "Excerpt Link Text", array('default' => '(More)…'))
  137.             ->text($themeslug."_excerpt_length", "Excerpt Character Length", array('default' => '55'))
  138.             ->checkbox($themeslug."_show_featured_images", "Featured Images")
  139.             ->select($themeslug."_featured_image_align", "Featured Image Alignment", array( 'options' => array("key1" => "Left", "key2" => "Center", "key3" => "Right")))
  140.             ->text($themeslug."_featured_image_height", "Featured Image Height", array('default' => '100'))
  141.             ->text($themeslug."_featured_image_width", "Featured Image Width", array('default' => '100'))  
  142.             ->multicheck($themeslug."_hide_byline", "Post Byline Elements", array( 'options' => array($themeslug."_hide_author" => "Author" , $themeslug."_hide_categories" => "Categories", $themeslug."_hide_date" => "Date", $themeslug."_hide_comments" => "Comments", $themeslug."_hide_share" => "Share", $themeslug."_hide_tags" => "Tags"), 'default' => array( $themeslug."_hide_tags" => true, $themeslug."_hide_share" => true, $themeslug."_hide_author" => true, $themeslug."_hide_date" => true, $themeslug."_hide_comments" => true, $themeslug."_hide_categories" => true ) ) )
  143.         ->subsection_end()
  144.         ->subsection("Feature Slider")
  145.             ->upload($themeslug."_blog_slide_one_image", "Slide One Image", array('default' => array('url' => TEMPLATE_URL . '/images/responseslider.jpg')))
  146.             ->text($themeslug."_blog_slide_one_url", "Slide One Link", array('default' => 'http://cyberchimps.com'))
  147.             ->upload($themeslug."_blog_slide_two_image", "Slide Two", array('default' => array('url' => TEMPLATE_URL . '/images/responseslider.jpg')))
  148.             ->text($themeslug."_blog_slide_two_url", "Slide Two Link", array('default' => 'http://cyberchimps.com'))
  149.             ->upload($themeslug."_blog_slide_three_image", "Slide Three", array('default' => array('url' => TEMPLATE_URL . '/images/responseslider.jpg')))
  150.             ->text($themeslug."_blog_slide_three_url", "Slide Three Link", array('default' => 'http://cyberchimps.com'))
  151.         ->subsection_end()
  152.         ->subsection("Callout Options")
  153.             ->textarea($themeslug."_blog_callout_text", "Enter your Callout text")
  154.         ->subsection_end()
  155.         ->section("Templates")
  156.         ->subsection("Single Post")
  157.             ->images($themeslug."_single_sidebar", "Sidebar Options", array( 'options' => array("left" => TEMPLATE_URL . '/images/options/left.png', "two-right" => TEMPLATE_URL . '/images/options/tworight.png', "right-left" => TEMPLATE_URL . '/images/options/rightleft.png', "none" => TEMPLATE_URL . '/images/options/none.png', "right" => TEMPLATE_URL . '/images/options/right.png'), 'default' => 'right'))
  158.             ->checkbox($themeslug."_single_breadcrumbs", "Breadcrumbs", array('default' => true))
  159.             ->checkbox($themeslug."_single_show_featured_images", "Featured Images")
  160.             ->checkbox($themeslug."_single_post_formats", "Post Format Icons",  array('default' => true))
  161.             ->multicheck($themeslug."_single_hide_byline", "Post Byline Elements", array( 'options' => array($themeslug."_hide_author" => "Author" , $themeslug."_hide_categories" => "Categories", $themeslug."_hide_date" => "Date", $themeslug."_hide_comments" => "Comments", $themeslug."_hide_share" => "Share", $themeslug."_hide_tags" => "Tags"), 'default' => array( $themeslug."_hide_tags" => true, $themeslug."_hide_share" => true, $themeslug."_hide_author" => true, $themeslug."_hide_date" => true, $themeslug."_hide_comments" => true, $themeslug."_hide_categories" => true ) ) )
  162.             ->checkbox($themeslug."_post_pagination", "Post Pagination Links",  array('default' => true))
  163.         ->subsection_end() 
  164.         ->subsection("Archive")
  165.             ->images($themeslug."_archive_sidebar", "Sidebar Options", array( 'options' => array("left" => TEMPLATE_URL . '/images/options/left.png', "two-right" => TEMPLATE_URL . '/images/options/tworight.png', "right-left" => TEMPLATE_URL . '/images/options/rightleft.png', "none" => TEMPLATE_URL . '/images/options/none.png', "right" => TEMPLATE_URL . '/images/options/right.png'), 'default' => 'right'))
  166.             ->checkbox($themeslug."_archive_breadcrumbs", "Breadcrumbs", array('default' => true))
  167.             ->checkbox($themeslug."_archive_show_excerpts", "Post Excerpts", array('default' => true))
  168.             ->checkbox($themeslug."_archive_show_featured_images", "Featured Images")
  169.             ->checkbox($themeslug."_archive_post_formats", "Post Format Icons",  array('default' => true))
  170.             ->multicheck($themeslug."_archive_hide_byline", "Post Byline Elements", array( 'options' => array($themeslug."_hide_author" => "Author" , $themeslug."_hide_categories" => "Categories", $themeslug."_hide_date" => "Date", $themeslug."_hide_comments" => "Comments", $themeslug."_hide_share" => "Share", $themeslug."_hide_tags" => "Tags"), 'default' => array( $themeslug."_hide_tags" => true, $themeslug."_hide_share" => true, $themeslug."_hide_author" => true, $themeslug."_hide_date" => true, $themeslug."_hide_comments" => true, $themeslug."_hide_categories" => true ) ) )
  171.             ->subsection_end()
  172.         ->subsection("Search")
  173.             ->images($themeslug."_search_sidebar", "Sidebar Options", array( 'options' => array("left" => TEMPLATE_URL . '/images/options/left.png', "two-right" => TEMPLATE_URL . '/images/options/tworight.png', "right-left" => TEMPLATE_URL . '/images/options/rightleft.png', "none" => TEMPLATE_URL . '/images/options/none.png', "right" => TEMPLATE_URL . '/images/options/right.png'), 'default' => 'right'))
  174.             ->checkbox($themeslug."_search_show_excerpts", "Post Excerpts", array('default' => true))
  175.         ->subsection_end()
  176.         ->subsection("404")
  177.             ->images($themeslug."_404_sidebar", "Select the Sidebar Type", array( 'options' => array("left" => TEMPLATE_URL . '/images/options/left.png', "two-right" => TEMPLATE_URL . '/images/options/tworight.png', "right-left" => TEMPLATE_URL . '/images/options/rightleft.png', "none" => TEMPLATE_URL . '/images/options/none.png', "right" => TEMPLATE_URL . '/images/options/right.png'), 'default' => 'right'))
  178.             ->textarea($themeslug."_custom_404", "Custom 404 Content")
  179.         ->subsection_end()
  180.     ->section("Footer")
  181.         ->open_outersection()
  182.             ->text($themeslug."_footer_text", "Footer Copyright Text")
  183.         ->close_outersection() 
  184. ;
  185. }
Advertisement
Add Comment
Please, Sign In to add comment