case '2': OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADMIN); break; case '4-1': OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN); $message = 'Dynamic submenu 4-1'; $menu = 'demo-menu-4'; // PageHeader function needs to know the *parent* menu setCurrentLeftMenuSubItem('demo-menu-4-1'); break; case '4-2': OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN); $message = 'Dynamic submenu 4-2'; $menu = 'demo-menu-4'; // PageHeader function needs to know the *parent* menu setCurrentLeftMenuSubItem('demo-menu-4-2'); break; } $colour = $GLOBALS['_MAX']['PREF']['demoUserInterface_demopref_' . OA_Permission::getAccountType(true)]; //$image = 'demoUI'.$i.'.jpg'; $message = $message; addLeftMenuSubItem('demo-menu-4-1', 'demo submenu 4-1', 'plugins/demoUserInterface/demoUI-page.php?action=4-1'); addLeftMenuSubItem('demo-menu-4-2', 'demo submenu 4-2', 'plugins/demoUserInterface/demoUI-page.php?action=4-2'); phpAds_PageHeader($menu, '', '../../'); $oTpl = new OA_Plugin_Template('demoUI.html', 'demoUserInterface'); //$oTpl->assign('image',$image); $oTpl->assign('message', $message); $oTpl->assign('colour', $colour); $oTpl->display(); phpAds_PageFooter(); } else {
function getSettingsPreferences($section) { /** * @todo After have a way to know if a user is in the admin role, manager role, publisher role * or advertiser role we'll create a personalized "Choose section" listBox * check strMainSettings */ if ($this->_optionType == 'account-settings') { $aSections = array('banner-delivery' => array('name' => $GLOBALS['strBannerDelivery'], 'perm' => OA_ACCOUNT_ADMIN), 'banner-logging' => array('name' => $GLOBALS['strBannerLogging'], 'perm' => OA_ACCOUNT_ADMIN), 'banner-storage' => array('name' => $GLOBALS['strBannerStorage'], 'perm' => OA_ACCOUNT_ADMIN), 'tracking' => array('name' => $GLOBALS['strConversionTracking'], 'perm' => OA_ACCOUNT_ADMIN), 'database' => array('name' => $GLOBALS['strDatabaseSettings'], 'perm' => OA_ACCOUNT_ADMIN), 'debug' => array('name' => $GLOBALS['strDebug'], 'perm' => OA_ACCOUNT_ADMIN), 'email' => array('name' => $GLOBALS['strEmailSettings'], 'perm' => OA_ACCOUNT_ADMIN), 'geotargeting' => array('name' => $GLOBALS['strGeotargetingSettings'], 'perm' => OA_ACCOUNT_ADMIN), 'maintenance' => array('name' => $GLOBALS['strMaintenanceSettings'], 'perm' => OA_ACCOUNT_ADMIN), 'update' => array('name' => $GLOBALS['strUpdateSettings'], 'perm' => OA_ACCOUNT_ADMIN), 'user-interface' => array('name' => $GLOBALS['strGuiSettings'], 'perm' => OA_ACCOUNT_ADMIN), 'plugins' => array('name' => $GLOBALS['strPluginSettings'], 'perm' => OA_ACCOUNT_ADMIN)); } elseif ($this->_optionType == 'account-preferences') { $aSections = array(); $aSections['banner'] = array('name' => $GLOBALS['strBannerPreferences'], 'value' => $this->_optionType . '-banner.php', 'perm' => array(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER, OA_ACCOUNT_TRAFFICKER)); $aSections['campaign'] = array('name' => $GLOBALS['strCampaignPreferences'], 'value' => $this->_optionType . '-campaign.php', 'perm' => array(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER)); $aSections['campaign-email-reports'] = array('name' => $GLOBALS['strCampaignEmailReportsPreferences'], 'value' => $this->_optionType . '-campaign-email-reports.php', 'perm' => array(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER, OA_ACCOUNT_TRAFFICKER)); if ($aConf['logging']['trackerImpressions']) { $aSections['tracker'] = array('name' => $GLOBALS['strTrackerPreferences'], 'value' => $this->_optionType . '-tracker.php', 'perm' => array(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER)); } $aSections['timezone'] = array('name' => $GLOBALS['strTimezonePreferences'], 'value' => $this->_optionType . '-timezone.php', 'perm' => array(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER, OA_ACCOUNT_TRAFFICKER)); $aSections['user-interface'] = array('name' => $GLOBALS['strUserInterfacePreferences'], 'value' => $this->_optionType . '-user-interface.php', 'perm' => array(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER, OA_ACCOUNT_TRAFFICKER)); $this->_mergePluginOptions($aSections); } elseif ($this->_optionType == 'account-user') { $aSections = array(); $aSections['name-language'] = array('name' => $GLOBALS['strNameLanguage'], 'perm' => array(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER, OA_ACCOUNT_TRAFFICKER)); $aSections['email'] = array('name' => $GLOBALS['strChangeEmail'], 'perm' => array(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER, OA_ACCOUNT_TRAFFICKER)); $aSections['password'] = array('name' => $GLOBALS['strChangePassword'], 'perm' => array(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER, OA_ACCOUNT_TRAFFICKER)); } /* elseif ($this->_optionType == 'account-user') { $aSections = array(); $aSections['name-language'] = array( 'name' => $GLOBALS['strNameLanguage'], 'perm' => array(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER, OA_ACCOUNT_TRAFFICKER) ); $aSections['email'] = array( 'name' => $GLOBALS['strChangeEmail'], 'perm' => array(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER, OA_ACCOUNT_TRAFFICKER) ); $aSections['password'] = array( 'name' => $GLOBALS['strChangePassword'], 'perm' => array(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER, OA_ACCOUNT_TRAFFICKER) ); }*/ foreach ($aSections as $k => $v) { if (OA_Permission::isAccount($v['perm'])) { $aResult[$k]['name'] = isset($v['text']) ? $v['text'] : $v['name']; $aResult[$k]['link'] = $this->_optionType == 'account-preferences' ? $v['value'] : $this->_optionType . '-' . $k . '.php'; addLeftMenuSubItem($k, $aResult[$k]['name'], $aResult[$k]['link']); } } setCurrentLeftMenuSubItem($section); return $aResult; }