本文整理汇总了PHP中MAX类的典型用法代码示例。如果您正苦于以下问题:PHP MAX类的具体用法?PHP MAX怎么用?PHP MAX使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MAX类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _getControllerClass
function _getControllerClass($controllerType = '', $aParams = null, &$class, &$file)
{
if (!is_array($aParams)) {
$aParams = array();
}
if (empty($controllerType) || $controllerType == '-') {
$controllerType = basename($_SERVER['SCRIPT_NAME']);
$controllerType = preg_replace('#^(?:stats-)?(.*)\\.php#', '$1', $controllerType);
}
// Validate
if (!preg_match('/^[a-z-]+$/Di', $controllerType)) {
$errMsg = "OA_Admin_Statistics_Factory::_getControllerClass() Unsupported controller type";
return MAX::raiseError($errMsg, MAX_ERROR_INVALIDARGS, PEAR_ERROR_RETURN);
}
// Prepare the strings required to generate the file and class names
list($primary, $secondary) = explode('-', $controllerType, 2);
$primary = ucfirst(strtolower($primary));
$aSecondary = explode('-', $secondary);
foreach ($aSecondary as $key => $string) {
$aSecondary[$key] = ucfirst(strtolower($string));
}
$file = MAX_PATH . '/lib/OA/Admin/Statistics/Delivery/Controller/';
$file .= $primary;
foreach ($aSecondary as $string) {
$file .= $string;
}
$file .= '.php';
$class = 'OA_Admin_Statistics_Delivery_Controller_';
$class .= $primary;
foreach ($aSecondary as $string) {
$class .= $string;
}
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:33,代码来源:Factory.php
示例2: processBucket
/**
* Process an aggregate-type bucket. This is MySQL specific.
*
* @param Plugins_DeliveryLog $oBucket a reference to the using (context) object.
* @param Date $oEnd A PEAR_Date instance, interval_start to process up to (inclusive).
*/
public function processBucket($oBucket, $oEnd)
{
$sTableName = $oBucket->getBucketTableName();
$oMainDbh =& OA_DB_Distributed::singleton();
if (PEAR::isError($oMainDbh)) {
MAX::raiseError($oMainDbh, MAX_ERROR_DBFAILURE, PEAR_ERROR_DIE);
}
OA::debug(' - Processing the ' . $sTableName . ' table for data with operation interval start equal to or before ' . $oEnd->format('%Y-%m-%d %H:%M:%S') . ' ' . $oEnd->tz->getShortName(), PEAR_LOG_INFO);
// Select all rows with interval_start <= previous OI start.
$rsData =& $this->getBucketTableContent($sTableName, $oEnd);
$rowCount = $rsData->getRowCount();
OA::debug(' - ' . $rsData->getRowCount() . ' records found', PEAR_LOG_DEBUG);
if ($rowCount) {
// We can't do bulk inserts with ON DUPLICATE.
$aExecQueries = array();
while ($rsData->fetch()) {
// Get first row
$aRow = $rsData->toArray();
// Insert or update
$aExecQueries[] = "SELECT bucket_update_{$sTableName}(" . join(',', array_map(array(&$oMainDbh, 'quote'), $aRow)) . ")";
}
if (count($aExecQueries)) {
foreach ($aExecQueries as $execQuery) {
$result = $oMainDbh->exec($execQuery);
if (PEAR::isError($result)) {
MAX::raiseError($result, MAX_ERROR_DBFAILURE, PEAR_ERROR_DIE);
}
}
}
}
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:37,代码来源:AggregateBucketProcessingStrategyPgsql.php
示例3: init
function init($templateName)
{
$this->template_dir = MAX_PATH . '/lib/templates/admin';
$this->compile_dir = MAX_PATH . '/var/templates_compiled';
$this->cache_dir = MAX_PATH . '/var/cache';
$this->caching = 0;
$this->cache_lifetime = 3600;
$this->register_function('t', array('OA_Admin_Template', '_function_t'));
$this->register_function('tabindex', array('OA_Admin_Template', '_function_tabindex'));
$this->register_function('oa_icon', array('OA_Admin_Template', '_function_oa_icon'));
$this->register_function('oa_title_sort', array('OA_Admin_Template', '_function_oa_title_sort'));
$this->register_function('ox_column_title', array('OA_Admin_Template', '_function_ox_column_title'));
$this->register_function('ox_column_class', array('OA_Admin_Template', '_function_ox_column_class'));
$this->register_function('ox_campaign_type', array('OA_Admin_Template', '_function_ox_campaign_type'));
$this->register_function('ox_campaign_status', array('OA_Admin_Template', '_function_ox_campaign_status'));
$this->register_function('ox_campaign_icon', array('OA_Admin_Template', '_function_ox_campaign_icon'));
$this->register_function('ox_banner_size', array('OA_Admin_Template', '_function_ox_banner_size'));
$this->register_function('ox_banner_icon', array('OA_Admin_Template', '_function_ox_banner_icon'));
$this->register_function('ox_zone_size', array('OA_Admin_Template', '_function_ox_zone_size'));
$this->register_function('ox_zone_icon', array('OA_Admin_Template', '_function_ox_zone_icon'));
$this->register_function('ox_tracker_type', array('OA_Admin_Template', '_function_ox_tracker_type'));
$this->register_function('ox_entity_id', array('OA_Admin_Template', '_function_ox_entity_id'));
$this->register_function('boldSearchPhrase', array('OA_Admin_Template', '_function_boldSearchPhrase'));
$this->register_function('oa_is_admin', array('OA_Admin_Template', '_function_oa_is_admin'));
$this->register_function('oa_is_manager', array('OA_Admin_Template', '_function_oa_is_manager'));
$this->register_function('oa_is_advertiser', array('OA_Admin_Template', '_function_oa_is_advertiser'));
$this->register_function('oa_is_trafficker', array('OA_Admin_Template', '_function_oa_is_trafficker'));
$this->register_function('phpAds_ShowBreak', array('OA_Admin_Template', '_function_phpAds_ShowBreak'));
$this->register_function('phpAds_DelConfirm', array('OA_Admin_Template', '_function_phpAds_DelConfirm'));
$this->register_function('MAX_zoneDelConfirm', array('OA_Admin_Template', '_function_MAX_zoneDelConfirm'));
$this->register_function('showStatusText', array('OA_Admin_Template', '_function_showStatusText'));
$this->register_function('showCampaignType', array('OA_Admin_Template', '_function_showCampaignType'));
$this->register_function('oa_form_input_attributes', array('OA_Admin_Template', '_function_form_input_attributes'));
$this->register_block('oa_edit', array('OA_Admin_Template', '_block_edit'));
$this->register_block('oa_form_element', array('OA_Admin_Template', '_block_form_element'));
$this->templateName = $templateName;
$this->assign('phpAds_TextDirection', $GLOBALS['phpAds_TextDirection']);
$this->assign('phpAds_TextAlignLeft', $GLOBALS['phpAds_TextAlignLeft']);
$this->assign('phpAds_TextAlignRight', $GLOBALS['phpAds_TextAlignRight']);
$this->assign('assetPath', OX::assetPath());
$this->assign("adminWebPath", MAX::constructURL(MAX_URL_ADMIN, ''));
$this->assign("oaTemplateDir", MAX_PATH . '/lib/templates/admin/');
//for pluggable page elements
//- plugins may need to refrence their JS in OXP page templates
$this->assign("adminPluginWebPath", MAX::constructURL(MAX_URL_ADMIN, 'plugins'));
//- plugins may need to inject their own
//template based elements into normal templates
$this->assign("pluginBaseDir", MAX_PATH . '/www/admin/plugins/');
$this->assign("pluginTemplateDir", '/templates/');
/**
* CVE-2013-5954
*
* Register the helper method to allow the the required session token to
* be placed into GET method calls for CRUD operations in templates. See
* OA_Permission::checkSessionToken() method for details.
*/
$this->register_function('rv_add_session_token', array('OA_Admin_Template', '_add_session_token'));
}
开发者ID:hostinger,项目名称:revive-adserver,代码行数:58,代码来源:Template.php
示例4: display
/**
* A method to launch and display the widget
*
*/
function display()
{
$oTpl = new OA_Admin_Template('dashboard/grid.html');
$oTpl->assign('dashboardURL', MAX::constructURL(MAX_URL_ADMIN, 'dashboard.php'));
$oTpl->assign('cssURL', OX::assetPath() . "/css");
$oTpl->assign('imageURL', OX::assetPath() . "/images");
$oTpl->assign('jsURL', OX::assetPath() . "/js");
$oTpl->display();
}
开发者ID:hostinger,项目名称:revive-adserver,代码行数:13,代码来源:Grid.php
示例5: belongsToAccount
/**
* The belongsToAccount() method behaves in a different way when looking
* at entries in the "audit" table. To check if an account has access
* to view specific audit data, we only need to check if the account's
* ID is set in the appropriate column in the record.
*
* @param string $accountId The account ID to test if this DB_DataObject is
* owned by.
* @return boolean|null Returns true if the entity belongs to the specified
* account, false if doesn't, or null if it was not
* possible to find the required object references.
*/
function belongsToAccount($accountId = null)
{
// Set the account ID, if not passed in
if (empty($accountId)) {
$accountId = OA_Permission::getAccountId();
}
// Prepare $this with the required info of the "entity" to be tested
if (!$this->N) {
$key = $this->getFirstPrimaryKey();
if (empty($this->{$key})) {
MAX::raiseError('Key on object is not set, table: ' . $this->getTableWithoutPrefix());
return null;
}
if (!$this->find($autoFetch = true)) {
return null;
}
}
// Test the account ID type, and then test for access
$accountType = OA_Permission::getAccountTypeByAccountId($accountId);
// Test the access to the audit trail entry
if ($accountType == OA_ACCOUNT_ADMIN) {
// Admin always has access
return true;
} else {
if ($accountType == OA_ACCOUNT_MANAGER) {
// Test if the account ID is equal to the account_id field
if (is_null($this->account_id)) {
return null;
}
if ($this->account_id == $accountId) {
return true;
}
} else {
if ($accountType == OA_ACCOUNT_ADVERTISER) {
// Test if the account ID is equal to the advertiser_account_id field
if (is_null($this->advertiser_account_id)) {
return null;
}
if ($this->advertiser_account_id == $accountId) {
return true;
}
} else {
if ($accountType == OA_ACCOUNT_TRAFFICKER) {
// Test if the account ID is equal to the website_account_id field
if (is_null($this->website_account_id)) {
return null;
}
if ($this->website_account_id == $accountId) {
return true;
}
}
}
}
}
return false;
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:68,代码来源:Audit.php
示例6: test_constructURL_Includes_Nonstandard_Secure_Port_Number
function test_constructURL_Includes_Nonstandard_Secure_Port_Number()
{
$http = $GLOBALS['_MAX']['HTTP'];
$GLOBALS['_MAX']['HTTP'] = 'https://';
$_SERVER['SERVER_PORT'] = 4430;
$GLOBALS['_MAX']['CONF']['openads']['sslPort'] = 4430;
$url = MAX::constructURL(MAX_URL_ADMIN, 'test.html');
$this->assertEqual($url, 'https://www.maxstore.net:4430/www/admin/test.html', "A non-standard port number should be explicitly provided in delivery URLs. %s");
$GLOBALS['_MAX']['HTTP'] = $http;
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:10,代码来源:max.lib.test.php
示例7: processBucket
/**
* Process a raw-type bucket.
*
* @param Plugins_DeliveryLog a reference to the using (context) object.
* @param Date $oEnd A PEAR_Date instance, interval_start to process up to (inclusive).
*/
public function processBucket($oBucket, $oEnd)
{
$sTableName = $oBucket->getBucketTableName();
$oMainDbh =& OA_DB_Distributed::singleton();
if (PEAR::isError($oMainDbh)) {
MAX::raiseError($oMainDbh, MAX_ERROR_DBFAILURE, PEAR_ERROR_DIE);
}
OA::debug(' - Processing the ' . $sTableName . ' table for data with operation interval start equal to or before ' . $oEnd->format('%Y-%m-%d %H:%M:%S') . ' ' . $oEnd->tz->getShortName(), PEAR_LOG_INFO);
// As this is raw data being processed, data will not be logged based on the operation interval,
// but based on the time the raw data was collected. Adjust the $oEnd value accordingly...
$aDates = OX_OperationInterval::convertDateToOperationIntervalStartAndEndDates($oEnd);
OA::debug(' - The ' . $sTableName . ' table is a raw data table. Data logged in real-time, not operation intervals.', PEAR_LOG_INFO);
OA::debug(' - Accordingly, processing of the ' . $sTableName . ' table will be performed based on data that has a logged date equal to', PEAR_LOG_INFO);
OA::debug(' or before ' . $aDates['end']->format('%Y-%m-%d %H:%M:%S') . ' ' . $aDates['end']->tz->getShortName(), PEAR_LOG_INFO);
// Select all rows with interval_start <= previous OI start.
$rsData =& $this->getBucketTableContent($sTableName, $aDates['end']);
$count = $rsData->getRowCount();
OA::debug(' - ' . $rsData->getRowCount() . ' records found', PEAR_LOG_DEBUG);
if ($count) {
$packetSize = 16777216;
// 16 MB hardcoded (there's no max limit)
$i = 0;
while ($rsData->fetch()) {
$aRow = $rsData->toArray();
$sRow = '(' . join(',', array_map(array(&$oMainDbh, 'quote'), $aRow)) . ')';
if (!$i) {
$sInsert = "INSERT INTO {$sTableName} (" . join(',', array_keys($aRow)) . ") VALUES ";
$query = '';
$aExecQueries = array();
}
if (!$query) {
$query = $sInsert . $sRow;
// Leave 4 bytes headroom for max_allowed_packet
} elseif (strlen($query) + strlen($sRow) + 4 < $packetSize) {
$query .= ',' . $sRow;
} else {
$aExecQueries[] = $query;
$query = $sInsert . $sRow;
}
if (++$i >= $count || strlen($query) >= $packetSize) {
$aExecQueries[] = $query;
$query = '';
}
if (count($aExecQueries)) {
foreach ($aExecQueries as $execQuery) {
$result = $oMainDbh->exec($execQuery);
if (PEAR::isError($result)) {
MAX::raiseError($result, MAX_ERROR_DBFAILURE, PEAR_ERROR_DIE);
}
}
$aExecQueries = array();
}
}
}
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:61,代码来源:RawBucketProcessingStrategyPgsql.php
示例8: getLogoutUrl
/**
* If the agency has set the logout URL in a database, returns this URL
* (trimmed).
* Otherwise, returns 'index.php'.
*
* @param string $agencyId
* @return string Url for redirection after logout.
*/
function getLogoutUrl($agencyId)
{
$doAgency = null;
if ($agencyId) {
$doAgency = OA_Dal::staticGetDO('agency', $agencyId);
}
if ($doAgency && !empty($doAgency->logout_url)) {
return trim($doAgency->logout_url);
}
return MAX::constructURL(MAX_URL_ADMIN, 'index.php');
}
开发者ID:villos,项目名称:tree_admin,代码行数:19,代码来源:Agency.php
示例9: getFieldType
/**
* This method returns class field type.
*
* @param string $fieldName
* @return string field type
*/
function getFieldType($fieldName)
{
$aFieldsTypes = $this->getFieldsTypes();
if (!isset($aFieldsTypes) || !is_array($aFieldsTypes)) {
MAX::raiseError('Please provide field types array for Info object creation');
}
if (!array_key_exists($fieldName, $aFieldsTypes)) {
MAX::raiseError('Unknown type for field \'' . $fieldName . '\'');
}
return $aFieldsTypes[$fieldName];
}
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:17,代码来源:Info.php
示例10: redirectIfNecessary
function redirectIfNecessary($adminPage)
{
$oDesiredUrl = new MAX_Url();
$oCurrentUrl = new MAX_Url();
$full_desired_url_string = MAX::constructURL(MAX_URL_ADMIN, $adminPage);
$oDesiredUrl->useValuesFromString($full_desired_url_string);
$oCurrentUrl->useValuesFromServerVariableArray($_SERVER);
if ($oDesiredUrl->equals($oCurrentUrl)) {
return;
}
$this->redirect($adminPage);
}
开发者ID:villos,项目名称:tree_admin,代码行数:12,代码来源:Redirect.php
示例11: OX_Maintenance
function OX_Maintenance()
{
$this->aConf = $GLOBALS['_MAX']['CONF'];
OA_Preferences::loadAdminAccountPreferences();
$this->aPref = $GLOBALS['_MAX']['PREF'];
// Get a connection to the datbase
$this->oDbh =& OA_DB::singleton();
if (PEAR::isError($this->oDbh)) {
// Unable to continue!
MAX::raiseError($this->oDbh, null, PEAR_ERROR_DIE);
}
}
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:12,代码来源:Maintenance.php
示例12: registerDecorator
/**
* Registers OA_Admin_UI_Decorator for a decorator
*
* @return true if successfully registered, false if there is already decorator
* registered for this name.
*/
function registerDecorator($decoratorName, $path, $className)
{
$decoratorName = strtolower($decoratorName);
if (empty($decoratorName) || empty($path) || empty($className)) {
$errMsg = "DecoratorRegistry::add() Cannot register decorator {$decoratorName} from class {$className} included from {$path}";
return MAX::raiseError($errMsg);
}
if (isset($GLOBALS['_OA_Admin_UI_Decorator_Factory_registered_decorators'][$decoratorName])) {
return false;
}
$GLOBALS['_OA_Admin_UI_Decorator_Factory_registered_decorators'][$decoratorName] = array($path, $className);
return true;
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:19,代码来源:DecoratorFactory.php
示例13: registerJQueryRuleAdaptor
/**
* Registers OA_Admin_UI_Rule_QuickFormToJQueryRuleAdaptor for a given quickform rule
*
* @return true if successfully registered, false if there is already adaptor
* registered for this quickform rule.
*/
function registerJQueryRuleAdaptor($quickFormRuleName, $path, $className)
{
$quickFormRuleName = strtolower($quickFormRuleName);
if (empty($quickFormRuleName) || empty($path) || empty($className)) {
$errMsg = "JQueryRuleAdaptorRegistry::add() Cannot register adaptor for class {$className} for rule {$quickFormRuleName} included from {$path}";
return MAX::raiseError($errMsg);
}
if (isset($GLOBALS['_OA_Admin_UI_Rule_JQueryRuleAdaptorRegistry_registered_adaptors'][$quickFormRuleName])) {
return false;
}
$GLOBALS['_OA_Admin_UI_Rule_JQueryRuleAdaptorRegistry_registered_adaptors'][$quickFormRuleName] = array($path, $className);
return true;
}
开发者ID:villos,项目名称:tree_admin,代码行数:19,代码来源:RuleAdaptorRegistry.php
示例14: processBucket
/**
* Process an aggregate-type bucket. This is MySQL specific.
*
* @param Plugins_DeliveryLog $oBucket a reference to the using (context) object.
* @param Date $oEnd A PEAR_Date instance, interval_start to process up to (inclusive).
*/
public function processBucket($oBucket, $oEnd)
{
$sTableName = $oBucket->getBucketTableName();
$oMainDbh =& OA_DB_Distributed::singleton();
if (PEAR::isError($oMainDbh)) {
MAX::raiseError($oMainDbh, MAX_ERROR_DBFAILURE, PEAR_ERROR_DIE);
}
OA::debug(' - Processing the ' . $sTableName . ' table for data with operation interval start equal to or before ' . $oEnd->format('%Y-%m-%d %H:%M:%S') . ' ' . $oEnd->tz->getShortName(), PEAR_LOG_INFO);
// Select all rows with interval_start <= previous OI start.
$rsData =& $this->getBucketTableContent($sTableName, $oEnd);
$rowCount = $rsData->getRowCount();
OA::debug(' - ' . $rsData->getRowCount() . ' records found', PEAR_LOG_DEBUG);
if ($rowCount) {
// We can't do bulk inserts with ON DUPLICATE.
$aExecQueries = array();
if ($rsData->fetch()) {
// Get first row
$aRow = $rsData->toArray();
// Prepare INSERT
$sInsert = "INSERT INTO {$sTableName} (" . join(',', array_keys($aRow)) . ") VALUES ";
// Add first row data
$sRow = '(' . join(',', array_map(array(&$oMainDbh, 'quote'), $aRow)) . ')';
$sOnDuplicate = ' ON DUPLICATE KEY UPDATE count = count + ' . $aRow['count'];
// Add first insert
$aExecQueries[] = $sInsert . $sRow . $sOnDuplicate;
// Deal with the other rows
while ($rsData->fetch()) {
$aRow = $rsData->toArray();
$sRow = '(' . join(',', array_map(array(&$oMainDbh, 'quote'), $aRow)) . ')';
$sOnDuplicate = ' ON DUPLICATE KEY UPDATE count = count + ' . $aRow['count'];
$aExecQueries[] = $sInsert . $sRow . $sOnDuplicate;
}
}
if (count($aExecQueries)) {
// Try to disable the binlog for the inserts so we don't
// replicate back out over our logged data.
PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
$result = $oMainDbh->exec('SET SQL_LOG_BIN = 0');
if (PEAR::isError($result)) {
OA::debug('Unable to disable the bin log, proceeding anyway.', PEAR_LOG_WARNING);
}
PEAR::staticPopErrorHandling();
foreach ($aExecQueries as $execQuery) {
$result = $oMainDbh->exec($execQuery);
if (PEAR::isError($result)) {
MAX::raiseError($result, MAX_ERROR_DBFAILURE, PEAR_ERROR_DIE);
}
}
}
}
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:57,代码来源:AggregateBucketProcessingStrategyMysql.php
示例15: switch
/**
* Creates a new Field object of the appropriate subclass.
*
* @param string $fieldType The type of field to create.
* @return Admin_UI_Field An instance of the correct {@link Admin_UI_Field} subclass.
*/
function &newField($fieldType)
{
switch ($fieldType) {
case 'advertiser':
$oField = new Admin_UI_AdvertiserIdField();
break;
case 'affiliateid-dropdown':
case 'publisherid-dropdown':
$oField = new Admin_UI_PublisherIdField();
break;
case 'campaignid-dropdown':
$oField = new Admin_UI_CampaignSelectionField();
break;
case 'clientid-dropdown':
$oField = new Admin_UI_AdvertiserIdField();
break;
case 'channelid-dropdown':
$oField = new Admin_UI_ChannelIdField();
break;
case 'date-month':
case 'day-span':
case 'day-span-selector':
$oField = new Admin_UI_DaySpanField();
break;
case 'dropdown':
$oField = new Admin_UI_DropdownField();
break;
case 'edit':
$oField = new Admin_UI_TextField();
break;
case 'scope':
$oField = new Admin_UI_OrganisationSelectionField();
break;
case 'sheet':
$oField = new Admin_UI_SheetSelectionField();
break;
case 'trackerid-dropdown':
$oField = new Admin_UI_TrackerField();
break;
case 'zone-scope':
$oField = new Admin_UI_ZoneScopeField();
break;
case 'zoneid-dropdown':
$oField = new Admin_UI_ZoneIdField();
break;
default:
MAX::raiseError("The report module discovered a field type that it didn't know how to handle.", MAX_ERROR_INVALIDARGS);
}
return $oField;
}
开发者ID:Jaree,项目名称:revive-adserver,代码行数:56,代码来源:FieldFactory.php
示例16: display
/**
* A method to launch and display the widget
*
*/
function display()
{
$aConf = $GLOBALS['_MAX']['CONF'];
phpAds_PageHeader(null, new OA_Admin_UI_Model_PageHeaderModel(), '', false, false);
$oTpl = new OA_Admin_Template('dashboard/main.html');
if (!$aConf['ui']['dashboardEnabled'] || !$aConf['sync']['checkForUpdates']) {
$dashboardUrl = MAX::constructURL(MAX_URL_ADMIN, 'dashboard.php?widget=Disabled');
} else {
$dashboardUrl = MAX::constructURL(MAX_URL_ADMIN, 'dashboard.php?widget=Grid');
}
$oTpl->assign('dashboardURL', $dashboardUrl);
$oTpl->display();
phpAds_PageFooter('', true);
}
开发者ID:Jaree,项目名称:revive-adserver,代码行数:18,代码来源:Index.php
示例17: raiseError
/**
* A method to invoke errors.
*
* @static
* @param mixed $message A string error message, or a {@link PEAR_Error} object.
* @param integer $type A custom message code - see the {@link setupConstants()} function.
* @param integer $behaviour Optional behaviour (i.e. PEAR_ERROR_DIE to halt on this error).
* @return PEAR_Error $error A (@link PEAR_Error} object.
*/
function raiseError($message, $type = null, $behaviour = null)
{
// If fatal
if ($behaviour == PEAR_ERROR_DIE) {
// Log fatal message here as execution will stop
$errorType = MAX::errorConstantToString($type);
if (!is_string($message)) {
$message = print_r($message, true);
}
OA::debug($type . ' :: ' . $message, PEAR_LOG_EMERG);
exit;
}
$error = PEAR::raiseError($message, $type, $behaviour);
return $error;
}
开发者ID:akirsch,项目名称:revive-adserver,代码行数:24,代码来源:Max.php
示例18: assetPath
/**
* A method to construct URLs for static assets, such as images, CSS and
* JavaScript files, based on OpenX installation and configuration details.
*
* @param string $asset An optional relative path to the asset.
* @return string The URL to the asset. If asset was not provided,
* the path does not contain a trailing slash.
*/
function assetPath($asset = null)
{
global $installing;
$aConf = $GLOBALS['_MAX']['CONF'];
$assetsVersion = $aConf['webpath']['adminAssetsVersion'];
$prefix = $installing ? '' : MAX::constructURL(MAX_URL_ADMIN, '');
$pathWithSuffix = $prefix . "assets";
if (strlen($assetsVersion)) {
$pathWithSuffix .= "/" . $assetsVersion;
}
if ($asset != null) {
return $pathWithSuffix . "/" . $asset;
} else {
return $pathWithSuffix;
}
}
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:24,代码来源:OX.php
示例19: display
function display()
{
$conf = $GLOBALS['_MAX']['CONF'];
if (!$conf['audit']['enabled']) {
$this->oTpl->assign('screen', 'disabled');
$this->oTpl->assign('siteTitle', $GLOBALS['strAuditTrailSetup']);
$this->oTpl->assign('siteUrl', MAX::constructUrl(MAX_URL_ADMIN, 'account-settings-debug.php'));
} else {
// Account security
if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
$aParams['account_id'] = OA_Permission::getAccountId();
}
if (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
$aParams['advertiser_account_id'] = OA_Permission::getAccountId();
}
if (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
$aParams['website_account_id'] = OA_Permission::getAccountId();
}
$oAudit = new OA_Dll_Audit();
$aAuditData = $oAudit->getAuditLogForAuditWidget($aParams);
if (count($aAuditData) > 0) {
foreach ($aAuditData as $key => $aValue) {
$aValue['action'] = $this->oTrans->translate($oAudit->getActionName($aValue['actionid']));
$result = $oAudit->getParentContextData($aValue);
$str = "{$aValue['username']} {$GLOBALS['strHas']} {$aValue['action']} {$aValue['context']}";
if (!empty($aValue['contextid'])) {
$str .= " ({$aValue['contextid']})";
}
if (!empty($aValue['parentcontext'])) {
$str .= " {$GLOBALS['strFor']} {$aValue['parentcontext']} ({$aValue['parentcontextid']})";
}
if (!empty($aValue['hasChildren'])) {
$str .= " {$GLOBALS['strAdditionItems']}";
}
$aAuditData[$key]['desc'] = strlen($str) > 30 ? substr($str, 0, 30) . '...' : $str;
}
} else {
$this->oTpl->assign('noData', $GLOBALS['strAuditNoData']);
}
$this->oTpl->assign('screen', 'enabled');
$this->oTpl->assign('aAuditData', $aAuditData);
$this->oTpl->assign('siteUrl', MAX::constructUrl(MAX_URL_ADMIN, 'userlog-index.php'));
$this->oTpl->assign('siteTitle', $GLOBALS['strAuditTrailGoTo']);
}
$this->oTpl->display();
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:46,代码来源:Audit.php
示例20: _getBucketProcessingStrategy
/**
* A private method to get the required default deliveryLog extension
* bucket processing strategy class.
*
* @access private
* @param string $type Either "Aggregate" or "Raw".
* @return OX_Extension_DeliveryLog_BucketProcessingStrategy
*/
private static function _getBucketProcessingStrategy($type)
{
$dbType = $GLOBALS['_MAX']['CONF']['database']['type'];
// Prepare the required filename for the default bucket processing strategy needed
$fileName = LIB_PATH . '/Extension/deliveryLog/' . ucfirst(strtolower($type)) . 'BucketProcessingStrategy' . ucfirst(strtolower($dbType)) . '.php';
// Include the required bucket processing strategy file
if (file_exists($fileName)) {
@(include_once $fileName);
// Prepare the required class name for the default bucket processing strategy needed
$className = 'OX_Extension_DeliveryLog_' . ucfirst(strtolower($type)) . 'BucketProcessingStrategy' . ucfirst(strtolower($dbType));
if (class_exists($className)) {
return new $className();
}
}
$message = 'Unable to instantiate the required default ' . strtolower($type) . " datbase bucket processing strategy for database type '{$dbType}'.";
MAX::raiseError($message, MAX_ERROR_INVALIDARGS, PEAR_ERROR_DIE);
}
开发者ID:villos,项目名称:tree_admin,代码行数:25,代码来源:BucketProcessingStrategyFactory.php
注:本文中的MAX类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论