示例#1
0
require_once MAX_PATH . '/lib/OA/Session.php';
require_once MAX_PATH . '/lib/OA/Admin/Menu.php';
require_once MAX_PATH . '/lib/max/other/html.php';
require_once MAX_PATH . '/lib/OA/Auth.php';
require_once MAX_PATH . '/lib/OA/Admin/UI/UserAccess.php';
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER);
OA_Permission::enforceAccountPermission(OA_ACCOUNT_MANAGER, OA_PERM_SUPER_ACCOUNT);
OA_Permission::enforceAccessToObject('agency', $agencyid);
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
if ($agencyid != '') {
    addPageTools($agencyid);
    if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN)) {
        OA_Admin_Menu::setAgencyPageContext($agencyid, 'agency-edit.php');
        $doAgency = OA_Dal::staticGetDO('agency', $agencyid);
        MAX_displayInventoryBreadcrumbs(array(array("name" => $doAgency->name)), "agency");
        phpAds_PageHeader("4.1.3");
        phpAds_ShowSections(array("4.1.2", "4.1.3"));
    } else {
        phpAds_PageHeader('4.4');
        phpAds_ShowSections(array("4.1", "4.2", "4.3", "4.4"));
    }
} else {
    MAX_displayInventoryBreadcrumbs(array(array("name" => phpAds_getClientName($agencyid))), "agency");
    phpAds_PageHeader("4.1.1");
    phpAds_ShowSections(array("4.1.1"));
}
$tabindex = 1;
/*-------------------------------------------------------*/
示例#2
0
function displayPage($aAgency, $form)
{
    if ($aAgency['agencyid'] != '') {
        OA_Admin_Menu::setAgencyPageContext($aAgency['agencyid'], 'agency-edit.php');
        MAX_displayInventoryBreadcrumbs(array(array("name" => $aAgency['name'])), "agency");
        phpAds_PageHeader();
    } else {
        MAX_displayInventoryBreadcrumbs(array(array("name" => "")), "agency", true);
        phpAds_PageHeader("agency-edit_new");
    }
    //get template and display form
    $oTpl = new OA_Admin_Template('agency-edit.html');
    $oTpl->assign('form', $form->serialize());
    $oTpl->display();
    //footer
    phpAds_PageFooter();
}