Exemplo n.º 1
0
 /**
  * Update banner 
  *
  * @return boolean
  */
 public function UpdateBanner(PluginBanneroid_ModuleBanner_EntityBanner $oBanner)
 {
     if ($oBanner->getBannerId() == '0') {
         return $this->_oMapper->AddBanner($oBanner);
     } else {
         return $this->_oMapper->UpdateBanner($oBanner);
     }
 }
 /**
  * Add link to page on banner
  * 
  * @param int $sPageId
  * @param int $sPageType
  * @param PluginBanneroid_ModuleBanner_EntityBanner $oBanner
  * @return boolean
  */
 public function AddBannerPage($sPageId, $sPageType, $oBanner)
 {
     $aData = array('banner_id' => $oBanner->getId(), 'page_id' => $sPageId, 'place_type' => $sPageType);
     $sql = 'INSERT INTO
                     ' . Config::Get('db.table.banneroid.places_holders') . '
                     (?#)
             VALUES
                     (?a)';
     return $this->oDb->query($sql, array_keys($aData), array_values($aData));
 }
 /**
  * Show banner add
  *
  * @return void
  */
 protected function EventBannerAdd()
 {
     $oBanner = new PluginBanneroid_ModuleBanner_EntityBanner();
     $oBanner->setBannerStartDate();
     $oBanner->setBannerId(0);
     $this->Viewer_Assign('add_banner', 1);
     if (getRequest('submit_banner')) {
         if ($this->PluginBanneroid_Banner_Save($oBanner)) {
             func_header_location('../edit/' . $oBanner->getId());
         }
     }
     $this->Viewer_Assign('oBanner', $oBanner);
     $_REQUEST['banner_places'] = $this->PluginBanneroid_Banner_GetAllPages();
     $_REQUEST['banner_start_date'] = date('Y-m-d');
     $_REQUEST['banner_end_date'] = '0000-00-00';
     $_REQUEST['banner_is_image'] = true;
     $_REQUEST['banner_type'] = 1;
     $this->SetTemplateAction('edit');
 }