Go to the documentation of this file.00001 <?php
00002
00009 class shop_rdfa extends Shop_Config
00010 {
00016 protected $_sThisTemplate = 'shop_rdfa.tpl';
00017
00023 protected $_aCustomers = array( "Enduser" => 0,
00024 "Reseller" => 0,
00025 "Business" => 0,
00026 "PublicInstitution" => 0);
00027
00034 public function getContentList()
00035 {
00036 $oContentList = oxNew("oxcontentlist");
00037 $sTable = getViewName("oxcontents", $this->_iEditLang);
00038 $oContentList->selectString("SELECT * FROM {$sTable} WHERE OXACTIVE = 1 AND OXTYPE = 0
00039 AND OXLOADID IN ('oxagb', 'oxdeliveryinfo', 'oximpressum', 'oxrightofwithdrawal')
00040 AND OXSHOPID = '".oxConfig::getParameter("oxid")."'");
00041 return $oContentList;
00042 }
00043
00049 public function getCustomers()
00050 {
00051 $aCustomersConf = $this->getConfig()->getShopConfVar("aRDFaCustomers");
00052 if (isset($aCustomersConf)) {
00053 foreach ($this->_aCustomers as $sCustomer => $iValue) {
00054 $aCustomers[$sCustomer] = (in_array($sCustomer, $aCustomersConf)) ? 1 : 0;
00055 }
00056 } else {
00057 $aCustomers = array();
00058 }
00059 return $aCustomers;
00060 }
00061
00067 public function submitUrl()
00068 {
00069 $aParams = oxConfig::getParameter( "aSubmitUrl" );
00070 if ($aParams['url']) {
00071 $sNotificationUrl = "http://gr-notify.appspot.com/submit?uri=".urlencode($aParams['url'])."&agent=oxid";
00072 if ( $aParams['email'] ) {
00073 $sNotificationUrl .= "&contact=".urlencode($aParams['email']);
00074 }
00075 $aHeaders = $this->getHttpResponseCode($sNotificationUrl);
00076 if (substr($aHeaders[2], -4) === "True") {
00077 $this->_aViewData["submitMessage"] = 'SHOP_RDFA_SUBMITED_SUCCESSFULLY';
00078 } else {
00079 oxUtilsView::getInstance()->addErrorToDisplay(substr($aHeaders[3], strpos($aHeaders[3], ":") + 2));
00080 }
00081 } else {
00082 oxUtilsView::getInstance()->addErrorToDisplay('SHOP_RDFA_MESSAGE_NOURL');
00083 }
00084 }
00085
00093 function getHttpResponseCode( $sURL )
00094 {
00095 return get_headers($sURL);
00096 }
00097 }