示例#1
0
 function display()
 {
     global $session, $list_filters;
     if (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
         echo "<input type='hidden' name='{$this->_name}' value='" . OA_Permission::getEntityId() . "'>";
     } else {
         $aPublishers = Admin_UI_PublisherIdField::phpAds_getPublisherArray('name');
         // if no default publisher set, set it to the first id in the array
         // - this is to ensure that we'll know which publisher to filter any other
         // dropdowns by even if no publisher is selected yet
         if (!isset($session['prefs']['GLOBALS']['report_publisher'])) {
             $list_filters['publisher'] = key($aPublishers);
         } else {
             $list_filters['publisher'] = $session['prefs']['GLOBALS']['report_publisher'];
         }
         echo "<input type='hidden' name='submit_type' value=''>";
         echo "<input type='hidden' name='changed_field' value=''>";
         echo "<input type='hidden' name='refresh_page' value='" . $_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING'] . "'>";
         echo "\n        <select name='{$this->_name}' tabindex='" . $this->_tabIndex++ . "' onchange=\"form.submit_type.value='change';form.changed_field.value='publisher';submit();\"   >";
         foreach ($aPublishers as $publisherId => $aPublisher) {
             $selected = $publisherId == $this->getValue() ? " selected='selected'" : '';
             echo "\n            <option value='{$publisherId}'{$selected}>{$aPublisher}</option>";
         }
         echo "\n        </select>";
     }
 }
 function display()
 {
     if (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
         echo "<input type='hidden' name='{$this->_name}' value='" . OA_Permission::getEntityId() . "'>";
     } else {
         $aPublishers = Admin_UI_PublisherIdField::_getPublisherArray('name');
         echo "\n        <select name='{$this->_name}' tabindex='" . $this->_tabIndex++ . "'>";
         foreach ($aPublishers as $publisherId => $aPublisher) {
             $selected = $publisherId == $this->getValue() ? " selected='selected'" : '';
             echo "\n            <option value='{$publisherId}'{$selected}>{$aPublisher}</option>";
         }
         echo "\n        </select>";
     }
 }