當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WT_Filter::postUrl方法代碼示例

本文整理匯總了PHP中WT_Filter::postUrl方法的典型用法代碼示例。如果您正苦於以下問題:PHP WT_Filter::postUrl方法的具體用法?PHP WT_Filter::postUrl怎麽用?PHP WT_Filter::postUrl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WT_Filter的用法示例。


在下文中一共展示了WT_Filter::postUrl方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: define

// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
use WT\Auth;
use WT\Log;
use WT\User;
define('WT_SCRIPT_NAME', 'message.php');
require './includes/session.php';
// Some variables are initialised from GET (so we can set initial values in URLs),
// but are submitted in POST so we can have long body text.
$subject = WT_Filter::post('subject', null, WT_Filter::get('subject'));
$body = WT_Filter::post('body');
$from_name = WT_Filter::post('from_name');
$from_email = WT_Filter::post('from_email');
$action = WT_Filter::post('action', 'compose|send', 'compose');
$to = WT_Filter::post('to', null, WT_Filter::get('to'));
$method = WT_Filter::post('method', 'messaging|messaging2|messaging3|mailto|none', WT_Filter::get('method', 'messaging|messaging2|messaging3|mailto|none', 'messaging2'));
$url = WT_Filter::postUrl('url', WT_Filter::getUrl('url'));
$controller = new WT_Controller_Simple();
$controller->setPageTitle(WT_I18N::translate('webtrees message'));
$to_user = User::findByIdentifier($to);
// Only admins can send broadcast messages
if ((!$to_user || $to == 'all' || $to == 'last_6mo' || $to == 'never_logged') && !Auth::isAdmin()) {
    // TODO, what if we have a user called "all" or "last_6mo" or "never_logged" ???
    WT_FlashMessages::addMessage(WT_I18N::translate('Message was not sent'));
    $controller->pageHeader();
    $controller->addInlineJavascript('window.opener.location.reload(); window.close();');
    exit;
}
$errors = '';
// Is this message from a member or a visitor?
if (WT_USER_ID) {
    $from = WT_USER_NAME;
開發者ID:brambravo,項目名稱:webtrees,代碼行數:31,代碼來源:message.php


注:本文中的WT_Filter::postUrl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。