git-svn-id: https://192.168.0.254/svn/Proyectos.Instaldeco_Web/trunk@15 d4ca0941-a869-4c45-9eab-2e1fd2dd58c0
276 lines
11 KiB
PHP
276 lines
11 KiB
PHP
<?php
|
|
/**
|
|
* A unique identifier is defined to store the options in the database and reference them from the theme.
|
|
* By default it uses the theme name, in lowercase and without spaces, but this can be changed if needed.
|
|
* If the identifier changes, it'll appear as if the options have been reset.
|
|
*
|
|
*/
|
|
|
|
function optionsframework_option_name() {
|
|
|
|
// This gets the theme name from the stylesheet (lowercase and without spaces)
|
|
$themename = get_theme_data(STYLESHEETPATH . '/style.css');
|
|
$themename = $themename['Name'];
|
|
$themename = preg_replace("/\W/", "", strtolower($themename) );
|
|
|
|
$optionsframework_settings = get_option('optionsframework');
|
|
$optionsframework_settings['id'] = $themename;
|
|
update_option('optionsframework', $optionsframework_settings);
|
|
|
|
// echo $themename;
|
|
}
|
|
|
|
/**
|
|
* Defines an array of options that will be used to generate the settings page and be saved in the database.
|
|
* When creating the "id" fields, make sure to use all lowercase and no spaces.
|
|
*
|
|
*/
|
|
|
|
function optionsframework_options() {
|
|
// Pull all the categories into an array
|
|
$options_categories = array();
|
|
$options_categories_obj = get_categories();
|
|
foreach ($options_categories_obj as $category) {
|
|
$options_categories[$category->cat_ID] = $category->cat_name;
|
|
}
|
|
|
|
// Pull all the pages into an array
|
|
$options_pages = array();
|
|
$options_pages_obj = get_pages('sort_column=post_parent,menu_order');
|
|
$options_pages[''] = 'Select a page:';
|
|
foreach ($options_pages_obj as $page) {
|
|
$options_pages[$page->ID] = $page->post_title;
|
|
}
|
|
|
|
// If using image radio buttons, define a directory path
|
|
$imagepath = get_bloginfo('stylesheet_directory') . '/images/';
|
|
|
|
$options = array();
|
|
|
|
$options[] = array("name" => "Basic Settings",
|
|
"type" => "heading");
|
|
|
|
$options[] = array( "name" => "Email Address",
|
|
"desc" => "Enter the email address that you would like to use for the social-networking icons.",
|
|
"id" => "email_address",
|
|
"std" => "",
|
|
"type" => "text");
|
|
|
|
$options[] = array( "name" => "Footer Text",
|
|
"desc" => "Add your copyright phrase or any text to be displayed below the footer (e.g. Copyright 2012. Designed by ProgressionStudios)",
|
|
"id" => "footer_text",
|
|
"std" => "Copyright © 2011 – Instaldeco S.L.",
|
|
"type" => "textarea");
|
|
|
|
$options[] = array("name" => "Social Settings",
|
|
"type" => "heading");
|
|
|
|
$options[] = array( "name" => "Facebook Link",
|
|
"desc" => "Enter the Facebook Link that you would like to use for the social-networking icons. Note: Use http://",
|
|
"id" => "facebook_link",
|
|
"std" => "",
|
|
"type" => "text");
|
|
|
|
$options[] = array( "name" => "Twitter ID",
|
|
"desc" => "Enter the Twitter Link that you would like to use for the social-networking icons. Use http://",
|
|
"id" => "twitter_id",
|
|
"std" => "",
|
|
"type" => "text");
|
|
|
|
$options[] = array( "name" => "Flickr Link",
|
|
"desc" => "Enter the Flickr Link that you would like to use for the social-networking icons. Use http://",
|
|
"id" => "flickr_link",
|
|
"std" => "",
|
|
"type" => "text");
|
|
|
|
$options[] = array( "name" => "Vimeo Link",
|
|
"desc" => "Enter the Vimeo Link that you would like to use for the social-networking icons. Use http://",
|
|
"id" => "vimeo_link",
|
|
"std" => "",
|
|
"type" => "text");
|
|
|
|
$options[] = array( "name" => "Google Link",
|
|
"desc" => "Enter the Google Link that you would like to use for the social-networking icons. Use http://",
|
|
"id" => "google_link",
|
|
"std" => "",
|
|
"type" => "text");
|
|
|
|
$options[] = array( "name" => "StumbleUpon Link",
|
|
"desc" => "Enter the StumbleUpon Link that you would like to use for the social-networking icons. Use http://",
|
|
"id" => "Stumbleupon_link",
|
|
"std" => "",
|
|
"type" => "text");
|
|
|
|
$options[] = array( "name" => "Youtube Link",
|
|
"desc" => "Enter the Youtube Link that you would like to use for the social-networking icons. Use http://",
|
|
"id" => "youtube_link",
|
|
"std" => "",
|
|
"type" => "text");
|
|
|
|
$options[] = array("name" => "Appearence",
|
|
"type" => "heading");
|
|
|
|
$options[] = array( "name" => "Logo",
|
|
"desc" => "Use the upload button to upload your site's logo and then click '<strong>Use this image</strong>'. The <strong>Maximum width is 270px</strong>. The navigation menu is 180px wide. Note: You will have to resize your own logo before uploading.",
|
|
"id" => "logo",
|
|
"std" => get_template_directory_uri() . "/images/logo-instaldeco1.png",
|
|
"type" => "upload");
|
|
|
|
$options[] = array( "name" => "Logo Position",
|
|
"desc" => "This changes the Logo position to the top or bottom. <strong>Note</strong>: The Navigation position should be set to the opposite.",
|
|
"id" => "logo_position",
|
|
"std" => "bottom",
|
|
"type" => "select",
|
|
"class" => "mini",
|
|
"options" => array('top' => 'Top', 'bottom' => 'Bottom'));
|
|
|
|
$options[] = array( "name" => "Navigation Position",
|
|
"desc" => "This changes the Navigation position to the top or bottom. <strong>Note</strong>: The Logo position should be set to the opposite.",
|
|
"id" => "nav_position",
|
|
"std" => "top",
|
|
"type" => "select",
|
|
"class" => "mini",
|
|
"options" => array('top' => 'Top', 'bottom' => 'Bottom'));
|
|
|
|
$options[] = array( "name" => "Favicon",
|
|
"desc" => "Use the upload button to upload your favicon (bookmark icon) and then click '<strong>Use this image</strong>'.",
|
|
"id" => "favicon",
|
|
"std" => "",
|
|
"type" => "upload");
|
|
|
|
$options[] = array( "name" => "Default Background (Required)",
|
|
"desc" => "This is used for the default background image of your website. It will automatically be resized to fit your browser window. Use the upload button to upload your own background and then click '<strong>Use this image</strong>'. The default image(in case you delete it) should be located at: /wp-content/themes/Broadside/images/background.jpg",
|
|
"id" => "default_bg",
|
|
"std" => get_template_directory_uri() . "/images/camouflage.png",
|
|
"type" => "upload");
|
|
|
|
$options[] = array( "name" => "Default Content Background (Required)",
|
|
"desc" => "This is a content background image of your website. It will automatically be resized to fit your content window. Use the upload button to upload your own background and then click '<strong>Use this image</strong>'. The default image(in case you delete it) should be located at: /wp-content/themes/Broadside/images/backgrounds/blog-background.jpg",
|
|
"id" => "blog_bg",
|
|
"std" => get_template_directory_uri() . "/images/backgrounds/about-background.jpg",
|
|
"type" => "upload");
|
|
|
|
$options[] = array( "name" => "Site Height",
|
|
"desc" => "Use this to adjust your site overall height. 'The Space' Live Preview is 600px tall, and 'The Architects' Live Preview is 500px tall. ",
|
|
"id" => "site_height",
|
|
"std" => "600",
|
|
"class" => "mini",
|
|
"type" => "text");
|
|
|
|
$options[] = array( "name" => "Scrollbar Height",
|
|
"desc" => "Use this to adjust at what height the scrollbar will be activated. This will depend on how tall you adjust your site height. ",
|
|
"id" => "scrollbar_height",
|
|
"std" => "400",
|
|
"class" => "mini",
|
|
"type" => "text");
|
|
|
|
$options[] = array( "name" => "Menu Background",
|
|
"desc" => "Use this to change the Menu background color. This includes the navigation and logo background. The default for 'The Space' is #b8174d and the default for 'The Architects' is #f20a0a.",
|
|
"id" => "menu_bg",
|
|
"std" => "#FF6900",
|
|
"type" => "color");
|
|
|
|
$options[] = array( "name" => "Headings Color",
|
|
"desc" => "Use this to change the main headings color. The default for 'The Space' is #000000 and the default for 'The Architects' is #f20a0a.",
|
|
"id" => "headings_color",
|
|
"std" => "#FF8630",
|
|
"type" => "color");
|
|
|
|
$options[] = array( "name" => "Static Menu",
|
|
"desc" => "Use this setting to remove the show/hide on the navigation menu. When marked yes, the navigation menu will be visible at all times.",
|
|
"id" => "static_menu",
|
|
"std" => "no",
|
|
"type" => "select",
|
|
"class" => "mini",
|
|
"options" => array('yes' => 'Yes', 'no' => 'No'));
|
|
|
|
$options[] = array("name" => "Tools",
|
|
"type" => "heading");
|
|
|
|
$options[] = array( "name" => "Homepage Title",
|
|
"desc" => "Enter a title for the homepage, leave blank if you want to use an auto generated one.",
|
|
"id" => "home_title",
|
|
"std" => "Instaldeco",
|
|
"type" => "text");
|
|
|
|
$options[] = array( "name" => "Homepage Meta Description",
|
|
"desc" => "Enter a description for the homepage, about 140 characters.",
|
|
"id" => "home_meta",
|
|
"std" => "Desarrollamos y materializamos cualquier proyecto o idea que llegue a nuestras manos",
|
|
"type" => "text");
|
|
|
|
$options[] = array( "name" => "Tracking Code",
|
|
"desc" => "Paste your tracking code here e.g. Google Analytics etc... without script tags",
|
|
"id" => "tracking_code",
|
|
"std" => "",
|
|
"type" => "textarea");
|
|
|
|
$options[] = array( "name" => "404 Error Message Text",
|
|
"desc" => "Enter your custom 404 error message.",
|
|
"id" => "404_error",
|
|
"std" => "Página no encontrada",
|
|
"type" => "textarea");
|
|
|
|
$options[] = array( "name" => "Custom CSS",
|
|
"desc" => "Past your custom css here... without script tags",
|
|
"id" => "custom_css",
|
|
"std" => "",
|
|
"type" => "textarea");
|
|
|
|
$options[] = array( "name" => "Custom Javascript",
|
|
"desc" => "Past your custom JavaScript code here... without script tags",
|
|
"id" => "custom_js",
|
|
"std" => "",
|
|
"type" => "textarea");
|
|
|
|
$options[] = array("name" => "Slider Settings",
|
|
"type" => "heading");
|
|
|
|
$options[] = array( "name" => "Animation",
|
|
"desc" => "Choose a transition effect between slides.",
|
|
"id" => "animation",
|
|
"std" => "fade",
|
|
"type" => "select",
|
|
"class" => "mini",
|
|
"options" => array('fade' => 'Fade', 'horizontal-slide' => 'Horizontal Slide', 'vertical-slide' => 'Vertical Slide', 'horizontal-push' => 'Horizontal Push'));
|
|
|
|
$options[] = array( "name" => "Animation Speed",
|
|
"desc" => "Duration of animation between images (the time the images changes in).",
|
|
"id" => "speed",
|
|
"std" => "1200",
|
|
"class" => "mini",
|
|
"type" => "text");
|
|
|
|
$options[] = array( "name" => "Timer",
|
|
"desc" => "Show the timer countdown and autoplay. <strong>Note: If turned off, autoplay is off</strong>.",
|
|
"id" => "timer",
|
|
"std" => "true",
|
|
"type" => "select",
|
|
"class" => "mini",
|
|
"options" => array('true' => 'On', 'false' => 'Off'));
|
|
|
|
$options[] = array( "name" => "Transition Speed",
|
|
"desc" => "How long each slide will show.",
|
|
"id" => "transition",
|
|
"std" => "4000",
|
|
"class" => "mini",
|
|
"type" => "text");
|
|
|
|
$options[] = array( "name" => "Arrows",
|
|
"desc" => "Show the next/previous navigation.",
|
|
"id" => "arrows",
|
|
"std" => "false",
|
|
"type" => "select",
|
|
"class" => "mini",
|
|
"options" => array('true' => 'On', 'false' => 'Off'));
|
|
|
|
$options[] = array( "name" => "Bullets",
|
|
"desc" => "Show the bullet navigation.",
|
|
"id" => "bullets",
|
|
"std" => "true",
|
|
"type" => "select",
|
|
"class" => "mini",
|
|
"options" => array('true' => 'On', 'false' => 'Off'));
|
|
|
|
return $options;
|
|
} |