VirtueMart  3.2.14.9808
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
ShopFunctions Class Reference

Public Member Functions

 __construct ()
 
 asteriskPad ($str, $display_length, $reversed=FALSE)
 

Static Public Member Functions

static renderGuiList ($idList, $table, $name, $view, $tableXref=false, $tableSecondaryKey=false, $quantity=3, $translate=true)
 
static renderVendorList ($vendorId=false, $name= 'virtuemart_vendor_id')
 
static renderVendorFullVendorList ($vendorId, $multiple=false, $name= 'virtuemart_vendor_id')
 
static renderShopperGroupList ($shopperGroupId=0, $multiple=TRUE, $name='virtuemart_shoppergroup_id', $select_attribute='COM_VIRTUEMART_DRDOWN_AVA2ALL', $attrs=array())
 
static renderManufacturerList ($manufacturerId=0, $multiple=FALSE, $name= 'virtuemart_manufacturer_id')
 
static renderTaxList ($selected, $name= 'product_tax_id', $class= '')
 
static renderTemplateList ($defaultText=0, $defaultOption=TRUE)
 
static renderOrderingList ($table, $fieldname, $selected, $where='', $orderingField= 'ordering')
 
static getWeightUnit ()
 
static renderWeightUnit ($name)
 
static renderWeightUnitList ($name, $selected)
 
static renderUnitIsoList ($name, $selected)
 
static convertWeigthUnit ($value, $from, $to)
 
static convertWeightUnit ($value, $from, $to)
 
static convertDimensionUnit ($value, $from, $to)
 
static renderLWHUnitList ($name, $selected)
 
static generateStAddressList ($view, $userModel, $task)
 
static renderVendorAddress ($vendorId, $lineSeparator="<br />", $skips=array('name','username','email','agreed'))
 
static categoryListTree ($selectedCategories=array(), $cid=0, $level=0, $disabledFields=array())
 
static categoryListTreeLoop ($selectedCategories=array(), $cid=0, $level=0, $disabledFields=array(), $isSite, $vendorId, $vmlang, $categoryParentName='')
 
static getCountryByID ($id, $fld= 'country_name')
 
static getCountryIDByName ($name)
 
static getStateByID ($id, $fld= 'state_name')
 
static getStateIDByName ($name)
 
static getTaxByID ($id)
 
static getCurrencyByID ($id, $fld= 'currency_name')
 
static getCurrencyIDByName ($name)
 
static getEnumeratedCategories ($onlyPublished=TRUE, $withParentId=FALSE, $parentId=0, $name= '', $attribs= '', $key= '', $text= '', $selected=NULL)
 
static getOrderStatusName ($_code)
 
static InvoiceNumberReserved ($invoice_number)
 
static listDays ($list_name, $selected=FALSE, $start=NULL, $end=NULL)
 
static listMonths ($list_name, $selected=FALSE, $attr= '', $format='F')
 
static listYears ($list_name, $selected=FALSE, $start=NULL, $end=NULL, $attr= '', $format='Y')
 
static getValidProductFilterArray ()
 
static display3rdInfo ($title, $intro, $developer, $logolink, $contactlink, $manlink, $width='96px', $height='66px', $linesHeight='33px')
 
static displayLinkButton ($title, $link, $bgrndImage, $width, $height, $linesHeight, $additionalStyles='')
 
static generateRandomString ($length=10)
 
static checkSafePath ($sPath=0)
 
static getInvoiceFolderName ()
 
static getInvoicePath ($safePath=null)
 
static getUpperJoomlaPath ()
 
static getSuggestedSafePath ()
 
static renderProductShopperList ($productShoppers)
 
static renderMetaEdit ($obj)
 
static getAvailabilityIconUrl ($vmtemplate)
 
static getClientIP ()
 
static validateIp ($ip)
 

Static Public Attributes

static $counter = 0
 
static $categoryTree = array()
 

Constructor & Destructor Documentation

ShopFunctions::__construct ( )

Contructor

Member Function Documentation

ShopFunctions::asteriskPad (   $str,
  $display_length,
  $reversed = FALSE 
)

Return $str with all but $display_length at the end as asterisks.

Author
gday

public

Parameters
string$strThe string to mask
int$display_lengthThe length at the end of the string that is NOT masked
boolean$reversedWhen true, masks the end. Masks from the beginning at default
Returns
string The string masked by asteriks
static ShopFunctions::categoryListTree (   $selectedCategories = array(),
  $cid = 0,
  $level = 0,
  $disabledFields = array() 
)
static
static ShopFunctions::categoryListTreeLoop (   $selectedCategories = array(),
  $cid = 0,
  $level = 0,
  $disabledFields = array(),
  $isSite,
  $vendorId,
  $vmlang,
  $categoryParentName = '' 
)
static

Creates structured option fields for all categories

Author
Max Milbers, jseros
Parameters
array$selectedCategoriesAll category IDs that will be pre-selected
int$cidInternally used for recursion
int$levelInternally used for recursion
Returns
string $category_tree HTML: Category tree list
static ShopFunctions::checkSafePath (   $sPath = 0)
static
static ShopFunctions::convertDimensionUnit (   $value,
  $from,
  $to 
)
static

Convert Metric Unit

Author
Florian Voutzinos
static ShopFunctions::convertWeightUnit (   $value,
  $from,
  $to 
)
static

Convert Weight Unit

Author
Valérie Isaksen
static ShopFunctions::convertWeigthUnit (   $value,
  $from,
  $to 
)
static

typo problem with the function name. We must keep the other one for compatibility purposes

Deprecated:
Parameters
$value
$from
$to
static ShopFunctions::display3rdInfo (   $title,
  $intro,
  $developer,
  $logolink,
  $contactlink,
  $manlink,
  $width = '96px',
  $height = '66px',
  $linesHeight = '33px' 
)
static

Returns developer information for a plugin Returns a 2 link with background image, should look like a button to open contact page or manual

Parameters
$titlestring Title of the plugin
$introstring Intro text
$logolinkurl Url to logo images, use here the path and then as image names contact.png and manual.png
$developerstring Name of the developer/company
$contactlinkurl Url to the contact form of the developer for support
$manlinkurl URL to the manual for this specific plugin
Returns
string
static ShopFunctions::displayLinkButton (   $title,
  $link,
  $bgrndImage,
  $width,
  $height,
  $linesHeight,
  $additionalStyles = '' 
)
static
static ShopFunctions::generateRandomString (   $length = 10)
static
Deprecated:
Parameters
int$length
Returns
string
static ShopFunctions::generateStAddressList (   $view,
  $userModel,
  $task 
)
static

This generates the list when the user have different ST addresses saved

Deprecated:
use shopFunctionsF::generateStAddressList instead
Author
Oscar van Eijk
static ShopFunctions::getAvailabilityIconUrl (   $vmtemplate)
static
static ShopFunctions::getClientIP ( )
static

get the Client IP, even if a reverse proxy or similar is used

Author
Valerie Isaksen, Max Milbers
Returns
bool|string
static ShopFunctions::getCountryByID (   $id,
  $fld = 'country_name' 
)
static

Return the countryname or code of a given countryID

Author
Oscar van Eijk public
Parameters
int$idCountry ID
char$fldField to return: country_name (default), country_2_code or country_3_code.
Returns
string Country name or code
static ShopFunctions::getCountryIDByName (   $name)
static

Return the virtuemart_country_id of a given country name

Author
Oscar van Eijk
Max Milbers public
Parameters
string$nameCountry name (can be country_name or country_3_code or country_2_code )
Returns
int virtuemart_country_id
static ShopFunctions::getCurrencyByID (   $id,
  $fld = 'currency_name' 
)
static

Return any field from table '#__virtuemart_currencies'

Author
Valérie Isaksen public
Parameters
int$idCurrency ID
char$fldField from table '#__virtuemart_currencies' to return: currency_name (default), currency_code_2, currency_code_3 etc.
Returns
string Currency name or code
static ShopFunctions::getCurrencyIDByName (   $name)
static

Return the currencyID of a given Currency name This function becomes dangerous if there is a currency name with 3 letters

Author
Valerie Isaksen, Max Milbers public
Parameters
string$nameCurrency name
Returns
int virtuemart_currency_id
static ShopFunctions::getEnumeratedCategories (   $onlyPublished = TRUE,
  $withParentId = FALSE,
  $parentId = 0,
  $name = '',
  $attribs = '',
  $key = '',
  $text = '',
  $selected = NULL 
)
static

Print a select-list with enumerated categories

Author
jseros
Parameters
boolean$onlyPublishedShow only published categories?
boolean$withParentIdKeep in mind $parentId param?
integer$parentIdShow only its childs
string$attribsHTML attributes for the list
Returns
string <Select> HTML
static ShopFunctions::getInvoiceFolderName ( )
static
static ShopFunctions::getInvoicePath (   $safePath = null)
static
static ShopFunctions::getOrderStatusName (   $_code)
static

proxy function going to be

Deprecated:
use shopFunctionsF::getOrderStatusName instead
Parameters
char$_codeOrder status code
Returns
string The name of the order status
static ShopFunctions::getStateByID (   $id,
  $fld = 'state_name' 
)
static

Return the statename or code of a given virtuemart_state_id

Author
Oscar van Eijk public
Parameters
int$idState ID
char$fldField to return: state_name (default), state_2_code or state_3_code.
Returns
string state name or code
static ShopFunctions::getStateIDByName (   $name)
static

Return the stateID of a given state name

Author
Max Milbers public
Parameters
string$nameCountry name
Returns
int virtuemart_state_id
static ShopFunctions::getSuggestedSafePath ( )
static
static ShopFunctions::getTaxByID (   $id)
static
static ShopFunctions::getUpperJoomlaPath ( )
static
static ShopFunctions::getValidProductFilterArray ( )
static
Deprecated:
Returns
array
static ShopFunctions::getWeightUnit ( )
static

Returns all the weight unit

Author
Valérie Isaksen
static ShopFunctions::InvoiceNumberReserved (   $invoice_number)
static
static ShopFunctions::listDays (   $list_name,
  $selected = FALSE,
  $start = NULL,
  $end = NULL 
)
static

Creates an drop-down list with numbers from 1 to 31 or of the selected range, dont use within virtuemart. It is just meant for paymentmethods

Deprecated:
Parameters
string$list_nameThe name of the select element
string$selected_itemThe pre-selected value
static ShopFunctions::listMonths (   $list_name,
  $selected = FALSE,
  $attr = '',
  $format = 'F' 
)
static

Creates a Drop-Down List for the 12 months in a year

Parameters
string$list_nameThe name for the select element
string$selected_itemThe pre-selected value
static ShopFunctions::listYears (   $list_name,
  $selected = FALSE,
  $start = NULL,
  $end = NULL,
  $attr = '',
  $format = 'Y' 
)
static

Creates an drop-down list with years of the selected range or of the next 11 years

Parameters
string$list_nameThe name of the select element
string$selected_itemThe pre-selected value
static ShopFunctions::renderGuiList (   $idList,
  $table,
  $name,
  $view,
  $tableXref = false,
  $tableSecondaryKey = false,
  $quantity = 3,
  $translate = true 
)
static

Builds an enlist for information (not chooseable)

Author
Max Milbers
Parameters
array$idListids
string$tablevmTable to use
string$namefieldname for the name
string$viewview for the links
bool$tableXrefthe xref table
bool$tableSecondaryKeythe fieldname of the xref table
int$quantity
bool$translate
Returns
string
static ShopFunctions::renderLWHUnitList (   $name,
  $selected 
)
static

Renders the list for the Length, Width, Height Unit

Author
Valérie Isaksen
static ShopFunctions::renderManufacturerList (   $manufacturerId = 0,
  $multiple = FALSE,
  $name = 'virtuemart_manufacturer_id' 
)
static

Renders the list of Manufacturers

Author
St. Kraft Mod. <mediaDESIGN> St.Kraft 2013-02-24 Herstellerrabatt
static ShopFunctions::renderMetaEdit (   $obj)
static
static ShopFunctions::renderOrderingList (   $table,
  $fieldname,
  $selected,
  $where = '',
  $orderingField = 'ordering' 
)
static
static ShopFunctions::renderProductShopperList (   $productShoppers)
static
static ShopFunctions::renderShopperGroupList (   $shopperGroupId = 0,
  $multiple = TRUE,
  $name = 'virtuemart_shoppergroup_id',
  $select_attribute = 'COM_VIRTUEMART_DRDOWN_AVA2ALL',
  $attrs = array() 
)
static

Creates a Drop Down list of available Shopper Groups

Author
Max Milbers public
Parameters
int$shopperGroupIdthe shopper group to pre-select
bool$multipleif the select list should allow multiple selections
Returns
string HTML select option list
static ShopFunctions::renderTaxList (   $selected,
  $name = 'product_tax_id',
  $class = '' 
)
static

Renders the list for the tax rules

Author
Max Milbers
static ShopFunctions::renderTemplateList (   $defaultText = 0,
  $defaultOption = TRUE 
)
static

Creates the chooseable template list

Author
Max Milbers, impleri
Parameters
stringdefaultText Text for the empty option
booleandefaultOption you can supress the empty otion setting this to false return array of Template objects
static ShopFunctions::renderUnitIsoList (   $name,
  $selected 
)
static
static ShopFunctions::renderVendorAddress (   $vendorId,
  $lineSeparator = "<br />",
  $skips = array('name','username','email','agreed') 
)
static
Deprecated:
use shopFunctionsF::renderVendorAddress instead
Parameters
$vendorId
string$lineSeparator
array$skips
Returns
string
static ShopFunctions::renderVendorFullVendorList (   $vendorId,
  $multiple = false,
  $name = 'virtuemart_vendor_id' 
)
static
static ShopFunctions::renderVendorList (   $vendorId = false,
  $name = 'virtuemart_vendor_id' 
)
static

Creates a Drop Down list of available Vendors

Author
Max Milbers public
Parameters
int$virtuemart_shoppergroup_idthe shopper group to pre-select
bool$multipleif the select list should allow multiple selections
Returns
string HTML select option list
static ShopFunctions::renderWeightUnit (   $name)
static

Renders the string for the

Author
Valérie Isaksen
static ShopFunctions::renderWeightUnitList (   $name,
  $selected 
)
static

Renders the list for the Weight Unit

Author
Valérie Isaksen
static ShopFunctions::validateIp (   $ip)
static

Ensures an ip address is both a valid IP and does not fall within a private network range.

Member Data Documentation

ShopFunctions::$categoryTree = array()
static
ShopFunctions::$counter = 0
static

The documentation for this class was generated from the following file: