Example #1
0
    <?php 
    foreach ($this->download->getChilds() as $d) {
        ?>
        <?php 
        echo $this->template('toolbox/download/list/item.php', array('download' => $d));
        ?>
    <?php 
    }
    ?>

<?php 
}
$dPath = $this->download->getFullPath();
$dSize = $this->download->getFileSize('kb', 2);
$dType = Pimcore\File::getFileExtension($this->download->getFilename());
$dName = $this->download->getMetadata('title') ? $this->download->getMetadata('title') : $this->translate('Download');
if ($this->showPreviewImages) {
    $dPreview = $this->download->getMetadata('previewImage') instanceof \Pimcore\Model\Asset\Image ? $this->download->getMetadata('previewImage')->getThumbnail('downloadPreviewImage') : ($this->download instanceof \Pimcore\Model\Asset\Image ? $this->download->getThumbnail('downloadPreviewImage') : $this->download->getImageThumbnail('downloadPreviewImage'));
    $altText = $this->download->getMetadata('alt') ? $this->download->getMetadata('alt') : $dName;
}
?>

<li>
    <a href="<?php 
echo $dPath;
?>
" <?php 
echo $this->toolboxHelper()->addTracker('download', $this->download);
?>
 target="_blank" class="icon-download-<?php 
 public function registerAction()
 {
     if ($this->getRequest()->isPost()) {
         $params = $this->getAllParams();
         $addressParams = array();
         $userParams = array();
         foreach ($params as $key => $value) {
             if (startsWith($key, "address_")) {
                 $addressKey = str_replace("address_", "", $key);
                 $addressParams[$addressKey] = $value;
             } else {
                 $userParams[$key] = $value;
             }
         }
         try {
             //Check User exists
             if (CoreShopUser::getUniqueByEmail($userParams['email']) instanceof CoreShopUser) {
                 throw new \Exception("E-Mail already exists");
             }
             $folder = "/users/" . strtolower(substr($userParams['lastname'], 0, 1));
             $adresses = new Object\Fieldcollection();
             $address = new CoreShopUserAddress();
             $address->setValues($addressParams);
             $address->setCountry(Country::getById($addressParams['country']));
             $adresses->add($address);
             $user = new CoreShopUser();
             $user->setKey(Pimcore\File::getValidFilename($userParams['email']));
             $user->setPublished(true);
             $user->setParent(Pimcore\Model\Object\Service::createFolderByPath($folder));
             $user->setValues($userParams);
             $user->setAddresses($adresses);
             $user->save();
             Plugin::getEventManager()->trigger('user.postAdd', $this, array("request" => $this->getRequest(), "user" => $user));
             $this->session->user = $user;
             if (array_key_exists("_redirect", $params)) {
                 $this->_redirect($params['_redirect']);
             }
         } catch (\Exception $ex) {
             $this->view->error = $ex->getMessage();
         }
     }
 }