Example #1
0
 /**
  * Adds the global Marker for the formtags to the given marker array.
  *
  * @param array $markerArray Array of marker
  * @param string|bool $wrap If the marker should be wrapped
  *
  * @return array Marker Array with the new marker
  */
 public function addFormMarker(array $markerArray, $wrap = false)
 {
     $newMarkerArray['GENERAL_FORM_ACTION'] = $this->pi_getPageLink($this->conf['basketPid']);
     if (!empty($this->conf['basketPid.'])) {
         $basketConf = $this->conf['basketPid.'];
         $basketConf['returnLast'] = 'url';
         $newMarkerArray['GENERAL_FORM_ACTION'] = $this->cObj->typoLink('', $basketConf);
     }
     if (is_object($this->category)) {
         $newMarkerArray['GENERAL_HIDDENCATUID'] = '<input type="hidden" name="' . $this->prefixId . '[catUid]" value="' . $this->category->getUid() . '" />';
     }
     if ($wrap) {
         foreach ($newMarkerArray as $key => $value) {
             $markerArray[$this->cObj->wrap($key, $wrap)] = $value;
         }
     } else {
         $markerArray = array_merge($markerArray, $newMarkerArray);
     }
     return $markerArray;
 }
Example #2
0
 /**
  * Returns an array of array for the TS rootline
  * Recursive Call to build rootline.
  *
  * @param int $categoryUid Category uid
  * @param array $result Result
  *
  * @return array
  */
 public function getCategoryRootlineforTypoScript($categoryUid, array $result = array())
 {
     if ($categoryUid) {
         /**
          * Category.
          *
          * @var \CommerceTeam\Commerce\Domain\Model\Category $category
          */
         $category = GeneralUtility::makeInstance('CommerceTeam\\Commerce\\Domain\\Model\\Category', $categoryUid, $this->getFrontendController()->sys_language_uid);
         $category->loadData();
         if (is_object($parentCategory = $category->getParentCategory())) {
             if ($parentCategory->getUid() != $this->category->getUid()) {
                 $result = $this->getCategoryRootlineforTypoScript($parentCategory->getUid(), $result);
             }
         }
         $additionalParams = $this->separator . $this->prefixId . '[showUid]=' . $this->separator . $this->prefixId . '[catUid]=' . $category->getUid();
         if (is_string($this->gpVars['basketHashValue'])) {
             $additionalParams .= $this->separator . $this->prefixId . '[basketHashValue]=' . $this->gpVars['basketHashValue'];
         }
         $cHash = $this->generateChash($additionalParams . $this->getFrontendController()->linkVars);
         if ($this->mConf['showProducts'] == 1 && $this->gpVars['showUid'] > 0) {
             $itemState = 'NO';
         } else {
             $itemState = $category->getUid() === $categoryUid ? 'CUR' : 'NO';
         }
         $result[] = array('uid' => $this->pid, '_ADD_GETVARS' => $additionalParams . $this->separator . 'cHash=' . $cHash, 'ITEM_STATE' => $itemState, 'title' => $category->getTitle(), 'nav_title' => $category->getNavtitle(), '_PAGES_OVERLAY' => $category->getTitle());
     }
     return $result;
 }