Exemple #1
0
    function shiword_theme_credits()
    {
        ?>
	&copy; <?php 
        echo date('Y');
        ?>
 <strong><?php 
        bloginfo('name');
        ?>
</strong>

	<?php 
        shiword_hook_change_view();
        ?>

	<?php 
        if (shiword_get_opt('shiword_tbcred')) {
            ?>
		<a href="http://www.twobeers.net/" title="Shiword theme<?php 
            echo ' ' . esc_attr(shiword_get_info('version'));
            ?>
 by TwoBeers Crew">
			<img alt="twobeers.net" src="<?php 
            echo esc_url(get_template_directory_uri() . '/images/tb_micrologo.png');
            ?>
" />
		</a>
		<a href="http://wordpress.org/" title="<?php 
            esc_attr_e('Powered by WordPress', 'shiword');
            ?>
">
			<img alt="WordPress" src="<?php 
            echo esc_url(get_template_directory_uri() . '/images/wp_micrologo.png');
            ?>
" />
		</a>
	<?php 
        }
        ?>
 <?php 
    }
Exemple #2
0
    function edit_options()
    {
        global $shiword_opt;
        if (!current_user_can('edit_theme_options')) {
            wp_die(__('You do not have sufficient permissions to access this page.', 'shiword'));
        }
        $the_coa = shiword_get_coa();
        $the_groups = shiword_get_coa('groups');
        $the_option_name = 'shiword_options';
        if (isset($_GET['erase'])) {
            $_SERVER['REQUEST_URI'] = remove_query_arg('erase', $_SERVER['REQUEST_URI']);
            delete_option($the_option_name);
            $this->default_options();
            $shiword_opt = get_option($the_option_name);
        }
        // update version value when admin visit options page
        if ($shiword_opt['version'] < shiword_get_info('version')) {
            $shiword_opt['version'] = shiword_get_info('version');
            update_option($the_option_name, $shiword_opt);
        }
        $the_opt = $shiword_opt;
        ?>
		<div class="wrap">
			<div class="icon32" id="sw-icon"><br></div>
			<h2><?php 
        echo shiword_get_info('current_theme') . ' - ' . __('Theme Options', 'shiword');
        ?>
</h2>
			<?php 
        // options have been updated
        if (isset($_REQUEST['settings-updated'])) {
            //return options save message
            echo '<div id="message" class="updated fade"><p><strong>' . __('Options saved.', 'shiword') . '</strong></p></div>';
        }
        // options to defaults done
        if (isset($_GET['erase'])) {
            echo '<div id="message" class="updated fade"><p><strong>' . __('Defaults values loaded.', 'shiword') . '</strong></p></div>';
        }
        ?>
			<div id="tabs-container">
				<ul id="selector">
					<li id="shiword-options-li">
						<a href="#shiword-options" onClick="shiwordOptions.switchSection(); return false;"><span class="wp-menu-image" style="background-image: url('<?php 
        echo get_admin_url() . 'images/menu.png';
        ?>
')"> </span><?php 
        _e('Theme features', 'shiword');
        ?>
</a>
					</li>
					<li id="shiword-infos-li">
						<a href="#shiword-infos" onClick="shiwordOptions.switchSection(); return false;"><span class="wp-menu-image" style="background-image: url('<?php 
        echo get_admin_url() . 'images/menu.png';
        ?>
')"> </span><?php 
        _e('Info', 'shiword');
        ?>
</a>
					</li>
				</ul>
				<div class="clear"></div>
				<div id="shiword-options">
					<form method="post" action="options.php">
						<?php 
        settings_fields('shiword_settings_group');
        ?>
						<ul id="sw-tabselector" class="hide-if-no-js">
						<?php 
        foreach ($the_groups as $key => $name) {
            ?>
							<li id="selgroup-<?php 
            echo $key;
            ?>
"><a href="#" onClick="shiwordOptions.switchTab('<?php 
            echo $key;
            ?>
'); return false;"><?php 
            echo $name;
            ?>
</a></li>
						<?php 
        }
        ?>
						</ul>
						<h2 class="hide-if-js" style="text-align: center;"><?php 
        _e('Options', 'shiword');
        ?>
</h2>
						<?php 
        foreach ($the_coa as $key => $val) {
            ?>
							<?php 
            if (isset($the_coa[$key]['sub']) && !$the_coa[$key]['sub']) {
                continue;
            }
            ?>
							<div class="sw-tab-opt sw-tabgroup-<?php 
            echo $the_coa[$key]['group'];
            ?>
">
								<span class="column-nam"><?php 
            echo $the_coa[$key]['description'];
            ?>
</span>
							<?php 
            if (!isset($the_opt[$key])) {
                $the_opt[$key] = $the_coa[$key]['default'];
            }
            ?>
							<?php 
            if ($the_coa[$key]['type'] == 'chk') {
                ?>
								<input name="shiword_options[<?php 
                echo $key;
                ?>
]" value="1" type="checkbox" class="ww_opt_p_checkbox" <?php 
                checked(1, $the_opt[$key]);
                ?>
 />
							<?php 
            } elseif ($the_coa[$key]['type'] == 'txt' || $the_coa[$key]['type'] == 'int') {
                ?>
								<input name="shiword_options[<?php 
                echo $key;
                ?>
]" value="<?php 
                echo $the_opt[$key];
                ?>
" type="text" />
							<?php 
            } elseif ($the_coa[$key]['type'] == 'txtarea') {
                ?>
								<textarea name="shiword_options[<?php 
                echo $key;
                ?>
]"><?php 
                echo $the_opt[$key];
                ?>
</textarea>
							<?php 
            } elseif ($the_coa[$key]['type'] == 'sel') {
                ?>
								<select name="shiword_options[<?php 
                echo $key;
                ?>
]">
								<?php 
                foreach ($the_coa[$key]['options'] as $optionkey => $option) {
                    ?>
									<option value="<?php 
                    echo $option;
                    ?>
" <?php 
                    selected($the_opt[$key], $option);
                    ?>
><?php 
                    echo $the_coa[$key]['options_readable'][$optionkey];
                    ?>
</option>
								<?php 
                }
                ?>
								</select>
							<?php 
            } elseif ($the_coa[$key]['type'] == 'opt') {
                ?>
								<?php 
                foreach ($the_coa[$key]['options'] as $optionkey => $option) {
                    ?>
									<label title="<?php 
                    echo esc_attr($option);
                    ?>
"><input type="radio" <?php 
                    checked($the_opt[$key], $option);
                    ?>
 value="<?php 
                    echo $option;
                    ?>
" name="shiword_options[<?php 
                    echo $key;
                    ?>
]"> <span><?php 
                    echo $the_coa[$key]['options_readable'][$optionkey];
                    ?>
</span></label>
								<?php 
                }
                ?>
							<?php 
            } elseif ($the_coa[$key]['type'] == 'col') {
                ?>
								<input class="color_picker" type="text" name="shiword_options[<?php 
                echo $key;
                ?>
]" id="shiword_options[<?php 
                echo $key;
                ?>
]" value="<?php 
                echo $the_opt[$key];
                ?>
" data-default-color="<?php 
                echo $the_coa[$key]['default'];
                ?>
" />
								<span class="description hide-if-js"><?php 
                _e('Default', 'shiword');
                ?>
: <?php 
                echo $the_coa[$key]['default'];
                ?>
</span>
							<?php 
            }
            ?>
								<?php 
            if ($the_coa[$key]['req'] != '') {
                ?>
<div class="column-req"><?php 
                echo '<u>' . __('requires', 'shiword') . '</u>: ' . $the_coa[$the_coa[$key]['req']]['description'];
                ?>
</div><?php 
            }
            ?>
								<div class="column-des"><?php 
            echo $the_coa[$key]['info'];
            ?>
</div>
							<?php 
            if (isset($the_coa[$key]['sub'])) {
                ?>
									<div class="sw-sub-opt">
								<?php 
                foreach ($the_coa[$key]['sub'] as $subkey => $subval) {
                    ?>
									<?php 
                    if ($subval == '') {
                        echo '<br>';
                        continue;
                    }
                    ?>
									<?php 
                    if (!isset($the_opt[$subval])) {
                        $the_opt[$subval] = $the_coa[$subval]['default'];
                    }
                    ?>
									<?php 
                    if ($the_coa[$subval]['type'] == 'chk') {
                        ?>
										<input name="shiword_options[<?php 
                        echo $subval;
                        ?>
]" value="1" type="checkbox" class="ww_opt_p_checkbox" <?php 
                        checked(1, $the_opt[$subval]);
                        ?>
 />
										<span class="sw-sub-opt-nam"><?php 
                        echo $the_coa[$subval]['description'];
                        ?>
</span>
									<?php 
                    } elseif ($the_coa[$subval]['type'] == 'txt' || $the_coa[$subval]['type'] == 'int') {
                        ?>
										<span class="sw-sub-opt-nam"><?php 
                        echo $the_coa[$subval]['description'];
                        ?>
</span> :
										<input name="shiword_options[<?php 
                        echo $subval;
                        ?>
]" value="<?php 
                        echo $the_opt[$subval];
                        ?>
" type="text" />
									<?php 
                    } elseif ($the_coa[$subval]['type'] == 'sel') {
                        ?>
										<span class="sw-sub-opt-nam"><?php 
                        echo $the_coa[$subval]['description'];
                        ?>
</span> :
										<select name="shiword_options[<?php 
                        echo $subval;
                        ?>
]">
										<?php 
                        foreach ($the_coa[$subval]['options'] as $optionkey => $option) {
                            ?>
											<option value="<?php 
                            echo $option;
                            ?>
" <?php 
                            selected($the_opt[$subval], $option);
                            ?>
><?php 
                            echo $the_coa[$subval]['options_readable'][$optionkey];
                            ?>
</option>
										<?php 
                        }
                        ?>
										</select>
									<?php 
                    } elseif ($the_coa[$subval]['type'] == 'opt') {
                        ?>
										<span class="sw-sub-opt-nam"><?php 
                        echo $the_coa[$subval]['description'];
                        ?>
</span> :
										<?php 
                        foreach ($the_coa[$subval]['options'] as $optionkey => $option) {
                            ?>
											<label title="<?php 
                            echo esc_attr($option);
                            ?>
"><input type="radio" <?php 
                            checked($the_opt[$subval], $option);
                            ?>
 value="<?php 
                            echo $option;
                            ?>
" name="shiword_options[<?php 
                            echo $subval;
                            ?>
]"> <span><?php 
                            echo $the_coa[$subval]['options_readable'][$optionkey];
                            ?>
</span></label>
										<?php 
                        }
                        ?>
									<?php 
                    } elseif ($the_coa[$subval]['type'] == 'col') {
                        ?>
										<span class="sw-sub-opt-nam"><?php 
                        echo $the_coa[$subval]['description'];
                        ?>
</span> :
										<input class="color_picker" type="text" name="shiword_options[<?php 
                        echo $subval;
                        ?>
]" id="shiword_options[<?php 
                        echo $subval;
                        ?>
]" value="<?php 
                        echo $the_opt[$subval];
                        ?>
" data-default-color="<?php 
                        echo $the_coa[$subval]['default'];
                        ?>
" />
										<span class="description hide-if-js"><?php 
                        _e('Default', 'shiword');
                        ?>
: <?php 
                        echo $the_coa[$subval]['default'];
                        ?>
</span>
									<?php 
                    }
                    ?>
									<?php 
                    if ($the_coa[$subval]['info'] != '') {
                        ?>
 - <span class="sw-sub-opt-des"><?php 
                        echo $the_coa[$subval]['info'];
                        ?>
</span><?php 
                    }
                    ?>
									</br>
								<?php 
                }
                ?>
									</div>
							<?php 
            }
            ?>
							</div>
						<?php 
        }
        ?>
						<div id="sw-submit">
							<input type="hidden" name="shiword_options[hidden_opt]" value="default" />
							<input class="button-primary" type="submit" name="Submit" value="<?php 
        _e('Update Options', 'shiword');
        ?>
" />
							<a href="themes.php?page=tb_shiword_functions" target="_self"><?php 
        _e('Undo Changes', 'shiword');
        ?>
</a>
							|
							<a id="to-defaults" href="themes.php?page=tb_shiword_functions&erase=1" target="_self"><?php 
        _e('Back to defaults', 'shiword');
        ?>
</a>
						</div>
					</form>
				</div>
				<div id="shiword-infos">
					<h2 class="hide-if-js" style="text-align: center;"><?php 
        _e('Info', 'shiword');
        ?>
</h2>
					<?php 
        locate_template('readme.html', true);
        ?>
				</div>
				<div class="clear"></div>
			</div>
			<div class="stylediv">
				<small>
					<?php 
        _e('If you like/dislike this theme, or if you encounter any issues, please let us know it.', 'shiword');
        ?>
<br />
					<a href="<?php 
        echo esc_url('http://www.twobeers.net/annunci/shiword');
        ?>
" title="Shiword theme" target="_blank"><?php 
        _e('Leave a feedback', 'shiword');
        ?>
</a>
				</small>
			</div>
			<div class="stylediv">
				<small>Support the theme in your language, provide a <a href="<?php 
        echo esc_url('http://www.twobeers.net/temi-wp/wordpress-themes-translations');
        ?>
" title="Themes translation" target="_blank">translation</a>.</small>
			</div>
		</div>
		<?php 
    }
    function step_1()
    {
        global $shiword_colors;
        /* Holds the inside colors descriptions */
        $default_device_colors_descr = array('menu1' => __('Background', 'shiword'), 'menu2' => __('Borders', 'shiword'), 'menu3' => __('Text', 'shiword'), 'menu4' => __('Links', 'shiword'), 'menu5' => __('Highlighted Links', 'shiword'), 'menu6' => __('Inner borders', 'shiword'), 'main3' => __('Links', 'shiword'), 'main4' => __('Highlighted Links', 'shiword'));
        $this->process_default_device_images();
        $this->build_style();
        ?>
<div class="wrap">
	<div class="icon32" id="sw-icon"><br></div>
	<h2><?php 
        echo shiword_get_info('current_theme') . ' - ' . __('Custom Colors', 'shiword');
        ?>
</h2>

	<?php 
        if (!empty($this->updated)) {
            ?>
		<div id="message" class="updated">
			<p><?php 
            printf(__('Colors updated. <a href="%s">Visit your site</a> to see how it looks.', 'shiword'), home_url('/'));
            ?>
</p>
		</div>
	<?php 
        }
        ?>

	<?php 
        $this->show_preview();
        ?>

	<div class="fields_wrap">
		<h3 class="h3_field"><?php 
        _e('Exterior Colors', 'shiword');
        ?>
 <a class="hide-if-no-js" href="#" onclick="shiwordCustomColors.secOpen('.shi_bgc'); return false;">&raquo;</a></h3>
		<div class="shi_bgc">
			<table class="form-table">
				<tbody>
					<tr valign="top">
						<td style="width:200px;"><?php 
        _e('Upload Image', 'shiword');
        ?>
</td>
						<td>
							<?php 
        _e('You can upload a custom skin image.', 'shiword');
        ?>
							<br />
							<form enctype="multipart/form-data" id="upload-form" method="post" action="<?php 
        echo esc_attr(add_query_arg('step', 2));
        ?>
">
								<p>
									<label for="upload"><?php 
        _e('Choose an image from your computer:', 'shiword');
        ?>
</label><br />
									<input type="file" id="upload" name="import" />
									<input type="hidden" name="action" value="save" />
									<?php 
        wp_nonce_field('load-custom-image', 'nonce-load-custom-image');
        ?>
									<input type="submit" class="button" value="<?php 
        esc_attr_e('Upload', 'shiword');
        ?>
" />
								</p>
							</form>
						</td>
					</tr>
				</tbody>
			</table>
		</div>

		<form method="post" action="<?php 
        echo esc_attr(add_query_arg('step', 3));
        ?>
">
			<div class="shi_bgc">
				<table class="form-table">
					<tbody>
						<tr>
							<td><?php 
        _e('Choose Image', 'shiword');
        ?>
</td>
							<td>
								<p>
									<label for="choose-from-library-link"><?php 
        _e('Choose an image from your media library:', 'shiword');
        ?>
</label><br />
									<input type="text" id="custom-device-image" name="custom-device-image" />
									<a id="choose-skin-from-library-link" class="button"
										data-choose="<?php 
        esc_attr_e('Choose a Custom Skin', 'shiword');
        ?>
"
										data-update="<?php 
        esc_attr_e('Set as skin', 'shiword');
        ?>
"><?php 
        _e('Choose Image', 'shiword');
        ?>
</a>
								</p>
							</td>
						</tr>
						<?php 
        if (!empty($this->default_device_images)) {
            ?>
							<tr valign="top">
								<td style="width:200px;"><?php 
            _e('Default Images', 'shiword');
            ?>
</td>
								<td>
									<?php 
            _e('If you don&lsquo;t want to upload your own image, you can choose from one of the following.', 'shiword');
            ?>
									<?php 
            $this->show_default_header_selector();
            ?>
								</td>
							</tr>
						<?php 
        }
        if ($shiword_colors['device_image'] != '') {
            ?>
							<tr valign="top">
								<td style="width:200px;"><?php 
            _e('Remove Image', 'shiword');
            ?>
</td>
								<td>
									<?php 
            _e('This will remove the background image.', 'shiword');
            ?>
									<input type="submit" class="button" name="removedeviceimage" value="<?php 
            esc_attr_e('Remove Image', 'shiword');
            ?>
" />
								</td>
							</tr>
						<?php 
        }
        ?>
						<tr valign="top">
							<td style="width:200px;"><?php 
        _e('Background Color', 'shiword');
        ?>
</td>
							<td>
								<input class="color_picker" type="text" name="devicecolor" id="shi_input_1" value="<?php 
        echo $shiword_colors['device_color'];
        ?>
" data-default-color="<?php 
        echo $this->default_device_bg['device_color'];
        ?>
" />
								<span class="description hide-if-js"><?php 
        _e('Default', 'shiword');
        ?>
: <?php 
        echo $this->default_device_bg['device_color'];
        ?>
</span>
								<span class="hide-if-no-js"><a href="#" onclick="shiwordCustomColors.pickColor('shi_input_1','transparent'); return false;"><?php 
        _e("Set to \"transparent\"", 'shiword');
        ?>
</a></span>
								<br />
								<div id="alpha_slider_wrap" style="padding-top:5px;">
									<span class="opaopt" style="margin-left: 40px;"><?php 
        _e('Opacity', 'shiword');
        ?>
 [0-100] <!--[if lte IE 8]><span style="color:#ff0000;">Not supported in Internet Explorer 8 and below </span><![endif]--><input type="text" name="deviceopacity" id="shi_input_1a" value="<?php 
        echo $shiword_colors['device_opacity'];
        ?>
" maxlength="3" size="3" /> %</span>
									<div id="alpha_slider" class="slider hide-if-no-js"></div>
								</div>
							</td>
						</tr>
						<tr valign="top">
							<td style="width:200px;"><?php 
        _e('Text Color', 'shiword');
        ?>
</td>
							<td>
								<input class="color_picker" type="text" name="devicetextcolor" id="shi_input_2" value="<?php 
        echo $shiword_colors['device_textcolor'];
        ?>
" data-default-color="<?php 
        echo $this->default_device_bg['device_textcolor'];
        ?>
" />
								<span class="description hide-if-js"><?php 
        _e('Default', 'shiword');
        ?>
: <?php 
        echo $this->default_device_bg['device_textcolor'];
        ?>
</span>
							</td>
						</tr>
						<tr valign="top">
							<td style="width:200px;"><?php 
        _e('Buttons Style', 'shiword');
        ?>
</td>
							<td>
								<select id="shi_select_1" name="devicebuttonstyle">
									<option value="light" <?php 
        selected($shiword_colors['device_button_style'], 'light');
        ?>
><?php 
        _e('light', 'shiword');
        ?>
</option>
									<option value="dark" <?php 
        selected($shiword_colors['device_button_style'], 'dark');
        ?>
><?php 
        _e('dark', 'shiword');
        ?>
</option>
								</select>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
		
			<div style="position: relative">
				<h3 class="h3_field"><?php 
        _e('Interior Colors', 'shiword');
        ?>
 <a class="hide-if-no-js" href="#" onclick="shiwordCustomColors.secOpen('.shi_cc'); return false;">&raquo;</a></h3>
				<div class="shi_cc">
					<table class="form-table">
						<?php 
        foreach ($this->default_device_colors as $key => $val) {
            ?>
							<?php 
            if ($key == 'main3') {
                echo '<tr><td style="font-weight:bold;" colspan="2">' . __('Main Content', 'shiword') . '</td></tr>';
            } elseif ($key == 'menu1') {
                echo '<tr><td style="font-weight:bold; border-top:1px solid #CCCCCC;" colspan="2">' . __('Pages Menu and Floating Menu', 'shiword') . '</td></tr>';
            }
            ?>
							<tr>
								<td style="width:200px;"><?php 
            echo $default_device_colors_descr[$key];
            ?>
</td>
								<td>
									<input class="color_picker" type="text" name="<?php 
            echo $key;
            ?>
" id="shi_input_<?php 
            echo $key;
            ?>
" value="<?php 
            echo $shiword_colors[$key];
            ?>
" data-default-color="<?php 
            echo $val;
            ?>
" />
									<span class="description hide-if-js"><?php 
            _e('Default', 'shiword');
            ?>
: <?php 
            echo $val;
            ?>
</span>
								</td>
							</tr>
						<?php 
        }
        ?>
					</table>
				</div>
			</div>

			
			<?php 
        wp_nonce_field('set-custom-colors', 'nonce-set-custom-colors');
        ?>
			<p class="submit"><input type="submit" class="button-primary" name="save-device-options" value="<?php 
        esc_attr_e('Save Changes', 'shiword');
        ?>
" /></p>
		</form>
	</div>
</div>
<?php 
    }
Exemple #4
0
 function stylesheet()
 {
     if (is_admin()) {
         return;
     }
     wp_enqueue_style('tbm-mobile-style', get_template_directory_uri() . '/mobile/style-mobile.css', false, shiword_get_info('version'), 'screen');
 }