Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
paypal_configuration.inc
1 <?php
18 require_once SQ_INCLUDE_PATH.'/asset.inc';
19 
32 {
33 
34 
41  function __construct($assetid=0)
42  {
43  parent::__construct($assetid);
44 
45  }//end constructor
46 
47 
58  protected function _preCreateCheck(Array &$link)
59  {
60  if (!parent::_preCreateCheck($link)) return FALSE;
61 
62  $name = trim($this->attr('name'));
63  if ($name == '') {
64  trigger_localised_error('CORE0083', E_USER_WARNING, $GLOBALS['SQ_SYSTEM']->am->getTypeInfo($this->type(), 'name'));
65  return FALSE;
66  }
67 
68  return TRUE;
69 
70  }//end _preCreateCheck()
71 
72 
83  protected function _createAdditional(Array &$link)
84  {
85  if (!parent::_createAdditional($link)) return FALSE;
86 
87  return $this->makeAndSaveInitialWebPath(strtolower($this->attr('name')), $link);
88 
89  }//end _createAdditional()
90 
91 
99  function _getAllowedLinks()
100  {
101  $allowed_links = parent::_getAllowedLinks();
102  //for better organization structure
103  $allowed_links[SQ_LINK_TYPE_1]['paypal_business_account'] = Array('card' => 'M', 'exclusive' => FALSE);
104  $allowed_links[SQ_LINK_TYPE_2]['paypal_business_account'] = Array('card' => 'M', 'exclusive' => FALSE);
105  $allowed_links[SQ_LINK_TYPE_1]['paypal_payment_button'] = Array('card' => 'M', 'exclusive' => FALSE);
106  $allowed_links[SQ_LINK_TYPE_2]['paypal_payment_button'] = Array('card' => 'M', 'exclusive' => FALSE);
107  $allowed_links[SQ_LINK_TYPE_1]['paypal_ipn_receiver'] = Array('card' => 'M', 'exclusive' => FALSE);
108  $allowed_links[SQ_LINK_TYPE_2]['paypal_ipn_receiver'] = Array('card' => 'M', 'exclusive' => FALSE);
109 
110  return $allowed_links;
111 
112  }//end _getAllowedLinks()
113 
114 
125  protected function _getName($short_name=FALSE, $contextid=NULL)
126  {
127  // No context specified, using the current context
128  if ($contextid === NULL) {
129  $contextid = $GLOBALS['SQ_SYSTEM']->getContextId();
130  }//end if
131 
132  // Obtain the attribute value for Name from the specified Context
133  $values = $GLOBALS['SQ_SYSTEM']->am->getAttributeValuesByName('name', $this->type(), Array($this->id), $contextid);
134  if (empty($values) === TRUE) {
135  return parent::_getName($short_name, $contextid);
136  } else {
137  return $values[$this->id];
138  }
139 
140  }//end _getName()
141 
142 
143 }//end class
144 ?>