OXID eShop CE  4.8.10
 All Classes Files Functions Variables Pages
shop_rdfa.php
Go to the documentation of this file.
1 <?php
2 
9 class shop_rdfa extends Shop_Config
10 {
16  protected $_sThisTemplate = 'shop_rdfa.tpl';
17 
23  protected $_aCustomers = array( "Enduser" => 0,
24  "Reseller" => 0,
25  "Business" => 0,
26  "PublicInstitution" => 0);
27 
34  public function getContentList()
35  {
36  $oContentList = oxNew("oxcontentlist");
37  $sTable = getViewName("oxcontents", $this->_iEditLang);
38  $oContentList->selectString("SELECT * FROM {$sTable} WHERE OXACTIVE = 1 AND OXTYPE = 0
39  AND OXLOADID IN ('oxagb', 'oxdeliveryinfo', 'oximpressum', 'oxrightofwithdrawal')
40  AND OXSHOPID = '".oxConfig::getParameter("oxid")."'"); // $this->getEditObjectId()
41  return $oContentList;
42  }
43 
49  public function getCustomers()
50  {
51  $aCustomersConf = $this->getConfig()->getShopConfVar("aRDFaCustomers");
52  if (isset($aCustomersConf)) {
53  foreach ($this->_aCustomers as $sCustomer => $iValue) {
54  $aCustomers[$sCustomer] = (in_array($sCustomer, $aCustomersConf)) ? 1 : 0;
55  }
56  } else {
57  $aCustomers = array();
58  }
59  return $aCustomers;
60  }
61 
67  public function submitUrl()
68  {
69  $aParams = oxConfig::getParameter( "aSubmitUrl" );
70  if ($aParams['url']) {
71  $sNotificationUrl = "http://gr-notify.appspot.com/submit?uri=".urlencode($aParams['url'])."&agent=oxid";
72  if ( $aParams['email'] ) {
73  $sNotificationUrl .= "&contact=".urlencode($aParams['email']);
74  }
75  $aHeaders = $this->getHttpResponseCode($sNotificationUrl);
76  if (substr($aHeaders[2], -4) === "True") {
77  $this->_aViewData["submitMessage"] = 'SHOP_RDFA_SUBMITED_SUCCESSFULLY';
78  } else {
79  oxRegistry::get("oxUtilsView")->addErrorToDisplay(substr($aHeaders[3], strpos($aHeaders[3], ":") + 2));
80  }
81  } else {
82  oxRegistry::get("oxUtilsView")->addErrorToDisplay('SHOP_RDFA_MESSAGE_NOURL');
83  }
84  }
85 
93  function getHttpResponseCode( $sURL )
94  {
95  return get_headers($sURL);
96  }
97 }