本文整理汇总了PHP中ExecMethod函数的典型用法代码示例。如果您正苦于以下问题:PHP ExecMethod函数的具体用法?PHP ExecMethod怎么用?PHP ExecMethod使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ExecMethod函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
$GLOBALS['phpgw_info']['flags']['noframework'] = true;
require_once PHPGW_SERVER_ROOT . '/felamimail/inc/xajax.inc.php';
$xajax = new xajax($GLOBALS['phpgw']->link('/felamimail/xajax.php', false, true), 'xajax_', 'utf-8');
$xajax->waitCursorOff();
$xajax->registerFunction("doXMLHTTP");
$GLOBALS['phpgw_info']['flags']['java_script'] .= $xajax->getJavascript($GLOBALS['phpgw_info']['server']['webserver_url'] . '/felamimail/js/');
$GLOBALS['phpgw']->js->validate_file('jsapi', 'jsapi', 'felamimail');
$this->displayCharset = 'utf-8';
if (!isset($_POST['composeid']) && !isset($_GET['composeid'])) {
// create new compose session
$this->bocompose = CreateObject('felamimail.bocompose', '', $this->displayCharset);
$this->composeID = $this->bocompose->getComposeID();
} else {
// reuse existing compose session
if (isset($_POST['composeid'])) {
$this->composeID = $_POST['composeid'];
} else {
$this->composeID = $_GET['composeid'];
}
$this->bocompose = CreateObject('felamimail.bocompose', $this->composeID, $this->displayCharset);
}
$this->t = CreateObject('phpgwapi.Template', PHPGW_APP_TPL);
$this->bofelamimail = CreateObject('felamimail.bofelamimail', $this->displayCharset);
$this->mailPreferences = ExecMethod('felamimail.bopreferences.getPreferences');
$this->t->set_unknowns('remove');
$this->rowColor[0] = $GLOBALS['phpgw_info']["theme"]["bg01"];
$this->rowColor[1] = $GLOBALS['phpgw_info']["theme"]["bg02"];
if (!isset($GLOBALS['phpgw']->css) || !is_object($GLOBALS['phpgw']->css)) {
$GLOBALS['phpgw']->css = createObject('phpgwapi.css');
}
$GLOBALS['phpgw']->css->validate_file('app', 'felamimail');
}
示例2: get_menu
/**
* Get the menus for the felamimail
*
* @return array available menus for the current user
*/
function get_menu()
{
$preferences = ExecMethod('felamimail.bopreferences.getPreferences');
$linkData = array('menuaction' => 'felamimail.uicompose.compose');
$menus = array();
$menus['navbar'] = array('felamimail' => array('text' => $GLOBALS['phpgw']->translation->translate('Felamimail', array(), true), 'url' => $GLOBALS['phpgw']->link('/felamimail/index.php'), 'image' => array('felamimail', 'navbar'), 'order' => 6, 'group' => 'office'));
$menus['toolbar'] = array(array('text' => $GLOBALS['phpgw']->translation->translate('New', array(), true), 'url' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'felamimail.uicompose.compose'))));
/*
$file = array(
array(
'text' => '<a class="textSidebox" href="'. htmlspecialchars($GLOBALS['phpgw']->link('/index.php', $linkData)).'" target="_blank" onclick="egw_openWindowCentered(\''.$GLOBALS['phpgw']->link('/index.php', $linkData).'\',\''.lang('compose').'\',700,750); return false;">'.lang('compose'),
'no_lang' => true,
),
);
*/
if (isset($GLOBALS['phpgw_info']['user']['apps']['admin'])) {
$menus['admin'] = array(array('text' => $GLOBALS['phpgw']->translation->translate('Site Configuration', array(), true), 'url' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'emailadmin.emailadmin_ui.listProfiles'))));
}
if (isset($GLOBALS['phpgw_info']['user']['apps']['preferences'])) {
$menus['preferences'] = array(array('text' => $GLOBALS['phpgw']->translation->translate('Preferences', array(), true), 'url' => $GLOBALS['phpgw']->link('/preferences/preferences.php', array('appname' => 'felamimail'))), array('text' => 'Manage Folders', 'url' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'felamimail.uipreferences.listFolder'))));
if ($preferences && ($preferences->userDefinedAccounts || $preferences->userDefinedIdentities)) {
$menus['preferences'][] = array('text' => $GLOBALS['phpgw']->translation->translate('Manage eMail: Accounts / Identities', array(), true), 'url' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'felamimail.uipreferences.listAccountData')));
}
if ($preferences && $preferences->ea_user_defined_signatures) {
$menus['preferences'][] = array('text' => $GLOBALS['phpgw']->translation->translate('Manage Signatures', array(), true), 'url' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'felamimail.uipreferences.listSignatures')));
}
$menus['toolbar'][] = array('text' => $GLOBALS['phpgw']->translation->translate('Preferences', array(), true), 'url' => $GLOBALS['phpgw']->link('/preferences/preferences.php', array('appname' => 'felamimail')), 'image' => array('felamimail', 'preferences'));
$menus['toolbar'][] = array('text' => $GLOBALS['phpgw']->translation->translate('Manage Folders', array(), true), 'url' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'felamimail.uipreferences.listFolder')));
}
$menus['navigation'] = array(array('text' => $GLOBALS['phpgw']->translation->translate('New', array(), true), 'url' => "javascript:openwindow('" . $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'felamimail.uicompose.compose')) . "','700','600')"));
if ($preferences) {
$icServer = $preferences->getIncomingServer(0);
if (is_a($icServer, 'defaultimap')) {
if ($icServer->enableSieve) {
$menus['navigation'][] = array(array('text' => $GLOBALS['phpgw']->translation->translate('filter rules', array(), true), 'url' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'felamimail.uisieve.listRules'))));
$menus['navigation'][] = array(array('text' => $GLOBALS['phpgw']->translation->translate('vacation notice', array(), true), 'url' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'felamimail.uisieve.editVacation'))));
$menus['navigation'][] = array(array('text' => $GLOBALS['phpgw']->translation->translate('email notification', array(), true), 'url' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'felamimail.uisieve.editEmailNotification'))));
}
}
$ogServer = $preferences->getOutgoingServer(0);
if (is_a($ogServer, 'defaultsmtp')) {
if ($ogServer->editForwardingAddress) {
$menus['navigation'][] = array(array('text' => $GLOBALS['phpgw']->translation->translate('Forwarding', array(), true), 'url' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'felamimail.uipreferences.editForwardingAddress'))));
}
}
}
//$menus['folders'] = phpgwapi_menu::get_categories('felamimail');
return $menus;
}
示例3: get_content
function get_content(&$arguments, $properties)
{
$GLOBALS['phpgw_info']['flags']['currentapp'] = 'phpbrain';
if (isset($_GET['menuaction'])) {
list($app, $class, $method) = explode('.', @$_GET['menuaction']);
} else {
$class = 'uikb';
$method = 'index';
}
$app = 'phpbrain';
$GLOBALS[$class] = CreateObject(sprintf('%s.%s', $app, $class), $this->find_template_dir(), $this->link(), $arguments);
if (is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions[$method]) {
return ExecMethod($app . '.' . $class . '.' . $method);
}
}
示例4: notify_coordinator_on_consumption
/**
* Check the consumption on an order - and notify the coordinator
* @param integer $order_id
*/
function notify_coordinator_on_consumption($order_id)
{
$notify_coordinator = true;
if (!$notify_coordinator) {
return false;
}
$toarray = array();
$workorder = $this->so->read_single($order_id);
if (!$workorder['continuous']) {
return false;
}
$project = ExecMethod('property.boproject.read_single_mini', $workorder['project_id']);
$coordinator = $project['coordinator'];
$prefs_coordinator = $this->bocommon->create_preferences('property', $coordinator);
if (isset($prefs_coordinator['email']) && $prefs_coordinator['email']) {
$toarray[] = $prefs_coordinator['email'];
}
if ($toarray) {
$budget_info = $this->so->get_order_budget_percent($order_id);
if ($budget_info['percent'] < 90) {
return false;
}
if (isset($GLOBALS['phpgw_info']['user']['preferences']['property']['email']) && $GLOBALS['phpgw_info']['user']['preferences']['property']['email']) {
$from_name = $GLOBALS['phpgw_info']['user']['fullname'];
$from_email = $GLOBALS['phpgw_info']['user']['preferences']['property']['email'];
} else {
$from_name = 'noreply';
$from_email = "{$from_name}<noreply@bergen.kommune.no>";
}
$subject = "Bestilling # {$order_id} har disponert {$budget_info['percent']} prosent av budsjettet";
$lang_budget = lang('budget');
$lang_actual_cost = lang('actual cost');
$lang_percent = lang('percent');
$lang_obligation = lang('obligation');
$_budget = number_format($budget_info['budget'], 0, ',', ' ');
$_actual_cost = number_format($budget_info['actual_cost'], 0, ',', ' ');
$_budget = number_format($budget_info['budget'], 0, ',', ' ');
$_obligation = number_format($budget_info['obligation'], 0, ',', ' ');
$to = implode(';', $toarray);
$cc = false;
$bcc = false;
$body = '<a href ="' . $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'property.uiworkorder.edit', 'id' => $order_id), false, true) . '">' . lang('workorder %1 has been edited', $order_id) . '</a>' . "\n";
$body .= <<<HTML
\t\t\t\t</br>
\t\t\t\t<h2>{$workorder['title']}</h2>
\t\t\t\t</br>
\t\t\t\t</br>
\t\t\t\t<table>
\t\t\t\t\t<tr>
\t\t\t\t\t\t<td>
\t\t\t\t\t\t\t{$lang_budget}
\t\t\t\t\t\t</td>
\t\t\t\t\t\t<td align = 'right'>
\t\t\t\t\t\t\t{$_budget}
\t\t\t\t\t\t</td>
\t\t\t\t\t</tr>
\t\t\t\t\t<tr>
\t\t\t\t\t\t<td>
\t\t\t\t\t\t\t{$lang_actual_cost}
\t\t\t\t\t\t</td>
\t\t\t\t\t\t<td align = 'right'>
\t\t\t\t\t\t\t{$_actual_cost}
\t\t\t\t\t\t</td>
\t\t\t\t\t</tr>
\t\t\t\t\t<tr>
\t\t\t\t\t\t<td>
\t\t\t\t\t\t\t{$lang_percent}
\t\t\t\t\t\t</td>
\t\t\t\t\t\t<td align = 'right'>
\t\t\t\t\t\t\t{$budget_info['percent']}
\t\t\t\t\t\t</td>
\t\t\t\t\t</tr>
\t\t\t\t\t<tr>
\t\t\t\t\t\t<td>
\t\t\t\t\t\t\t{$lang_obligation}
\t\t\t\t\t\t</td>
\t\t\t\t\t\t<td align = 'right'>
\t\t\t\t\t\t\t{$_obligation}
\t\t\t\t\t\t</td>
\t\t\t\t\t</tr>
\t\t\t\t</table>
HTML;
if (!is_object($GLOBALS['phpgw']->send)) {
$GLOBALS['phpgw']->send = CreateObject('phpgwapi.send');
}
try {
$ok = $GLOBALS['phpgw']->send->msg('email', $to, $subject, $body, false, $cc, $bcc, $from_email, $from_name, 'html');
} catch (phpmailerException $e) {
phpgwapi_cache::message_set($e->getMessage(), 'error');
}
if ($ok) {
$historylog = CreateObject('property.historylog', 'workorder');
$historylog->add('ON', $order_id, lang('%1 is notified', $to));
$historylog->add('RM', $order_id, $subject);
return true;
}
//.........这里部分代码省略.........
示例5: compose
function compose($_focusElement = "to")
{
// read the data from session
// all values are empty for a new compose window
$sessionData = $this->bocompose->getSessionData();
$preferences = ExecMethod('felamimail.bopreferences.getPreferences');
#_debug_array($preferences);
// is the to address set already?
if (!empty($GLOBALS['HTTP_GET_VARS']['send_to'])) {
$sessionData['to'] = base64_decode($_GET['send_to']);
}
$this->display_app_header();
$this->t->set_file(array("composeForm" => "composeForm.tpl"));
$this->t->set_block('composeForm', 'header', 'header');
$this->t->set_block('composeForm', 'body_input');
$this->t->set_block('composeForm', 'attachment', 'attachment');
$this->t->set_block('composeForm', 'attachment_row', 'attachment_row');
$this->t->set_block('composeForm', 'attachment_row_bold');
$this->translate();
$this->t->set_var("link_addressbook", $GLOBALS['phpgw']->link('/felamimail/addressbook.php'));
$this->t->set_var("focusElement", $_focusElement);
$linkData = array('menuaction' => 'felamimail.uifelamimail.viewMainScreen');
if ($this->mailPreferences['messageNewWindow']) {
$this->t->set_var("link_message_list", "javascript:window.close();");
} else {
$this->t->set_var("link_message_list", $GLOBALS['phpgw']->link('/felamimail/index.php', $linkData));
}
$linkData = array('menuaction' => 'felamimail.uicompose.action', 'composeid' => $this->composeID);
$this->t->set_var("link_action", $GLOBALS['phpgw']->link('/index.php', $linkData));
$this->t->set_var('folder_name', $this->bofelamimail->sessionData['mailbox']);
// check for some error messages from last posting attempt
if ($errorInfo = $this->bocompose->getErrorInfo()) {
$this->t->set_var('errorInfo', "<font color=\"red\"><b>{$errorInfo}</b></font>");
} else {
$this->t->set_var('errorInfo', ' ');
}
// header
$displayFrom = @htmlentities($preferences['emailAddress'][0][name] . ' <' . $preferences['emailAddress'][0][address] . '>', ENT_QUOTES, $this->displayCharset);
$this->t->set_var("from", $displayFrom);
$this->t->set_var("to", @htmlentities($sessionData['to'], ENT_QUOTES, $this->displayCharset));
$this->t->set_var("cc", @htmlentities($sessionData['cc'], ENT_QUOTES, $this->displayCharset));
$this->t->set_var("bcc", @htmlentities($sessionData['bcc'], ENT_QUOTES, $this->displayCharset));
$this->t->set_var("reply_to", @htmlentities($sessionData['reply_to'], ENT_QUOTES, $this->displayCharset));
$this->t->set_var("subject", @htmlentities($sessionData['subject'], ENT_QUOTES, $this->displayCharset));
$this->t->set_var('addressbookImage', $GLOBALS['phpgw']->common->image('phpgwapi/templates/phpgw_website', 'users'));
$this->t->pparse("out", "header");
// body
$this->t->set_var("body", $sessionData['body']);
$this->t->set_var("signature", $sessionData['signature']);
$this->t->pparse("out", "body_input");
// attachments
if (is_array($sessionData['attachments']) && count($sessionData['attachments']) > 0) {
$this->t->set_var('row_color', $this->rowColor[0]);
$this->t->set_var('name', lang('name'));
$this->t->set_var('type', lang('type'));
$this->t->set_var('size', lang('size'));
$this->t->parse('attachment_rows', 'attachment_row_bold', True);
while (list($key, $value) = each($sessionData['attachments'])) {
#print "$key : $value<br>";
$this->t->set_var('row_color', $this->rowColor[($key + 1) % 2]);
$this->t->set_var('name', $value['name']);
$this->t->set_var('type', $value['type']);
$this->t->set_var('size', $value['size']);
$this->t->set_var('attachment_number', $key);
$this->t->parse('attachment_rows', 'attachment_row', True);
}
} else {
$this->t->set_var('attachment_rows', '');
}
$this->t->pparse("out", "attachment");
}
示例6: data2db
/**
* changes the data from your work-format to the db-format
*
* reimplemented to adjust the timezone of the timestamps (subtraction $this->tz_offset_s to get server-time)
* Please note, we do NOT call the method of the parent so_sql !!!
*
* @param array $data if given works on that array and returns result, else works on internal data-array
* @return array with changed data
*/
function data2db($data = null)
{
if ($intern = !is_array($data)) {
$data =& $this->data;
}
foreach ($this->timestamps as $name) {
if (isset($data[$name]) && $data[$name]) {
$data[$name] -= $this->tz_offset_s;
}
}
if ($data['cp_trainer'] && is_array($data['cp_trainer'])) {
$data['cp_trainer'] = implode(',', $data['cp_trainer']);
}
if ($data['cp_defect_cleared'] && is_array($data['cp_defect_cleared'])) {
$data['cp_defect_cleared'] = implode(',', $data['cp_defect_cleared']);
}
if ($data['cp_events'] && is_array($data['cp_events'])) {
$data['cp_events'] = implode(',', $data['cp_events']);
}
if ($data['cal_id'] && ($event = ExecMethod('calendar.calendar_bo.read', $data['cal_id']))) {
$data['cp_date'] = $event['start'];
}
return $data;
}
示例7: editAccountData
function editAccountData()
{
$boPreferences =& CreateObject('felamimail.bopreferences');
$preferences =& $boPreferences->getPreferences();
if (!($preferences->userDefinedAccounts || $preferences->userDefinedIdentities)) {
die('you are not allowed to be here');
}
if ($_POST['save'] || $_POST['apply']) {
// IMAP connection settings
$icServer =& CreateObject('emailadmin.defaultimap');
if (is_array($_POST['ic'])) {
foreach ($_POST['ic'] as $key => $value) {
switch ($key) {
case 'validatecert':
$icServer->{$key} = $value != 'dontvalidate';
break;
case 'enableSieve':
$icServer->{$key} = $value == 'enableSieve';
break;
default:
$icServer->{$key} = $value;
break;
}
}
} else {
$icServer = NULL;
}
// SMTP connection settings
$ogServer =& CreateObject('emailadmin.defaultsmtp');
if (is_array($_POST['og'])) {
foreach ($_POST['og'] as $key => $value) {
$ogServer->{$key} = $value;
}
} else {
$ogServer = NULL;
}
// identity settings
$identity =& CreateObject('emailadmin.ea_identity');
if (is_array($_POST['identity'])) {
foreach ($_POST['identity'] as $key => $value) {
$identity->{$key} = $value;
}
}
$newID = $boPreferences->saveAccountData($icServer, $ogServer, $identity);
if ($identity->id == 'new') {
$identity->id = $newID;
}
if ((int) $_POST['active']) {
#$boPreferences->saveAccountData($icServer, $ogServer, $identity);
$boPreferences->setProfileActive(false);
$boPreferences->setProfileActive(true, $identity->id);
} else {
$boPreferences->setProfileActive(false, $identity->id);
}
if ($_POST['save']) {
ExecMethod('felamimail.uifelamimail.viewMainScreen');
return;
}
} elseif ($_POST['cancel']) {
ExecMethod('felamimail.uifelamimail.viewMainScreen');
return;
}
$this->display_app_header(TRUE);
$this->t->set_root(PHPGW_APP_TPL);
$this->t->set_file(array("body" => "edit_account_data.tpl"));
$this->t->set_block('body', 'main');
$this->translate();
// if there is no accountID with the call of the edit method, retrieve an active account
$account2retrieve = 'active';
if ((int) $_GET['accountID']) {
$account2retrieve = $_GET['accountID'];
}
if ($_GET['accountID'] == 'new') {
$account2retrieve = 'new';
}
if (!empty($newID) && $newID > 0) {
$account2retrieve = $newID;
}
if ($account2retrieve != 'new') {
$accountData = $boPreferences->getAccountData($preferences, $account2retrieve);
}
$icServer =& $accountData['icServer'];
$ogServer =& $accountData['ogServer'];
$identity =& $accountData['identity'];
#_debug_array($identity);
if ($icServer) {
foreach ($icServer as $key => $value) {
if (is_object($value) || is_array($value)) {
continue;
}
switch ($key) {
case 'encryption':
$this->t->set_var('checked_ic_' . $key . '_' . $value, 'checked');
break;
case 'enableSieve':
$this->t->set_var('checked_ic_' . $key, $value ? 'checked' : '');
break;
case 'validatecert':
$this->t->set_var('checked_ic_' . $key, $value ? '' : 'checked');
break;
//.........这里部分代码省略.........
示例8: edit
function edit($content = '', $msg = '')
{
if (isset($_GET['app'])) {
$this->app = $_GET['app'];
}
if (is_array($content)) {
if ($this->debug) {
echo "content =";
_debug_array($content);
}
$this->app = $content['app'];
// this is what the user selected
$this->table = $content['table_name'];
$posted_app = $content['posted_app'];
// this is the old selection
$posted_table = $content['posted_table'];
}
if ($posted_app && $posted_table && ($posted_app != $this->app || $posted_table != $this->table)) {
if ($this->needs_save('', $posted_app, $posted_table, $this->content2table($content))) {
return;
}
$this->renames = array();
}
if (!$this->app) {
$this->table = '';
$table_names = array('' => lang('none'));
} else {
$this->read($this->app, $this->data);
foreach ($this->data as $name => $table) {
$table_names[$name] = $name;
}
}
if (!$this->table || $this->app != $posted_app) {
reset($this->data);
list($this->table) = each($this->data);
// use first table
} elseif ($this->app == $posted_app && $posted_table) {
$this->data[$posted_table] = $this->content2table($content);
}
if ($content['write_tables']) {
if ($this->needs_save('', $this->app, $this->table, $this->data[$posted_table])) {
return;
}
$msg .= lang('Table unchanged, no write necessary !!!');
} elseif ($content['delete']) {
list($col) = each($content['delete']);
@reset($this->data[$posted_table]['fd']);
while ($col-- > 0 && (list($key, $data) = @each($this->data[$posted_table]['fd']))) {
}
unset($this->data[$posted_table]['fd'][$key]);
$this->changes[$posted_table][$key] = '**deleted**';
} elseif ($content['add_column']) {
$this->data[$posted_table]['fd'][''] = array();
} elseif ($content['add_table'] || $content['import']) {
if (!$this->app) {
$msg .= lang('Select an app first !!!');
} elseif (!$content['new_table_name']) {
$msg .= lang('Please enter table-name first !!!');
} elseif ($content['add_table']) {
$this->table = $content['new_table_name'];
$this->data[$this->table] = array('fd' => array(), 'pk' => array(), 'ix' => array(), 'uc' => array(), 'fk' => array());
$msg .= lang('New table created');
} else {
$oProc = CreateObject('phpgwapi.schema_proc', $GLOBALS['phpgw_info']['server']['db_type']);
$oProc->m_odb = $GLOBALS['phpgw']->db;
$oProc->m_oTranslator->_GetColumns($oProc, $content['new_table_name'], $nul);
while (list($key, $tbldata) = each($oProc->m_oTranslator->sCol)) {
$cols .= $tbldata;
}
eval('$cols = array(' . $cols . ');');
$this->data[$this->table = $content['new_table_name']] = array('fd' => $cols, 'pk' => $oProc->m_oTranslator->pk, 'fk' => $oProc->m_oTranslator->fk, 'ix' => $oProc->m_oTranslator->ix, 'uc' => $oProc->m_oTranslator->uc);
}
} elseif ($content['editor']) {
ExecMethod('etemplate.editor.edit');
return;
}
$add_index = isset($content['add_index']);
// from here on, filling new content for eTemplate
$content = array('msg' => $msg, 'table_name' => $this->table, 'app' => $this->app);
if (!isset($table_names[$this->table])) {
$table_names[$this->table] = $this->table;
}
$sel_options = array('table_name' => $table_names, 'type' => $this->types);
if ($this->table != '' && isset($this->data[$this->table])) {
$content += $this->table2content($this->data[$this->table], $sel_options['Index'], $add_index);
}
$no_button = array();
if (!$this->app || !$this->table) {
$no_button += array('write_tables' => True);
}
if ($this->debug) {
echo 'editor.edit: content =';
_debug_array($content);
}
$this->editor->exec('etemplate.db_tools.edit', $content, $sel_options, $no_button, array('posted_table' => $this->table, 'posted_app' => $this->app, 'changes' => $this->changes));
}
示例9: deleteMessage
function deleteMessage()
{
$preferences = ExecMethod('felamimail.bopreferences.getPreferences');
$message[] = $_GET["message"];
$mailfolder = NULL;
if (!empty($_GET['folder'])) {
$mailfolder = base64_decode($_GET['folder']);
}
$this->bofelamimail->deleteMessages($message, $mailfolder);
// set the url to open when refreshing
$linkData = array('menuaction' => 'felamimail.uifelamimail.viewMainScreen');
$refreshURL = $GLOBALS['phpgw']->link('/index.php', $linkData);
print "<script type=\"text/javascript\">\n\t\t\topener.location.href = '" . $refreshURL . "';\n\t\t\twindow.close();</script>";
}
示例10: delete
function delete($data)
{
return ExecMethod($this->svc . '.' . $this->function_map['delete']['function'], $data);
}
示例11: process_edit
//.........这里部分代码省略.........
for ($row = 1; $row <= $this->etemplate->rows; ++$row) {
$row_data = $this->etemplate->data[$row];
for ($col = $delete_col; $col < $this->etemplate->cols; ++$col) {
$row_data[$this->etemplate->num2chrs($col - 1)] = $row_data[$this->etemplate->num2chrs($col)];
}
unset($row_data[$this->etemplate->num2chrs($this->etemplate->cols - 1)]);
$this->etemplate->data[$row] = $row_data;
}
$width = $this->etemplate->data[0];
for ($col = $delete_col; $col < $this->etemplate->cols; ++$col) {
$width[$this->etemplate->num2chrs($col - 1)] = $width[$this->etemplate->num2chrs($col)];
}
$this->etemplate->data[0] = $width;
--$this->etemplate->cols;
}
if ($this->debug) {
echo 'editor.process_edit: rows=' . $this->etemplate->rows . ', cols=' . $this->etemplate->cols . ', data =';
_debug_array($this->etemplate->data);
}
// Execute the action resulting from the submit-button
if ($content['read']) {
if ($content['version'] != '') {
$save_version = $content['version'];
unset($content['version']);
$this->etemplate->read($content);
$newest_version = $this->etemplate->version;
$content['version'] = $save_version;
}
if (!$this->etemplate->read($content)) {
$content['version'] = '';
// trying it without version
if ($this->etemplate->read($content)) {
$msg = lang('only an other Version found !!!');
} else {
$result = $this->etemplate->search($content);
if (count($result) > 1) {
return $this->list_result(array('result' => $result));
} elseif (!count($result) || !$this->etemplate->read($result[0])) {
$msg = lang('Error: Template not found !!!');
} elseif ($content['name'] == $result[0]['name']) {
$msg = lang('only an other Version found !!!');
}
}
} elseif ($newest_version != '' && $this->etemplate->version != $newest_version) {
$msg = lang("newer version '%1' exists !!!", $newest_version);
}
} elseif ($content['delete']) {
$this->delete();
return;
} elseif ($content['dump']) {
list($name) = explode('.', $content['name']);
if (empty($name) || !@is_dir(PHPGW_SERVER_ROOT . '/' . $name)) {
$msg = lang('Application name needed to write a langfile or dump the eTemplates !!!');
} else {
$msg = $this->etemplate->dump2setup($content['name']);
}
} elseif ($content['save']) {
if (!$this->etemplate->modified_set || !$this->etemplate->modified) {
$this->etemplate->modified = time();
}
$ok = $this->etemplate->save(trim($content['name']), trim($content['template']), trim($content['lang']), intval($content['group']), trim($content['version']));
$msg = $ok ? lang('Template saved') : lang('Error: while saveing !!!');
} elseif ($content['show']) {
$this->show();
return;
} elseif ($content['langfile']) {
list($name) = explode('.', $content['name']);
if (empty($name) || !@is_dir(PHPGW_SERVER_ROOT . '/' . $name)) {
$msg = lang('Application name needed to write a langfile or dump the eTemplates !!!');
} else {
$additional = array();
if ($name == 'etemplate') {
$additional = $this->etemplate->types + $this->extensions + $this->aligns;
} else {
$ui = @CreateObject($name . '.' . ($class = 'ui' . $name));
if (!is_object($ui)) {
$ui = @CreateObject($name . '.' . ($class = 'ui'));
}
if (!is_object($ui)) {
$ui = @CreateObject($name . '.' . ($class = $name));
}
if (is_object($ui) && @$ui->public_functions['writeLangFile']) {
$msg = "{$class}::writeLangFile: " . $ui->writeLangFile();
}
unset($ui);
}
if (empty($msg)) {
$msg = $this->etemplate->writeLangFile($name, 'en', $additional);
}
}
} elseif ($content['export_xml']) {
$msg = $this->export_xml();
} elseif ($content['import_xml']) {
$msg = $this->import_xml($content['file']['tmp_name']);
} elseif ($content['db_tools']) {
ExecMethod('etemplate.db_tools.edit');
return;
}
$this->edit($msg);
}
示例12: create_tabs
function create_tabs($tabs, $selected, $fontsize = '')
{
$output_text = '<table border="0" cellspacing="0" cellpadding="0"><tr>';
/* This is a php3 workaround */
if (PHPGW_IMAGES_DIR == 'PHPGW_IMAGES_DIR') {
$ir = ExecMethod('phpgwapi.phpgw.common.get_image_path', 'phpgwapi');
} else {
$ir = PHPGW_IMAGES_DIR;
}
if ($fontsize) {
$fs = '<font size="' . $fontsize . '">';
$fse = '</font>';
}
$i = 1;
while ($tab = each($tabs)) {
if ($tab[0] == $selected) {
if ($i == 1) {
$output_text .= '<td align="right"><img src="' . $ir . '/tabs-start1.gif"></td>';
}
$output_text .= '<td align="left" background="' . $ir . '/tabs-bg1.gif"> <b><a href="' . $tab[1]['link'] . '" class="tablink" ' . $tab[1]['target'] . '>' . $fs . $tab[1]['label'] . $fse . '</a></b> </td>';
if ($i == count($tabs)) {
$output_text .= '<td align="left"><img src="' . $ir . '/tabs-end1.gif"></td>';
} else {
$output_text .= '<td align="left"><img src="' . $ir . '/tabs-sepr.gif"></td>';
}
} else {
if ($i == 1) {
$output_text .= '<td align="right"><img src="' . $ir . '/tabs-start0.gif"></td>';
}
$output_text .= '<td align="left" background="' . $ir . '/tabs-bg0.gif"> <b><a href="' . $tab[1]['link'] . '" class="tablink" ' . $tab[1]['target'] . '>' . $fs . $tab[1]['label'] . $fse . '</a></b> </td>';
if ($i + 1 == $selected) {
$output_text .= '<td align="left"><img src="' . $ir . '/tabs-sepl.gif"></td>';
} elseif ($i == $selected || $i != count($tabs)) {
$output_text .= '<td align="left"><img src="' . $ir . '/tabs-sepm.gif"></td>';
} elseif ($i == count($tabs)) {
if ($i == $selected) {
$output_text .= '<td align="left"><img src="' . $ir . '/tabs-end1.gif"></td>';
} else {
$output_text .= '<td align="left"><img src="' . $ir . '/tabs-end0.gif"></td>';
}
} else {
if ($i != count($tabs)) {
$output_text .= '<td align="left"><img src="' . $ir . '/tabs-sepr.gif"></td>';
}
}
}
$i++;
$output_text .= "\n";
}
$output_text .= "</table>\n";
return $output_text;
}
示例13: export
function export($data)
{
return ExecMethod($this->svc . '.' . $this->function_map['export_event']['function'], $data);
}
示例14: manager
function manager()
{
$alarm = phpgw::get_var('alarm', 'int', 'POST');
if (phpgw::get_var('delete', 'bool', 'POST') && is_array($alarm) && count($alarm)) {
if ($this->bo->delete($alarm) < 0) {
echo '<div class="err">' . lang('You do not have permission to delete this alarm !!!') . '</div>';
$GLOBALS['phpgw']->common->phpgw_exit(True);
}
}
$enable = phpgw::get_var('enable', 'bool', 'POST');
$disable = phpgw::get_var('disable', 'bool', 'POST');
if (($enable || $disable) && count($alarm)) {
if ($this->bo->enable($alarm, $enable) < 0) {
echo '<div class="err">' . lang('You do not have permission to enable/disable this alarm !!!') . '</div>';
$GLOBALS['phpgw']->common->phpgw_exit(True);
}
}
$this->prep_page();
if (phpgw::get_var('add', 'bool', 'POST')) {
$post_time = phpgw::get_var('time', 'int', 'POST');
$time = $post_time['days'] * phpgwapi_datetime::SECONDS_IN_DAY + $post_time['hours'] * phpgwapi_datetime::SECONDS_IN_HOUR + $post_time['minutes'] * 60;
if ($time > 0 && !$this->bo->add($this->event, $time, phpgw::get_var('owner', 'int', 'POST'))) {
echo '<div class="err">' . lang('You do not have permission to add alarms to this event !!!') . '</div';
$GLOBALS['phpgw']->common->phpgw_exit(True);
}
}
if (!ExecMethod('calendar.uicalendar.view_event', $this->event)) {
echo '<center>' . lang('You do not have permission to read this record!') . '</center>';
$GLOBALS['phpgw']->common->phpgw_exit(True);
}
$GLOBALS['phpgw']->template->set_var('th_bg', $this->theme['th_bg']);
$GLOBALS['phpgw']->template->set_var('hr_text', lang('Alarms') . ':');
$GLOBALS['phpgw']->template->fp('row', 'hr', True);
$GLOBALS['phpgw']->template->pfp('phpgw_body', 'view_event');
$var = array('action_url' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'calendar.uialarm.manager')), 'hidden_vars' => $this->html->input_hidden('cal_id', $this->bo->cal_id), 'lang_select' => lang('Select'), 'lang_time' => lang('Time'), 'lang_text' => lang('Text'), 'lang_owner' => lang('Owner'), 'lang_enabled' => lang('enabled'), 'lang_disabled' => lang('disabled'), 'lang_enabled' => lang('enabled'), 'lang_disabled' => lang('disabled'));
if ($this->event['alarm']) {
$this->output_template_array('rows', 'alarm_headers', $var);
$to_delete = '';
foreach ($this->event['alarm'] as $key => $alarm) {
if (!$this->bo->check_perms(PHPGW_ACL_READALARM, $alarm['owner'])) {
continue;
}
$var = array('field' => $GLOBALS['phpgw']->common->show_date($alarm['time']), 'data' => 'Email Notification', 'owner' => $GLOBALS['phpgw']->common->grab_owner_name($alarm['owner']), 'enabled' => $alarm['enabled'] ? '<img src="' . $GLOBALS['phpgw']->common->image('calendar', 'enabled.png') . '" width="13" height="13" title="' . lang('enabled') . '">' : '<img src="' . $GLOBALS['phpgw']->common->image('calendar', 'disabled.png') . '" width="13" height="13" title="' . lang('disabled') . '">', 'select' => '<input type="checkbox" name="alarm[' . $alarm['id'] . ']">');
if ($this->bo->check_perms(PHPGW_ACL_DELETEALARM, $alarm['owner'])) {
++$to_delete;
}
$this->output_template_array('rows', 'list', $var);
}
$this->template->set_var('enable_button', $this->html->submit_button('enable', 'Enable'));
$this->template->set_var('disable_button', $this->html->submit_button('disable', 'Disable'));
if ($to_delete) {
$this->template->set_var('delete_button', $this->html->submit_button('delete', 'Delete', "return confirm('" . lang("Are you sure\\nyou want to\\ndelete these alarms?") . "')"));
}
$this->template->parse('rows', 'buttons', True);
}
if (isset($this->event['participants'][intval($GLOBALS['phpgw_info']['user']['person_id'])])) {
$time = phpgw::get_var('time', 'int', 'POST');
$this->template->set_var(array('hidden_vars' => $this->html->input_hidden('cal_id', $this->bo->cal_id), 'input_text' => lang('Email reminder'), 'input_days' => $this->html->select('time[days]', isset($time['days']) ? $time['days'] : 0, range(0, 31), True) . ' ' . lang('days'), 'input_hours' => $this->html->select('time[hours]', isset($time['hours']) ? $time['hours'] : 0, range(0, 24), True) . ' ' . lang('hours'), 'input_minutes' => $this->html->select('time[mins]', isset($time['mins']) ? $time['mins'] : 0, range(0, 60), True) . ' ' . lang('minutes') . ' ' . lang('before the event'), 'input_owner' => $this->html->select('owner', $GLOBALS['phpgw_info']['user']['account_id'], $this->bo->participants($this->event, True), True), 'input_add' => $this->html->submit_button('add', 'Add Alarm')));
}
//echo "<p>alarm_management='".htmlspecialchars($this->template->get_var('alarm_management'))."'</p>\n";
$this->template->pfp('out', 'alarm_management');
}
示例15: array
<?php
/**************************************************************************\
* eGroupWare - Polls *
* http://www.egroupware.org *
* Copyright (c) 1999 Till Gerken (tig@skv.org) *
* Modified by Greg Haygood (shrykedude@bellsouth.net) *
* ----------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id: index.php,v 1.9 2004/01/10 02:18:08 shrykedude Exp $ */
$GLOBALS['phpgw_info'] = array();
$GLOBALS['phpgw_info']['flags'] = array('currentapp' => 'polls', 'noheader' => True, 'nonavbar' => True, 'enable_nextmatchs_class' => True);
include '../header.inc.php';
ExecMethod('polls.ui.index');
$GLOBALS['phpgw']->common->phpgw_footer();