OXID eShop CE  4.10.1
 All Classes Namespaces 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 {
11 
17  protected $_sThisTemplate = 'shop_rdfa.tpl';
18 
24  protected $_aCustomers = array("Enduser" => 0,
25  "Reseller" => 0,
26  "Business" => 0,
27  "PublicInstitution" => 0);
28 
35  public function getContentList()
36  {
37  $oContentList = oxNew("oxcontentlist");
38  $sTable = getViewName("oxcontents", $this->_iEditLang);
39  $oContentList->selectString(
40  "SELECT * FROM {$sTable} WHERE OXACTIVE = 1 AND OXTYPE = 0
41  AND OXLOADID IN ('oxagb', 'oxdeliveryinfo', 'oximpressum', 'oxrightofwithdrawal')
42  AND OXSHOPID = '" . oxRegistry::getConfig()->getRequestParameter("oxid") . "'"
43  ); // $this->getEditObjectId()
44  return $oContentList;
45  }
46 
52  public function getCustomers()
53  {
54  $aCustomersConf = $this->getConfig()->getShopConfVar("aRDFaCustomers");
55  if (isset($aCustomersConf)) {
56  foreach ($this->_aCustomers as $sCustomer => $iValue) {
57  $aCustomers[$sCustomer] = (in_array($sCustomer, $aCustomersConf)) ? 1 : 0;
58  }
59  } else {
60  $aCustomers = array();
61  }
62 
63  return $aCustomers;
64  }
65 
69  public function submitUrl()
70  {
71  $aParams = oxRegistry::getConfig()->getRequestParameter("aSubmitUrl");
72  if ($aParams['url']) {
73  $sNotificationUrl = "http://gr-notify.appspot.com/submit?uri=" . urlencode($aParams['url']) . "&agent=oxid";
74  if ($aParams['email']) {
75  $sNotificationUrl .= "&contact=" . urlencode($aParams['email']);
76  }
77  $aHeaders = $this->getHttpResponseCode($sNotificationUrl);
78  if (substr($aHeaders[2], -4) === "True") {
79  $this->_aViewData["submitMessage"] = 'SHOP_RDFA_SUBMITED_SUCCESSFULLY';
80  } else {
81  oxRegistry::get("oxUtilsView")->addErrorToDisplay(substr($aHeaders[3], strpos($aHeaders[3], ":") + 2));
82  }
83  } else {
84  oxRegistry::get("oxUtilsView")->addErrorToDisplay('SHOP_RDFA_MESSAGE_NOURL');
85  }
86  }
87 
95  public function getHttpResponseCode($sURL)
96  {
97  return get_headers($sURL);
98  }
99 }