Skip to content
Snippets Groups Projects
Commit 98a656f9 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Restructure, images for docs, make output more configurable

parent 67f937ca
No related branches found
No related tags found
No related merge requests found
Showing
with 202 additions and 44 deletions
Makefile 0 → 100644
BASE=downloads_for_sale
PLUGINTYPE=vmcustom
VERSION=0.9
PLUGINFILES=$(BASE).php $(BASE).script.php $(BASE).xml index.html
TRANSLATIONS=$(call wildcard,*.plg_$(PLUGINTYPE)_$(BASE).*ini)
INDEXFILES=$(BASE)/index.html
TMPLFILES=$(call wildcard,$(BASE)/tmpl/*.php) $(BASE)/index.html $(BASE)/tmpl/index.html
ASSETS=$(call wildcard,assets/*.png) $(call wildcard,assets/*.css) assets/index.html
ZIPFILE=plg_$(PLUGINTYPE)_$(BASE)_v$(VERSION).zip
zip: $(PLUGINFILES) $(TRANSLATIONS) $(ELEMENTS) $(TMPLFILES)
@echo "Packing all files into distribution file $(ZIPFILE):"
@zip -r $(ZIPFILE) $(PLUGINFILES) $(TRANSLATIONS) $(ELEMENTS) $(INDEXFILES) $(TMPLFILES) $(ASSETS)
clean:
rm -f $(ZIPFILE)
File moved
File moved
div.downloads-for-sale tr, div.downloads-for-sale td {
border: none;
}
.file_title {
font-weight: bold;
}
.file_info {
font-size: smaller;
}
.vm-customfield-mod .downloads-for-sale img, .vm-customfield-cart .downloads-for-sale img {
width: inherit;
}
\ No newline at end of file
...@@ -170,7 +170,7 @@ class plgVmCustomDownloads_for_Sale extends vmCustomPlugin { ...@@ -170,7 +170,7 @@ class plgVmCustomDownloads_for_Sale extends vmCustomPlugin {
return true; return true;
} }
$link_types = array('none' => 'VMCUSTOM_DLSALE_LINK_NONE', 'text'=>'VMCUSTOM_DLSALE_LINK_TEXT', 'image'=>'VMCUSTOM_DLSALE_LINK_IMAGE'); $link_types = array('none' => 'VMCUSTOM_DLSALE_LINK_NONE', 'compact'=>'VMCUSTOM_DLSALE_LINK_COMPACT', 'long'=>'VMCUSTOM_DLSALE_LINK_LONG');
$html .= VmHTML::row('select', 'VMCUSTOM_DLSALE_DOWNLOAD_FILE', 'custom_param['.$row.'][media_id]', $download_files, $field->media_id,'','virtuemart_media_id', 'file_title', false); $html .= VmHTML::row('select', 'VMCUSTOM_DLSALE_DOWNLOAD_FILE', 'custom_param['.$row.'][media_id]', $download_files, $field->media_id,'','virtuemart_media_id', 'file_title', false);
if ($field->is_cart_attribute) { if ($field->is_cart_attribute) {
......
<?php
defined('_JEXEC') or die('Restricted access');
class plgVmCustomDownloads_for_SaleInstallerScript
{
/**
* Constructor
*
* @param JAdapterInstance $adapter The object responsible for running this script
*/
// public function __constructor(JAdapterInstance $adapter);
/**
* Called before any type of action
*
* @param string $route Which action is happening (install|uninstall|discover_install)
* @param JAdapterInstance $adapter The object responsible for running this script
*
* @return boolean True on success
*/
// public function preflight($route, JAdapterInstance $adapter);
/**
* Called after any type of action
*
* @param string $route Which action is happening (install|uninstall|discover_install)
* @param JAdapterInstance $adapter The object responsible for running this script
*
* @return boolean True on success
*/
// public function postflight($route, JAdapterInstance $adapter);
/**
* Called on installation
*
* @param JAdapterInstance $adapter The object responsible for running this script
*
* @return boolean True on success
*/
public function install(JAdapterInstance $adapter)
{
// enabling plugin
$db =& JFactory::getDBO();
$db->setQuery('update #__extensions set enabled = 1 where type = "plugin" and element = "downloads_for_sale" and folder = "vmcustom"');
$db->query();
return True;
}
/**
* Called on update
*
* @param JAdapterInstance $adapter The object responsible for running this script
*
* @return boolean True on success
*/
// public function update(JAdapterInstance $adapter)
// {
// jimport( 'joomla.filesystem.file' );
// $file = JPATH_ROOT . DS . "administrator" . DS . "language" . DS . "en-GB" . DS . "en-GB.plg_vmshopper_ordernumber.sys.ini";
// if (JFile::exists($file)) JFile::delete($file);
// $file = JPATH_ROOT . DS . "administrator" . DS . "language" . DS . "de-DE" . DS . "de-DE.plg_vmshopper_ordernumber.sys.ini";
// if (JFile::exists($file)) JFile::delete($file);
// return true;
// }
/**
* Called on uninstallation
*
* @param JAdapterInstance $adapter The object responsible for running this script
*/
public function uninstall(JAdapterInstance $adapter)
{
// Remove plugin table
// $db =& JFactory::getDBO();
// $db->setQuery('DROP TABLE `#__virtuemart_shipment_plg_rules_shipping`;');
// $db->query();
}
}
\ No newline at end of file
...@@ -8,23 +8,26 @@ ...@@ -8,23 +8,26 @@
<license>http://www.gnu.org/licenses/gpl.html GNU/GPL v3+</license> <license>http://www.gnu.org/licenses/gpl.html GNU/GPL v3+</license>
<version>0.0.1</version> <version>0.0.1</version>
<description>VMCUSTOM_DLSALE_DESC</description> <description>VMCUSTOM_DLSALE_DESC</description>
<languages>
<language tag="en-GB">en-GB.plg_vmcustom_downloads_for_sale.ini</language>
</languages>
<files> <files>
<filename plugin="downloads_for_sale">downloads_for_sale.php</filename> <filename plugin="downloads_for_sale">downloads_for_sale.php</filename>
<filename>downloads_for_sale.script.php</filename>
<folder>downloads_for_sale</folder>
<filename>index.html</filename>
</files> </files>
<languages>
<language tag="en-GB">en-GB.plg_vmcustom_downloads_for_sale.ini</language>
</languages>
<scriptfile>downloads_for_sale.script.php</scriptfile>
<params addpath="/administrator/components/com_virtuemart/elements"> <params addpath="/administrator/components/com_virtuemart/elements">
<param type="spacer" default="VMCUSTOM_DLSALE_USAGE" />
<param name="invoice_link_type" type="list" default="link" label="VMCUSTOM_DLSALE_INVOICE_LINK" description="VMCUSTOM_DLSALE_INVOICE_LINK_DESC" > <param name="invoice_link_type" type="list" default="link" label="VMCUSTOM_DLSALE_INVOICE_LINK" description="VMCUSTOM_DLSALE_INVOICE_LINK_DESC" >
<option value="none">VMCUSTOM_DLSALE_LINK_NONE</option> <option value="none">VMCUSTOM_DLSALE_LINK_NONE</option>
<option value="text">VMCUSTOM_DLSALE_LINK_TEXT</option> <option value="compact">VMCUSTOM_DLSALE_LINK_COMPACT</option>
<option value="image">VMCUSTOM_DLSALE_LINK_IMAGE</option> <option value="long">VMCUSTOM_DLSALE_LINK_LONG</option>
</param> </param>
<param name="product_link_type" type="list" default="image" label="VMCUSTOM_DLSALE_PRODUCT_LINK" description="VMCUSTOM_DLSALE_PRODUCT_LINK_DESC" > <param name="product_link_type" type="list" default="image" label="VMCUSTOM_DLSALE_PRODUCT_LINK" description="VMCUSTOM_DLSALE_PRODUCT_LINK_DESC" >
<option value="none">VMCUSTOM_DLSALE_LINK_NONE</option> <option value="none">VMCUSTOM_DLSALE_LINK_NONE</option>
<option value="text">VMCUSTOM_DLSALE_LINK_TEXT</option> <option value="compact">VMCUSTOM_DLSALE_LINK_COMPACT</option>
<option value="image">VMCUSTOM_DLSALE_LINK_IMAGE</option> <option value="long">VMCUSTOM_DLSALE_LINK_LONG</option>
</param> </param>
<param name="download_type" type="list" default="yes" label="VMCUSTOM_DLSALE_TYPE" description="VMCUSTOM_DLSALE_TYPE_DESC"> <param name="download_type" type="list" default="yes" label="VMCUSTOM_DLSALE_TYPE" description="VMCUSTOM_DLSALE_TYPE_DESC">
<option value="free_download">VMCUSTOM_DLSALE_TYPE_FREE</option> <option value="free_download">VMCUSTOM_DLSALE_TYPE_FREE</option>
......
<?php <?php
/** /**
*
* @author Reinhold Kainhofer * @author Reinhold Kainhofer
* @package VirtueMart * @package VirtueMart
* @subpackage custom * @subpackage custom
...@@ -10,7 +9,6 @@ ...@@ -10,7 +9,6 @@
**/ **/
defined('_JEXEC') or die(); defined('_JEXEC') or die();
?> ?>
<div class="download-for-sale-image"> <a href="<?php echo $viewData[0]; ?>"><img style="vertical-align:middle; display: inline;" src="<?php echo JURI::root().'plugins/vmcustom/downloads_for_sale/assets/download_small.png'; ?>" alt=""/> <?php echo $viewData[2]->file_title; ?></a>
<a href="<?php echo $viewData[0]; ?>"><img style="vertical-align:middle; display: inline;" src="<?php echo JURI::root().'plugins/vmcustom/downloads_for_sale/downloads_for_sale/download_medium.png'; ?>" alt="<?php echo $viewData[2]->file_title; ?>"></a></div> \ No newline at end of file
<br clear="all"/>
<?php
/**
*
* @author Reinhold Kainhofer
* @package VirtueMart
* @subpackage custom
* @copyright Copyright (C) 2013 RK - All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
**/
defined('_JEXEC') or die();
?><a href="<?php echo $viewData[0]; ?>"><img height="16" src="<?php echo JURI::root().'plugins/vmcustom/downloads_for_sale/downloads_for_sale/download_medium.png'; ?>" alt="Download"> <?php echo $viewData[2]->file_title; ?></a>
<?php
/**
*
* @author Reinhold Kainhofer
* @package VirtueMart
* @subpackage custom
* @copyright Copyright (C) 2013 RK - All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
**/
defined('_JEXEC') or die();
if(JFile::exists(JPATH_SITE.DS.'plugins'.DS.'vmcustom'.DS.'downloads_for_sale'.DS.'assets'.DS.'downloads_for_sale.css')) {
$doc =& JFactory::getDocument();
$doc->addStyleSheet(JURI::root().'plugins/vmcustom/downloads_for_sale/assets/downloads_for_sale.css');
}
?>
<div class="downloads-for-sale">
<table border=0>
<tr>
<td width="15%">
<a href="<?php echo $viewData[0]; ?>"><img style="vertical-align:middle; display: inline; float:left;" src="<?php echo JURI::root().'plugins/vmcustom/downloads_for_sale/assets/download_medium.png'; ?>" alt="<?php echo $viewData[2]->file_title; ?>"></a>
</td>
<td width="85%"><a href="<?php echo $viewData[0]; ?>"><span class="file_title"><?php echo $viewData[2]->file_title; ?></span></a><br/>
<span class="file_info">(<?php echo basename($viewData[2]->file_url); ?>)<br/>
<?php echo JText::_('VMCUSTOM_DLSALE_FILESIZE')?>:&nbsp;<?php echo filesize($viewData[2]->file_url); ?>&nbsp;<?php echo JText::_('VMCUSTOM_DLSALE_FILESIZE_BYTES')?></span>
</td>
</tr>
</table>
</div>
\ No newline at end of file
<?php
/**
* @author Reinhold Kainhofer
* @package VirtueMart
* @subpackage custom
* @copyright Copyright (C) 2013 RK - All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
**/
defined('_JEXEC') or die();
?>Download: <a href="<?php echo $viewData[0]; ?>"><?php echo $viewData[2]->file_title; ?></a>
...@@ -11,4 +11,4 @@ ...@@ -11,4 +11,4 @@
defined('_JEXEC') or die(); defined('_JEXEC') or die();
?> ?>
<p><img style="vertical-align:middle; display: inline;" src="<?php echo JURI::root().'plugins/vmcustom/downloads_for_sale/downloads_for_sale/download_small.png'; ?>" alt=""/> <a href="<?php echo $viewData[0]; ?>"><?php echo $viewData[2]->file_title; ?></a></p> <p><img style="vertical-align:middle; display: inline;" src="<?php echo JURI::root().'plugins/vmcustom/downloads_for_sale/assets/download_small.png'; ?>" alt=""/> <a href="<?php echo $viewData[0]; ?>"><?php echo $viewData[2]->file_title; ?></a></p>
<?php
/**
*
* @author Reinhold Kainhofer
* @package VirtueMart
* @subpackage custom
* @copyright Copyright (C) 2013 RK - All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
**/
defined('_JEXEC') or die();
if(JFile::exists(JPATH_SITE.DS.'plugins'.DS.'vmcustom'.DS.'downloads_for_sale'.DS.'assets'.DS.'downloads_for_sale.css')) {
$doc =& JFactory::getDocument();
$doc->addStyleSheet(JURI::root().'plugins/vmcustom/downloads_for_sale/assets/downloads_for_sale.css');
}
?>
<div class="downloads-for-sale">
<table border=0>
<tr>
<td>
<a href="<?php echo $viewData[0]; ?>"><img style="vertical-align:middle; display: inline; float:left;" src="<?php echo JURI::root().'plugins/vmcustom/downloads_for_sale/assets/download_medium.png'; ?>" alt="<?php echo $viewData[2]->file_title; ?>"></a>
</td>
<td>
<a href="<?php echo $viewData[0]; ?>"><span class="file_title"><?php echo $viewData[2]->file_title; ?></span></a><br/>
<span class="file_info"><?php echo JText::_('VMCUSTOM_DLSALE_FILENAME')?>:&nbsp;<?php echo basename($viewData[2]->file_url); ?><br/>
<?php echo JText::_('VMCUSTOM_DLSALE_MIMETYPE')?>:&nbsp;<?php echo $viewData[2]->file_mimetype; ?><br/>
<?php echo JText::_('VMCUSTOM_DLSALE_FILESIZE')?>:&nbsp;<?php echo filesize($viewData[2]->file_url); ?>&nbsp;<?php echo JText::_('VMCUSTOM_DLSALE_FILESIZE_BYTES')?></span>
</td>
</tr>
</table>
</div>
<br clear="all"/>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
; License http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php ; License http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php
; Note : All ini files need to be saved as UTF-8 - No BOM ; Note : All ini files need to be saved as UTF-8 - No BOM
VMCUSTOM_DLSALE="Downloadable products" VMCUSTOM_DLSALE="VM Downloads for Sale"
VMCUSTOM_DLSALE_DESC="Assign a downloadable media file to the product." VMCUSTOM_DLSALE_DESC="Assign a downloadable media file to the product."
VMCUSTOM_DLSALE_USAGE="TODO" VMCUSTOM_DLSALE_USAGE="TODO"
...@@ -13,8 +13,8 @@ VMCUSTOM_DLSALE_PRODUCT_LINK="Link type on Product Page" ...@@ -13,8 +13,8 @@ VMCUSTOM_DLSALE_PRODUCT_LINK="Link type on Product Page"
VMCUSTOM_DLSALE_PRODUCT_LINK_DESC="Download link type displayed on the product page for permitted users." VMCUSTOM_DLSALE_PRODUCT_LINK_DESC="Download link type displayed on the product page for permitted users."
VMCUSTOM_DLSALE_LINK_NONE="No link displayed" VMCUSTOM_DLSALE_LINK_NONE="No link displayed"
VMCUSTOM_DLSALE_LINK_TEXT="Text link" VMCUSTOM_DLSALE_LINK_COMPACT="Compact link"
VMCUSTOM_DLSALE_LINK_IMAGE="Image" VMCUSTOM_DLSALE_LINK_LONG="Full link and information"
VMCUSTOM_DLSALE_TYPE="Type of download" VMCUSTOM_DLSALE_TYPE="Type of download"
VMCUSTOM_DLSALE_TYPE_DESC="Select the default type of download" VMCUSTOM_DLSALE_TYPE_DESC="Select the default type of download"
...@@ -31,3 +31,8 @@ VMCUSTOM_DLSALE_ERROR_NO_FILE_SET="Media file is not available." ...@@ -31,3 +31,8 @@ VMCUSTOM_DLSALE_ERROR_NO_FILE_SET="Media file is not available."
VMCUSTOM_DLSALE_ERROR_ORDER_NOT_FOUND="Unable to find order data in database." VMCUSTOM_DLSALE_ERROR_ORDER_NOT_FOUND="Unable to find order data in database."
VMCUSTOM_DLSALE_ERROR_WRONG_PASSWD="Invalid combination of order number and password." VMCUSTOM_DLSALE_ERROR_WRONG_PASSWD="Invalid combination of order number and password."
VMCUSTOM_DLSALE_ERROR_STATUS_NOT_AUTHORIZED="Order status does not allow download." VMCUSTOM_DLSALE_ERROR_STATUS_NOT_AUTHORIZED="Order status does not allow download."
VMCUSTOM_DLSALE_FILENAME="Filename"
VMCUSTOM_DLSALE_MIMETYPE="MIME-Type"
VMCUSTOM_DLSALE_FILESIZE="File size"
VMCUSTOM_DLSALE_FILESIZE_BYTES="Bytes"
...@@ -3,4 +3,4 @@ ...@@ -3,4 +3,4 @@
; License http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php ; License http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php
; Note : All ini files need to be saved as UTF-8 - No BOM ; Note : All ini files need to be saved as UTF-8 - No BOM
VMCUSTOM_DLSALE="VM Custom Field for downloadable products" VMCUSTOM_DLSALE="VM Downloads for Sale"
images/downloads_for_sale_-_customfield_new.png

68 KiB

images/downloads_for_sale_-_customfields.png

67.5 KiB

images/downloads_for_sale_-_icon.png

19.9 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment