本文整理汇总了PHP中save_option函数的典型用法代码示例。如果您正苦于以下问题:PHP save_option函数的具体用法?PHP save_option怎么用?PHP save_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了save_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testOptions
public function testOptions()
{
$data = array();
$data['today'] = date('Y-m-d');
$data['option_key'] = 'a_test';
$data = json_encode($data);
$save = save_option($data);
$get = get_option('a_test', $data);
d($get);
}
示例2: save_option_reply_prefix
/**
* This function saves the reply prefix (body_quote) character(s)
* @param object $option
*/
function save_option_reply_prefix($option)
{
// save as "NONE" if it was blanked out
//
if (empty($option->new_value)) {
$option->new_value = 'NONE';
}
// Save the option like normal.
//
save_option($option);
}
示例3: testOptions
public function testOptions()
{
$data = array();
$now = date('YmdHis');
$data['option_value'] = $now;
$data['option_key'] = 'a_test';
$data['option_group'] = 'test';
$save = save_option($data);
$get = get_option('a_test', 'test');
$this->assertEquals($now, $get);
}
示例4: save_goodlayers_panel
function save_goodlayers_panel()
{
check_ajax_referer(plugin_basename(__FILE__), 'security');
global $goodlayers_element;
foreach ($goodlayers_element as $elements) {
foreach ($elements as $element) {
// when save sidebar
if ($element['type'] == 'sidebar') {
$sidebar_xml = '<sidebar>';
$sidebar = $_POST[$element['name']];
foreach ($sidebar as $sidebar_name) {
$sidebar_xml = $sidebar_xml . create_xml_tag('name', $sidebar_name);
}
$sidebar_xml = $sidebar_xml . '</sidebar>';
if (!save_option($element['name'], get_option($element['name']), $sidebar_xml)) {
die('-1');
}
// when save uploaded font
} else {
if ($element['type'] == 'uploadfont') {
$uploadfont_xml = '<uploadfont>';
$uploadfont = $_POST[$element['name']];
$uploadfont_file = $_POST[$element['file']];
$num = sizeof($uploadfont);
for ($i = 0; $i < $num; $i++) {
$uploadfont_xml = $uploadfont_xml . '<font>';
$uploadfont_xml = $uploadfont_xml . create_xml_tag('name', $uploadfont[$i]);
$uploadfont_xml = $uploadfont_xml . create_xml_tag('file', $uploadfont_file[$i]);
$uploadfont_xml = $uploadfont_xml . '</font>';
}
$uploadfont_xml = $uploadfont_xml . '</uploadfont>';
if (!save_option($element['name'], get_option($element['name']), $uploadfont_xml)) {
die('-1');
}
// do nothing with dummy button
} else {
if ($element['type'] == 'dummy') {
} else {
$new_option_value = str_replace("\\'", "'", $_POST[$element['name']]);
$new_option_value = str_replace('\\"', '"', $new_option_value);
$new_option_value = str_replace('\\\\', '\\', $new_option_value);
if (!save_option($element['name'], get_option($element['name']), $new_option_value)) {
die('-1');
}
}
}
}
}
}
die('0');
}
示例5: homepage_settings
function homepage_settings()
{
foreach ($_REQUEST as $keys => $values) {
${$keys} = trim($values);
}
$return_data = array('success' => '-1', 'alert' => 'Save option failed, please try contacting your host provider to increase the post_max_size and suhosin.post.max_vars varialble on the server.');
?>
<?php
if (isset($action) and $action == 'homepage_settings') {
$homepage_xml = '<homepage_settings>';
$homepage_xml = $homepage_xml . create_xml_tag('homepage_newsline_on', $homepage_newsline_on);
$homepage_xml = $homepage_xml . create_xml_tag('header_headline', htmlspecialchars(stripslashes($header_headline)));
$homepage_xml = $homepage_xml . create_xml_tag('section_headline_category', $section_headline_category);
$homepage_xml = $homepage_xml . create_xml_tag('homepage_twitter_on', $homepage_twitter_on);
$homepage_xml = $homepage_xml . create_xml_tag('header_twitter', htmlspecialchars(stripslashes($header_twitter)));
$homepage_xml = $homepage_xml . create_xml_tag('consumer_key', $consumer_key);
$homepage_xml = $homepage_xml . create_xml_tag('consumer_secret', $consumer_secret);
$homepage_xml = $homepage_xml . create_xml_tag('user_token', $user_token);
$homepage_xml = $homepage_xml . create_xml_tag('user_secret', $user_secret);
$homepage_xml = $homepage_xml . create_xml_tag('twitter_id', htmlspecialchars(stripslashes($twitter_id)));
$homepage_xml = $homepage_xml . create_xml_tag('homepage_layout_on', $homepage_layout_on);
// $homepage_xml = $homepage_xml . create_xml_tag('section_select_background',$section_select_background);
// $homepage_xml = $homepage_xml . create_xml_tag('section_scheme',$section_scheme);
// $homepage_xml = $homepage_xml . create_xml_tag('section_patren',$section_patren);
// $homepage_xml = $homepage_xml . create_xml_tag('section_body_patren',$section_body_patren);
$homepage_xml = $homepage_xml . create_xml_tag('footer_sec_title', htmlspecialchars(stripslashes($footer_sec_title)));
$homepage_xml = $homepage_xml . create_xml_tag('home_page_layout', $home_page_layout);
$homepage_xml = $homepage_xml . '</homepage_settings>';
if (!save_option('homepage_settings', get_option('homepage_settings'), $homepage_xml)) {
die(json_encode($return_data));
}
die(json_encode(array('success' => '0')));
}
$homepage_newsline_on = '';
$header_headline = '';
$section_headline_category = '';
$homepage_twitter_on = '';
$header_twitter = '';
$consumer_key = '';
$consumer_secret = '';
$user_token = '';
$user_secret = '';
$twitter_id = '';
$homepage_on = '';
$homepage_layout_on = '';
// $section_select_background = '';
// $section_scheme = '';
// $section_patren = '';
// $section_body_patren = '';
$footer_sec_title = '';
$home_page_layout = '';
$cp_typography_settings = get_option('homepage_settings');
if ($cp_typography_settings != '') {
$cp_typo = new DOMDocument();
$cp_typo->loadXML($cp_typography_settings);
$homepage_newsline_on = find_xml_value($cp_typo->documentElement, 'homepage_newsline_on');
$header_headline = find_xml_value($cp_typo->documentElement, 'header_headline');
$section_headline_category = find_xml_value($cp_typo->documentElement, 'section_headline_category');
$homepage_twitter_on = find_xml_value($cp_typo->documentElement, 'homepage_twitter_on');
$header_twitter = find_xml_value($cp_typo->documentElement, 'header_twitter');
$consumer_key = find_xml_value($cp_typo->documentElement, 'consumer_key');
$consumer_secret = find_xml_value($cp_typo->documentElement, 'consumer_secret');
$user_token = find_xml_value($cp_typo->documentElement, 'user_token');
$user_secret = find_xml_value($cp_typo->documentElement, 'user_secret');
$twitter_id = find_xml_value($cp_typo->documentElement, 'twitter_id');
$homepage_layout_on = find_xml_value($cp_typo->documentElement, 'homepage_layout_on');
// $section_select_background = find_xml_value($cp_typo->documentElement,'section_select_background');
// $section_scheme = find_xml_value($cp_typo->documentElement,'section_scheme');
// $section_patren = find_xml_value($cp_typo->documentElement,'section_patren');
// $section_body_patren = find_xml_value($cp_typo->documentElement,'section_body_patren');
$footer_sec_title = find_xml_value($cp_typo->documentElement, 'footer_sec_title');
$home_page_layout = find_xml_value($cp_typo->documentElement, 'home_page_layout');
}
?>
<div id="wrapper_backend cp-margin-left">
<div id="header_theme_options"> <span id="backend_logo"> <h1> <a href="#"><h3> <?php
_e('CrunchPress Framework', 'crunchpress');
?>
</h3>
</a> </h1> </span>
</div>
<div class="wrapper_1">
<?php
echo top_navigation_html();
?>
</div>
<div class="below_wrapper tabs">
<div class="wrapper_left">
<ul id="wp_t_o_right_menu">
<li class="home_layout" id="active_tab"><?php
_e('Home Page Layout', 'crunchpress');
?>
</li>
<li class="footer_area"><?php
_e('Footer Layout', 'crunchpress');
?>
</li>
</ul>
//.........这里部分代码省略.........
示例6: is_custom_style_generated
function is_custom_style_generated()
{
if (get_option(THEME_SHORT_NAME . '_stylesheet_generated') == 'No') {
gdl_generate_style_custom();
save_option(THEME_SHORT_NAME . '_stylesheet_generated', 'No', '');
}
}
示例7: general_options
//.........这里部分代码省略.........
$general_logo_xml = $general_logo_xml . create_xml_tag('body_image', $body_image);
$general_logo_xml = $general_logo_xml . create_xml_tag('position_image_layout', $position_image_layout);
$general_logo_xml = $general_logo_xml . create_xml_tag('image_repeat_layout', $image_repeat_layout);
$general_logo_xml = $general_logo_xml . create_xml_tag('image_attachment_layout', $image_attachment_layout);
$general_logo_xml = $general_logo_xml . create_xml_tag('contact_us_code', htmlspecialchars(stripslashes($contact_us_code)));
$general_logo_xml = $general_logo_xml . create_xml_tag('topcounter_circle', $topcounter_circle);
$general_logo_xml = $general_logo_xml . create_xml_tag('countd_event_category', $countd_event_category);
$general_logo_xml = $general_logo_xml . create_xml_tag('header_css_code', htmlspecialchars(stripslashes($header_css_code)));
$general_logo_xml = $general_logo_xml . create_xml_tag('google_webmaster_code', htmlspecialchars(stripslashes($google_webmaster_code)));
$general_logo_xml = $general_logo_xml . create_xml_tag('topbutton_icon', $topbutton_icon);
$general_logo_xml = $general_logo_xml . create_xml_tag('topcart_icon', $topcart_icon);
$general_logo_xml = $general_logo_xml . create_xml_tag('topsocial_icon', $topsocial_icon);
$general_logo_xml = $general_logo_xml . create_xml_tag('select_footer_cp', $select_footer_cp);
$general_logo_xml = $general_logo_xml . create_xml_tag('footer_style_apply', $footer_style_apply);
$general_logo_xml = $general_logo_xml . create_xml_tag('footer_upper_layout', $footer_upper_layout);
$general_logo_xml = $general_logo_xml . create_xml_tag('copyright_code', htmlspecialchars(stripslashes($copyright_code)));
$general_logo_xml = $general_logo_xml . create_xml_tag('social_networking', $social_networking);
$general_logo_xml = $general_logo_xml . create_xml_tag('top_count_header', $top_count_header);
$general_logo_xml = $general_logo_xml . create_xml_tag('footer_banner', htmlspecialchars(stripslashes($footer_banner)));
$general_logo_xml = $general_logo_xml . create_xml_tag('footer_col_layout', $footer_col_layout);
$general_logo_xml = $general_logo_xml . create_xml_tag('breadcrumbs', $breadcrumbs);
$general_logo_xml = $general_logo_xml . create_xml_tag('rtl_layout', $rtl_layout);
$general_logo_xml = $general_logo_xml . create_xml_tag('site_loader', $site_loader);
$general_logo_xml = $general_logo_xml . create_xml_tag('element_loader', $element_loader);
$general_logo_xml = $general_logo_xml . create_xml_tag('maintenance_mode', $maintenance_mode);
$general_logo_xml = $general_logo_xml . create_xml_tag('maintenace_title', htmlspecialchars(stripslashes($maintenace_title)));
$general_logo_xml = $general_logo_xml . create_xml_tag('countdown_time', $countdown_time);
$general_logo_xml = $general_logo_xml . create_xml_tag('email_mainte', $email_mainte);
$general_logo_xml = $general_logo_xml . create_xml_tag('mainte_description', htmlspecialchars(stripslashes($mainte_description)));
$general_logo_xml = $general_logo_xml . create_xml_tag('social_icons_mainte', $social_icons_mainte);
$general_logo_xml = $general_logo_xml . create_xml_tag('tf_username', $tf_username);
$general_logo_xml = $general_logo_xml . create_xml_tag('tf_sec_api', $tf_sec_api);
$general_logo_xml = $general_logo_xml . '</general_settings>';
if (!save_option('general_settings', get_option('general_settings'), $general_logo_xml)) {
die(json_encode($return_data));
}
die(json_encode(array('success' => '0')));
}
?>
</div>
<?php
$header_logo_upload = '';
$logo_width = '';
$logo_height = '';
$select_layout_cp = '';
//$boxed_scheme = '';
$select_bg_pat = '';
$scheme_color_scheme = '';
$color_scheme = '';
//$color_scheme_1 = '';
$border_color = '';
$button_color = '';
$button_hover_color = '';
$color_patren = '';
$bg_scheme = '';
$body_patren = '';
$body_image = '';
$position_image_layout = '';
$image_repeat_layout = '';
$image_attachment_layout = '';
$contact_us_code = '';
$header_css_code = '';
$google_webmaster_code = '';
$topbutton_icon = '';
$footer_upper_layout = '';
$select_header_cp = '';
示例8: template_save_css
function template_save_css($params)
{
$is_admin = $this->app->user_manager->is_admin();
if ($is_admin == false) {
return false;
}
if (is_string($params)) {
$params = parse_params($params);
}
$ref_page = false;
if (!isset($params['active_site_template'])) {
if (!isset($params['content_id'])) {
if (isset($_SERVER['HTTP_REFERER'])) {
$ref_page_url = $_SERVER['HTTP_REFERER'];
if ($ref_page_url != '') {
$ref_page_url_rel = str_ireplace(site_url(), '', $ref_page_url);
if ($ref_page_url_rel == '') {
$ref_page1 = $this->app->content_manager->homepage();
} else {
$ref_page1 = $this->app->content_manager->get_by_url($ref_page_url, true);
}
if (isset($ref_page1['id'])) {
$ref_page = $this->app->content_manager->get_by_id(intval($ref_page1['id']));
}
}
}
} else {
$ref_page = $this->app->content_manager->get_by_id(intval($params['content_id']));
}
if (isset($ref_page['id']) and isset($ref_page['content_type']) and $ref_page['content_type'] != 'page') {
$ref_page_parent = $this->app->content_manager->get_by_id(intval($ref_page['id']));
if (isset($ref_page_partent['parent']) and intval($ref_page_partent['parent']) != 0) {
$ref_page = $this->app->content_manager->get_by_id(intval($ref_page_partent['id']));
} else {
$ref_page_parents = $this->app->content_manager->get_parents(intval($ref_page['id']));
if (!empty($ref_page_parents)) {
$ref_page_parent = array_pop($ref_page_parents);
$ref_page = $this->app->content_manager->get_by_id($ref_page_parent);
}
}
}
} else {
$ref_page = $params;
}
if (!is_array($ref_page) or empty($ref_page)) {
return false;
}
$pd = $ref_page;
if ($is_admin == true and is_array($pd)) {
$save_page = $pd;
if (isset($save_page["layout_file"]) and $save_page["layout_file"] == 'inherit') {
$inherit_from_id = $this->app->content_manager->get_inherited_parent($save_page["id"]);
$inherit_from = $this->app->content_manager->get_by_id($inherit_from_id);
if (is_array($inherit_from) and isset($inherit_from['active_site_template'])) {
$save_page['active_site_template'] = $inherit_from['active_site_template'];
$save_page['layout_file'] = $inherit_from['layout_file'];
}
}
$template = false;
if (!isset($save_page['active_site_template']) or $save_page['active_site_template'] == '') {
$template = 'default';
} else {
if (isset($save_page['active_site_template'])) {
$template = $save_page['active_site_template'];
}
}
if ($template == 'default') {
$site_template_settings = $this->app->option_manager->get('current_template', 'template');
if ($site_template_settings != false and $site_template_settings != 'default') {
$template = $site_template_settings;
}
}
$final_file_blocks = array();
if ($template != false) {
if (isset($_POST['save_template_settings'])) {
$json = json_encode($_POST);
$option = array();
$option['option_value'] = $json;
$option['option_key'] = 'template_settings';
$option['option_group'] = 'template_' . $template;
save_option($option);
}
$template_folder = templates_path() . $template . DS;
$template_url = templates_url() . $template . '/';
$this_template_url = THIS_TEMPLATE_URL;
$template_folder = userfiles_path() . 'css' . DS . $template . DS;
if (!is_dir($template_folder)) {
mkdir_recursive($template_folder);
}
$live_edit_css = $template_folder . 'live_edit.css';
$fcont = '';
if (is_file($live_edit_css)) {
$fcont = file_get_contents($live_edit_css);
}
$css_cont = $fcont;
$css_cont_new = $css_cont;
//@import on top
$sort_params = array();
$sort_params2 = array();
foreach ($params as $item) {
//.........这里部分代码省略.........
示例9: newsletter_settings
function newsletter_settings()
{
foreach ($_REQUEST as $keys => $values) {
${$keys} = trim($values);
}
$return_data = array('success' => '-1', 'alert' => 'Save option failed, please try contacting your host provider to increase the post_max_size and suhosin.post.max_vars varialble on the server.');
?>
<div class="cp-wrapper bootstrap_admin cp-margin-left">
<!--content area start -->
<div class="hbg top_navigation row-fluid">
<div class="cp-logo span2">
<img src="<?php
echo CP_PATH_URL;
?>
/framework/images/logo.png" class="logo" />
</div>
<div class="sidebar span10">
<?php
echo top_navigation_html_tooltip();
?>
</div>
<?php
//echo top_navigation_html();
?>
</div>
<div class="content-area-main row-fluid">
<!--sidebar start -->
<div class="sidebar-wraper span2">
<div class="sidebar-sublinks">
<ul id="wp_t_o_right_menu">
<li id="active_tab" class="news_letter" ><?php
_e('Newsletter Settings', 'crunchpress');
?>
</li>
</ul>
</div>
</div>
<!--sidebar end -->
<!--content start -->
<div class="content-area span10">
<?php
//echo top_navigation_html();
?>
<form id="options-panel-form" name="cp-panel-form">
<div class="panel-elements" id="panel-elements">
<div class="panel-element" id="panel-element-save-complete">
<div class="panel-element-save-text">
<?php
_e('Save Options Complete', 'crunchpress');
?>
.</div>
<div class="panel-element-save-arrow"></div>
</div>
<div class="panel-element">
<?php
if (isset($action) and $action == 'newsletter_settings') {
$newsletter_xml = '<newsletter_settings>';
$newsletter_xml = $newsletter_xml . create_xml_tag('newsletter_config', $newsletter_config);
$newsletter_xml = $newsletter_xml . create_xml_tag('feed_burner_text', $feed_burner_text);
$newsletter_xml = $newsletter_xml . '</newsletter_settings>';
if (!save_option('newsletter_settings', get_option('newsletter_settings'), $newsletter_xml)) {
die(json_encode($return_data));
}
die(json_encode(array('success' => '0')));
}
$newsletter_config = '';
$feed_burner_text = '';
$cp_newsletter_settings = get_option('newsletter_settings');
if ($cp_newsletter_settings != '') {
$cp_newsletter = new DOMDocument();
$cp_newsletter->loadXML($cp_newsletter_settings);
$newsletter_config = find_xml_value($cp_newsletter->documentElement, 'newsletter_config');
$feed_burner_text = find_xml_value($cp_newsletter->documentElement, 'feed_burner_text');
}
?>
</div>
<ul class="newsletter_class">
<li id="news_letter" class="active_tab">
<ul class="recipe_class row-fluid">
<li class="panel-input span8">
<span class="panel-title">
<h3> <?php
_e('Newsletter Type', 'crunchpress');
?>
</h3>
</span>
<div class="combobox">
<select name="newsletter_config" id="newsletter_settings">
<option class="google_feed_burner" value="google_feed_burner" <?php
if ($newsletter_config == 'google_feed_burner') {
echo 'selected';
}
?>
><h3> <?php
_e('Google Feed Burner', 'crunchpress');
?>
</h3>
//.........这里部分代码省略.........
示例10: registerMwClient
private function registerMwClient()
{
$key = Config::get('app.key');
$client = new \Guzzle\Service\Client('https://login.microweber.com/api/v1/client/');
$domain = site_url();
$domain = substr($domain, strpos($domain, '://') + 3);
$domain = str_replace('/', '', $domain);
$request = $client->createRequest('POST', "config/{$domain}");
//dd($request, $request);
$request->setPostField('token', $key);
$response = $client->send($request);
if (200 == $response->getStatusCode()) {
$body = (string) $response->getBody();
$body = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $body, MCRYPT_MODE_ECB);
$body = trim($body);
$body = (array) json_decode($body);
Config::set('services.microweber', $body);
Config::save();
save_option(['option_value' => 'y', 'option_key' => 'enable_user_microweber_registration', 'option_group' => 'users']);
} else {
// $reason = $response->getReasonPhrase();
// dd(__FILE__, $reason, $response->getStatusCode());
}
}
示例11: save_option_draft_folder
/**
* Saves the draft folder option.
* @param object $option SquirrelOption object
* @since 1.3.2
*/
function save_option_draft_folder($option)
{
global $data_dir, $username;
if (strtolower($option->new_value) == 'inbox') {
// make sure that it is not INBOX
error_option_save(_("You can't select INBOX as Draft folder."));
} else {
/* Set move to draft on or off. */
$draft_on = $option->new_value == SMPREF_NONE ? SMPREF_OFF : SMPREF_ON;
setPref($data_dir, $username, 'save_as_draft', $draft_on);
/* Now just save the option as normal. */
save_option($option);
}
}
示例12: save_option_draft_folder
/**
* Saves the draft folder option.
*/
function save_option_draft_folder($option)
{
global $data_dir, $username;
/* Set move to draft on or off. */
$draft_on = $option->new_value == SMPREF_NONE ? SMPREF_OFF : SMPREF_ON;
setPref($data_dir, $username, 'save_as_draft', $draft_on);
/* Now just save the option as normal. */
save_option($option);
}
示例13: save_option_reply_prefix
function save_option_reply_prefix($option)
{
global $data_dir, $username, $new_javascript_setting;
// save as "NONE" if it was blanked out
//
if (empty($option->new_value)) {
$option->new_value = 'NONE';
}
// Save the option like normal.
//
save_option($option);
}
示例14: typography_settings
function typography_settings()
{
foreach ($_REQUEST as $keys => $values) {
${$keys} = trim($values);
}
$return_data = array('success' => '-1', 'alert' => 'Save option failed, please try contacting your host provider to increase the post_max_size and suhosin.post.max_vars varialble on the server.');
if (isset($action) and $action == 'typography_settings') {
$typography_xml = '<typography_settings>';
$typography_xml = $typography_xml . create_xml_tag('font_google', $font_google);
$typography_xml = $typography_xml . create_xml_tag('font_size_normal', $font_size_normal);
$typography_xml = $typography_xml . create_xml_tag('font_google_heading', $font_google_heading);
$typography_xml = $typography_xml . create_xml_tag('menu_font_google', $menu_font_google);
$typography_xml = $typography_xml . create_xml_tag('heading_h1', $heading_h1);
$typography_xml = $typography_xml . create_xml_tag('heading_h2', $heading_h2);
$typography_xml = $typography_xml . create_xml_tag('heading_h3', $heading_h3);
$typography_xml = $typography_xml . create_xml_tag('heading_h4', $heading_h4);
$typography_xml = $typography_xml . create_xml_tag('heading_h5', $heading_h5);
$typography_xml = $typography_xml . create_xml_tag('heading_h6', $heading_h6);
$typography_xml = $typography_xml . create_xml_tag('embed_typekit_code', htmlspecialchars(stripslashes($embed_typekit_code)));
$typography_xml = $typography_xml . '</typography_settings>';
$font_setting_xml = '<typekit_font>';
$sidebars = $_POST['typekit_font'];
foreach ($sidebars as $keys => $values) {
$font_setting_xml = $font_setting_xml . create_xml_tag('typekit_font', $values);
}
$font_setting_xml = $font_setting_xml . '</typekit_font>';
save_option('typokit_settings', get_option('typokit_settings'), $font_setting_xml);
if (!save_option('typography_settings', get_option('typography_settings'), $typography_xml)) {
die(json_encode($return_data));
}
die(json_encode(array('success' => '0')));
}
$font_google = '';
$font_size_normal = '';
$menu_font_google = '';
$fonts_array = '';
$font_google_heading = '';
$heading_h1 = '';
$heading_h2 = '';
$heading_h3 = '';
$heading_h4 = '';
$heading_h5 = '';
$heading_h6 = '';
$embed_typekit_code = '';
$cp_typography_settings = get_option('typography_settings');
//$dd = find_xml_node($logo_uploa_d,'logo_upload');
if ($cp_typography_settings != '') {
$cp_typo = new DOMDocument();
$cp_typo->loadXML($cp_typography_settings);
$font_google = find_xml_value($cp_typo->documentElement, 'font_google');
$font_size_normal = find_xml_value($cp_typo->documentElement, 'font_size_normal');
$menu_font_google = find_xml_value($cp_typo->documentElement, 'menu_font_google');
$font_google_heading = find_xml_value($cp_typo->documentElement, 'font_google_heading');
$heading_h1 = find_xml_value($cp_typo->documentElement, 'heading_h1');
$heading_h2 = find_xml_value($cp_typo->documentElement, 'heading_h2');
$heading_h3 = find_xml_value($cp_typo->documentElement, 'heading_h3');
$heading_h4 = find_xml_value($cp_typo->documentElement, 'heading_h4');
$heading_h5 = find_xml_value($cp_typo->documentElement, 'heading_h5');
$heading_h6 = find_xml_value($cp_typo->documentElement, 'heading_h6');
$embed_typekit_code = find_xml_value($cp_typo->documentElement, 'embed_typekit_code');
}
?>
<div class="cp-wrapper bootstrap_admin cp-margin-left">
<!--content area start -->
<div class="hbg top_navigation row-fluid">
<div class="cp-logo span2">
<img src="<?php
echo CP_PATH_URL;
?>
/framework/images/logo.png" class="logo" />
</div>
<div class="sidebar span10">
<?php
echo top_navigation_html_tooltip();
?>
</div>
<?php
//echo top_navigation_html();
?>
</div>
<div class="content-area-main row-fluid">
<!--sidebar start -->
<div class="sidebar-wraper span2">
<div class="sidebar-sublinks">
<ul id="wp_t_o_right_menu">
<li class="font_family" id="active_tab"><?php
_e('Font Family', 'crunchpress');
?>
</li>
<li class="font_size"><?php
_e('Font Size', 'crunchpress');
?>
</li>
<li class="type_kit_font"><?php
_e('Type Kit Font', 'crunchpress');
?>
//.........这里部分代码省略.........
示例15: sidebar_settings
function sidebar_settings()
{
foreach ($_REQUEST as $keys => $values) {
${$keys} = trim($values);
}
?>
<div class="cp-wrapper bootstrap_admin cp-margin-left">
<!--content area start -->
<div class="hbg top_navigation row-fluid">
<div class="cp-logo span2">
<img src="<?php
echo CP_PATH_URL;
?>
/framework/images/logo.png" class="logo" />
</div>
<div class="sidebar span10">
<?php
echo top_navigation_html_tooltip();
?>
</div>
<?php
//echo top_navigation_html();
?>
</div>
<div class="content-area-main row-fluid">
<!--sidebar start -->
<div class="sidebar-wraper span2">
<div class="sidebar-sublinks">
<ul id="wp_t_o_right_menu">
<li id="active_tab" class="sidebar_settings"><?php
_e('Add New Sidebar', 'crunchpress');
?>
</li>
</ul>
</div>
</div>
<!--content start -->
<div class="content-area span10">
<?php
//echo top_navigation_html();
?>
<form id="options-panel-form" name="cp-panel-form">
<div class="panel-elements" id="panel-elements">
<div class="panel-element" id="panel-element-save-complete">
<div class="panel-element-save-text">
<?php
_e('Save Options Complete', 'crunchpress');
?>
.</div>
<div class="panel-element-save-arrow"></div>
</div>
<div class="panel-element">
<?php
$return_data = array('success' => '-1', 'alert' => 'Save option failed, please try contacting your host provider to increase the post_max_size and suhosin.post.max_vars varialble on the server.');
//Sidebar settings Saved
if (isset($action) and $action == 'sidebar_settings') {
$sidebar_xml = '<sidebar_settings>';
if (isset($_POST['sidebar'])) {
$sidebars = $_POST['sidebar'];
foreach ($sidebars as $keys => $values) {
$sidebar_xml = $sidebar_xml . create_xml_tag('sidebar_name', $values);
}
}
$sidebar_xml = $sidebar_xml . '</sidebar_settings>';
if (!save_option('sidebar_settings', get_option('sidebar_settings'), $sidebar_xml)) {
die(json_encode($return_data));
}
die(json_encode(array('success' => '0')));
}
//Sidebar values getting from database
$cp_sidebar_settings = get_option('sidebar_settings');
?>
</div>
<ul class="sidebar_settings">
<li class="active_tab" id="sidebar_settings">
<div class="row-fluid">
<div class="panel-input span8">
<div class="panel-title">
<h3> <?php
_e('Add Sidebar Name', 'crunchpress');
?>
</h3>
</div>
<input type="text" id="add-more-sidebar" value="type title here" rel="type title here">
<div id="add-more-sidebar" class="add-more-sidebar"></div>
</div>
<div class="span4 right-box-sec"><p><?php
_e('Add New Sidebars(Widget Areas) here you can manage them from Dashboard > Appearance > Widgets.', 'crunchpress');
?>
</p></div>
<div id="selected-sidebar" class="selected-sidebar first span12">
<div class="default-sidebar-item" id="sidebar-item">
<div class="panel-delete-sidebar"></div>
<div class="slider-item-text"></div>
<input type="hidden" id="sidebar">
</div>
<?php
//Sidebar addition
//.........这里部分代码省略.........