Example #1
0
 /**
  * tarski_options_update() - Sets Options properties to the values set on the Options page.
  * 
  * Note that this function doesn't save anything to the database, that's the
  * preserve of save_tarski_options().
  * @since 2.0
  * @see save_tarski_options()
  */
 function tarski_options_update()
 {
     if ($_POST['update_notification'] == 'off') {
         $this->update_notification = false;
     } elseif ($_POST['update_notification'] == 'on') {
         $this->update_notification = true;
     }
     $header = $_POST['header_image'];
     if (isset($header)) {
         $header = str_replace('-thumb', '', $header);
         $this->header = $header;
     }
     $nav_pages = $_POST['nav_pages'];
     if (isset($nav_pages)) {
         $nav_pages = implode(',', $nav_pages);
         $this->nav_pages = $nav_pages;
     } else {
         $this->nav_pages = false;
     }
     $collapsed_pages = $_POST['collapsed_pages'];
     if (isset($collapsed_pages)) {
         $this->collapsed_pages = $collapsed_pages;
     } else {
         $this->collapsed_pages = '';
     }
     $stylefile = $_POST['alternate_style'];
     if (is_valid_tarski_style($stylefile)) {
         $this->style = $stylefile;
     } elseif (!$stylefile) {
         $this->style = false;
     }
     $this->display_title = (bool) $_POST['display_title'];
     $this->display_tagline = (bool) $_POST['display_tagline'];
     $this->show_categories = (bool) $_POST['show_categories'];
     $this->tags_everywhere = (bool) $_POST['tags_everywhere'];
     $this->use_pages = (bool) $_POST['use_pages'];
     $this->centred_theme = (bool) $_POST['centred_theme'];
     $this->swap_sides = (bool) $_POST['swap_sides'];
     $this->swap_title_order = (bool) $_POST['swap_title_order'];
     $this->asidescategory = $_POST['asides_category'];
     $this->nav_extlinkcat = $_POST['nav_extlinkcat'];
     $this->home_link_name = $_POST['home_link_name'];
     $this->sidebar_pp_type = $_POST['sidebar_pp_type'];
     $this->show_authors = tarski_should_show_authors();
     unset($this->deleted);
 }
Example #2
0
/**
 * tarski_resave_show_authors() - Re-saves Tarski's 'show_authors' option.
 * 
 * If more than one author is detected, it will turn the 'show_authors'
 * option on; otherwise it will turn it off.
 * @since 2.0.3
 * @uses tarski_should_show_authors()
 */
function tarski_resave_show_authors()
{
    if (get_option('tarski_options')) {
        update_tarski_option('show_authors', tarski_should_show_authors());
    }
}