Cheetah
ChStoreModule.php
Go to the documentation of this file.
1 <?php
2 
8 function ch_store_import($sClassPostfix, $aModuleOverwright = array())
9 {
11  $a = $aModuleOverwright ? $aModuleOverwright : $aModule;
12  if (!$a || $a['uri'] != 'store') {
13  $oMain = ChWsbModule::getInstance('ChStoreModule');
14  $a = $oMain->_aModule;
15  }
16  ch_import($sClassPostfix, $a);
17 }
18 
19 ch_import('ChWsbPaginate');
20 ch_import('ChWsbAlerts');
21 ch_import('ChWsbTwigModule');
22 
23 define('CH_STORE_PHOTOS_CAT', 'Store');
24 define('CH_STORE_PHOTOS_TAG', 'store');
25 
26 define('CH_STORE_VIDEOS_CAT', 'Store');
27 define('CH_STORE_VIDEOS_TAG', 'store');
28 
29 define('CH_STORE_FILES_CAT', 'Store');
30 define('CH_STORE_FILES_TAG', 'store');
31 
119 {
122 
123  var $_aQuickCache = array();
124 
126  {
127  parent::__construct($aModule);
128  $this->_sFilterName = 'ch_store_filter';
129  $this->_sPrefix = 'ch_store';
130 
131  ch_import('PrivacyProduct', $aModule);
132  ch_import('PrivacyFile', $aModule);
133  $this->_oPrivacyProduct = new ChStorePrivacyProduct($this);
134  $this->_oPrivacyFile = new ChStorePrivacyFile($this);
135 
136  $GLOBALS['oChStoreModule'] = &$this;
137  }
138 
139  function actionHome()
140  {
141  parent::_actionHome(_t('_ch_store_page_title_home'));
142  }
143 
144  function actionVideos($sUri)
145  {
146  parent::_actionVideos($sUri, _t('_ch_store_page_title_videos'));
147  }
148 
149  function actionPhotos($sUri)
150  {
151  parent::_actionPhotos($sUri, _t('_ch_store_page_title_photos'));
152  }
153 
154  function actionComments($sUri)
155  {
156  parent::_actionComments($sUri, _t('_ch_store_page_title_comments'));
157  }
158 
159  function actionView($sUri)
160  {
161  parent::_actionView($sUri, _t('_ch_store_msg_pending_approval'));
162  }
163 
164  function actionBroadcast($iEntryId)
165  {
166  parent::_actionBroadcast($iEntryId, _t('_ch_store_page_title_broadcast'),
167  _t('_ch_store_msg_broadcast_no_recipients'), _t('_ch_store_msg_broadcast_message_sent'));
168  }
169 
170  function actionCalendar($iYear = '', $iMonth = '')
171  {
172  parent::_actionCalendar($iYear, $iMonth, _t('_ch_store_page_title_calendar'));
173  }
174 
175  function actionSearch($sKeyword = '', $sCategory = '')
176  {
177  parent::_actionSearch($sKeyword, $sCategory, _t('_ch_store_page_title_search'));
178  }
179 
180  function actionAdd()
181  {
182  parent::_actionAdd(_t('_ch_store_page_title_add'));
183  }
184 
185  function actionEdit($iEntryId)
186  {
187  $this->_oTemplate->addCss('form_field_product_files_choice.css');
188  parent::_actionEdit($iEntryId, _t('_ch_store_page_title_edit'));
189  }
190 
191  function actionDelete($iEntryId)
192  {
193  parent::_actionDelete($iEntryId, _t('_ch_store_msg_product_was_deleted'));
194  }
195 
196  function actionMarkFeatured($iEntryId)
197  {
198  parent::_actionMarkFeatured($iEntryId, _t('_ch_store_msg_added_to_featured'),
199  _t('_ch_store_msg_removed_from_featured'));
200  }
201 
202  function actionSharePopup($iEntryId)
203  {
204  parent::_actionSharePopup($iEntryId, _t('_ch_store_cpation_share_product'));
205  }
206 
207  function actionTags()
208  {
209  parent::_actionTags(_t('_ch_store_page_title_tags'));
210  }
211 
212  function actionCategories()
213  {
214  parent::_actionCategories(_t('_ch_store_page_title_categories'));
215  }
216 
218  {
219  header('Content-type:text/html;charset=utf-8');
220 
221  $aFileInfo = $this->_oDb->getFileInfoByFileId((int)$iFileId);
222  if (!$aFileInfo) {
223  echo _t('_sys_request_page_not_found_cpt');
224  exit;
225  }
226 
227  if (!$this->_iProfileId || $aFileInfo['author_id'] != $this->_iProfileId) {
228  echo _t('_Access denied');
229  exit;
230  }
231 
232  if (false === ($iHidden = $this->_oDb->toggleProductFileVisibility($aFileInfo['id']))) {
233  echo _t('_Error Occured');
234  exit;
235  }
236 
237  echo $iHidden ? _t('_ch_store_product_file_hidden') : _t('_ch_store_product_file_visible');
238  exit;
239  }
240 
242  {
243  $aFileInfo = $this->_oDb->getFileInfoByFileId((int)$iFileId);
244 
245  if (!$aFileInfo) {
246  $this->_oTemplate->displayPageNotFound();
247  exit;
248  }
249 
250  if (!$this->isAllowedDownload($aFileInfo)) {
251  $this->_oTemplate->displayAccessDenied();
252  exit;
253  }
254 
255  parent::_actionDownload($aFileInfo, 'media_id');
256  }
257 
258  // ================================== external actions
259 
261  {
262  if (!$this->_oDb->isAnyPublicContent()) {
263  return '';
264  }
265 
266  ch_import('PageMain', $this->_aModule);
267  $o = new ChStorePageMain ($this);
268  $o->sUrlStart = CH_WSB_URL_ROOT . '?';
269 
270  $sDefaultHomepageTab = $this->_oDb->getParam('ch_store_homepage_default_tab');
271 
272  $sBrowseMode = $sDefaultHomepageTab;
273  switch ($_GET['ch_store_filter']) {
274  case 'featured':
275  case 'recent':
276  case 'top':
277  case 'popular':
278  case 'free':
279  case $sDefaultHomepageTab:
280  $sBrowseMode = $_GET['ch_store_filter'];
281  break;
282  }
283 
284  return $o->ajaxBrowse(
285  $sBrowseMode,
286  $this->_oDb->getParam('ch_store_perpage_homepage'),
287  array(
288  _t('_ch_store_tab_featured') => array(
289  'href' => CH_WSB_URL_ROOT . '?ch_store_filter=featured',
290  'active' => 'featured' == $sBrowseMode,
291  'dynamic' => true
292  ),
293  _t('_ch_store_tab_recent') => array(
294  'href' => CH_WSB_URL_ROOT . '?ch_store_filter=recent',
295  'active' => 'recent' == $sBrowseMode,
296  'dynamic' => true
297  ),
298  _t('_ch_store_tab_top') => array(
299  'href' => CH_WSB_URL_ROOT . '?ch_store_filter=top',
300  'active' => 'top' == $sBrowseMode,
301  'dynamic' => true
302  ),
303  _t('_ch_store_tab_popular') => array(
304  'href' => CH_WSB_URL_ROOT . '?ch_store_filter=popular',
305  'active' => 'popular' == $sBrowseMode,
306  'dynamic' => true
307  ),
308  _t('_ch_store_tab_free') => array(
309  'href' => CH_WSB_URL_ROOT . '?ch_store_filter=free',
310  'active' => 'free' == $sBrowseMode,
311  'dynamic' => true
312  ),
313  )
314  );
315  }
316 
318  {
320  ch_import('PageMain', $this->_aModule);
321  $o = new ChStorePageMain ($this);
322  $o->sUrlStart = getProfileLink($aProfile['ID']) . '?';
323 
324  return $o->ajaxBrowse(
325  'user',
326  $this->_oDb->getParam('ch_store_perpage_profile'),
327  array(),
329  true,
330  false
331  );
332  }
333 
335  {
336  parent::_serviceGetMemberMenuItem(_t('_ch_store'), _t('_ch_store'), 'shopping-cart');
337  }
338 
340  {
341  if (!$this->isAllowedAdd()) {
342  return '';
343  }
344 
345  return parent::_serviceGetMemberMenuItem(_t('_ch_store_products_single'), _t('_ch_store_products_single'),
346  'shopping-cart', false, '&ch_store_filter=add_product');
347  }
348 
349  function serviceGetWallPost($aEvent)
350  {
351  $aParams = array(
352  'icon' => 'shopping-cart',
353  'txt_object' => '_ch_store_wall_object',
354  'txt_added_new_single' => '_ch_store_wall_added_new',
355  'txt_added_new_title_single' => '_ch_store_wall_added_new_title',
356  'txt_added_new_plural' => '_ch_store_wall_added_new_items',
357  'txt_added_new_title_plural' => '_ch_store_wall_added_new_title_items',
358  'txt_privacy_view_event' => 'view_product',
359  'obj_privacy' => $this->_oPrivacyProduct,
360  'fields' => array(
361  'owner' => 'author_id',
362  'date' => 'created'
363  )
364  );
365 
366  return parent::_serviceGetWallPost($aEvent, $aParams);
367  }
368 
369  function serviceGetWallAddComment($aEvent)
370  {
371  $aParams = array(
372  'txt_privacy_view_event' => 'view_product',
373  'obj_privacy' => $this->_oPrivacyProduct
374  );
375 
376  return parent::_serviceGetWallAddComment($aEvent, $aParams);
377  }
378 
382  function serviceGetWallPostComment($aEvent)
383  {
384  $aParams = array(
385  'txt_privacy_view_event' => 'view_product',
386  'obj_privacy' => $this->_oPrivacyProduct
387  );
388 
389  return parent::_serviceGetWallPostComment($aEvent, $aParams);
390  }
391 
392  function serviceGetWallPostOutline($aEvent)
393  {
394  $aParams = array(
395  'txt_privacy_view_event' => 'view_product',
396  'obj_privacy' => $this->_oPrivacyProduct,
397  'templates' => array(
398  'grouped' => 'wall_outline_grouped'
399  )
400  );
401 
402  return parent::_serviceGetWallPostOutline($aEvent, 'shopping-cart', $aParams);
403  }
404 
405  function serviceGetSpyPost($sAction, $iObjectId = 0, $iSenderId = 0, $aExtraParams = array())
406  {
407  return parent::_serviceGetSpyPost($sAction, $iObjectId, $iSenderId, $aExtraParams, array(
408  'add' => '_ch_store_spy_post',
409  'change' => '_ch_store_spy_post_change',
410  'rate' => '_ch_store_spy_rate',
411  'commentPost' => '_ch_store_spy_comment',
412  ));
413  }
414 
415  function serviceGetSpyData()
416  {
417  $aOld = parent::serviceGetSpyData();
418  $aNew = array(
419  'handlers' => array(),
420  'alerts' => array(),
421  );
422  foreach ($aOld['handlers'] as $a) {
423  if ('join' == $a['alert_action']) {
424  continue;
425  }
426  $aNew['handlers'][] = $a;
427  }
428  foreach ($aOld['alerts'] as $a) {
429  if ('join' == $a['action']) {
430  continue;
431  }
432  $aNew['alerts'][] = $a;
433  }
434 
435  return $aNew;
436  }
437 
439  {
440  $a = array(
441  'change' => _t('_ch_store_sbs_change'),
442  'commentPost' => _t('_ch_store_sbs_comment'),
443  'rate' => _t('_ch_store_sbs_rate'),
444  );
445 
446  return parent::_serviceGetSubscriptionParams($sAction, $iEntryId, $a);
447  }
448 
449  function serviceGetItems($iVendorId)
450  {
451  $iVendorId = (int)$iVendorId;
452  if ($iVendorId < 0) {
453  return array();
454  }
455 
456  $aItems = $this->_oDb->getFilesByAuthor($iVendorId);
457 
458  $aResult = array();
459  foreach ($aItems as $aItem) {
460  $aFile = ChWsbService::call('files', 'get_file_array', array($aItem['media_id']), 'Search');
461  if (!$aFile['date']) {
462  continue;
463  }
464  $aResult[] = array(
465  'id' => $aItem['id'],
466  'title' => $aItem['title'] . ' - ' . $aFile['title'] . ' / ' . $aItem['price'],
467  'description' => $aItem['title'] . ' - ' . $aFile['title'],
468  'url' => CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aItem['uri'],
469  'price' => $aItem['price'],
470  );
471  }
472 
473  return $aResult;
474  }
475 
477  {
478  return $this->_aModule;
479  }
480 
481  function serviceGetCartItem($iClientId, $iItemId)
482  {
483  if (!$iItemId || !$iClientId) {
484  return array();
485  }
486 
487  $aItem = $this->_oDb->getFileInfoByFileId($iItemId);
488  $aFile = ChWsbService::call('files', 'get_file_array', array($aItem['media_id']), 'Search');
489  if (!$aFile['date']) {
490  return array();
491  }
492 
493  return array(
494  'id' => $aItem['id'],
495  'title' => $aItem['title'] . ' - ' . $aFile['title'],
496  'description' => $aItem['title'] . ' - ' . $aFile['title'],
497  'url' => CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aItem['uri'],
498  'price' => $aItem['price'],
499  );
500  }
501 
502  function serviceRegisterCartItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrderId)
503  {
504  $aItem = $this->_oDb->getFileInfoByFileId($iItemId);
505  $aFile = ChWsbService::call('files', 'get_file_array', array($aItem['media_id']), 'Search');
506  if (!$aFile['date']) {
507  return array();
508  }
509 
510  if (!$this->_oDb->registerCustomer($iClientId, $iItemId, $sOrderId, $iItemCount, time())) {
511  return array();
512  }
513 
514  return array(
515  'id' => $aItem['id'],
516  'title' => $aItem['title'] . ' - ' . $aFile['title'],
517  'description' => $aItem['title'] . ' - ' . $aFile['title'],
518  'url' => CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aItem['uri'],
519  'price' => $aItem['price'],
520  );
521  }
522 
523  function serviceUnregisterCartItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrderId)
524  {
525  return $this->_oDb->unregisterCustomer($iClientId, $iItemId, $sOrderId);
526  }
527 
529  {
530  parent::serviceDeleteProfileData($iProfileId);
531 
532  // delete from list of customers
533  $this->_oDb->removeCustomersFromAllEntries($iProfileId);
534  }
535 
536  // ================================== admin actions
537 
539  {
540  if (!$this->isAdmin()) {
541  $this->_oTemplate->displayAccessDenied();
542 
543  return;
544  }
545 
546  $this->_oTemplate->pageStart();
547 
548  $aMenu = array(
549  'pending_approval' => array(
550  'title' => _t('_ch_store_menu_admin_pending_approval'),
551  'href' => CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'administration/pending_approval',
552  '_func' => array(
553  'name' => 'actionAdministrationManage',
554  'params' => array(false, 'administration/pending_approval')
555  ),
556  ),
557  'admin_entries' => array(
558  'title' => _t('_ch_store_menu_admin_entries'),
559  'href' => CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'administration/admin_entries',
560  '_func' => array(
561  'name' => 'actionAdministrationManage',
562  'params' => array(true, 'administration/admin_entries')
563  ),
564  ),
565  'create' => array(
566  'title' => _t('_ch_store_menu_admin_add_entry'),
567  'href' => CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'administration/create',
568  '_func' => array('name' => 'actionAdministrationCreateEntry', 'params' => array()),
569  ),
570  'settings' => array(
571  'title' => _t('_ch_store_menu_admin_settings'),
572  'href' => CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'administration/settings',
573  '_func' => array('name' => 'actionAdministrationSettings', 'params' => array()),
574  ),
575  );
576 
577  if (empty($aMenu[$sUrl])) {
578  $sUrl = 'pending_approval';
579  }
580 
581  $aMenu[$sUrl]['active'] = 1;
582  $sContent = call_user_func_array(array($this, $aMenu[$sUrl]['_func']['name']),
583  $aMenu[$sUrl]['_func']['params']);
584 
585  echo $this->_oTemplate->adminBlock($sContent, _t('_ch_store_page_title_administration'), $aMenu);
586  $this->_oTemplate->addCssAdmin(array(
587  'admin.css',
588  'unit.css',
589  'twig.css',
590  'main.css',
591  'forms_extra.css',
592  'forms_adv.css'
593  ));
594  $this->_oTemplate->pageCodeAdmin(_t('_ch_store_page_title_administration'));
595  }
596 
598  {
599  return parent::_actionAdministrationSettings('Store');
600  }
601 
602  function actionAdministrationManage($isAdminEntries = false, $sUrl = '')
603  {
604  return parent::_actionAdministrationManage($isAdminEntries, '_ch_store_admin_delete',
605  '_ch_store_admin_activate', $sUrl);
606  }
607 
608  // ================================== events
609 
610 
611  // ================================== permissions
612 
613  function isEntryAdmin($aDataEntry, $iIdProfile = 0)
614  {
615  if (!$iIdProfile) {
616  $iIdProfile = $this->_iProfileId;
617  }
618 
619  return ($this->isAdmin() || $aDataEntry['author_id'] == $iIdProfile);
620  }
621 
622  function isAllowedView($aDataEntry, $isPerformAction = false)
623  {
624  // admin and owner always have access
625  if ($this->isAdmin() || $aDataEntry['author_id'] == $this->_iProfileId) {
626  return true;
627  }
628 
629  // check admin acl
630  $this->_defineActions();
631  $aCheck = checkAction($this->_iProfileId, CH_STORE_VIEW_PRODUCT, $isPerformAction);
633  return false;
634  }
635 
636  // check user group
637  return $this->_oPrivacyProduct->check('view_product', $aDataEntry['id'], $this->_iProfileId);
638  }
639 
640  function isAllowedBrowse($isPerformAction = false)
641  {
642  if ($this->isAdmin()) {
643  return true;
644  }
645  $this->_defineActions();
646  $aCheck = checkAction($this->_iProfileId, CH_STORE_BROWSE, $isPerformAction);
647 
649  }
650 
651  function isAllowedSearch($isPerformAction = false)
652  {
653  if ($this->isAdmin()) {
654  return true;
655  }
656  $this->_defineActions();
657  $aCheck = checkAction($this->_iProfileId, CH_STORE_SEARCH, $isPerformAction);
658 
660  }
661 
662  function isAllowedAdd($isPerformAction = false)
663  {
664  if ($this->isAdmin()) {
665  return true;
666  }
667  if (!$GLOBALS['logged']['member']) {
668  return false;
669  }
670  $this->_defineActions();
671  $aCheck = checkAction($this->_iProfileId, CH_STORE_ADD_PRODUCT, $isPerformAction);
672 
674  }
675 
676  function isAllowedEdit($aDataEntry, $isPerformAction = false)
677  {
678  // admin and owner can always edit product
679  if ($this->isAdmin() || ($GLOBALS['logged']['member'] && $aDataEntry['author_id'] == $this->_iProfileId && isProfileActive($this->_iProfileId))) {
680  return true;
681  }
682 
683  // check acl
684  $this->_defineActions();
685  $aCheck = checkAction($this->_iProfileId, CH_STORE_EDIT_ANY_PRODUCT, $isPerformAction);
686 
688  }
689 
690  function isAllowedMarkAsFeatured($aDataEntry, $isPerformAction = false)
691  {
692  if ($this->isAdmin()) {
693  return true;
694  }
695  $this->_defineActions();
696  $aCheck = checkAction($this->_iProfileId, CH_STORE_MARK_AS_FEATURED, $isPerformAction);
697 
699  }
700 
701  function isAllowedBroadcast($aDataEntry, $isPerformAction = false)
702  {
703  if ($this->isAdmin() || ($GLOBALS['logged']['member'] && $aDataEntry['author_id'] == $this->_iProfileId && isProfileActive($this->_iProfileId))) {
704  return true;
705  }
706  $this->_defineActions();
707  $aCheck = checkAction($this->_iProfileId, CH_STORE_BROADCAST_MESSAGE, $isPerformAction);
708 
710  }
711 
712  function isAllowedDelete(&$aDataEntry, $isPerformAction = false)
713  {
714  if ($this->isAdmin() || ($GLOBALS['logged']['member'] && $aDataEntry['author_id'] == $this->_iProfileId && isProfileActive($this->_iProfileId))) {
715  return true;
716  }
717  $this->_defineActions();
718  $aCheck = checkAction($this->_iProfileId, CH_STORE_DELETE_ANY_PRODUCT, $isPerformAction);
719 
721  }
722 
723  function isAllowedActivate(&$aDataEntry, $isPerformAction = false)
724  {
725  if ($aDataEntry['status'] != 'pending') {
726  return false;
727  }
728  if ($this->isAdmin()) {
729  return true;
730  }
731  $this->_defineActions();
732  $aCheck = checkAction($this->_iProfileId, CH_STORE_APPROVE_PRODUCT, $isPerformAction);
733 
735  }
736 
737  function isAllowedShare(&$aDataEntry)
738  {
739  if ($aDataEntry['allow_view_product_to'] != CH_WSB_PG_ALL) {
740  return false;
741  }
742 
743  return true;
744  }
745 
746  function isAllowedPurchase(&$aItem)
747  {
748  if (!$this->_iProfileId || 0 == $aItem['price']) {
749  return false;
750  }
751 
752  return $this->isAdmin() || $this->_oPrivacyFile->check('purchase', $aItem['id'], $this->_iProfileId);
753  }
754 
755  function isAllowedPostInForum(&$aDataEntry, $iProfileId = -1)
756  {
757  if (-1 == $iProfileId) {
759  }
760 
761  return $this->isAdmin() || ($GLOBALS['logged']['member'] && $aDataEntry['author_id'] == $this->_iProfileId && isProfileActive($this->_iProfileId)) || $this->_oPrivacyProduct->check('post_in_forum',
762  $aDataEntry['id'], $iProfileId);
763  }
764 
765  function isAllowedReadForum(&$aDataEntry, $iProfileId = -1)
766  {
767  if (-1 == $iProfileId) {
769  }
770 
771  return $this->isAdmin() || ($GLOBALS['logged']['member'] && $aDataEntry['author_id'] == $this->_iProfileId && isProfileActive($this->_iProfileId)) || $this->_oPrivacyProduct->check('view_forum',
772  $aDataEntry['id'], $iProfileId);
773  }
774 
775  function isAllowedDownload(&$aItem)
776  {
777  if ($this->isAdmin()) {
778  return true;
779  }
780  if (0 == $aItem['price'] && $this->_oPrivacyFile->check('purchase', $aItem['id'], $this->_iProfileId)) {
781  return true;
782  }
783  if ($this->_oDb->isPurchasedItem($this->_iProfileId, $aItem['id'])) {
784  return true;
785  }
786 
787  return false;
788  }
789 
790  function isAllowedRate(&$aDataEntry)
791  {
792  return $this->isAdmin() || $this->isCustomer($aDataEntry);
793  }
794 
795  function isAllowedComments(&$aDataEntry)
796  {
797  return $this->isAdmin() || $this->isCustomer($aDataEntry);
798  }
799 
800  function isAllowedCreatorCommentsDeleteAndEdit(&$aEvent, $isPerformAction = false)
801  {
802  if ($this->isAdmin()) {
803  return true;
804  }
805  if (!$GLOBALS['logged']['member'] || $aEvent['author_id'] != $this->_iProfileId) {
806  return false;
807  }
808  $this->_defineActions();
809  $aCheck = checkAction($this->_iProfileId, CH_STORE_PRODUCT_COMMENTS_DELETE_AND_EDIT, $isPerformAction);
810 
812  }
813 
814  function isCustomer($aItem)
815  {
816  if($aItem['price_range'] == 'Free')
817  return true;
818 
819  return $this->_oDb->isCustomer($this->_iProfileId, $aItem['id']);
820  }
821 
822  function _defineActions()
823  {
825  'store view product',
826  'store browse',
827  'store search',
828  'store add product',
829  'store edit any product',
830  'store delete any product',
831  'store mark as featured',
832  'store approve product',
833  'store broadcast message'
834  ));
835  }
836 
837  // ================================== other function
838 
839  function getGroupName($mixedId)
840  {
841  if ('m' == $mixedId[0]) {
842  require_once(CH_DIRECTORY_PATH_INC . 'membership_levels.inc.php');
843  $a = getMembershipInfo(substr($mixedId, 1));
844 
845  return $a && isset($a['Name']) ? $a['Name'] : 'undefined';
846  } else {
847  ch_import('ChWsbPrivacyQuery');
848  $oPrivacyQuery = new ChWsbPrivacyQuery();
849  $a = $oPrivacyQuery->getGroupsBy(array('type' => 'id', 'id' => $mixedId));
850 
851  return $a && (int)$a['owner_id'] == 0 ? _t('_ps_group_' . $a['id'] . '_title') : $a['title'];
852  }
853  }
854 
855  function _browseMy(&$aProfile, $sTitle = null)
856  {
857  parent::_browseMy($aProfile, _t('_ch_store_page_title_my_store'));
858  }
859 
860  function _formatPriceRange($aData)
861  {
862  $sPrice = '';
863  if ('Free' == $aData['price_range']) {
864  $sPrice = _t('_ch_store_free_product');
865  } else {
866  $sPrice = str_replace('.00', '', sprintf($aData['price_range'], getParam('pmt_default_currency_sign'),
867  getParam('pmt_default_currency_sign')));
868  }
869 
870  return $sPrice;
871  }
872 
873  function _formatSnippetTextForOutline($aEntryData)
874  {
875  return $this->_oTemplate->parseHtmlByName('wall_outline_extra_info', array(
876  'desc' => $this->_formatSnippetText($aEntryData, 200),
877  'price_range' => $this->_formatPriceRange($aEntryData),
878  ));
879  }
880 }
ChStorePageMain
Definition: ChStorePageMain.php:11
process_db_input
process_db_input($sText, $iStripTags=0)
Definition: utils.inc.php:256
header
</code > Be careful enabling this directive if you have a redirector script that does not use the< code > Location</code > HTTP header
Definition: URI.MungeResources.txt:10
ChStoreModule\isAllowedBrowse
isAllowedBrowse($isPerformAction=false)
Definition: ChStoreModule.php:640
ChWsbTwigModule
Definition: ChWsbTwigModule.php:14
ChStoreModule
Definition: ChStoreModule.php:119
ChStoreModule\actionHome
actionHome()
Definition: ChStoreModule.php:139
ChStoreModule\actionDownload
actionDownload($iFileId)
Definition: ChStoreModule.php:241
ChStoreModule\__construct
__construct(&$aModule)
Definition: ChStoreModule.php:125
isProfileActive
isProfileActive($iId=0)
Definition: profiles.inc.php:236
ChWsbModule\getInstance
static getInstance($sClassName)
Definition: ChWsbModule.php:89
ChStorePrivacyFile
Definition: ChStorePrivacyFile.php:11
ChStoreModule\_defineActions
_defineActions()
Definition: ChStoreModule.php:822
ChStoreModule\actionTags
actionTags()
Definition: ChStoreModule.php:207
ChStoreModule\getGroupName
getGroupName($mixedId)
Definition: ChStoreModule.php:839
ChStoreModule\serviceProfileBlock
serviceProfileBlock($iProfileId)
Definition: ChStoreModule.php:317
ChStoreModule\serviceGetMemberMenuItemAddContent
serviceGetMemberMenuItemAddContent()
Definition: ChStoreModule.php:339
ChStoreModule\actionCategories
actionCategories()
Definition: ChStoreModule.php:212
ChStoreModule\serviceUnregisterCartItem
serviceUnregisterCartItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrderId)
Definition: ChStoreModule.php:523
CHECK_ACTION_RESULT_ALLOWED
const CHECK_ACTION_RESULT_ALLOWED
Definition: membership_levels.inc.php:60
ChStoreModule\_browseMy
_browseMy(&$aProfile, $sTitle=null)
Definition: ChStoreModule.php:855
ChStoreModule\isAllowedBroadcast
isAllowedBroadcast($aDataEntry, $isPerformAction=false)
Definition: ChStoreModule.php:701
ChStoreModule\serviceGetSubscriptionParams
serviceGetSubscriptionParams($sAction, $iEntryId)
Definition: ChStoreModule.php:438
$aModule
$aModule
Definition: classifieds.php:21
ChStoreModule\isAllowedMarkAsFeatured
isAllowedMarkAsFeatured($aDataEntry, $isPerformAction=false)
Definition: ChStoreModule.php:690
ChWsbTwigModule\$_iProfileId
$_iProfileId
Definition: ChWsbTwigModule.php:15
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
$aResult
$aResult
Definition: index.php:19
CHECK_ACTION_RESULT
const CHECK_ACTION_RESULT
Definition: membership_levels.inc.php:54
ChWsbPrivacyQuery
Definition: ChWsbPrivacyQuery.php:11
$sUrl
$sUrl
Definition: cart.php:15
php
ChStoreModule\isAllowedRate
isAllowedRate(&$aDataEntry)
Definition: ChStoreModule.php:790
ChStoreModule\serviceRegisterCartItem
serviceRegisterCartItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrderId)
Definition: ChStoreModule.php:502
ChStoreModule\actionPhotos
actionPhotos($sUri)
Definition: ChStoreModule.php:149
ChStoreModule\_formatSnippetTextForOutline
_formatSnippetTextForOutline($aEntryData)
Definition: ChStoreModule.php:873
ChStoreModule\isAllowedPostInForum
isAllowedPostInForum(&$aDataEntry, $iProfileId=-1)
Definition: ChStoreModule.php:755
ChStoreModule\isEntryAdmin
isEntryAdmin($aDataEntry, $iIdProfile=0)
Definition: ChStoreModule.php:613
ChStoreModule\actionMarkFeatured
actionMarkFeatured($iEntryId)
Definition: ChStoreModule.php:196
ChStoreModule\serviceGetPaymentData
serviceGetPaymentData()
Definition: ChStoreModule.php:476
getMembershipInfo
getMembershipInfo($iMembershipId)
Definition: membership_levels.inc.php:724
ch_store_import
ch_store_import($sClassPostfix, $aModuleOverwright=array())
Definition: ChStoreModule.php:8
CH_SLASHES_NO_ACTION
const CH_SLASHES_NO_ACTION
Definition: utils.inc.php:30
ChStoreModule\actionAdministration
actionAdministration($sUrl='')
Definition: ChStoreModule.php:538
ChStoreModule\actionSharePopup
actionSharePopup($iEntryId)
Definition: ChStoreModule.php:202
ChStoreModule\actionToggleProductFileVisibility
actionToggleProductFileVisibility($iFileId)
Definition: ChStoreModule.php:217
ChStorePrivacyProduct
Definition: ChStorePrivacyProduct.php:11
ChStoreModule\isAllowedCreatorCommentsDeleteAndEdit
isAllowedCreatorCommentsDeleteAndEdit(&$aEvent, $isPerformAction=false)
Definition: ChStoreModule.php:800
ChStoreModule\serviceGetWallAddComment
serviceGetWallAddComment($aEvent)
Definition: ChStoreModule.php:369
exit
exit
Definition: cart.php:21
$_GET
$_GET['debug']
Definition: index.php:67
ChStoreModule\$_oPrivacyProduct
$_oPrivacyProduct
Definition: ChStoreModule.php:120
getParam
getParam($sParamName, $bUseCache=true)
Definition: db.inc.php:130
ChStoreModule\isAllowedSearch
isAllowedSearch($isPerformAction=false)
Definition: ChStoreModule.php:651
ChStoreModule\serviceGetCartItem
serviceGetCartItem($iClientId, $iItemId)
Definition: ChStoreModule.php:481
ChStoreModule\$_aQuickCache
$_aQuickCache
Definition: ChStoreModule.php:123
ChStoreModule\isAllowedReadForum
isAllowedReadForum(&$aDataEntry, $iProfileId=-1)
Definition: ChStoreModule.php:765
ChStoreModule\isAllowedView
isAllowedView($aDataEntry, $isPerformAction=false)
Definition: ChStoreModule.php:622
$sTitle
$sTitle
Definition: actions.inc.php:13
$aProfile
$aProfile
Definition: flash.php:14
ChWsbModule\$_aModule
$_aModule
Definition: ChWsbModule.php:42
ChStoreModule\actionEdit
actionEdit($iEntryId)
Definition: ChStoreModule.php:185
ChStoreModule\isAllowedAdd
isAllowedAdd($isPerformAction=false)
Definition: ChStoreModule.php:662
ChStoreModule\serviceGetSpyPost
serviceGetSpyPost($sAction, $iObjectId=0, $iSenderId=0, $aExtraParams=array())
Definition: ChStoreModule.php:405
ChStoreModule\actionAdministrationManage
actionAdministrationManage($isAdminEntries=false, $sUrl='')
Definition: ChStoreModule.php:602
ChStoreModule\isAllowedDownload
isAllowedDownload(&$aItem)
Definition: ChStoreModule.php:775
CH_TAGS_NO_ACTION
const CH_TAGS_NO_ACTION
Definition: utils.inc.php:21
ChStoreModule\isAllowedPurchase
isAllowedPurchase(&$aItem)
Definition: ChStoreModule.php:746
ChStoreModule\serviceDeleteProfileData
serviceDeleteProfileData($iProfileId)
Definition: ChStoreModule.php:528
ChStoreModule\actionBroadcast
actionBroadcast($iEntryId)
Definition: ChStoreModule.php:164
ChStoreModule\serviceGetMemberMenuItem
serviceGetMemberMenuItem()
Definition: ChStoreModule.php:334
ChStoreModule\actionAdministrationSettings
actionAdministrationSettings()
Definition: ChStoreModule.php:597
global
if(!defined("GLOBAL_MODULE")) define("GLOBAL_MODULE" global
Definition: header.inc.php:25
$sContent
$sContent
Definition: bottom_menu_compose.php:169
_t
_t($key, $arg0="", $arg1="", $arg2="")
Definition: languages.inc.php:509
time
that in the case of a Adaptation or at a minimum such credit will if a credit for all contributing authors of the Adaptation or Collection then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors For the avoidance of You may only use the credit required by this Section for the purpose of attribution in the manner set out above by exercising Your rights under this You may not implicitly or explicitly assert or imply any connection sponsorship or endorsement by the Original Licensor and or Attribution as of You or Your use of the without the express prior written permission of the Original Licensor and or Attribution Parties Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable if You Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or You must not modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author s honor or reputation Licensor agrees that in those in which any exercise of the right granted in modification or other derogatory action prejudicial to the Original Author s honor and the Licensor will waive or not as this to the fullest extent permitted by the applicable national to enable You to reasonably exercise Your right under Warranties and Disclaimer UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN LICENSOR OFFERS THE WORK AS IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE STATUTORY OR WITHOUT WARRANTIES OF FITNESS FOR A PARTICULAR OR THE ABSENCE OF LATENT OR OTHER OR THE PRESENCE OF ABSENCE OF WHETHER OR NOT DISCOVERABLE SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED SO SUCH EXCLUSION MAY NOT APPLY TO YOU Limitation on Liability EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES Termination This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License Individuals or entities who have received Adaptations or Collections from You under this will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses and will survive any termination of this License Subject to the above terms and the license granted here is Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time
Definition: license.txt:56
CH_WSB_PG_ALL
const CH_WSB_PG_ALL
Definition: ChWsbPrivacy.php:12
ChStoreModule\isAllowedDelete
isAllowedDelete(&$aDataEntry, $isPerformAction=false)
Definition: ChStoreModule.php:712
getProfileLink
getProfileLink( $iID, $sLinkAdd='')
Definition: profiles.inc.php:484
$aMenu
$aMenu
Definition: categories.php:257
checkAction
checkAction($iMemberId, $actionID, $performAction=false, $iForcedProfID=0, $isCheckMemberStatus=true)
Definition: membership_levels.inc.php:313
ChStoreModule\actionVideos
actionVideos($sUri)
Definition: ChStoreModule.php:144
ChStoreModule\$_oPrivacyFile
$_oPrivacyFile
Definition: ChStoreModule.php:121
ChStoreModule\actionComments
actionComments($sUri)
Definition: ChStoreModule.php:154
ChStoreModule\serviceGetItems
serviceGetItems($iVendorId)
Definition: ChStoreModule.php:449
ChStoreModule\actionDelete
actionDelete($iEntryId)
Definition: ChStoreModule.php:191
ChStoreModule\_formatPriceRange
_formatPriceRange($aData)
Definition: ChStoreModule.php:860
defineMembershipActions
defineMembershipActions($aActionsAll, $sPrefix='CH_')
Definition: membership_levels.inc.php:744
ChStoreModule\actionView
actionView($sUri)
Definition: ChStoreModule.php:159
ChWsbTwigModule\_formatSnippetText
_formatSnippetText($aEntryData, $iMaxLen=300)
Definition: ChWsbTwigModule.php:2044
ChStoreModule\actionSearch
actionSearch($sKeyword='', $sCategory='')
Definition: ChStoreModule.php:175
ChWsbTwigModule\isAdmin
isAdmin()
Definition: ChWsbTwigModule.php:1715
$iFileId
$iFileId
Definition: embed.php:12
ChStoreModule\actionCalendar
actionCalendar($iYear='', $iMonth='')
Definition: ChStoreModule.php:170
getProfileInfo
getProfileInfo($iProfileID=0, $checkActiveStatus=false, $forceCache=false)
Definition: profiles.inc.php:249
ChStoreModule\serviceGetWallPostComment
serviceGetWallPostComment($aEvent)
Definition: ChStoreModule.php:382
ChStoreModule\serviceGetWallPost
serviceGetWallPost($aEvent)
Definition: ChStoreModule.php:349
ChStoreModule\actionAdd
actionAdd()
Definition: ChStoreModule.php:180
ChStoreModule\isAllowedShare
isAllowedShare(&$aDataEntry)
Definition: ChStoreModule.php:737
$sAction
$sAction
Definition: categories.php:274
ChStoreModule\serviceHomepageBlock
serviceHomepageBlock()
Definition: ChStoreModule.php:260
ChStoreModule\isAllowedEdit
isAllowedEdit($aDataEntry, $isPerformAction=false)
Definition: ChStoreModule.php:676
empty
Attr AllowedRel this is empty
Definition: Attr.AllowedRel.txt:7
$o
$o
Definition: cmd.php:193
ChStoreModule\serviceGetSpyData
serviceGetSpyData()
Definition: ChStoreModule.php:415
ChWsbService\call
static call($mixed, $sMethod, $aParams=array(), $sClass='Module')
Definition: ChWsbService.php:32
ChStoreModule\serviceGetWallPostOutline
serviceGetWallPostOutline($aEvent)
Definition: ChStoreModule.php:392
as
as
Definition: Filter.ExtractStyleBlocks.Escaping.txt:10
ChStoreModule\isCustomer
isCustomer($aItem)
Definition: ChStoreModule.php:814
ChStoreModule\isAllowedComments
isAllowedComments(&$aDataEntry)
Definition: ChStoreModule.php:795
ChStoreModule\isAllowedActivate
isAllowedActivate(&$aDataEntry, $isPerformAction=false)
Definition: ChStoreModule.php:723
$iProfileId
if( $sMembersList) $iProfileId
Definition: communicator.php:29
$GLOBALS
$GLOBALS['iAdminPage']
Definition: advanced_settings.php:10