/**
  * Create the complete path of a category
  *
  * @todo this could be improved as it uses multiple queries
  * @param bool $withAllLink make all name clickable
  * @return string complete path (breadcrumb)
  */
 function getCategoryPath($withAllLink = true, $currentCategory = false)
 {
     include_once SMARTOBJECT_ROOT_PATH . "class/smartobjectcontroller.php";
     $controller = new SmartObjectController($this->handler);
     if (!$this->_categoryPath) {
         if ($withAllLink && !$currentCategory) {
             $ret = $controller->getItemLink($this);
         } else {
             $currentCategory = false;
             $ret = $this->getVar('name');
         }
         $parentid = $this->getVar('parentid');
         if ($parentid != 0) {
             $parentObj =& $this->handler->get($parentid);
             if ($parentObj->isNew()) {
                 exit;
             }
             $parentid = $parentObj->getVar('parentid');
             $ret = $parentObj->getCategoryPath($withAllLink, $currentCategory) . " > " . $ret;
         }
         $this->_categoryPath = $ret;
     }
     return $this->_categoryPath;
 }
Exemple #2
0
 /**
  * Retreive the object user side link
  *
  * @param bool $onlyUrl wether or not to return a simple URL or a full <a> link
  * @return string user side link to the object
  */
 function getItemLink($onlyUrl = false)
 {
     $controller = new SmartObjectController($this->handler);
     return $controller->getItemLink($this, $onlyUrl);
 }