本文整理汇总了PHP中Book::XtractMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP Book::XtractMessage方法的具体用法?PHP Book::XtractMessage怎么用?PHP Book::XtractMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Book
的用法示例。
在下文中一共展示了Book::XtractMessage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareView
function prepareView($p_variables, &$p_form)
{
$v_accounts = NULL;
try {
$v_accounts = Book::Singleton()->getAccountsForStatement();
} catch (Exception $v_exception) {
Cloudbank::PushError(Book::XtractMessage($v_exception));
}
$v_template = NULL;
$p_form = NULL;
switch (is_null($v_accounts) || count($v_accounts) == 0 ? 'import' : 'accounts') {
case 'accounts':
$v_template = new Horde_Template();
array_walk($v_accounts, function (&$p_record, $p_key) {
$p_record['type'] = CloudBankConsts::LedgerAccountType_Account;
});
CloudBank::AddLinks($v_accounts, 'events.php', array('ledger_account_id' => 'id', 'ledger_account_type' => 'type'), 'name', 'account_link');
$v_template->set('accounts', $v_accounts);
$p_form = preparePurgeForm($p_variables);
break;
case 'import':
$p_form = prepareImportForm($p_variables, $v_dummy);
break;
}
return $v_template;
}
示例2: processActions
function processActions(&$p_variables, &$p_form)
{
/* + create new event (ID is empty)
+ just render empty form (set defaults)
+ form submitted (call server create, if OK redirect to events view)
+ if error, render the form w/ data entered
+ create new event from statement data (ID is empty)
+ render the form w/ data got in paramters (adjust is_income, amount)
+ form submitted (call server create, if OK redirect to events view)
+ if error, render the form w/ data entered
+ modify event (ID is filled)
+ render the form w/ data got in paramters (adjust is_income, amount,
populate old_ variables)
+ form submitted (call server modify, if OK redirect to events view)
+ if error, render the form w/ data entered
*/
$v_event_id = $p_variables->get('event_id');
$v_isEdit = !empty($v_event_id);
if ($p_form->validate($p_variables)) {
// submitted -> process
$v_account_id = $p_variables->get('account_id');
try {
if ($v_isEdit) {
Book::Singleton()->modifyEvent($p_variables);
} else {
//print "submitted/before createEvent(): " . $p_variables->get('amount');
Book::Singleton()->createEvent($p_variables);
}
header('Location: ' . Horde::url('events.php', true)->add(array('ledger_account_id' => $v_account_id, 'ledger_account_type' => CloudBankConsts::LedgerAccountType_Account), NULL, false));
exit;
} catch (Exception $v_exception) {
Cloudbank::PushError(Book::XtractMessage($v_exception));
}
//print "submitted/after create/modifyEvent(): " . $p_variables->get('amount');
} else {
$v_isEmpty = !$p_variables->get('date');
//print "not submitted/before PopulateEventForm():" . $p_variables->get('amount');
if ($v_isEmpty) {
setDefaultValues($p_variables);
} else {
Book::Singleton()->PopulateEventForm($p_variables);
}
//print "not submitted/after PopulateEventForm():" . $p_variables->get('amount');
}
return $v_isEdit;
}
示例3: header
<?php
/**
* $Id: delete_event.php,v 1.1 2010/10/24 17:24:39 pety Exp pety $
*
* Copyright 2007-2009 The Horde Project (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (GPL). If you
* did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
*
* @author Peter Sagi <psagi@freemail.hu>
*/
require_once __DIR__ . '/lib/Application.php';
Horde_Registry::appInit('cloudbank');
require_once CLOUDBANK_BASE . '/lib/Cloudbank.php';
require_once CLOUDBANK_BASE . '/lib/Book.php';
/* main() */
$g_variables =& Horde_Variables::getDefaultVariables();
$g_account_id = $g_variables->get('account_id');
$g_event_id = $g_variables->get('event_id');
try {
Book::Singleton()->deleteEvent($g_event_id);
header('Location: ' . Horde::url('events.php', true)->add(array('ledger_account_id' => $g_account_id, 'ledger_account_type' => CloudBankConsts::LedgerAccountType_Account), NULL, false));
} catch (Exception $v_exception) {
Cloudbank::PushError(Book::XtractMessage($v_exception));
$page_output->header();
$notification->notify(array('listeners' => 'status'));
$page_output->footer();
}