Exemple #1
0
 public function getShopDetailLink($view, $canonical = false)
 {
     $params = is_array($view->params) ? $view->params : $view->getAllParams();
     unset($params['controller']);
     unset($params['action']);
     unset($params['module']);
     unset($params['document']);
     unset($params['pimcore_request_source']);
     unset($params['ajax-call']);
     unset($params['infinite-scroll']);
     unset($params['view']);
     unset($params['cartId']);
     if ($canonical) {
         unset($params['category']);
     }
     $params = array_merge((array) $params, array('name' => strtolower(Website_Tool_Text::toUrl($this->getName() ? $this->getName() : $this->getDesc1())), 'product' => $this->getId()));
     if (!$params['country']) {
         $params['country'] = $view->document->getProperty("country");
     }
     $urlCategory = $this->getFirstCategory();
     if ($urlCategory) {
         $params['name'] = $urlCategory->getNavigationPath() . '/' . $params['name'];
     }
     $params['country'] = str_replace('/', '', $params['country']);
     return $view->url($params, "shop-detail");
 }
Exemple #2
0
 public function getNavigationPath()
 {
     $topLevel = $this;
     $categories = array();
     $root = Object_Abstract::getById(47);
     //Pimcore_Config::getWebsiteConfig()->shopCategoriesFolder;
     while ($topLevel && $topLevel->getId() != $root->getId()) {
         $categories[] = $topLevel;
         $topLevel = $topLevel->getParent();
     }
     $categories = array_reverse($categories);
     $path = '';
     foreach ($categories as $category) {
         $path .= Website_Tool_Text::toUrl($category->getText()) . '/';
     }
     $path = substr($path, 0, strlen($path) - 1);
     return $path;
 }
Exemple #3
0
                <a href="<?php 
        echo $this->url(array('key' => $entry->getUrlPath()), 'blog-show', false, false);
        ?>
"
                ><?php 
        echo $entry->getTitle();
        ?>
</a>
            </h4>
            <small><?php 
        echo $entry->getDate()->toString('FFFFF');
        ?>
</small>
            <p>
                <?php 
        echo trim($entry->getSummary()) ? $entry->getSummary() : Website_Tool_Text::cutStringRespectingWhitespace(trim(strip_tags($entry->getContent())), 200);
        ?>
            </p>
        </blockquote>
    <?php 
    }
    ?>
    </div>

<?php 
    if ($this->editmode) {
        ?>
</div>
<?php 
    }
    ?>
Exemple #4
0
 /**
  * @param string $format
  * @return Zend_Feed_Abstract
  */
 public function getFeed($format = 'rss')
 {
     if ($format != 'rss' && $format != 'atom') {
         throw new Zend_Controller_Action_Exception("Feed type {$format} is not supported");
     }
     $url = new Pimcore_View_Helper_Url();
     $host = 'http://' . $_SERVER['HTTP_HOST'];
     $feed = array('title' => '', 'copyright' => '', 'link' => $host . 'plugin/Blog/entry/feed/format/' . $format, 'charset' => 'utf-8', 'language' => 'pl-pl', 'lastUpdate' => time(), 'published' => time(), 'entries' => array());
     if ($this->_options->feed) {
         $feed = array_merge($feed, $this->_options->feed->toArray());
     }
     foreach ($this->getList() as $entry) {
         $entry instanceof Object_BlogEntry;
         $feed['entries'][] = array('title' => $entry->getTitle(), 'link' => $host . $url->url(array('key' => $entry->getKey()), 'blog-show'), 'description' => trim($entry->getSummary()) ? $entry->getSummary() : Website_Tool_Text::cutStringRespectingWhitespace(trim(strip_tags($entry->getContent())), 200), 'lastUpdate' => $entry->getDate()->getTimestamp());
         if ($entry->getModificationDate() < $feed['lastUpdate']) {
             $feed['lastUpdate'] = $feed['published'] = $entry->getModificationDate();
         }
     }
     return Zend_Feed::importArray($feed, $format);
 }
Exemple #5
0
        <div class="image">
            <a href="<?php 
echo $link;
?>
"><img src="<?php 
echo $this->product->getFirstImageAsset('productList');
?>
" alt=""></a>
        </div>
        <div class="details fixclear">
            <h3><?php 
echo $this->product->getOsName();
?>
</h3>
            <p class="desc"><?php 
echo Website_Tool_Text::cutStringRespectingWhitespace(strip_tags($this->product->getDescription()), 70);
?>
</p>
            <div class="actions">
                <a href="<?php 
echo $this->view->url(array('action' => 'add', 'item' => $linkProduct->getId()), 'cart');
?>
" class="add-to-cart"><?php 
echo $this->translate("shop.addtocart");
?>
</a>
                <a href="<?php 
echo $link;
?>
"><?php 
echo $this->translate("shop.moreinfo");
 public function getAction()
 {
     $question = Poll_Question::getById((int) $this->_getParam('id'));
     $pollData = array('responses' => $question->sumResponses());
     $allowedKeys = array('id', 'title', 'startDate', 'endDate', 'isActive', 'multiple', 'answers');
     foreach (get_object_vars($question) as $key => $value) {
         if (in_array($key, $allowedKeys)) {
             $value = $question->getValue($key);
             if ($value instanceof Iterator) {
                 $value = iterator_to_array($value);
             }
             switch ($key) {
                 case 'startDate':
                 case 'endDate':
                     if ($value) {
                         $value = strtotime($value);
                     }
                     break;
             }
             $pollData[$key] = $value;
         }
     }
     $pollData['shortTitle'] = Website_Tool_Text::cutStringRespectingWhitespace($question->getTitle(), 16);
     $this->_helper->json($pollData);
 }