本文整理汇总了PHP中PHPWS_Core::getCurrentModule方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPWS_Core::getCurrentModule方法的具体用法?PHP PHPWS_Core::getCurrentModule怎么用?PHP PHPWS_Core::getCurrentModule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPWS_Core
的用法示例。
在下文中一共展示了PHPWS_Core::getCurrentModule方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: logSwiftmailMessage
/**
* PHPWS_Email has a built-in simple logging function. This replicates
* the functionality of that function for SwiftMail.
*/
public static function logSwiftmailMessage(Swift_Message $message)
{
$id = 'id:' . $message->getId();
$from = 'from:' . $message->getSender();
$to = 'to:' . implode(',', array_keys($message->getTo()));
// Optional fields, If the message has them, implode the arrays to simple strings.
$cc = $message->getCc() != null ? 'cc:' . implode(',', array_keys($message->getCc())) : '';
$bcc = $message->getBcc() != null ? 'bcc:' . implode(',', array_keys($message->getBcc())) : '';
$replyto = $message->getReplyTo() != null ? 'reply-to:' . implode(',', array_keys($message->getReplyTo())) : '';
$subject = 'subject:' . $message->getSubject();
$module = 'module:' . PHPWS_Core::getCurrentModule();
$user = 'user:' . (Current_User::isLogged() ? Current_User::getUsername() : '');
PHPWS_Core::log("{$id} {$module} {$user} {$subject} {$from} {$to} {$cc} {$bcc} {$replyto}", 'phpws-mail.log', 'mail');
}
示例2: display
public static function display($content = null, $current_tab = null)
{
self::deleteLinksAdmin();
Layout::addStyle('controlpanel');
$panel = new PHPWS_Panel('controlpanel');
$panel->disableSecure();
$current_mod = PHPWS_Core::getCurrentModule();
$checkTabs = PHPWS_ControlPanel::loadTabs();
$panel->setTabs($checkTabs);
$allLinks = PHPWS_ControlPanel::getAllLinks();
if (empty($checkTabs)) {
PHPWS_Error::log(CP_NO_TABS, 'controlpanel', 'display');
PHPWS_ControlPanel::makeDefaultTabs();
PHPWS_ControlPanel::reset();
PHPWS_Core::errorPage();
exit;
}
$defaultTabs = PHPWS_ControlPanel::getDefaultTabs();
foreach ($defaultTabs as $tempTab) {
$tabList[] = $tempTab['id'];
}
if (!empty($allLinks)) {
$links = array_keys($allLinks);
if ($current_mod != 'controlpanel' && !$current_tab) {
foreach ($allLinks as $key => $tablinks) {
foreach ($tablinks as $link) {
if ($link->itemname == $current_mod) {
$current_tab = $key;
break 2;
}
}
}
}
}
foreach ($checkTabs as $tab) {
if ($tab->getItemname() == 'controlpanel' && in_array($tab->id, $tabList) && (!isset($links) || !in_array($tab->id, $links))) {
$panel->dropTab($tab->id);
}
}
if (empty($panel->tabs)) {
return dgettext('controlpanel', 'No tabs available in the Control Panel.');
}
if (!isset($content) && $current_mod == 'controlpanel') {
if (isset($allLinks[$panel->getCurrentTab()])) {
foreach ($allLinks[$panel->getCurrentTab()] as $id => $link) {
$link_content[] = $link->view();
}
$link_content = PHPWS_Template::process(array('LINKS' => implode('', $link_content)), 'controlpanel', 'links.tpl');
$panel->setContent($link_content);
}
} else {
$panel->setContent($content);
}
if (isset($current_tab)) {
$panel->setCurrentTab($current_tab);
}
if (!isset($panel->tabs[$panel->getCurrentTab()])) {
return dgettext('controlpanel', 'An error occurred while accessing the Control Panel.');
}
$tab = $panel->tabs[$panel->getCurrentTab()];
$link = str_replace('&', '&', $tab->getLink(false)) . '&tab=' . $tab->id;
$current_link = str_replace($_SERVER['PHP_SELF'] . '\\?', '', $_SERVER['REQUEST_URI']);
// Headers to the tab's link if it is not a control panel
// link tab.
if (isset($_REQUEST['command']) && $_REQUEST['command'] == 'panel_view' && !preg_match('/controlpanel/', $link) && $link != $current_link) {
PHPWS_Core::reroute($link);
}
return $panel->display();
}
示例3:
<?php
/**
* @author Matthew McNaney <mcnaney at gmail dot com>
* @version $Id$
*/
// Destroy unused sessions
if (PHPWS_Core::getCurrentModule() != 'users') {
PHPWS_Core::killSession('Member_Pager');
PHPWS_Core::killSession('All_Demo');
PHPWS_Core::killSession('User_Manager');
PHPWS_Core::killSession('Group_Manager');
}
Current_User::permissionMenu();
示例4: log
protected static function log($to, $headers, $result)
{
$id = 'id:' . $headers['Message-Id'];
$from = 'from:' . (isset($headers['From']) ? $headers['From'] : '');
$to = 'to:' . $to;
$cc = 'cc:' . (isset($headers['Cc']) ? $headers['Cc'] : '');
$bcc = 'bcc:' . (isset($headers['Bcc']) ? $headers['Bcc'] : '');
$replyto = 'reply-to:' . (isset($headers['Reply-To']) ? $headers['Reply-To'] : '');
$subject = 'subject:' . (isset($headers['Subject']) ? $headers['Subject'] : '');
$module = 'module:' . PHPWS_Core::getCurrentModule();
$user = 'user:' . (Current_User::isLogged() ? Current_User::getUsername() : '');
$result = 'result:' . (PHPWS_Error::isError($result) ? 'Failure' : 'Success');
PHPWS_Core::log("{$id} {$module} {$user} {$subject} {$from} {$to} {$cc} {$bcc} {$replyto} {$result}", 'phpws-mail.log', 'mail');
}