shop_rdfa.php

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