if ($mailbox == 'All Folders') { $search_all = 'all'; } if (isset($composenew) && $composenew) { $comp_uri = "../src/compose.php?mailbox=" . urlencode($mailbox) . "&session={$composesession}&"; displayPageHeader($color, $mailbox, "comp_in_new('{$comp_uri}');", false); } else { displayPageHeader($color, $mailbox); } /* See how the page was called and fire off correct function */ if (empty($submit) && !empty($what)) { $submit = _("Search"); } if ($submit == _("Search") && !empty($what)) { if ($recent_count > 0) { update_recent($what, $where, $mailbox, $username, $data_dir); } } elseif ($submit == 'forget' && isset($count)) { forget_recent($count, $username, $data_dir); } elseif ($submit == 'save' && isset($count)) { save_recent($count, $username, $data_dir); } elseif ($submit == 'delete' && isset($count)) { delete_saved($count, $username, $data_dir); } do_hook('search_before_form'); echo html_tag('table', html_tag('tr', "\n" . html_tag('td', '<b>' . _("Search") . '</b>', 'center', $color[0])), '', '', 'width="100%"') . "\n"; /* update the recent and saved searches from the pref files */ $attributes = get_recent($username, $data_dir); $saved_attributes = get_saved($username, $data_dir); if (isset($saved_attributes['saved_what'])) { $saved_count = count($saved_attributes['saved_what']);
/** * Create a wikinote page automatically * * @param string $page * @param boolean created or not */ function create_notepage($page = '') { global $vars; if ($vars['cmd'] != 'read') { return FALSE; } $page = $page === '' ? $vars['page'] : $page; list($mainpage, $notepage) = $this->get_mainpage_notepage($page); if (!$this->is_effect($mainpage)) { return FALSE; } if (is_page($notepage)) { return FALSE; } $contents = auto_template($notepage); if ($contents == '') { $contents = $this->default_template_contents; } if (file_put_contents(get_filename($notepage), $contents) === FALSE) { return FALSE; } update_recent($notepage); return TRUE; }