当前位置: 首页>>代码示例>>PHP>>正文


PHP OA_Admin_UI::getInstance方法代码示例

本文整理汇总了PHP中OA_Admin_UI::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP OA_Admin_UI::getInstance方法的具体用法?PHP OA_Admin_UI::getInstance怎么用?PHP OA_Admin_UI::getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OA_Admin_UI的用法示例。


在下文中一共展示了OA_Admin_UI::getInstance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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']);
}
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:58,代码来源:zone-advanced.php

示例2: processDatabaseAction

 /**
  * Process input from user and creates/upgrades DB etc....
  *
  * @param OA_Admin_UI_Component_Form $oForm
  * @param OX_Admin_UI_Install_Wizard $oWizard
  */
 protected function processDatabaseAction($oForm, $oWizard)
 {
     $oUpgrader = $this->getUpgrader();
     $upgraderSuccess = false;
     $aDbConfig = $oForm->populateDbConfig();
     if ($oUpgrader->canUpgradeOrInstall()) {
         $installStatus = $oUpgrader->existing_installation_status;
         define('DISABLE_ALL_EMAILS', 1);
         OA_Permission::switchToSystemProcessUser('Installer');
         if ($installStatus == OA_STATUS_NOT_INSTALLED) {
             if ($oUpgrader->install($aDbConfig)) {
                 $message = $GLOBALS['strDBInstallSuccess'];
                 $upgraderSuccess = true;
             }
         } else {
             if ($oUpgrader->upgrade($oUpgrader->package_file)) {
                 // Timezone support - hack
                 if ($oUpgrader->versionInitialSchema['tables_core'] < 538 && empty($aDbConfig['noTzAlert'])) {
                     OA_Dal_ApplicationVariables::set('utc_update', OA::getNowUTC());
                 }
                 // Clear the menu cache to built a new one with the new settings
                 OA_Admin_Menu::_clearCache(OA_ACCOUNT_ADMIN);
                 OA_Admin_Menu::_clearCache(OA_ACCOUNT_MANAGER);
                 OA_Admin_Menu::_clearCache(OA_ACCOUNT_ADVERTISER);
                 OA_Admin_Menu::_clearCache(OA_ACCOUNT_TRAFFICKER);
                 OA_Admin_Menu::singleton();
                 $message = $GLOBALS['strDBUpgradeSuccess'];
                 $upgraderSuccess = true;
             }
         }
         OA_Permission::switchToSystemProcessUser();
         //get back to normal user previously logged in
     } else {
         if ($oUpgrader->existing_installation_status == OA_STATUS_CURRENT_VERSION) {
             $upgraderSuccess = true;
             //rare but can occur if DB has been installed and user revisits the screen
         }
     }
     $dbSuccess = $upgraderSuccess && !$oUpgrader->oLogger->errorExists;
     if ($dbSuccess) {
         //show success status
         OA_Admin_UI::getInstance()->queueMessage($message, 'global', 'info');
     } else {
         //sth went wrong, display messages from upgrader
         $aMessages = OX_Admin_UI_Install_InstallUtils::getMessagesWithType($oUpgrader->getMessages());
         $this->setModelProperty('aMessages', $aMessages);
     }
     return $dbSuccess;
 }
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:55,代码来源:InstallController.php

示例3: phpAds_PageHeader

/**
 * Show page header
 *
 * @todo Remove the "if stats, use numeric system" mechanism, should happen with the stats rewrite
 *       Also, this function seems to just be a wrapper to OA_Admin_UI::showHeader()... removing it would seem to make sense
 *
 * @param string ID If not passed in (or null) the page filename is used as the ID
 * @param string Extra
 * @param string imgPath: a relative path to Images, CSS files. Used if calling function from anything other than admin folder
 * @param bool $showSidebar Set to false if you do not wish to show the sidebar navigation
 * @param bool $showContentFrame Set to false if you do not wish to show the content frame
 * @param bool $showMainNavigation Set to false if you do not wish to show the main navigation
 */
function phpAds_PageHeader($ID = null, $headerModel = null, $imgPath = "", $showSidebar = true, $showContentFrame = true, $showMainNavigation = true)
{
    $GLOBALS['_MAX']['ADMIN_UI'] = OA_Admin_UI::getInstance();
    $GLOBALS['_MAX']['ADMIN_UI']->showHeader($ID, $headerModel, $imgPath, $showSidebar, $showContentFrame, $showMainNavigation);
    $GLOBALS['phpAds_GUIDone'] = true;
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:19,代码来源:lib-gui.inc.php

示例4:

<?php

/*
+---------------------------------------------------------------------------+
| Revive Adserver                                                           |
| http://www.revive-adserver.com                                            |
|                                                                           |
| Copyright: See the COPYRIGHT.txt file.                                    |
| License: GPLv2 or later, see the LICENSE.txt file.                        |
+---------------------------------------------------------------------------+
*/
/**
 * OpenX jQuery ajax functions
 */
require_once '../../../../init.php';
require_once MAX_PATH . '/lib/OA/Admin/UI.php';
/**
 since we are loading a page inside of a frame we do not have access to
 scripts defined in top frame. Thus we need to load them on our own if we want to
 use jQuery.
 Please note that scripts.html is an admin template not a plugin template
 **/
$oUI = OA_Admin_UI::getInstance();
$aScripts = $oUI->genericJavascript();
$oTpl = new OA_Admin_Template('layout/scripts.html');
$oTpl->assign('aGenericJavascript', $aScripts);
$oTpl->display();
//now display the page content
include "templates/content.html";
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:29,代码来源:demojQuery-frame.php

示例5: elseif

<?php

require_once '../../../../init.php';
require_once '../../config.php';
require_once MAX_PATH . '/lib/OA/Admin/TemplatePlugin.php';
require_once MAX_PATH . '/lib/OA/Admin/UI/component/Form.php';
require_once 'lib/common.php';
$admin_ui = OA_Admin_UI::getInstance();
$admin_ui->registerStylesheetFile(MAX::constructURL(MAX_URL_ADMIN, 'plugins/zpBannerDesigner/css/colorpicker.css'));
$admin_ui->registerStylesheetFile(MAX::constructURL(MAX_URL_ADMIN, 'plugins/zpBannerDesigner/css/zp-style.css'));
phpAds_registerGlobalUnslashed('bannerid', 'campaignid', 'clientid', 'ajax', 'size', 'keywords', 'qty', 'template_id', 'image_url', 'description', 'type');
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER);
if (isset($ajax)) {
    if ($ajax === 'search') {
        echo search_ajax_request($keywords, $size, $qty);
    } elseif ($ajax === 'form') {
        echo form_ajax_request($template_id);
    } elseif ($ajax === 'preview') {
        echo preview_ajax_request($template_id);
    } elseif ($ajax === 'save-image') {
        echo save_ajax_request($bannerid, $campaignid, $clientid, $image_url, $template_id, $description, $type);
    }
    return;
}
//get advertisers and set the current one
$aAdvertisers = getAdvertiserMap();
if (empty($clientid)) {
    //if it's empty
    $campaignid = null;
    //reset campaign id, we could derive it after we have clientid
    if ($session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['clientid']) {
开发者ID:TheProjecter,项目名称:openx-banner-creator,代码行数:31,代码来源:banner-designer.php


注:本文中的OA_Admin_UI::getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。