PageRenderTime 77ms CodeModel.GetById 36ms RepoModel.GetById 1ms app.codeStats 0ms

/template-options.php

https://github.com/marpa/translucence
PHP | 2064 lines | 1465 code | 268 blank | 331 comment | 212 complexity | f9216f3cd8f2903a261a5b62e7388208 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. /*********************************************************
  3. * Theme options
  4. * renders UI and theme model for chosing and previewing options
  5. *
  6. * @since 2010 Translucence 1.0
  7. *********************************************************/
  8. function translucence_theme_options_do_page() {
  9. global $translucence_config;
  10. global $translucence_options_id, $translucence_options, $translucence_options_values;
  11. global $translucence_custom_header_set, $translucence_custom_background_set, $translucence_custom_header_image;
  12. global $translucence_syndication_image, $translucence_model_site_width, $translucence_model_content_width;
  13. if ($translucence_options['revert'] == 1) {
  14. translucence_option_feedback();
  15. translucence_delete_options();
  16. $translucence_options['revert'] = 0;
  17. translucence_theme_options_update();
  18. }
  19. translucence_option_feedback();
  20. $translucence_options = get_option($translucence_options_id);
  21. $current_widgets = get_option ('sidebars_widgets');
  22. $custom_background_color = get_background_color();
  23. $custom_background_image = get_background_image();
  24. $translucence_custom_header_image = get_header_image();
  25. if (isset($translucence_custom_header_image) && $translucence_custom_header_image != "") {
  26. $translucence_custom_header_set = 1;
  27. } else {
  28. $translucence_custom_header_set = 0;
  29. }
  30. if ($translucence_custom_header_set == 0 && $translucence_options['header-image-options'] != "none") {
  31. $custom_header = $translucence_config['custom_header'][$translucence_options['header-image-options']]['url'];
  32. $custom_header = str_replace('%s', '', $custom_header);
  33. $translucence_custom_header_image = $custom_header;
  34. $translucence_custom_header_set = 1;
  35. }
  36. if ($custom_background_image) {
  37. $translucence_options['background_image'] = "url('".$custom_background_image."')";
  38. $translucence_options['background_repeat'] = get_theme_mod( 'background_repeat', 'repeat' );
  39. $translucence_options['background_attachment'] = get_theme_mod( 'background_attachment', 'scroll' );
  40. $translucence_options['background_position'] = get_theme_mod( 'background_position_x', 'left' );
  41. $translucence_custom_background_set = 1;
  42. } else if ($custom_background_color) {
  43. $translucence_custom_background_set = 1;
  44. } else {
  45. $translucence_custom_background_set = 0;
  46. }
  47. /*********************************************************
  48. * Define theme layout model values
  49. *********************************************************/
  50. $translucence_model_site_width = $translucence_options['site-width']+80;
  51. $model_right_sidebar_width = $translucence_options['right01-width']+50;
  52. $model_right_sidebar_width02 = $translucence_options['right02-width']+50;
  53. $model_left_sidebar_width = $translucence_options['left01-width']+50;
  54. $translucence_model_content_width = $translucence_options['site-width'] - ($translucence_options['left01-width'] + $translucence_options['right01-width'] + $translucence_options['right02-width'] + 220);
  55. /*********************************************************
  56. * Define theme model css
  57. * model css uses most of the actual theme's css except
  58. * theme body css
  59. * model css adds css for theme edit UI components
  60. *********************************************************/
  61. $model_css = preg_replace("/body/", ".body_na", $translucence_options['css']);
  62. $translucence_syndication_image = get_template_directory_uri()."/variations/feed.png";
  63. print "
  64. <script type='text/javascript' src='".get_template_directory_uri()."/jscolor/jscolor.js'></script>
  65. <style type='text/css'>";
  66. print $model_css;
  67. print translucence_get_theme_model_css();
  68. // printpre($translucence_options['activated-widgets']);
  69. // printpre($translucence_options['page-links-display']);
  70. /******************************************************************************
  71. * Theme Options Introduction with Update and Revert buttons
  72. ******************************************************************************/
  73. ?>
  74. <form id='settings' action='options.php' method='post' class='themeform' style='margin: 20px;'>
  75. <?php settings_fields( $translucence_options_id ); ?>
  76. <?php $translucence_options = get_option($translucence_options_id); ?>
  77. <table width = '<?php print $translucence_model_site_width; ?>' cellpadding='0' style='background-color: transparent;'>
  78. <tr>
  79. <td width='20%'>
  80. <span class='submit'><input type='submit' value='<?php _e( 'Update', '2010-translucence' ); ?>' name='save'/></span>
  81. <span class='submit'><input type='submit' value='<?php _e( 'Revert to Default', '2010-translucence' ); ?>' name='<?php echo $translucence_options_id ?>[reset]'/></span>
  82. </td>
  83. <td width='80%'>
  84. <?php
  85. print "<input type='hidden' value='".$translucence_options['activated-theme']."' name='".$translucence_options_id."[activated-theme]'/>";
  86. print "<input type='hidden' value='".$translucence_options['footer-widget-width']."' name='".$translucence_options_id."[footer-widget-width]'/>";
  87. /******************************************************************************
  88. * Widget Set Options
  89. ******************************************************************************/
  90. print "<div style='font-size: 10px;'>";
  91. if (in_array("activated-widgets", $translucence_config['model'])) {
  92. // widget set label
  93. print __('Widgets', '2010-translucence').": ";
  94. // widget set select field
  95. print "<select name='".$translucence_options_id."[activated-widgets]' style='font-size: 10px;' onchange='this.form.submit();'>";
  96. $widget_sets = array_keys($translucence_config['preset_widgets']);
  97. foreach ($widget_sets as $widget_set) {
  98. print "\n<option value='".$widget_set."'".($translucence_options['activated-widgets'] == $widget_set ? ' selected' : '') . ">".$widget_set."</option>";
  99. }
  100. print "</select> ";
  101. // widget set description and activate button
  102. //printpre($translucence_config['preset_widgets'][$translucence_options['activated-widgets']]['description']);
  103. if ($translucence_options['activated-widgets'] != "default" ) {
  104. print "<span class='submit'><input type='submit' value='".__('Activate New Widgets', '2010-translucence')."' name='".$translucence_options_id."[widgets]'/></span>";
  105. print " <span style='font-size: 10px;'> (".__('will <span class=\'warning\'>replace</span> existing widgets.', '2010-translucence').")</span>";
  106. print "<div style='margin-left: 100px;'>";
  107. print " <span style='font-size: 10px; font-style: italic'> ".$translucence_config['preset_widgets'][$translucence_options['activated-widgets']]['description'][0]."</span> ";
  108. print "</div>";
  109. } else {
  110. print "<input type='hidden' value='default' name='".$translucence_options_id."[widgets]'/>";
  111. }
  112. }
  113. print "</div>";
  114. /******************************************************************************
  115. * Content Set Options
  116. * NOT IMPLEMENTED YET....
  117. ******************************************************************************/
  118. print "<div style='font-size: 10px;'>";
  119. if (in_array("added-content-not-implemented", $translucence_config['model'])) {
  120. //content set label
  121. print __('Content', '2010-translucence').": ";
  122. // content set select field
  123. print "<select name='".$translucence_options_id."[added-content]' style='font-size: 10px;' onchange='this.form.submit();'>";
  124. $content_sets = array_keys($translucence_config['preset_content']);
  125. foreach ($content_sets as $content_set) {
  126. print "\n<option value='".$content_set."'".($translucence_options['added-content'] == $content_set ? ' selected' : '') . ">".$content_set."</option>";
  127. }
  128. print "</select> ";
  129. // widget set description and activate button
  130. if ($translucence_options['added-content'] != "default" ) {
  131. print " <span class='submit'><input type='submit' value='".__('Add New Content', '2010-translucence')."' name='".$translucence_options_id."[content]'/></span>";
  132. print "<span style='font-size: 10px;'> ".__('New posts, pages, tags and categories will be <span class=\'notify\'>added</span> to your site.', '2010-translucence')."</span>";
  133. print "<div style='margin-left: 100px;'>";
  134. print " <span style='font-size: 10px; font-style: italic'> ".$translucence_config['preset_content'][$translucence_options['added-content']]['description'][0]."</span> ";
  135. print "</div>";
  136. } else {
  137. print "<input type='hidden' value='default' name='".$translucence_options_id."[content]'/>";
  138. }
  139. }
  140. print "</div>";
  141. ?>
  142. </div>
  143. </td>
  144. <td width='20%'>
  145. </td>
  146. </tr>
  147. </table>
  148. <?php
  149. /******************************************************************************
  150. * html from theme template files (header.php, index.php, footer.php and sidebars
  151. * embedded in this html are functions for printing theme options UI
  152. ******************************************************************************/
  153. ?>
  154. <div class='modelwrapper' style='margin-bottom: 5px;'>
  155. <?php print translucence_get_global_options(); ?>
  156. </div>
  157. <div class='modelwrapper'>
  158. <div class='sitewrapper'>
  159. <div class='headermeta_right'>
  160. <div class='bgtextcolor'><?php print translucence_headermeta_right(); ?></div>
  161. </div>
  162. <div class='headermeta_left'>
  163. <div class='bgtextcolor'><?php print translucence_headermeta_left(); ?></div>
  164. </div>
  165. <?php print translucence_get_custom_options(); ?>
  166. </div>
  167. <div id='wrapper'>
  168. <div id='header'>
  169. <div id='masthead'>
  170. <div id='branding'>
  171. <div class='headerblock'>
  172. </div>
  173. <span id='title-box'>
  174. <a href='index.php'>
  175. <div id='site-title'><?php print get_bloginfo('name') ?></div><br/>
  176. <div id='site-description'><?php print get_bloginfo('description') ?></div>
  177. </a>
  178. </span>
  179. </div><!-- #branding -->
  180. <div id='access' role='navigation'>
  181. <!-- top navigation links -->
  182. <div class='menu-header'>
  183. <?php print translucence_get_topmenu_options(); ?>
  184. </div>
  185. </div><!-- #access -->
  186. </div><!-- #masthead -->
  187. </div><!-- #header -->
  188. <div id='main' style="clear: both;">
  189. <div id='container'>
  190. <div id='tertiary' class='widget-area'>
  191. <!-- left sidebar -->
  192. <h3 class='widget-title'><?php _e( 'Left Sidebar', '2010-translucence' ); ?></h3>
  193. <?php print translucence_get_left01_options(); ?>
  194. </div>
  195. <div id='content'>
  196. <!-- syndication links -->
  197. <div style = 'width: 100%; float: right;'>
  198. <div id='syndication'>
  199. <a href='#' class='feed'><?php _e( 'Posts RSS', '2010-translucence' ); ?></a>
  200. <a href='#' class='feed'><?php _e( 'Comments RSS', '2010-translucence' ); ?></a>
  201. </div>
  202. </div>
  203. <!-- main content -->
  204. <?php print translucence_get_layout_options(); ?>
  205. <h2 class='entry-title'><?php _e( 'Entry Title', '2010-translucence' ); ?></h2>
  206. <div class='entry-content'>
  207. <?php print translucence_get_post_options(); ?>
  208. </div>
  209. </div>
  210. <div id='primary' class='widget-area'>
  211. <!-- 1st right sidebar -->
  212. <h3 class='widget-title'><?php _e( '1st Right Sidebar', '2010-translucence' ); ?></h3>
  213. <?php print translucence_get_right01_options(); ?>
  214. </div>
  215. <div id='secondary' class='widget-area' style=''>
  216. <!-- 2nd right sidebar -->
  217. <h3 class='widget-title'><?php _e( '2nd Right Sidebar', '2010-translucence' ); ?></h3>
  218. <?php print translucence_get_right02_options(); ?>
  219. </div>
  220. </div><!-- #container -->
  221. </div><!-- #main -->
  222. <br/>
  223. <div id='colophon'></div><!-- #colophon -->
  224. <div id='footer-widget-area'>
  225. <?php print translucence_get_footer_options(); ?>
  226. <!-- footer -->
  227. <div id='first' class='widget-area'>
  228. <ul class='xoxo'>
  229. <h3 class='widget-title'><?php _e( 'First Footer Widget Area', '2010-translucence' ); ?></h3>
  230. <?php print translucence_get_footer_widgets('first'); ?>
  231. </ul>
  232. </div>
  233. <div id='second' class='widget-area'>
  234. <ul class='xoxo'>
  235. <h3 class='widget-title'><?php _e( 'Second Footer Widget Area', '2010-translucence' ); ?></h3>
  236. <?php print translucence_get_footer_widgets('second'); ?>
  237. </ul>
  238. </div>
  239. <div id='third' class='widget-area'>
  240. <ul class='xoxo'>
  241. <h3 class='widget-title'><?php _e( 'Third Footer Widget Area', '2010-translucence' ); ?></h3>
  242. <?php print translucence_get_footer_widgets('third'); ?>
  243. </ul>
  244. </div>
  245. <div id='fourth' class='widget-area'>
  246. <ul class='xoxo'>
  247. <h3 class='widget-title'><?php _e( 'Fourth Footer Widget Area', '2010-translucence' ); ?></h3>
  248. <?php print translucence_get_footer_widgets('fourth'); ?>
  249. </ul>
  250. </div>
  251. </div>
  252. </div><!-- #wrapper -->
  253. <div class='sitewrapper'>
  254. <div class='footermeta_right'>
  255. <div class='bgtextcolor'><?php print translucence_footermeta_right(); ?></div>
  256. </div>
  257. <div class='footermeta_left'>
  258. <div class='bgtextcolor'><?php print translucence_footermeta_left(); ?></div>
  259. </div>
  260. </div><!-- #sitewrapper -->
  261. </div><!-- modelwrapper -->
  262. <div class='modelwrapper' style='margin-top: 5px;'>
  263. <?php print translucence_get_footermeta_options(); ?>
  264. </div>
  265. <?php
  266. /******************************************************************************
  267. * Update and Revert button
  268. ******************************************************************************/
  269. ?>
  270. <span class='submit'><input type='submit' value='<?php _e( 'Update', '2010-translucence' ); ?>' name='save'/></span>
  271. <span class='submit'><input type='submit' value='<?php _e( 'Revert to Default', '2010-translucence' ); ?>' name='<?php echo $translucence_options_id ?>[reset]'/></span>
  272. </form>
  273. <?php
  274. }
  275. /**
  276. * Generates CSS for theme options UI (based on theme CSS)
  277. *
  278. * @since 2010 Translucence 1.0
  279. * @return string CSS for theme options UI
  280. */
  281. function translucence_get_theme_model_css() {
  282. global $translucence_config;
  283. global $translucence_options_id, $translucence_options, $translucence_options_values;
  284. global $translucence_custom_header_image, $translucence_model_site_width, $translucence_syndication_image;
  285. ob_start();
  286. print "
  287. .modelwrapper {
  288. background-image: ".$translucence_options['background_image'].";
  289. background-position: ".$translucence_options['background_position'].";
  290. background-color: ".$translucence_options['background_color'].";
  291. background-repeat: ".$translucence_options['background_repeat'].";
  292. background-attachment: ".$translucence_options['background_attachment'].";
  293. width: ".$translucence_model_site_width."px;
  294. background-color: ".$translucence_options['background_color'].";
  295. color: #000000;
  296. padding: 1px 0px 0px 0px;
  297. border: 1px solid #CCCCCC;
  298. }
  299. #wphead h1 a {
  300. text-decoration: none;
  301. border-bottom: none;
  302. }
  303. a, a:hover {
  304. border-bottom: none;
  305. text-decoration: none;
  306. }
  307. #wrapper {
  308. margin: 0 auto;
  309. margin-top: 1px;
  310. margin-bottom: 10px;
  311. }
  312. .sitewrapper {
  313. margin-left: auto;
  314. margin-right: auto;
  315. }
  316. /* The theme meta areas */
  317. .headermeta_left {
  318. font-size: 12px;
  319. width: 50%;
  320. text-align: left;
  321. }
  322. .headermeta_right {
  323. font-size: 12px;
  324. width: 45%;
  325. text-align: right;
  326. float: right;
  327. clear: left;
  328. }
  329. .footermeta_left {
  330. font-size: 12px;
  331. width: 50%;
  332. text-align: left;
  333. padding-top: 5px;
  334. padding-bottom: 10px;
  335. }
  336. .footermeta_right {
  337. font-size: 12px;
  338. width: 40%;
  339. text-align: right;
  340. float: right;
  341. padding-top: 5px;
  342. padding-bottom: 10px;
  343. }
  344. /* The theme header area */
  345. #header {
  346. padding: 0 0 0 0px;
  347. }
  348. #branding {
  349. margin: 0 auto;
  350. position: relative;
  351. }
  352. #branding .headerblock {
  353. margin: 0 auto;
  354. position: absolute;
  355. color: transparent;
  356. top: 0;
  357. left: 0;
  358. overflow: hidden;
  359. cursor:pointer;
  360. }
  361. #branding #title-box {
  362. position: absolute;
  363. }
  364. #branding #title-box a {
  365. text-decoration:none;
  366. border:0;
  367. }
  368. #branding #title-box a:hover {
  369. text-decoration:none;
  370. border:0;
  371. }
  372. #branding #site-title {
  373. margin-bottom: 4px;
  374. display:inline-block;
  375. padding:0 3px;
  376. }
  377. #branding #site-description {
  378. display:inline-block;
  379. padding:0 3px;
  380. cursor:pointer;
  381. }
  382. .headerblock {
  383. background-image: url(".$translucence_custom_header_image.");
  384. background-position: center center;
  385. background-repeat: no-repeat;
  386. }
  387. #content {
  388. float: left;
  389. position:relative;
  390. margin-bottom: 25px;
  391. }
  392. #primary,
  393. #secondary,
  394. #tertiary {
  395. float: left;
  396. position:relative;
  397. }
  398. #primary {
  399. display:".$translucence_options['right01-visibility']."
  400. }
  401. #secondary {
  402. display:".$translucence_options['right02-visibility']."
  403. }
  404. #tertiary {
  405. display:".$translucence_options['left01-visibility']."
  406. }
  407. #footer-widget-area {
  408. overflow: hidden;
  409. padding: 20px 0px 0px 4px;
  410. }
  411. #footer-widget-area .widget-area {
  412. float: left;
  413. background-color: transparent;
  414. margin-right: 1px;
  415. }
  416. #footer-widget-area #fourth {
  417. margin-right: 0;
  418. }
  419. #syndication{
  420. width: 100%;
  421. text-align: right;
  422. font-size: 11px;
  423. padding: 0px 0 10px 0;
  424. white-space:nowrap;
  425. }
  426. #syndication a.feed {
  427. padding: 5px 2px 0px 23px;
  428. background: url(".$translucence_syndication_image.") no-repeat 0 1px;
  429. border-bottom: none;
  430. }
  431. .catlinks a,
  432. .taglinks a {
  433. border: 1px solid #666666;
  434. cursor: pointer;
  435. display: inline-block;
  436. margin: 2px 0.2em;
  437. padding: 0.1em 0.2em;
  438. }
  439. .options {
  440. margin-top: 5px;
  441. margin-bottom: 5px;
  442. margin-right: 5px;
  443. margin-left: 5px;
  444. background-color: #fff;
  445. font-size: 10px;
  446. line-height: 1.5em;
  447. padding: 10px;
  448. border: 1px dotted #CCCCCC;
  449. }
  450. .option-group {
  451. color: #333333;
  452. }
  453. .option-label {
  454. color: #333333;
  455. }
  456. .option-label:hover {
  457. color: #333333;
  458. }
  459. .option-label-dimmed {
  460. color: #CCCCCC;
  461. }
  462. .option-label-dimmed:hover {
  463. color: #333333;
  464. }
  465. .option-row {
  466. width: 100%;
  467. color: #CCCCCC;
  468. background-color: #fff;
  469. border-bottom: 1px dotted;
  470. padding: 2px;
  471. }
  472. .option-row:hover {
  473. background-color: #F8F8F8;
  474. color: #000000;
  475. }
  476. .instructions {
  477. margin-top: 5px;
  478. margin-bottom: 5px;
  479. margin-right: 0px;
  480. margin-left: 0px;
  481. background-color: #fffeeb;
  482. color: #000000;
  483. font-size: 10px;
  484. line-height: 1.5em;
  485. padding: 5px;
  486. border: 1px solid #CCCCCC;
  487. }
  488. .widgetbox {
  489. font-size: 10px;
  490. border-width: 1px;
  491. border-style: solid;
  492. padding: 5px;
  493. margin: 3px;
  494. }
  495. #appgroupedit textarea {
  496. width: 300px;
  497. }
  498. .metatext {
  499. font-size: 9px;
  500. color: ".$translucence_options['bglinkcolor'].";
  501. }
  502. .metatext a {
  503. color: ".$translucence_options['bglinkcolor'].";
  504. }
  505. .horizontalbar {
  506. padding-top: 4px;
  507. padding-bottom: 4px;
  508. margin-bottom: 4px;
  509. text-align: right;
  510. }
  511. #primary a,
  512. #secondary a,
  513. #tertiary a {
  514. border: 1px dotted;
  515. }
  516. #primary post-link {
  517. border-color: ".$translucence_options['right01-link-color'].";
  518. margin-right: 5px;
  519. margin-left: 5px;
  520. }
  521. .post-link {
  522. border-color: ".$translucence_options['bgtextcolor'].";
  523. margin-right: 5px;
  524. margin-left: 5px;
  525. }
  526. .editwidgetlink {
  527. display: block;
  528. color: ".$translucence_options['linkcolor'].";
  529. }
  530. .editwidgetlink a {
  531. display: block;
  532. color: ".$translucence_options['linkcolor'].";
  533. border: 1px dotted;
  534. padding: 3px;
  535. margin-bottom: 3px;
  536. }
  537. .editwidgetlink a:hover {
  538. border: 1px solid;
  539. text-decoration: none;
  540. }
  541. .editheaderlink {
  542. color: ".$translucence_options['bglinkcolor'].";
  543. font-size: 9px;
  544. white-space:nowrap;
  545. }
  546. .editheaderlink a {
  547. color: ".$translucence_options['bglinkcolor'].";
  548. padding: 3px;
  549. border: 1px dotted ".$translucence_options['bglinkcolor'].";
  550. }
  551. .editheaderlink a:hover {
  552. border: 1px solid ".$translucence_options['bglinkcolor'].";
  553. text-decoration: none;
  554. color: ".$translucence_options['bglinkcolor'].";
  555. }
  556. .modelheadertextposition {
  557. font-size: 20px;
  558. margin-left: 5px;
  559. padding-top: ".$translucence_options['header-text-padding-top']."px;
  560. color: ".$translucence_options['site-title-color'].";
  561. }
  562. .warning {
  563. color: #900;
  564. font-weight: bold;
  565. }
  566. .notify {
  567. color: #009933;
  568. font-weight: bold;
  569. }
  570. </style>
  571. ";
  572. print "<!--[if IE]>";
  573. print "<style type='text/css'>";
  574. print $translucence_options['header-color-ie']."\n";
  575. print $translucence_options['title-box-color-ie']."\n";
  576. print $translucence_options['description-box-color-ie']."\n";
  577. print $translucence_options['right02-color-ie']."\n";
  578. print $translucence_options['top-color-ie']."\n";
  579. // print $translucence_options['submenu-color-ie']."\n";
  580. print $translucence_options['content-color-ie']."\n";
  581. print $translucence_options['bottom-color-ie']."\n";
  582. print $translucence_options['left01-color-ie']."\n";
  583. print $translucence_options['right01-color-ie']."\n";
  584. print $translucence_options['right02-color-ie']."\n";
  585. print $translucence_options['cat-links-color-ie']."\n";
  586. print $translucence_options['tag-links-color-ie']."\n";
  587. print "#access ul ul {border-left: 1px solid #ccc; border-right: 1px solid #ccc;}";
  588. print "</style>";
  589. print "<![endif]-->";
  590. $translucence_theme_model_css = ob_get_contents();
  591. ob_end_clean();
  592. return $translucence_theme_model_css;
  593. }
  594. /**
  595. * Gets theme options UI for header left meta options
  596. *
  597. * @since 2010 Translucence 1.0
  598. * @return string html for theme options UI
  599. */
  600. function translucence_headermeta_left() {
  601. global $translucence_config, $translucence_options, $translucence_options_id;
  602. ob_start();
  603. print "<div class='metatext'>";
  604. if ($translucence_options['headerleft'] == "") {
  605. print "no links defined...";
  606. } else {
  607. print $translucence_options['headerleft'];
  608. }
  609. // if header left links selection is custom
  610. if ($translucence_options['header-meta-left'] == 'custom') {
  611. print "
  612. <input id='appgroupdo' type='hidden' name='appgroupdo' value='0'/> -
  613. <a href='javascript: document.getElementById(\"appgroupedit\").style.display = \"block\"; document.getElementById(\"appgroupdo\").value = \"1\"; exit; '>edit</a>
  614. <div id='appgroupedit' style='display: none;'>
  615. <textarea name='".$translucence_options_id."[headerleftcustom].' style='width: 100%; height: 50px; font-size: 10px;' class='code'>";
  616. print stripslashes(stripslashes(trim($translucence_options['headerleftcustom'])));
  617. print "</textarea>
  618. &nbsp;&nbsp;&nbsp;
  619. <a href='javascript: document.getElementById(\"appgroupedit\").style.display = \"none\"; document.getElementById(\"appgroupdo\").value = \"0\"; exit;'>Cancel</a> -
  620. <span class='submit'><input type='submit' value='Update' name='save'/></span>
  621. </div>
  622. ";
  623. }
  624. print "</div>";
  625. $headermeta_left = ob_get_contents();
  626. ob_end_clean();
  627. return $headermeta_left;
  628. }
  629. /**
  630. * Gets theme options UI for header right meta options
  631. *
  632. * @since 2010 Translucence 1.0
  633. * @return string html for theme options UI
  634. */
  635. function translucence_headermeta_right() {
  636. global $translucence_config, $translucence_options, $translucence_options_id;
  637. ob_start();
  638. print "<div class='metatext'>";
  639. if ($translucence_options['headerright'] == "") {
  640. print "no links defined...";
  641. } else {
  642. print $translucence_options['headerright'];
  643. }
  644. // if header right links selection is custom
  645. if ($translucence_options['header-meta-right'] == 'custom') {
  646. print "
  647. <input id='headerrightdo' type='hidden' name='headerrightdo' value='0'/> -
  648. <a href='javascript: document.getElementById(\"headerrightedit\").style.display = \"block\"; document.getElementById(\"headerrightdo\").value = \"1\"; exit; '>edit</a>
  649. <div id='headerrightedit' style='display: none;'>
  650. <textarea name='".$translucence_options_id."[headerrightcustom].' style='width: 100%; height: 50px; font-size: 10px;' class='code'>";
  651. print stripslashes(stripslashes(trim($translucence_options['headerrightcustom'])));
  652. print "</textarea>
  653. &nbsp;&nbsp;&nbsp;
  654. <a href='javascript: document.getElementById(\"headerrightedit\").style.display = \"none\"; document.getElementById(\"headerrightdo\").value = \"0\"; exit;'>Cancel</a> -
  655. <span class='submit'><input type='submit' value='Update' name='save'/></span>
  656. </div>
  657. ";
  658. }
  659. print "</div>";
  660. $headermeta_right = ob_get_contents();
  661. ob_end_clean();
  662. return $headermeta_right;
  663. }
  664. /**
  665. * Gets theme options UI for global options
  666. *
  667. * @uses translucence_get_option_modes() to get option modes
  668. * @uses translucence_get_active_options() to get options that are active for a given option mode
  669. * @uses translucence_get_option_selector() to generate select field for a given option
  670. * @uses translucence_get_option_field() to display a field for a given option
  671. *
  672. * @since 2010 Translucence 1.0
  673. * @return string html of global options for theme options UI
  674. */
  675. function translucence_get_global_options() {
  676. global $translucence_config, $translucence_options, $translucence_options_values, $translucence_variations;
  677. global $translucence_options_id;
  678. global $translucence_custom_header_set, $translucence_custom_background_set, $active_options;
  679. ob_start();
  680. print "<div class='options'>";
  681. print "<table style='width: 100%;'>";
  682. print "<tr>";
  683. // Variation options
  684. print "<td style='width: 70%; text-align: left; border-bottom: 1px solid; padding-bottom: 5px; '>";
  685. if (in_array("background", $translucence_config['model'])) {
  686. print "<div>";
  687. print "<select name='".$translucence_options_id."[background]' style='font-size: 14px;' onchange='this.form.submit();'>";
  688. // variations defined in variations folder
  689. foreach ($translucence_variations as $label => $value) {
  690. if (!in_array($value, $translucence_config['variations_disabled']))
  691. print "\n<option value='".$value."'".($translucence_options['background'] == $value ? ' selected' : '') . ">".$label."</option>";
  692. }
  693. print "</select>";
  694. print __( '', '2010-translucence' )."<span class='option-label'>";
  695. translucence_get_option_selector ("", "variation-type", $translucence_options_values['variation-type'], 'active');
  696. print "</span>";
  697. print "</div>";
  698. if ($translucence_custom_background_set == 1) {
  699. print "<div style='font-size: 10px; text-align: left; border-color: ".$translucence_options['bgtextcolor']."'>";
  700. print "(Custom background color or image may change the background of this variation)";
  701. print "</div>";
  702. }
  703. }
  704. print "</td>";
  705. // options mode values (used in translucence_get_active_options)
  706. $translucence_options_values['mode'] = translucence_get_option_modes();
  707. print "<td style='width: 30%; text-align: right; border-bottom: 1px solid; padding-bottom: 5px;'>";
  708. print __( 'Options Mode', '2010-translucence' ).":<span class='option-label'>";
  709. translucence_get_option_selector ("", "options-mode", $translucence_options_values['mode'], 'active');
  710. print "</span>";
  711. print "</td>";
  712. print "</tr>";
  713. print "</table>";
  714. // global options for: site, header, site title, tagline and header meta
  715. print "<table style='width: 100%;'>";
  716. print "<tr>";
  717. // get active options
  718. if (in_array('options-mode', $translucence_config['model'])) {
  719. $active_options = translucence_get_active_options($translucence_options['options-mode']);
  720. }
  721. // site width, color, opacity and border options
  722. if (in_array('site-options', $active_options)) {
  723. print "<td class='option-row'>";
  724. //site width
  725. print "<span class='option-label'>".__( 'Site', '2010-translucence' )."</span>";
  726. $translucence_title = __( 'width', '2010-translucence' );
  727. translucence_get_option_selector ($translucence_title, "site-width", $translucence_options_values['site-width']);
  728. // site color
  729. if ($translucence_options['variation-type'] == "custom") {
  730. $translucence_title = __( 'color', '2010-translucence' );
  731. translucence_get_option_selector ($translucence_title, "site-color", $translucence_options_values['sidebar-color']);
  732. // site opacity
  733. $translucence_title = __( 'opacity', '2010-translucence' );
  734. translucence_get_option_selector ($translucence_title, "site-opacity", $translucence_options_values['header-opacity']);
  735. // site border
  736. $translucence_title = __( 'border', '2010-translucence' );
  737. translucence_get_option_selector ($translucence_title, "site-border-style", $translucence_options_values['border-style']);
  738. }
  739. print "</td>";
  740. print "</tr>";
  741. // if not in active_options print out as hidden fields
  742. } else {
  743. translucence_get_option_selector ("", "site-width", $translucence_options_values['site-width'])."<br/>";
  744. translucence_get_option_selector ("", "site-color", $translucence_options_values['sidebar-color'])."<br/>";
  745. translucence_get_option_selector ("", "site-opacity", $translucence_options_values['header-opacity'])."<br/>";
  746. translucence_get_option_selector ("", "site-border-style", $translucence_options_values['border-style'])."<br/>";
  747. }
  748. // header height, color, opacity, border options
  749. if (in_array('header-options', $active_options)) {
  750. print "<tr>";
  751. print "<td class='option-row'>";
  752. // header height options
  753. print "<span class='option-label'>".__( 'Header', '2010-translucence' )."</span>";
  754. $translucence_title = __( 'height', '2010-translucence' );
  755. translucence_get_option_selector ($translucence_title, "header-block-height", $translucence_options_values['header-block-height']);
  756. // header color
  757. if ($translucence_options['variation-type'] == "custom") {
  758. $translucence_title = __( 'color', '2010-translucence' );
  759. translucence_get_option_selector ($translucence_title, "header-color", $translucence_options_values['header-color']);
  760. }
  761. if ($translucence_options['variation-type'] == "custom") {
  762. // header opacity
  763. $translucence_title = __( 'opacity', '2010-translucence' );
  764. translucence_get_option_selector ($translucence_title, "header-opacity", $translucence_options_values['header-opacity']);
  765. // header border
  766. $translucence_title = __( 'border', '2010-translucence' );
  767. translucence_get_option_selector ($translucence_title, "header-border-style", $translucence_options_values['border-style']);
  768. }
  769. print "</td>";
  770. print "</tr>";
  771. // if not in active_options print out as hidden fields
  772. } else {
  773. translucence_get_option_selector ("", "header-block-height", $translucence_options_values['header-block-height']);
  774. translucence_get_option_selector ("", "header-color", $translucence_options_values['header-color']);
  775. translucence_get_option_selector ("", "header-opacity", $translucence_options_values['header-opacity']);
  776. translucence_get_option_selector ("", "header-border-style", $translucence_options_values['border-style']);
  777. }
  778. // header text size color shadow, box and position
  779. if (in_array('site-title-options', $active_options) || $translucence_custom_header_set == 1) {
  780. print "<tr>";
  781. print "<td class='option-row'>";
  782. if (in_array('site-title-options', $active_options)) {
  783. // header-text-size options
  784. if (in_array("site-title-size", $translucence_config['model'])) {
  785. print "<span class='option-label'>".__( 'Site Title', '2010-translucence' )." </span>";
  786. $translucence_title = __( 'size', '2010-translucence' );
  787. translucence_get_option_selector ($translucence_title, "site-title-size", $translucence_options_values['header-text-size']);
  788. }
  789. // header-text-color options
  790. // if (in_array("site-title-color", $translucence_config['model']) && $translucence_options['variation-type'] == "custom") {
  791. // $translucence_title = __( 'color', '2010-translucence' );
  792. // translucence_get_option_field ($translucence_title, "site-title-color", 6);
  793. // }
  794. // header-text-offset options
  795. if (in_array("header-text-shadow-offset", $translucence_config['model']) && $translucence_options['variation-type'] == "custom") {
  796. $translucence_title = __( 'offset', '2010-translucence' );
  797. translucence_get_option_selector ($translucence_title, "header-text-shadow-offset", $translucence_options_values['text-shadow-offset']);
  798. }
  799. // header-text-blur options
  800. if (in_array("header-text-shadow-blur", $translucence_config['model']) && $translucence_options['variation-type'] == "custom") {
  801. $translucence_title = __( 'blur', '2010-translucence' );
  802. translucence_get_option_selector ($translucence_title, "header-text-shadow-blur", $translucence_options_values['text-shadow-blur']);
  803. }
  804. }
  805. if (in_array('site-title-box-options', $active_options) || $translucence_custom_header_set == 1) {
  806. translucence_get_option_field ("Color: #", "site-title-color", 6);
  807. // header-text-box options
  808. if (in_array("title-box-color", $translucence_config['model'])) {
  809. print "<span class='option-label'> ".__( 'Site Title Box', '2010-translucence' )."</span>";
  810. $translucence_title = __( 'color', '2010-translucence' );
  811. translucence_get_option_selector ($translucence_title, "title-box-color", $translucence_options_values['header-color']);
  812. }
  813. if (in_array("title-box-opacity", $translucence_config['model'])) {
  814. $translucence_title = __( 'opacity', '2010-translucence' );
  815. translucence_get_option_selector ($translucence_title, "title-box-opacity", $translucence_options_values['header-opacity']);
  816. }
  817. // header-text-display options
  818. if (in_array("header-text-display", $translucence_config['model'])) {
  819. print "
  820. <span class='option-label' <span style='font-size: 10px;'>".__( 'position', '2010-translucence' )."
  821. <select name='".$translucence_options_id."[header-text-display]' class='option-label-dimmed' style='font-size: 10px;' onchange='this.form.submit();'>
  822. <option value='middle' ".($translucence_options['header-text-display'] == 'middle' ? ' selected' : '') . ">".__( 'Middle', '2010-translucence' )."</option>
  823. <option value='top' ".($translucence_options['header-text-display'] == 'top' ? ' selected' : '') . ">".__( 'Top', '2010-translucence' )."</option>
  824. <option value='bottom' ".($translucence_options['header-text-display'] == 'bottom' ? ' selected' : '') . ">".__( 'Bottom', '2010-translucence' )."</option>
  825. <option value='hide' ".($translucence_options['header-text-display'] == 'hide' ? ' selected' : '') . ">".__( 'Hide', '2010-translucence' )."</option>
  826. <option value='above' ".($translucence_options['header-text-display'] == 'above' ? ' selected' : '') . ">".__( 'Above', '2010-translucence' )."</option>
  827. </select>
  828. </span></span>";
  829. }
  830. }
  831. print "</td>";
  832. print "</tr>";
  833. // if not in active_options print out as hidden fields
  834. } else {
  835. translucence_get_option_selector ("size: ", "site-title-size", $translucence_options_values['header-text-size']);
  836. //translucence_get_option_field ("Color: #", "site-title-color", 6);
  837. translucence_get_option_selector ("offset: ", "header-text-shadow-offset", $translucence_options_values['text-shadow-offset']);
  838. translucence_get_option_selector ("blur: ", "header-text-shadow-blur", $translucence_options_values['text-shadow-blur']);
  839. translucence_get_option_selector ("color: ", "title-box-color", $translucence_options_values['header-color']);
  840. translucence_get_option_selector ("opacity:", "title-box-opacity", $translucence_options_values['header-opacity']);
  841. print "<input type='hidden' name='".$translucence_options_id."[header-text-display]' value = '".$translucence_options['header-text-display']."'/>";
  842. }
  843. // Tagline text size, color, box
  844. if (in_array('tagline-options', $active_options) || $translucence_custom_header_set == 1) {
  845. print "<tr>";
  846. print "<td class='option-row'>";
  847. // text size and color
  848. if (in_array('site-description-size', $active_options)) {
  849. // header-description-size options
  850. if (in_array("site-description-size", $translucence_config['model'])) {
  851. print "<span class='option-label'>".__( 'Tagline', '2010-translucence' )."</span><span class='option-label'>";
  852. $translucence_title = __( 'size', '2010-translucence' );
  853. translucence_get_option_selector ("size: ", "site-description-size", $translucence_options_values['header-text-size']);
  854. print "</span>";
  855. }
  856. // if not in active_options print out as hidden fields
  857. } else {
  858. translucence_get_option_selector ("size: ", "site-description-size", $translucence_options_values['header-text-size']);
  859. }
  860. if (in_array('site-description-color', $active_options)) {
  861. // header-description-color options
  862. if (in_array("site-description-color", $translucence_config['model'])) {
  863. print "<span class='option-label'>";
  864. $translucence_title = __( 'Color #', '2010-translucence' );
  865. translucence_get_option_field ($translucence_title, "site-description-color", 6);
  866. print "</span>";
  867. }
  868. // if not in active_options print out as hidden fields
  869. } else {
  870. translucence_get_option_field ("color: #", "site-description-color", 6);
  871. }
  872. if (in_array('description-box-color', $active_options) || $translucence_custom_header_set == 1) {
  873. if (in_array("description-box-color", $translucence_config['model'])) {
  874. print "<span class='option-label'> ".__( 'Tagline box', '2010-translucence' )."</span><span class='option-label'>";
  875. $translucence_title = __( 'color', '2010-translucence' );
  876. translucence_get_option_selector ($translucence_title, "description-box-color", $translucence_options_values['header-color']);
  877. print "</span>";
  878. }
  879. if (in_array("description-box-opacity", $translucence_config['model'])) {
  880. print "<span class='option-label'>";
  881. $translucence_title = __( 'opacity', '2010-translucence' );
  882. translucence_get_option_selector ($translucence_title, "description-box-opacity", $translucence_options_values['header-opacity']);
  883. print "</span>";
  884. }
  885. // if not in active_options print out as hidden fields
  886. } else {
  887. translucence_get_option_selector ("color:", "description-box-color", $translucence_options_values['header-color']);
  888. translucence_get_option_selector ("opacity:", "description-box-opacity", $translucence_options_values['header-opacity']);
  889. }
  890. print "</td>";
  891. print "</tr>";
  892. // if not in active_options print out as hidden fields
  893. } else {
  894. translucence_get_option_selector ("size: ", "site-description-size", $translucence_options_values['header-text-size']);
  895. translucence_get_option_field ("color: #", "site-description-color", 6);
  896. translucence_get_option_selector ("color:", "description-box-color", $translucence_options_values['header-color']);
  897. translucence_get_option_selector ("opacity:", "description-box-opacity", $translucence_options_values['header-opacity']);
  898. }
  899. print "</table>";
  900. // headermeta right and left options
  901. if (in_array('headermeta-options', $active_options)) {
  902. print "<table style='width: 100%;'>";
  903. print "<tr>";
  904. // headermeta left options
  905. print "<td style='width: 50%'>";
  906. if (in_array("header-meta-left", $translucence_config['model'])) {
  907. print "<span style='font-size: 9px;'>".__( 'Left Header Links', '2010-translucence' )."</span>\n";
  908. print "<select name='".$translucence_options_id."[header-meta-left]' style='font-size: 10px;' onchange='this.form.submit();'>";
  909. foreach (array_keys($translucence_config['header_meta_left_options']) as $meta_left_option) {
  910. print "<option value='".$translucence_config['header_meta_left_options'][$meta_left_option]['option_name']."' ";
  911. print ($translucence_options['header-meta-left'] == $translucence_config['header_meta_left_options'][$meta_left_option]['option_name'] ? ' selected' : '') . ">";
  912. print $translucence_config['header_meta_left_options'][$meta_left_option]['option_label']."</option>";
  913. }
  914. print "</select>";
  915. }
  916. print "</td>";
  917. // headermeta right options
  918. print "<td style='width: 50%; text-align: right;'>";
  919. if (in_array("header-meta-right", $translucence_config['model'])) {
  920. print "
  921. <span style='font-size: 9px;'>".__( 'Right Header Links', '2010-translucence' ).":</span>\n";
  922. print "<select name='".$translucence_options_id."[header-meta-right]' style='font-size: 10px;' onchange='this.form.submit();'>";
  923. foreach (array_keys($translucence_config['header_meta_right_options']) as $meta_right_option) {
  924. print "<option value='".$translucence_config['header_meta_right_options'][$meta_right_option]['option_name']."' ";
  925. print ($translucence_options['header-meta-right'] == $translucence_config['header_meta_right_options'][$meta_left_option]['option_name'] ? ' selected' : '') . ">";
  926. print $translucence_config['header_meta_right_options'][$meta_right_option]['option_label']."</option>";
  927. }
  928. print "</select>"; }
  929. print "</td>";
  930. print "</tr>";
  931. print "</table>";
  932. // if not in active_options print out as hidden fields
  933. } else {
  934. print "<input type='hidden' name='".$translucence_options_id."[header-meta-left]' value='".$translucence_options['header-meta-left']."'/>";
  935. //print "<input type='hidden' name='".$translucence_options_id."[headermeta]' value='".$translucence_options['headermeta']."'/>";
  936. }
  937. print "<div style='font-size: 10px;'>";
  938. if ($translucence_options['options-mode'] != "global" && $translucence_options['options-mode'] != "advanced") {
  939. print __( 'For more site and header options see', '2010-translucence' ).": ";
  940. print "<a style='color: #003366;' href='javascript:setThemeOptionsMode(\"basic\", \"".$translucence_options_id."\")'>Basic Options</a> | ";
  941. print "<a style='color: #003366;' href='javascript:setThemeOptionsMode(\"global\", \"".$translucence_options_id."\")'>Global Options</a>";
  942. } else {
  943. print __( 'For basic options see', '2010-translucence' ).": ";
  944. print "<a style='color: #003366;' href='javascript:setThemeOptionsMode(\"basic\", \"".$translucence_options_id."\")'>Basic Options</a>";
  945. }
  946. print "</div>";
  947. print "</div>";
  948. $global_options = ob_get_contents();
  949. ob_end_clean();
  950. return $global_options;
  951. }
  952. /**
  953. * Gets theme options UI for custom options
  954. *
  955. * @since 2010 Translucence 1.0
  956. * @return string html of custom options for theme options UI
  957. */
  958. function translucence_get_custom_options() {
  959. global $translucence_config, $translucence_options, $translucence_options_values;
  960. global $translucence_options_id;
  961. global $translucence_custom_header_set, $translucence_custom_background_set;
  962. ob_start();
  963. print "<div class='options' style='background-color: transparent; clear: both; border: none; margin-bottom: 35px;'>";
  964. if ($translucence_custom_header_set == 1) {
  965. print "<div class='post-link' style='float: left; width: 40%;'>";
  966. print "<a style='color:".$translucence_options['bglinkcolor']."; border-color:".$translucence_options['bgtextcolor']." ' href='".get_bloginfo('url')."/wp-admin/themes.php?page=custom-header'>".__( 'Edit Custom Header', '2010-translucence')."</a>";
  967. print "</div>";
  968. } else {
  969. print "<div class='post-link' style='float: left; width: 55%;'>";
  970. print "<a style='color:".$translucence_options['bglinkcolor']."; border-color:".$translucence_options['bgtextcolor']." ' href='".get_bloginfo('url')."/wp-admin/themes.php?page=custom-header'>".__( 'Add Custom Header', '2010-translucence')."</a>";
  971. print "</div>";
  972. }
  973. if ($translucence_custom_background_set == 1) {
  974. print "<div class='post-link' style='float: right; width: 40%;'>";
  975. print "<a style='color:".$translucence_options['bglinkcolor']."; border-color:".$translucence_options['bgtextcolor']." ' href='".get_bloginfo('url')."/wp-admin/themes.php?page=custom-background'>".__( 'Edit Custom Background', '2010-translucence')."</a>";
  976. print "</div>";
  977. } else {
  978. print "<div class='post-link' style='float: right; width: 40%; '>";
  979. print "<a style='color:".$translucence_options['bglinkcolor']."; border-color:".$translucence_options['bgtextcolor']." ' href='".get_bloginfo('url')."/wp-admin/themes.php?page=custom-background'>".__( 'Add Custom Background', '2010-translucence')."</a>";
  980. print "</div>";
  981. }
  982. if ($translucence_options['header-text-display'] == "hide") {
  983. print "<div style='float: left; color:".$translucence_options['bglinkcolor']."; padding-bottom: 10px;'>";
  984. print "<em>".__( 'Site Title and description are hidden', '2010-translucence')."</em> ";
  985. // print "display: <input type='checkbox' name='header-text-display' id='header-text-display'".(isset($translucence_options['header-text-display']) && $translucence_options['header-text-display'] != 'hide' ? ' checked' : '')." onchange='this.form.submit();'/>";
  986. print "</div>";
  987. }
  988. print "</div>";
  989. $custom_options = ob_get_contents();
  990. ob_end_clean();
  991. return $custom_options;
  992. }
  993. /**
  994. * Gets theme options UI for layout options
  995. *
  996. * @uses translucence_get_option_selector() to generate select field for a given option
  997. * @uses is_active_sidebar() to determine if sidebar has widgets
  998. *
  999. * @since 2010 Translucence 1.0
  1000. * @return string html of layout options for theme options UI
  1001. */
  1002. function translucence_get_layout_options() {
  1003. global $translucence_config, $translucence_options, $translucence_options_values, $translucence_model_content_width;
  1004. global $translucence_options_id, $active_options;
  1005. ob_start();
  1006. if (in_array('layout-options', $active_options)) {
  1007. print "<div class='options' style='background-color: transparent; clear: both;'>";
  1008. print "<div style='font-size: 10px; text-align: center;'>&larr; ".$translucence_model_content_width." px &rarr;<br/>";
  1009. if ($translucence_options['variation-type'] == "custom") {
  1010. print "<span style='font-size: 10px;'>".__( 'Content', '2010-translucence')."</span>\n";
  1011. translucence_get_option_selector ("", "content-color", $translucence_options_values['sidebar-color']);
  1012. translucence_get_option_selector ("", "content-opacity", $translucence_options_values['sidebar-opacity']);
  1013. translucence_get_option_selector ("", "content-border-style", $translucence_options_values['border-style']);
  1014. }
  1015. print "</div>";
  1016. print "<table style='width: 100%;'>";
  1017. print "<tr>";
  1018. // left sidebar
  1019. print "<td>";
  1020. print "<div>".__( 'Left Sidebar', '2010-translucence')."</div>\n";
  1021. // hidden widgets warning
  1022. if (is_active_sidebar("sidebar-1") && $translucence_options['left01-width'] == 0) {
  1023. print "<span class='warning' style='font-size: 10px'>".__( 'hidden widgets!', '2010-translucence')."</span>";
  1024. }
  1025. //width
  1026. translucence_get_option_selector ("", "left01-width", $translucence_options_values['sidebar-width']);
  1027. print "</td>";
  1028. // Right sidebar
  1029. print "<td style='text-align: right;'>";
  1030. print "<div>".__( '1st Right Sidebar', '2010-translucence')."</div>\n";
  1031. // hidden widgets warning
  1032. if (is_active_sidebar("primary-widget-area") && $translucence_options['right01-width'] == 0) {
  1033. print "<span class='warning' style='font-size: 10px'>".__( 'hidden widgets!', '2010-translucence')."</span>";
  1034. }
  1035. // width
  1036. translucence_get_option_selector ("", "right01-width", $translucence_options_values['sidebar-width']);
  1037. print "</td>";
  1038. print "</tr>";
  1039. print "<tr>";
  1040. // Default Post Display
  1041. print "<td>";
  1042. print "<div>".__( 'Default Post Display', '2010-translucence')."</div>\n";
  1043. translucence_get_option_selector ("", "default-post-display", $translucence_options_values['post-display']);
  1044. print "</td>";
  1045. // 2nd Right sidebar
  1046. print "<td style='text-align: right;'>";
  1047. print "<div>".__( '2nd Right Sidebar', '2010-translucence')."</div>\n";
  1048. // hidden widgets warning
  1049. if (is_active_sidebar("secondary-widget-area") && $translucence_options['right02-width'] == 0) {
  1050. print "<span class='warning' style='font-size: 10px'>".__( 'hidden widgets!', '2010-translucence')."</span>";
  1051. }
  1052. // width
  1053. translucence_get_option_selector ("", "right02-width", $translucence_options_values['sidebar-width']);
  1054. print "</td>";
  1055. print "</tr>";
  1056. print "</table>";
  1057. print __( 'For more sidebar options, see', '2010-translucence').": ";
  1058. print "<a href='javascript:setThemeOptionsMode(\"layout\", \"".$translucence_options_id."\")'>".__( 'Layout Options', '2010-translucence')."</a> | ";
  1059. print "<a href='javascript:setThemeOptionsMode(\"sidebar\", \"".$translucence_options_id."\")'>".__( 'Sidebar Options', '2010-translucence')."</a>";
  1060. print "</div>";
  1061. if ($translucence_options['options-mode'] == "layout") {
  1062. print "<input type='hidden' name='".$translucence_options_id."[site-title-color]' value = '".$translucence_options['site-title-color']."'/>";
  1063. print "<input type='hidden' name='".$translucence_options_id."[site-description-color]' value = '".$translucence_options['site-description-color']."'/>";
  1064. }
  1065. // if not in active_options print out as hidden fields
  1066. } else {
  1067. translucence_get_option_selector ("", "content-color", $translucence_options_values['sidebar-color']);
  1068. translucence_get_option_selector ("", "content-opacity", $translucence_options_values['sidebar-opacity']);
  1069. translucence_get_option_selector ("", "content-border-style", $translucence_options_values['border-style']);
  1070. translucence_get_option_selector ("", "left01-width", $translucence_options_values['sidebar-width']);
  1071. translucence_get_option_selector ("", "right01-width", $translucence_options_values['sidebar-width']);
  1072. translucence_get_option_selector ("", "right02-width", $translucence_options_values['sidebar-width']);
  1073. print "<div style='font-size: 10px;'>";
  1074. print __( 'For more sidebar layout options, see', '2010-translucence').": ";
  1075. print "<a href='javascript:setThemeOptionsMode(\"layout\", \"".$translucence_options_id."\")'>".__( 'Layout Options', '2010-translucence')."</a>";
  1076. print "</div>";
  1077. }
  1078. $entry_options = ob_get_contents();
  1079. ob_end_clean();
  1080. return $entry_options;

Large files files are truncated, but you can click here to view the full file