本文整理汇总了PHP中OA_Admin_UI::queueMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP OA_Admin_UI::queueMessage方法的具体用法?PHP OA_Admin_UI::queueMessage怎么用?PHP OA_Admin_UI::queueMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OA_Admin_UI
的用法示例。
在下文中一共展示了OA_Admin_UI::queueMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handlePost
function handlePost($vars)
{
$codes = array();
if (isset($vars['tag']) && is_array($vars['tag'])) {
foreach ($vars['tag'] as $k => $v) {
$codes[$k] = array('tagcode' => stripslashes($v), 'paused' => false);
$codes[$k]['autotrack'] = isset($vars['autotrack'][$k]);
}
}
if (isset($vars['t_paused'])) {
foreach (explode(',', $vars['t_paused']) as $k) {
if (isset($codes[$k])) {
$codes[$k]['paused'] = true;
}
}
}
if (isset($vars['t_action'])) {
switch ($vars['t_action']) {
case 'new':
$codes[] = array('tagcode' => '', 'paused' => false);
break;
case 'del':
if (isset($vars['t_id']) && isset($codes[$vars['t_id']])) {
unset($codes[$vars['t_id']]);
}
break;
case 'up':
if (isset($vars['t_id']) && isset($codes[$vars['t_id']]) && isset($codes[$vars['t_id'] - 1])) {
$tmp = $codes[$vars['t_id']];
$codes[$vars['t_id']] = $codes[$vars['t_id'] - 1];
$codes[$vars['t_id'] - 1] = $tmp;
}
break;
case 'down':
if (isset($vars['t_id']) && isset($codes[$vars['t_id']]) && isset($codes[$vars['t_id'] + 1])) {
$tmp = $codes[$vars['t_id']];
$codes[$vars['t_id']] = $codes[$vars['t_id'] + 1];
$codes[$vars['t_id'] + 1] = $tmp;
}
break;
case 'pause':
case 'restart':
if (isset($vars['t_id']) && isset($codes[$vars['t_id']])) {
$codes[$vars['t_id']]['paused'] = $vars['t_action'] == 'pause';
}
break;
}
}
if (isset($vars['save'])) {
$this->_dal->setAppendCodes($this->tracker_id, $codes);
// Queue confirmation message
$doTrackers = OA_Dal::factoryDO('trackers');
$doTrackers->get($this->tracker_id);
$translation = new OX_Translation();
$translated_message = $translation->translate($GLOBALS['strTrackerAppendHasBeenUpdated'], array(MAX::constructURL(MAX_URL_ADMIN, "tracker-edit.php?clientid=" . $this->advertiser_id . "&trackerid=" . $this->tracker_id), htmlspecialchars($doTrackers->trackername)));
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
OX_Admin_Redirect::redirect("tracker-append.php?clientid={$this->advertiser_id}&trackerid={$this->tracker_id}");
} else {
$this->codes = $codes;
$this->showReminder = true;
}
}
示例2: OX_Translation
}
}
if (!count($aErrormessage) && $changePassword) {
$result = $oPlugin->changePassword($doUsers, $pw, $pwold);
if (PEAR::isError($result)) {
$aErrormessage[0][] = $result->getMessage();
}
}
if (!count($aErrormessage)) {
if ($doUsers->update() === false) {
// Unable to update the preferences
$aErrormessage[0][] = $strUnableToWritePrefs;
} else {
$translation = new OX_Translation();
$translated_message = $translation->translate($GLOBALS['strPasswordChanged']);
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
// The "preferences" were written correctly saved to the database,
// go to the "next" preferences page from here
OX_Admin_Redirect::redirect(basename($_SERVER['SCRIPT_NAME']));
}
}
}
// Set the correct section of the preference pages and display the drop-down menu
$prefSection = "password";
$setPref = $oOptions->getSettingsPreferences($prefSection);
$title = $setPref[$prefSection]['name'];
// Display the settings page's header and sections
$oHeaderModel = new OA_Admin_UI_Model_PageHeaderModel($title);
phpAds_PageHeader('account-user-index', $oHeaderModel);
// Get the current logged in user details
$oUser = OA_Permission::getCurrentUser();
示例3: processForm
function processForm($affiliateid, $form, $oComponent)
{
$aFields = $form->exportValues();
$newWebsite = empty($aFields['affiliateid']);
// Setup a new publisher object and set the fields passed in from the form:
$oPublisher = new OA_Dll_PublisherInfo();
$oPublisher->agencyId = $aFields['agencyid'];
$oPublisher->contactName = $aFields['contact'];
$oPublisher->emailAddress = $aFields['email'];
$oPublisher->publisherId = $aFields['affiliateid'];
$oPublisher->publisherName = $aFields['name'];
$oPublisher->website = $aFields['website'];
// process form data for oxThorium if this is edit existing website
if (!$newWebsite && $oComponent) {
$aFields['affiliateid'] = $oPublisher->publisherId;
$oComponent->processAffiliateForm($aFields);
}
$oPublisherDll = new OA_Dll_Publisher();
if ($oPublisherDll->modify($oPublisher) && !$oPublisherDll->_noticeMessage) {
// Queue confirmation message
$translation = new OX_Translation();
if ($newWebsite) {
//process form data for oxThorium for new website
if ($oComponent) {
$aFields['affiliateid'] = $oPublisher->publisherId;
$oComponent->processAffiliateForm($aFields);
}
$translated_message = $translation->translate($GLOBALS['strWebsiteHasBeenAdded'], array(MAX::constructURL(MAX_URL_ADMIN, 'affiliate-edit.php?affiliateid=' . $oPublisher->publisherId), htmlspecialchars($oPublisher->publisherName), MAX::constructURL(MAX_URL_ADMIN, 'zone-edit.php?affiliateid=' . $oPublisher->publisherId)));
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
$redirectURL = "website-index.php";
} else {
$translated_message = $translation->translate($GLOBALS['strWebsiteHasBeenUpdated'], array(MAX::constructURL(MAX_URL_ADMIN, 'affiliate-edit.php?affiliateid=' . $oPublisher->publisherId), htmlspecialchars($oPublisher->publisherName)));
$redirectURL = "affiliate-edit.php?affiliateid={$oPublisher->publisherId}";
}
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
OX_Admin_Redirect::redirect($redirectURL);
}
return $oPublisherDll;
}
示例4: processForm
function processForm($form)
{
$aFields = $form->exportValues();
if (empty($aFields['affiliateid'])) {
$aFields['affiliateid'] = 0;
}
if ($aFields['channelid']) {
$doChannel = OA_Dal::factoryDO('channel');
$doChannel->get($aFields['channelid']);
$doChannel->name = $aFields['name'];
$doChannel->description = $aFields['description'];
$doChannel->comments = $aFields['comments'];
$ret = $doChannel->update();
// Queue confirmation message
$translation = new OX_Translation();
$channelURL = "channel-edit.php?" . (empty($aFields['affiliateid']) ? "agencyid=" . $aFields['agencyid'] . "&channelid=" . $aFields['channelid'] : "affiliateid=" . $aFields['affiliateid'] . "&channelid=" . $aFields['channelid']);
$translated_message = $translation->translate($GLOBALS['strChannelHasBeenUpdated'], array(MAX::constructURL(MAX_URL_ADMIN, $channelURL), htmlspecialchars($aFields['name'])));
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
if (!empty($aFields['affiliateid'])) {
header("Location: channel-edit.php?affiliateid=" . $aFields['affiliateid'] . "&channelid=" . $aFields['channelid']);
} else {
header("Location: channel-edit.php?agencyid=" . $aFields['agencyid'] . "&channelid=" . $aFields['channelid']);
}
exit;
} else {
$doChannel = OA_Dal::factoryDO('channel');
$doChannel->agencyid = $aFields['agencyid'];
$doChannel->affiliateid = $aFields['affiliateid'];
$doChannel->name = $aFields['name'];
$doChannel->description = $aFields['description'];
$doChannel->comments = $aFields['comments'];
$doChannel->compiledlimitation = 'true';
$doChannel->acl_plugins = 'true';
$doChannel->active = 1;
$aFields['channelid'] = $doChannel->insert();
// Queue confirmation message
$translation = new OX_Translation();
$translated_message = $translation->translate($GLOBALS['strChannelHasBeenAdded'], array(MAX::constructURL(MAX_URL_ADMIN, 'channel-edit.php?affiliateid=' . $aFields['affiliateid'] . '&channelid=' . $aFields['channelid']), htmlspecialchars($aFields['name']), MAX::constructURL(MAX_URL_ADMIN, 'channel-acl.php?affiliateid=' . $aFields['affiliateid'] . '&channelid=' . $aFields['channelid'])));
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
if (!empty($aFields['affiliateid'])) {
OX_Admin_Redirect::redirect("affiliate-channels.php?affiliateid=" . $aFields['affiliateid']);
} else {
OX_Admin_Redirect::redirect("channel-index.php");
}
}
}
示例5: displayLogin
/**
* A static method to display a login screen
*
* @static
*
* @param string $sMessage
* @param string $sessionID
* @param bool $inlineLogin
*/
function displayLogin($sMessage = '', $sessionID = 0, $inLineLogin = false)
{
global $strUsername, $strPassword, $strLogin, $strWelcomeTo, $strEnterUsername, $strNoAdminInteface, $strForgotPassword;
$aConf = $GLOBALS['_MAX']['CONF'];
$aPref = $GLOBALS['_MAX']['PREF'];
@header('Cache-Control: max-age=0, no-cache, proxy-revalidate, must-revalidate');
if (!$inLineLogin) {
phpAds_PageHeader(phpAds_Login);
}
// Check environment settings
$oSystemMgr = new OA_Environment_Manager();
$aSysInfo = $oSystemMgr->checkSystem();
foreach ($aSysInfo as $env => $vals) {
$errDetails = '';
if (is_array($vals['error']) && !empty($vals['error'])) {
if ($env == 'PERMS') {
// Just note that some file/folders are unwritable and that more information can be found in the debug.log
OA_Admin_UI::queueMessage('Error: File permission errors detected.<br />These <em>may</em> impact the accurate delivery of your ads,<br />See the debug.log file for the list of unwritable files', 'global', 'error', 0);
} else {
foreach ($vals['error'] as $key => $val) {
$errDetails .= '<li>' . htmlspecialchars($key) . ' => ' . htmlspecialchars($val) . '</li>';
}
phpAds_Die(' Error: ' . $err, $errDetails);
}
}
}
$oTpl = new OA_Admin_Template('login.html');
$appName = !empty($aConf['ui']['applicationName']) ? $aConf['ui']['applicationName'] : PRODUCT_NAME;
$oTpl->assign('uiEnabled', $aConf['ui']['enabled']);
$oTpl->assign('sessionID', $sessionID);
$oTpl->assign('appName', $appName);
$oTpl->assign('message', $sMessage);
$oTpl->display();
phpAds_PageFooter();
exit;
}
示例6: processForm
function processForm($aZone, $form, $oComponent = null)
{
$aFields = $form->exportValues();
if (empty($aFields['zoneid'])) {
return;
}
$doZones = OA_Dal::factoryDO('zones');
$doZones->get($aFields['zoneid']);
// Determine chain
if ($aFields['chaintype'] == '1' && $aFields['chainzone'] != '') {
$chain = 'zone:' . $aFields['chainzone'];
} else {
$chain = '';
}
$doZones->chain = $chain;
if (!isset($aFields['prepend'])) {
$aFields['prepend'] = '';
}
$aFields['prepend'] = MAX_commonGetValueUnslashed('prepend');
$doZones->prepend = $aFields['prepend'];
// Do not save append until not finished with zone appending, if present
if (!empty($aFields['appendsave'])) {
if (!isset($aFields['append'])) {
$aFields['append'] = '';
}
if (!isset($aFields['appendtype'])) {
$aFields['appendtype'] = phpAds_ZoneAppendZone;
}
$aFields['append'] = MAX_commonGetValueUnslashed('append');
$doZones->append = $aFields['append'];
$doZones->appendtype = $aFields['appendtype'];
}
if (isset($aFields['forceappend'])) {
$doZones->forceappend = $aFields['forceappend'];
}
$block = _initCappingVariables($aFields['time'], $aFields['capping'], $aFields['session_capping']);
// Set adselection PCI if required
if (isset($aFields['ext_adselection'])) {
$doZones->ext_adselection = $aFields['ext_adselection'] == 'none' ? OX_DATAOBJECT_NULL : $aFields['ext_adselection'];
}
$doZones->block = $block;
$doZones->capping = $aFields['capping'];
$doZones->session_capping = $aFields['session_capping'];
if ($aFields['show_capped_no_cookie'] != 1) {
$aFields['show_capped_no_cookie'] = 0;
}
$doZones->show_capped_no_cookie = $aFields['show_capped_no_cookie'];
$doZones->update();
// Queue confirmation message
$translation = new OX_Translation();
$translated_message = $translation->translate($GLOBALS['strZoneAdvancedHasBeenUpdated'], array(MAX::constructURL(MAX_URL_ADMIN, 'zone-edit.php?affiliateid=' . $aFields['affiliateid'] . '&zoneid=' . $aFields['zoneid']), htmlspecialchars($doZones->zonename)));
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
// Rebuild Cache
// require_once MAX_PATH . '/lib/max/deliverycache/cache-'.$conf['delivery']['cache'].'.inc.php';
// phpAds_cacheDelete('what=zone:'.$zoneid);
$oUI = OA_Admin_UI::getInstance();
OX_Admin_Redirect::redirect("zone-advanced.php?affiliateid=" . $aFields['affiliateid'] . "&zoneid=" . $aFields['zoneid']);
}
示例7: processForm
function processForm($aAdvertiser, $form)
{
$aFields = $form->exportValues();
// Name
if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
$aAdvertiser['clientname'] = $aFields['clientname'];
}
// Default fields
$aAdvertiser['contact'] = $aFields['contact'];
$aAdvertiser['email'] = $aFields['email'];
$aAdvertiser['comments'] = $aFields['comments'];
// Same advertiser limitation
$aAdvertiser['advertiser_limitation'] = $aFields['advertiser_limitation'] == '1' ? 1 : 0;
// Reports
$aAdvertiser['report'] = $aFields['report'] == 't' ? 't' : 'f';
$aAdvertiser['reportdeactivate'] = $aFields['reportdeactivate'] == 't' ? 't' : 'f';
$aAdvertiser['reportinterval'] = (int) $aFields['reportinterval'];
if ($aAdvertiser['reportinterval'] == 0) {
$aAdvertiser['reportinterval'] = 1;
}
if ($aFields['reportlastdate'] == '' || $aFields['reportlastdate'] == '0000-00-00' || $aFields['reportprevious'] != $aAdvertiser['report']) {
$aAdvertiser['reportlastdate'] = date("Y-m-d");
}
if (empty($aAdvertiser['clientid'])) {
// Set agency ID
$aAdvertiser['agencyid'] = OA_Permission::getAgencyId();
$doClients = OA_Dal::factoryDO('clients');
$doClients->setFrom($aAdvertiser);
$doClients->updated = OA::getNow();
// Insert
$aAdvertiser['clientid'] = $doClients->insert();
// Queue confirmation message
$translation = new OX_Translation();
$translated_message = $translation->translate($GLOBALS['strAdvertiserHasBeenAdded'], array(MAX::constructURL(MAX_URL_ADMIN, 'advertiser-edit.php?clientid=' . $aAdvertiser['clientid']), htmlspecialchars($aAdvertiser['clientname']), MAX::constructURL(MAX_URL_ADMIN, 'campaign-edit.php?clientid=' . $aAdvertiser['clientid'])));
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
// Go to next page
OX_Admin_Redirect::redirect("advertiser-index.php");
} else {
$doClients = OA_Dal::factoryDO('clients');
$doClients->get($aAdvertiser['clientid']);
$doClients->setFrom($aAdvertiser);
$doClients->updated = OA::getNow();
$doClients->update();
// Queue confirmation message
$translation = new OX_Translation();
$translated_message = $translation->translate($GLOBALS['strAdvertiserHasBeenUpdated'], array(MAX::constructURL(MAX_URL_ADMIN, 'advertiser-edit.php?clientid=' . $aAdvertiser['clientid']), htmlspecialchars($aAdvertiser['clientname'])));
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
OX_Admin_Redirect::redirect('advertiser-edit.php?clientid=' . $aAdvertiser['clientid']);
}
exit;
}
示例8: switchAccount
/**
* A method to switch the active account to a different one
*
* @static
* @param int $accountId
* @param boolean $hasAccess Can be used for optimization - if we know that user
* has access to the account he is switching to there is
* no need to check it again
*/
public static function switchAccount($accountId, $hasAccess = false)
{
if ($hasAccess || self::hasAccess($accountId)) {
$oUser =& self::getCurrentUser();
$oUser->loadAccountData($accountId);
}
// Force session save
phpAds_SessionDataRegister('user', $oUser);
// If exists previous message related to switchAccount remove it
OA_Admin_UI::removeOneMessage('switchAccount');
// Queue confirmation message
$translation = new OX_Translation();
$translated_message = $translation->translate($GLOBALS['strYouAreNowWorkingAsX'], array(htmlspecialchars($oUser->aAccount['account_name'])));
OA_Admin_UI::queueMessage($translated_message, 'global', 'info', null, 'switchAccount');
}
示例9: processForm
function processForm($form)
{
$aFields = $form->exportValues();
// If ID is not set, it should be a null-value for the auto_increment
if (empty($aFields['trackerid'])) {
$aFields['trackerid'] = "null";
}
$doTrackers = OA_Dal::factoryDO('trackers');
$doTrackers->trackername = $aFields['trackername'];
$doTrackers->description = $aFields['description'];
$doTrackers->status = $aFields['status'];
$doTrackers->type = $aFields['type'];
$doTrackers->linkcampaigns = $aFields['linkcampaigns'] == "t" ? "t" : "f";
$doTrackers->clientid = $aFields['clientid'];
if (empty($aFields['trackerid']) || $aFields['trackerid'] == "null") {
$aFields['trackerid'] = $doTrackers->insert();
// Queue confirmation message
$translation = new OX_Translation();
$translated_message = $translation->translate($GLOBALS['strTrackerHasBeenAdded'], array(MAX::constructURL(MAX_URL_ADMIN, "tracker-edit.php?clientid=" . $aFields['clientid'] . "&trackerid=" . $aFields['trackerid']), htmlspecialchars($aFields['trackername'])));
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
OX_Admin_Redirect::redirect('advertiser-trackers.php?clientid=' . $aFields['clientid']);
} else {
$doTrackers->trackerid = $aFields['trackerid'];
$doTrackers->update();
// Queue confirmation message
$translation = new OX_Translation();
$translated_message = $translation->translate($GLOBALS['strTrackerHasBeenUpdated'], array(MAX::constructURL(MAX_URL_ADMIN, "tracker-edit.php?clientid=" . $aFields['clientid'] . "&trackerid=" . $aFields['trackerid']), htmlspecialchars($aFields['trackername'])));
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
OX_Admin_Redirect::redirect("tracker-edit.php?clientid=" . $aFields['clientid'] . "&trackerid=" . $aFields['trackerid']);
}
exit;
}
示例10: processCampaignForm
//.........这里部分代码省略.........
}
if ($aFields['companion'] != 1) {
$aFields['companion'] = 0;
}
if ($aFields['show_capped_no_cookie'] != 1) {
$aFields['show_capped_no_cookie'] = 0;
}
$new_campaign = $aFields['campaignid'] == 'null';
if (empty($aFields['revenue']) || $aFields['revenue'] <= 0) {
// No revenue information, set to null
$aFields['revenue'] = OX_DATAOBJECT_NULL;
}
if (empty($aFields['ecpm']) || $aFields['ecpm'] <= 0) {
// No ecpm information, set to null
$aFields['ecpm'] = OX_DATAOBJECT_NULL;
}
// Get the capping variables
$block = _initCappingVariables($aFields['time'], $aFields['capping'], $aFields['session_capping']);
$doCampaigns = OA_Dal::factoryDO('campaigns');
$doCampaigns->campaignname = $aFields['campaignname'];
$doCampaigns->clientid = $aFields['clientid'];
$doCampaigns->views = $aFields['impressions'];
$doCampaigns->clicks = $aFields['clicks'];
$doCampaigns->conversions = $aFields['conversions'];
$doCampaigns->priority = $aFields['priority'];
$doCampaigns->weight = $aFields['weight'];
$doCampaigns->target_impression = $target_impression;
$doCampaigns->target_click = $target_click;
$doCampaigns->target_conversion = $target_conversion;
$doCampaigns->min_impressions = $aFields['min_impressions'];
$doCampaigns->ecpm = $aFields['ecpm'];
$doCampaigns->anonymous = $aFields['anonymous'];
$doCampaigns->companion = $aFields['companion'];
$doCampaigns->show_capped_no_cookie = $aFields['show_capped_no_cookie'];
$doCampaigns->comments = $aFields['comments'];
$doCampaigns->revenue = $aFields['revenue'];
$doCampaigns->revenue_type = $aFields['revenue_type'];
$doCampaigns->block = $block;
$doCampaigns->capping = $aFields['capping'];
$doCampaigns->session_capping = $aFields['session_capping'];
// Activation and expiration
$doCampaigns->activate_time = isset($activate) ? $activate : OX_DATAOBJECT_NULL;
$doCampaigns->expire_time = isset($expire) ? $expire : OX_DATAOBJECT_NULL;
if (!empty($aFields['campaignid']) && $aFields['campaignid'] != "null") {
$doCampaigns->campaignid = $aFields['campaignid'];
$doCampaigns->setEcpmEnabled();
$doCampaigns->update();
} else {
$doCampaigns->setEcpmEnabled();
$aFields['campaignid'] = $doCampaigns->insert();
}
if ($oComponent) {
$oComponent->processCampaignForm($aFields);
}
// Recalculate priority only when editing a campaign
// or moving banners into a newly created, and when:
//
// - campaign changes status (activated or deactivated) or
// - the campaign is active and target/weight are changed
//
if (!$new_campaign) {
$doCampaigns = OA_Dal::staticGetDO('campaigns', $aFields['campaignid']);
$status = $doCampaigns->status;
switch (true) {
case (bool) $status != (bool) $aFields['status_old']:
// Run the Maintenance Priority Engine process
OA_Maintenance_Priority::scheduleRun();
break;
case $status == OA_ENTITY_STATUS_RUNNING:
if (!empty($aFields['target_type']) && ${$aFields['target_type']} != $aFields['target_old'] || !empty($aFields['target_type']) && $aFields['target_type_old'] != $aFields['target_type'] || $aFields['weight'] != $aFields['weight_old'] || $aFields['clicks'] != $aFields['previousclicks'] || $aFields['conversions'] != $aFields['previousconversions'] || $aFields['impressions'] != $aFields['previousimpressions']) {
// Run the Maintenance Priority Engine process
OA_Maintenance_Priority::scheduleRun();
}
break;
}
}
// Rebuild cache
// include_once MAX_PATH . '/lib/max/deliverycache/cache-'.$conf['delivery']['cache'].'.inc.php';
// phpAds_cacheDelete();
// Delete channel forecasting cache
include_once 'Cache/Lite.php';
$options = array('cacheDir' => MAX_CACHE);
$cache = new Cache_Lite($options);
$group = 'campaign_' . $aFields['campaignid'];
$cache->clean($group);
$translation = new OX_Translation();
if ($new_campaign) {
// Queue confirmation message
$translated_message = $translation->translate($GLOBALS['strCampaignHasBeenAdded'], array(MAX::constructURL(MAX_URL_ADMIN, 'campaign-edit.php?clientid=' . $aFields['clientid'] . '&campaignid=' . $aFields['campaignid']), htmlspecialchars($aFields['campaignname']), MAX::constructURL(MAX_URL_ADMIN, 'banner-edit.php?clientid=' . $aFields['clientid'] . '&campaignid=' . $aFields['campaignid'])));
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
OX_Admin_Redirect::redirect("advertiser-campaigns.php?clientid=" . $aFields['clientid']);
} else {
$translated_message = $translation->translate($GLOBALS['strCampaignHasBeenUpdated'], array(MAX::constructURL(MAX_URL_ADMIN, 'campaign-edit.php?clientid=' . $aFields['clientid'] . '&campaignid=' . $aFields['campaignid']), htmlspecialchars($aFields['campaignname'])));
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
OX_Admin_Redirect::redirect("campaign-edit.php?clientid=" . $aFields['clientid'] . "&campaignid=" . $aFields['campaignid']);
}
}
//return processing errors
return $errors;
}
示例11: processForm
//.........这里部分代码省略.........
// Reset append codes which called this zone
$doZones = OA_Dal::factoryDO('zones');
$doZones->appendtype = phpAds_ZoneAppendZone;
if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
$doZones->addReferenceFilter('agency', OA_Permission::getEntityId());
} elseif (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
$doZones->addReferenceFilter('affiliates', OA_Permission::getEntityId());
}
$doZones->find();
while ($doZones->fetch() && ($row = $doZones->toArray())) {
$append = phpAds_ZoneParseAppendCode($row['append']);
if ($append[0]['zoneid'] == $aFields['zoneid']) {
$doZonesClone = clone $doZones;
$doZonesClone->appendtype = phpAds_ZoneAppendRaw;
$doZonesClone->append = '';
$doZonesClone->update();
}
}
if ($type_changed && $aFields['delivery'] == MAX_ZoneEmail) {
// Unlink all campaigns/banners linked to this zone
$aPlacementZones = Admin_DA::getPlacementZones(array('zone_id' => $aFields['zoneid']), true, 'placement_id');
if (!empty($aPlacementZones)) {
foreach ($aPlacementZones as $placementId => $aPlacementZone) {
Admin_DA::deletePlacementZones(array('zone_id' => $aFields['zoneid'], 'placement_id' => $placementId));
}
}
$aAdZones = Admin_DA::getAdZones(array('zone_id' => $aFields['zoneid']), false, 'ad_id');
if (!empty($aAdZones)) {
foreach ($aAdZones as $adId => $aAdZone) {
Admin_DA::deleteAdZones(array('zone_id' => $aFields['zoneid'], 'ad_id' => $adId));
}
}
} else {
if ($size_changed) {
$aZone = Admin_DA::getZone($aFields['zoneid']);
// Loop through all appended banners and make sure that they still fit...
$aAds = Admin_DA::getAdZones(array('zone_id' => $aFields['zoneid']), false, 'ad_id');
if (!empty($aAds)) {
foreach ($aAds as $adId => $aAd) {
$aAd = Admin_DA::getAd($adId);
if ($aZone['type'] == phpAds_ZoneText && $aAd['type'] != 'txt' || $aAd['width'] != $aZone['width'] && $aZone['width'] > -1 || $aAd['height'] != $aZone['height'] && $aZone['height'] > -1) {
Admin_DA::deleteAdZones(array('zone_id' => $aFields['zoneid'], 'ad_id' => $adId));
}
}
}
// Check if any campaigns linked to this zone have ads that now fit.
// If so, link them to the zone.
$aPlacementZones = Admin_DA::getPlacementZones(array('zone_id' => $aFields['zoneid']), true);
if (!empty($aPlacementZones)) {
foreach ($aPlacementZones as $aPlacementZone) {
// get ads in this campaign
$aAds = Admin_DA::getAds(array('placement_id' => $aPlacementZone['placement_id']), true);
foreach ($aAds as $adId => $aAd) {
Admin_DA::addAdZone(array('zone_id' => $aFields['zoneid'], 'ad_id' => $adId));
}
}
}
}
}
// Queue confirmation message
$translation = new OX_Translation();
$translated_message = $translation->translate($GLOBALS['strZoneHasBeenUpdated'], array(MAX::constructURL(MAX_URL_ADMIN, "zone-edit.php?affiliateid=" . $aFields['affiliateid'] . "&zoneid=" . $aFields['zoneid']), htmlspecialchars($aFields['zonename'])));
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
OX_Admin_Redirect::redirect("zone-edit.php?affiliateid=" . $aFields['affiliateid'] . "&zoneid=" . $aFields['zoneid']);
} else {
$doZones = OA_Dal::factoryDO('zones');
$doZones->affiliateid = $aFields['affiliateid'];
$doZones->zonename = $aFields['zonename'];
$doZones->zonetype = phpAds_ZoneCampaign;
$doZones->description = $aFields['description'];
$doZones->comments = $aFields['comments'];
$doZones->width = $aFields['width'];
$doZones->height = $aFields['height'];
$doZones->delivery = $aFields['delivery'];
$doZones->oac_category_id = $aFields['oac_category_id'];
// The following fields are NOT NULL but do not get values set in the form.
// Should these fields be changed to NULL in the schema or should they have a default value?
$doZones->category = '';
$doZones->ad_selection = '';
$doZones->chain = '';
$doZones->prepend = '';
$doZones->append = '';
$aFields['zoneid'] = $doZones->insert();
// Ad Networks
$doPublisher = OA_Dal::factoryDO('affiliates');
$doPublisher->get($aFields['affiliateid']);
$anWebsiteId = $doPublisher->as_website_id;
if ($anWebsiteId) {
$oAdNetworks = new OA_Central_AdNetworks();
$oAdNetworks->updateZone($doZones, $anWebsiteId);
}
// Queue confirmation message
$translation = new OX_Translation();
$translated_message = $translation->translate($GLOBALS['strZoneHasBeenAdded'], array(MAX::constructURL(MAX_URL_ADMIN, 'zone-edit.php?affiliateid=' . $aFields['affiliateid'] . '&zoneid=' . $aFields['zoneid']), htmlspecialchars($aFields['zonename'])));
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
OX_Admin_Redirect::redirect("affiliate-zones.php?affiliateid=" . $aFields['affiliateid']);
}
}
return $errors;
}
示例12: processForm
function processForm($bannerid, $form, &$oComponent, $formDisabled = false)
{
$aFields = $form->exportValues();
$doBanners = OA_Dal::factoryDO('banners');
if (!empty($bannerid)) {
if ($doBanners->get($bannerid)) {
$aBanner = $doBanners->toArray();
}
}
$aVariables = array();
$aVariables['campaignid'] = $aFields['campaignid'];
$aVariables['target'] = isset($aFields['target']) ? $aFields['target'] : '';
$aVariables['height'] = isset($aFields['height']) ? $aFields['height'] : 0;
$aVariables['width'] = isset($aFields['width']) ? $aFields['width'] : 0;
$aVariables['weight'] = !empty($aFields['weight']) ? $aFields['weight'] : 0;
$aVariables['adserver'] = !empty($aFields['adserver']) ? $aFields['adserver'] : '';
$aVariables['alt'] = !empty($aFields['alt']) ? $aFields['alt'] : '';
$aVariables['bannertext'] = !empty($aFields['bannertext']) ? $aFields['bannertext'] : '';
$aVariables['htmltemplate'] = !empty($aFields['htmltemplate']) ? $aFields['htmltemplate'] : '';
$aVariables['description'] = !empty($aFields['description']) ? $aFields['description'] : '';
$aVariables['imageurl'] = !empty($aFields['imageurl']) && $aFields['imageurl'] != 'http://' ? $aFields['imageurl'] : '';
$aVariables['url'] = !empty($aFields['url']) && $aFields['url'] != 'http://' ? $aFields['url'] : '';
$aVariables['status'] = $aFields['status'] != '' ? $aFields['status'] : '';
$aVariables['storagetype'] = $aFields['type'];
$aVariables['ext_bannertype'] = 'bannerTypeText:oxMarkedText:oxMarkedTextComponent';
$aVariables['comments'] = $aFields['comments'];
$aVariables['contenttype'] = 'txt';
if (isset($aFields['keyword']) && $aFields['keyword'] != '') {
$keywordArray = split('[ ,]+', $aFields['keyword']);
$aVariables['keyword'] = implode(' ', $keywordArray);
} else {
$aVariables['keyword'] = '';
}
$editSwf = false;
$parameters = null;
$aVariables['parameters'] = serialize($parameters);
$insert = empty($bannerid) ? true : false;
$doBanners->setFrom($aVariables);
if ($insert) {
$bannerid = $doBanners->insert();
OA_Maintenance_Priority::scheduleRun();
} else {
$doBanners->update();
if ($aVariables['width'] != $aBanner['width'] || $aVariables['height'] != $aBanner['height']) {
MAX_adjustAdZones($bannerid);
MAX_addDefaultPlacementZones($bannerid, $aVariables['campaignid']);
}
}
$translation = new OX_Translation();
if ($insert) {
$translated_message = $translation->translate($GLOBALS['strBannerHasBeenAdded'], array(MAX::constructURL(MAX_URL_ADMIN, 'banner-edit.php?clientid=' . $aFields['clientid'] . '&campaignid=' . $aFields['campaignid'] . '&bannerid=' . $bannerid), htmlspecialchars($aFields['description'])));
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
$nextPage = "oxMarkedTextAdvertiser-index.php?clientid=" . $aFields['clientid'] . "&campaignid=" . $aFields['campaignid'];
} else {
$translated_message = $translation->translate($GLOBALS['strBannerHasBeenUpdated'], array(MAX::constructURL(MAX_URL_ADMIN, 'banner-edit.php?clientid=' . $aFields['clientid'] . '&campaignid=' . $aFields['campaignid'] . '&bannerid=' . $aFields['bannerid']), htmlspecialchars($aFields['description'])));
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
$nextPage = "banner-edit.php?clientid=" . $aFields['clientid'] . "&campaignid=" . $aFields['campaignid'] . "&bannerid={$bannerid}";
}
Header("Location: {$nextPage}");
exit;
}
示例13: processForm
//.........这里部分代码省略.........
}
// Update existing hard-coded links if new file has not been uploaded
if ($aVariables['contenttype'] == 'swf' && empty($_FILES['upload']['tmp_name']) && isset($aFields['alink']) && is_array($aFields['alink']) && count($aFields['alink'])) {
// Prepare the parameters
$parameters_complete = array();
// Prepare targets
if (!isset($aFields['atar']) || !is_array($aFields['atar'])) {
$aFields['atar'] = array();
}
foreach ($aFields['alink'] as $key => $val) {
if (substr($val, 0, 7) == 'http://' && strlen($val) > 7) {
if (!isset($aFields['atar'][$key])) {
$aFields['atar'][$key] = '';
}
if (isset($aFields['alink_chosen']) && $aFields['alink_chosen'] == $key) {
$aVariables['url'] = $val;
$aVariables['target'] = $aFields['atar'][$key];
}
/*
if (isset($aFields['asource'][$key]) && $aFields['asource'][$key] != '') {
$val .= '|source:'.$aFields['asource'][$key];
}
*/
$parameters_complete[$key] = array('link' => $val, 'tar' => $aFields['atar'][$key]);
}
}
$parameters = array('swf' => $parameters_complete);
} else {
$parameters = null;
}
$aVariables['parameters'] = serialize($parameters);
//TODO: deleting images is not viable because they could still be in use in the delivery cache
// // Delete any old banners...
// if (!empty($aBanner['filename']) && $aBanner['filename'] != $aVariables['filename']) {
// phpAds_ImageDelete($aBanner['storagetype'], $aBanner['filename']);
// }
// if (!empty($aBanner['alt_filename']) && $aBanner['alt_filename'] != $aVariables['alt_filename']) {
// phpAds_ImageDelete($aBanner['storagetype'], $aBanner['alt_filename']);
// }
// Clients are only allowed to modify certain fields, ensure that other fields are unchanged
if (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
$aVariables['weight'] = $aBanner['weight'];
$aVariables['description'] = $aBanner['name'];
$aVariables['comments'] = $aBanner['comments'];
}
$insert = empty($bannerid) ? true : false;
if ($oComponent) {
$result = $oComponent->preprocessForm($insert, $bannerid, $aFields, $aVariables);
if ($result === false) {
// handle error
return false;
}
}
// File the data
$doBanners->setFrom($aVariables);
if ($insert) {
$bannerid = $doBanners->insert();
// Run the Maintenance Priority Engine process
OA_Maintenance_Priority::scheduleRun();
} else {
$doBanners->update();
// check if size has changed
if ($aVariables['width'] != $aBanner['width'] || $aVariables['height'] != $aBanner['height']) {
MAX_adjustAdZones($bannerid);
MAX_addDefaultPlacementZones($bannerid, $aVariables['campaignid']);
}
}
if ($oComponent) {
$result = $oComponent->processForm($insert, $bannerid, $aFields, $aVariables);
if ($result === false) {
// handle error
// remove rec from banners table?
return false;
}
}
$translation = new OX_Translation();
if ($insert) {
// Queue confirmation message
$translated_message = $translation->translate($GLOBALS['strBannerHasBeenAdded'], array(MAX::constructURL(MAX_URL_ADMIN, 'banner-edit.php?clientid=' . $aFields['clientid'] . '&campaignid=' . $aFields['campaignid'] . '&bannerid=' . $bannerid), htmlspecialchars($aFields['description'])));
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
// Determine what the next page is
if ($editSwf) {
$nextPage = "banner-swf.php?clientid=" . $aFields['clientid'] . "&campaignid=" . $aFields['campaignid'] . "&bannerid={$bannerid}&insert=true";
} else {
$nextPage = "campaign-banners.php?clientid=" . $aFields['clientid'] . "&campaignid=" . $aFields['campaignid'];
}
} else {
// Determine what the next page is
if ($editSwf) {
$nextPage = "banner-swf.php?clientid=" . $aFields['clientid'] . "&campaignid=" . $aFields['campaignid'] . "&bannerid={$bannerid}";
} else {
$translated_message = $translation->translate($GLOBALS['strBannerHasBeenUpdated'], array(MAX::constructURL(MAX_URL_ADMIN, 'banner-edit.php?clientid=' . $aFields['clientid'] . '&campaignid=' . $aFields['campaignid'] . '&bannerid=' . $aFields['bannerid']), htmlspecialchars($aFields['description'])));
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
$nextPage = "banner-edit.php?clientid=" . $aFields['clientid'] . "&campaignid=" . $aFields['campaignid'] . "&bannerid={$bannerid}";
}
}
// Go to the next page
Header("Location: {$nextPage}");
exit;
}
示例14: displayLogin
/**
* A static method to display a login screen
*
* @static
*
* @param string $sMessage
* @param string $sessionID
* @param bool $inlineLogin
*/
function displayLogin($sMessage = '', $sessionID = 0, $inLineLogin = false)
{
global $strUsername, $strPassword, $strLogin, $strWelcomeTo, $strEnterUsername, $strNoAdminInteface, $strForgotPassword;
$aConf = $GLOBALS['_MAX']['CONF'];
$aPref = $GLOBALS['_MAX']['PREF'];
@header('Cache-Control: max-age=0, no-cache, proxy-revalidate, must-revalidate');
if (!$inLineLogin) {
phpAds_PageHeader(phpAds_Login);
}
// Check environment settings
$oSystemMgr = new OA_Environment_Manager();
$aSysInfo = $oSystemMgr->checkSystem();
foreach ($aSysInfo as $env => $vals) {
$errDetails = '';
if (is_array($vals['error']) && !empty($vals['error'])) {
if ($env == 'PERMS') {
// Just note that some file/folders are unwritable and that more information can be found in the debug.log
OA_Admin_UI::queueMessage('Error: File permission errors detected.<br />These <em>may</em> impact the accurate delivery of your ads,<br />See the debug.log file for the list of unwritable files', 'global', 'error', 0);
} else {
foreach ($vals['error'] as $key => $val) {
$errDetails .= '<li>' . htmlspecialchars($key) . ' => ' . htmlspecialchars($val) . '</li>';
}
phpAds_Die(' Error: ' . $err, $errDetails);
}
}
}
$oTpl = new OA_Admin_Template('login.html');
// we build the URL of the current page to use a redirect URL after login
// this code should work on all server configurations hence why it is a bit complicated
// inspired by http://dev.piwik.org/svn/trunk/core/Url.php getCurrentUrl()
$url = '';
if (!empty($_SERVER['PATH_INFO'])) {
$url = $_SERVER['PATH_INFO'];
} else {
if (!empty($_SERVER['REQUEST_URI'])) {
if (($pos = strpos($_SERVER['REQUEST_URI'], "?")) !== false) {
$url = substr($_SERVER['REQUEST_URI'], 0, $pos);
} else {
$url = $_SERVER['REQUEST_URI'];
}
}
}
if (empty($url)) {
$url = $_SERVER['SCRIPT_NAME'];
}
if (!empty($_SERVER['QUERY_STRING'])) {
$url .= '?' . $_SERVER['QUERY_STRING'];
}
if (!empty($url)) {
// remove any extra slashes that would confuse the browser (see OX-5234)
$url = '/' . ltrim($url, '/');
}
$appName = !empty($aConf['ui']['applicationName']) ? $aConf['ui']['applicationName'] : MAX_PRODUCT_NAME;
$oTpl->assign('uiEnabled', $aConf['ui']['enabled']);
$oTpl->assign('formAction', $url);
$oTpl->assign('sessionID', $sessionID);
$oTpl->assign('appName', $appName);
$oTpl->assign('message', $sMessage);
$oTpl->display();
phpAds_PageFooter();
exit;
}
示例15: array
$aElements = array();
$aCheckboxes = array();
// Timezone
$aElements[] = 'timezone';
// Save the preferences
$result = OA_Preferences::processPreferencesFromForm($aElements, $aCheckboxes);
if ($result) {
// Queue confirmation message
$setPref = $oOptions->getSettingsPreferences($prefSection);
$title = $setPref[$prefSection]['name'];
$translation = new OX_Translation();
$translatedMessage = $translation->translate($GLOBALS['strXPreferencesHaveBeenUpdated'], array(htmlspecialchars($title)));
OA_Admin_UI::queueMessage($translatedMessage, 'local', 'confirm', 2000);
// Also display warning after 2 seconds
$translatedMessage = $translation->translate($GLOBALS['strTZPreferencesWarning']);
OA_Admin_UI::queueMessage($translatedMessage, 'local', 'warning', 0);
OX_Admin_Redirect::redirect(basename($_SERVER['SCRIPT_NAME']));
}
// Could not write the preferences to the database, store this
// error message and continue
$aErrormessage[0][] = $strUnableToWritePrefs;
}
// Set the correct section of the preference pages and display the drop-down menu
$setPref = $oOptions->getSettingsPreferences($prefSection);
$title = $setPref[$prefSection]['name'];
// Display the settings page's header and sections
$oHeaderModel = new OA_Admin_UI_Model_PageHeaderModel($title);
phpAds_PageHeader('account-preferences-index', $oHeaderModel);
// Get timezone dropdown information
$aTimezones = OX_Admin_Timezones::availableTimezones(true);
$oConfigTimezone = trim($GLOBALS['_MAX']['PREF']['timezone']);