Beispiel #1
0
 public function index()
 {
     $vw = new ViewWrap($this->_view);
     $P = PVars::getObj('page');
     $request = PRequest::get()->request;
     if (!isset($request[1])) {
         $request[1] = '';
     }
     $TDonationArray = false;
     $error = false;
     $sub = '';
     $sub = $request[1];
     // static pages
     switch ($request[1]) {
         case 'done':
             $error = $this->_model->returnFromPayPal();
             $TDonationArray = $this->_model->getDonations();
             break;
         case 'cancel':
             if (isset($_SESSION["PaypalBW_key"])) {
                 // Log to track wrong donation
                 MOD_log::get()->write("Donation cancelled  [\$_SESSION[\"PaypalBW_key\"]=" . $_SESSION["PaypalBW_key"] . "]", "Donation");
                 break;
             }
         default:
             $TDonationArray = $this->_model->getDonations();
             break;
     }
     $P->content .= $vw->donate($sub, $TDonationArray, $error);
     // teaser content
     $P->teaserBar .= $vw->ShowSimpleTeaser('Donate', $TDonationArray);
     // submenu
     $P->subMenu .= $vw->submenu($sub);
     // User bar on the left
     $P->newBar .= $vw->donateBar($TDonationArray);
 }