?> <div class=""> <h4><a href="<?php echo JRoute::_($this->link->getPageLink('attachment', true, NULL, 'attachment_id=' . (int) $attachment->attachment_id)); ?> "><?php echo $attachment->name; ?> </a></h4> <p class="text-muted"><?php echo $attachment->description; ?> </p> <a class="btn btn-default btn-block" href="<?php echo JRoute::_($this->context->controller->getPageLink('attachment', true, NULL, 'attachment_id=' . $attachment->attachment_id)); ?> " > <i class="icon-download"></i> <?php echo JText::_('COM_JEPROSHOP_DOWNLOAD_LABEL') . "(" . JeproshopTools::formatBytes($attachment->file_size, 2) . ")"; ?> </a> <hr /> </div> <?php if ($index % 3 == 0 || $index == count($this->attachements) - 1) { ?> </div><?php } } ?> </div>
protected function checkUploadError($error_code) { $error = 0; switch ($error_code) { case 1: $error = JError::raiseError(500, sprintf('The uploaded file exceeds %s', ini_get('post_max_size'))); break; case 2: $error = JError::raiseError(500, sprintf('The uploaded file exceeds %s', JeproshopTools::formatBytes((int) $_POST['MAX_FILE_SIZE']))); break; case 3: $error = JError::raiseError(500, 'The uploaded file was only partially uploaded'); break; case 4: $error = JError::raiseError(500, 'No file was uploaded'); break; case 6: $error = JError::raiseError(500, 'Missing temporary folder'); break; case 7: $error = JError::raiseError(500, 'Failed to write file to disk'); break; case 8: $error = JError::raiseError(500, 'A PHP extension stopped the file upload'); break; default: break; } return $error; }