本文整理汇总了PHP中CitruscartHelperBase类的典型用法代码示例。如果您正苦于以下问题:PHP CitruscartHelperBase类的具体用法?PHP CitruscartHelperBase怎么用?PHP CitruscartHelperBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CitruscartHelperBase类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: downloadFile
/**
* downloads a file
*
* @return void
*/
function downloadFile()
{
$app = JFactory::getApplication();
$user = JFactory::getUser();
$productfile_id = $app->input->getInt('id', 0);
//$productfile_id = intval( JRequest::getvar( 'id', '', 'request', 'int' ) );
$product_id = $app->input->getInt('product_id', 0);
$link = 'index.php?option=com_citruscart&view=products&task=edit&id=' . $product_id;
Citruscart::load('CitruscartHelperBase', 'helpers._base');
$helper = CitruscartHelperBase::getInstance('ProductDownload', 'CitruscartHelper');
JTable::addIncludePath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_citruscart' . DS . 'tables');
$productfile = JTable::getInstance('ProductFiles', 'CitruscartTable');
$productfile->load($productfile_id);
if (empty($productfile->productfile_id)) {
$this->messagetype = 'notice';
$this->message = JText::_('COM_CITRUSCART_INVALID FILE');
$this->setRedirect($link, $this->message, $this->messagetype);
return false;
}
// log and download
Citruscart::load('CitruscartFile', 'library.file');
// geting the ProductDownloadId to updated for which productdownload_max is greater then 0
$productToDownload = $helper->getProductDownloadInfo($productfile->productfile_id, $user->id);
if ($downloadFile = CitruscartFile::download($productfile)) {
$link = JRoute::_($link, false);
$this->setRedirect($link);
}
}
开发者ID:joomlacorner,项目名称:citruscart,代码行数:33,代码来源:productfiles.php
示例2: check
/**
* Checks row for data integrity.
* Assumes working dates have been converted to local time for display,
* so will always convert working dates to GMT
*
* @return unknown_type
*/
function check()
{
if (empty($this->product_id)) {
$this->setError(JText::_('COM_CITRUSCART_PRODUCT_ASSOCIATION_REQUIRED'));
return false;
}
$offset = JFactory::getConfig()->getValue('config.offset');
if (isset($this->publishing_date)) {
$this->publishing_date = date('Y-m-d H:i:s', strtotime(CitruscartHelperBase::getOffsetDate($this->publishing_date, -$offset)));
}
$nullDate = $this->_db->getNullDate();
Citruscart::load('CitruscartHelperBase', 'helpers._base');
if (empty($this->created_date) || $this->created_date == $nullDate) {
$date = JFactory::getDate();
$this->created_date = $date->toSql();
}
$date = JFactory::getDate();
$this->modified_date = $date->toSql();
$act = strtotime(Date('Y-m-d', strtotime($this->publishing_date)));
$db = $this->_db;
if (empty($this->product_issue_id)) {
$q = 'SELECT `publishing_date` FROM `#__citruscart_productissues` WHERE `product_id`=' . $this->product_id . ' ORDER BY `publishing_date` DESC LIMIT 1';
$db->setQuery($q);
$next = $db->loadResult();
if ($next === null) {
return true;
}
$next = strtotime($next);
if ($act <= $next) {
$this->setError(JText::_('COM_CITRUSCART_PUBLISHING_DATE_IS_NOT_PRESERVING_ISSUE_ORDER') . ' - ' . $this->publishing_date);
return false;
}
} else {
$q = 'SELECT `publishing_date` FROM `#__citruscart_productissues` WHERE `product_issue_id`=' . $this->product_issue_id;
$db->setQuery($q);
$original = $db->loadResult();
if ($act == strtotime(Date('Y-m-d', strtotime($original)))) {
return true;
}
$q = 'SELECT `publishing_date` FROM `#__citruscart_productissues` WHERE `product_id`=' . $this->product_id . ' AND `publishing_date` < \'' . $original . '\' ORDER BY `publishing_date` DESC LIMIT 1';
$db->setQuery($q);
$prev = $db->loadResult();
$q = 'SELECT `publishing_date` FROM `#__citruscart_productissues` WHERE `product_id`=' . $this->product_id . ' AND `publishing_date` > \'' . $original . '\' ORDER BY `publishing_date` ASC LIMIT 1';
$db->setQuery($q);
$next = $db->loadResult();
if ($prev === null) {
$prev = 0;
} else {
$prev = strtotime($prev);
}
if ($next) {
$next = strtotime($next);
}
if ($prev >= $act || $next && $next <= $act) {
$this->setError(JText::_('COM_CITRUSCART_PUBLISHING_DATE_IS_NOT_PRESERVING_ISSUE_ORDER') . ' - ' . $this->publishing_date);
return false;
}
}
return true;
}
开发者ID:joomlacorner,项目名称:citruscart,代码行数:67,代码来源:productissues.php
示例3: save
/**
* Run function after saving
*/
function save($src = '', $orderingFilter = '', $ignore = '')
{
if ($return = parent::save($src, $orderingFilter, $ignore)) {
Citruscart::load("CitruscartHelperProduct", 'helpers.product');
$helper = CitruscartHelperBase::getInstance('product');
$helper->doProductQuantitiesReconciliation($this->product_id, '0');
}
return $return;
}
开发者ID:joomlacorner,项目名称:citruscart,代码行数:12,代码来源:productattributes.php
示例4: check
/**
* Checks row for data integrity.
* Assumes working dates have been converted to local time for display,
* so will always convert working dates to GMT
*
* @return unknown_type
*/
function check()
{
if (empty($this->product_id)) {
$this->setError(JText::_('COM_CITRUSCART_PRODUCT_ASSOCIATION_REQUIRED'));
return false;
}
$nullDate = $this->_db->getNullDate();
Citruscart::load('CitruscartHelperBase', 'helpers._base');
$CitruscartHelperBase = new CitruscartHelperBase();
$this->product_price_startdate = $this->product_price_startdate != $nullDate ? $CitruscartHelperBase->getOffsetDate($this->product_price_startdate) : $this->product_price_startdate;
$this->product_price_enddate = $this->product_price_enddate != $nullDate ? $CitruscartHelperBase->getOffsetDate($this->product_price_enddate) : $this->product_price_enddate;
if (empty($this->created_date) || $this->created_date == $nullDate) {
$date = JFactory::getDate();
$this->created_date = $date->toSql();
}
$date = JFactory::getDate();
$this->modified_date = $date->toSql();
return true;
}
开发者ID:joomlacorner,项目名称:citruscart,代码行数:26,代码来源:productprices.php
示例5: getList
/**
* Method to get content article data for the frontpage
*
* @since 1.5
*/
function getList()
{
$where = array();
$mainframe = JFactory::getApplication();
if (!empty($this->_list)) {
return $this->_list;
}
// Initialize variables
$db = $this->getDBO();
$filter = null;
// Get some variables from the request
// $sectionid = JRequest::getVar( 'sectionid', -1, '', 'int' );
// $redirect = $sectionid;
// $option = JRequest::get( 'option' );
$filter_order = $mainframe->getUserStateFromRequest('userelement.filter_order', 'filter_order', '', 'cmd');
$filter_order_Dir = $mainframe->getUserStateFromRequest('userelement.filter_order_Dir', 'filter_order_Dir', '', 'word');
$limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
$limitstart = $mainframe->getUserStateFromRequest('userelement.limitstart', 'limitstart', 0, 'int');
$search = $mainframe->getUserStateFromRequest('userelement.search', 'search', '', 'string');
$search = JString::strtolower($search);
if (!$filter_order) {
$filter_order = 'tbl.product_id';
}
$order = ' ORDER BY ' . $filter_order . ' ' . $filter_order_Dir;
$all = 1;
// Keyword filter
if ($search) {
$where[] = 'LOWER( tbl.product_id ) LIKE ' . $db->q('%' . $db->escape($search, true) . '%', false);
$where[] = 'LOWER( tbl.product_name ) LIKE ' . $db->q('%' . $db->escape($search, true) . '%', false);
}
// Build the where clause of the query
$where = count($where) ? ' WHERE ' . implode(' OR ', $where) : '';
// Get the total number of records
$query = 'SELECT COUNT(tbl.product_id)' . ' FROM #__citruscart_products AS tbl' . $where;
$db->setQuery($query);
$total = $db->loadResult();
// Create the pagination object
jimport('joomla.html.pagination');
$this->_page = new JPagination($total, $limitstart, $limit);
// Get the products
$query = 'SELECT tbl.*, pp.* ' . ' FROM #__citruscart_products AS tbl' . ' LEFT JOIN #__citruscart_productprices pp ON pp.product_id = tbl.product_id ' . $where . $order;
$db->setQuery($query, $this->_page->limitstart, $this->_page->limit);
$this->_list = $db->loadObjectList();
//currency formatting
Citruscart::load('CitruscartHelperBase', 'helpers._base');
foreach ($this->_list as $item) {
$item->product_price = CitruscartHelperBase::currency($item->product_price);
}
// If there is a db query error, throw a HTTP 500 and exit
if ($db->getErrorNum()) {
JError::raiseError(500, $db->stderr());
return false;
}
return $this->_list;
}
开发者ID:joomlacorner,项目名称:citruscart,代码行数:60,代码来源:elementproductmultiple.php
示例6: save
/**
* Run function when saving
* @see Citruscart/admin/tables/CitruscartTable#save()
*/
function save($src = '', $orderingFilter = '', $ignore = '')
{
if ($return = parent::save($src, $orderingFilter, $ignore)) {
$pa = JTable::getInstance('ProductAttributes', 'CitruscartTable');
$pa->load($this->productattribute_id);
Citruscart::load("CitruscartHelperProduct", 'helpers.product');
$helper = CitruscartHelperBase::getInstance('product');
$helper->doProductQuantitiesReconciliation($pa->product_id);
}
return $return;
}
开发者ID:joomlacorner,项目名称:citruscart,代码行数:15,代码来源:productattributeoptions.php
示例7: store
/**
*
* @param unknown_type $updateNulls
* @return unknown_type
*/
function store($updateNulls = false)
{
if ($return = parent::store($updateNulls)) {
if ($this->notify_customer == '1') {
Citruscart::load("CitruscartHelperBase", 'helpers._base');
$helper = CitruscartHelperBase::getInstance('Email');
$model = Citruscart::getClass("CitruscartModelSubscriptions", "models.subscriptions");
$model->setId($this->subscription_id);
$subscription = $model->getItem();
$helper->sendEmailNotices($subscription, 'subscription');
}
}
return $return;
}
开发者ID:joomlacorner,项目名称:citruscart,代码行数:19,代码来源:subscriptionhistory.php
示例8: store
/**
*
* @param unknown_type $updateNulls
* @return unknown_type
*/
function store($updateNulls = false)
{
if ($return = parent::store($updateNulls)) {
if ($this->notify_customer == '1') {
Citruscart::load("CitruscartHelperBase", 'helpers._base');
$helper = CitruscartHelperBase::getInstance('Email');
$model = Citruscart::getClass("CitruscartModelOrders", "models.orders");
$model->setId($this->order_id);
// this isn't necessary because you specify the requested PK id as a getItem() argument
$order = $model->getItem($this->order_id, true);
$helper->sendEmailNotices($order, 'order');
}
}
return $return;
}
开发者ID:joomlacorner,项目名称:citruscart,代码行数:20,代码来源:orderhistory.php
示例9: display
function display($cachable = false, $urlparams = false)
{
$uri = JURI::getInstance();
$view = $this->getView($this->get('suffix'), JFactory::getDocument()->getType());
$view->set('hidemenu', false);
$view->set('_doTask', true);
$view->setLayout('default');
if (version_compare(JVERSION, '1.6.0', 'ge')) {
$url = "index.php?option=com_users&view=user&task=user.edit";
} else {
$url = "index.php?option=com_user&view=user&task=edit";
}
Citruscart::load("CitruscartHelperBase", 'helpers._base');
$helper = CitruscartHelperBase::getInstance('Ambra');
if ($helper->isInstalled()) {
$url = "index.php?option=com_ambra&view=users&task=edit&return=" . base64_encode($uri->__toString());
}
$view->assign('url_profile', $url);
parent::display($cachable, $urlparams);
}
开发者ID:joomlacorner,项目名称:citruscart,代码行数:20,代码来源:accounts.php
示例10: store
public function store($updateNulls = false)
{
// Check the table activation status first
if (!$this->active) {
// Activate it with a default value
$this->setType('');
}
if ($this->getType() == 'datetime') {
if (isset($this->eavvalue_value)) {
$null_date = JFactory::getDbo()->getNullDate();
if ($this->eavvalue_value == $null_date || $this->eavvalue_value == '') {
$this->eavvalue_value = $null_date;
} else {
$offset = JFactory::getConfig()->getValue('config.offset');
$this->eavvalue_value = date('Y-m-d H:i:s', strtotime(CitruscartHelperBase::getOffsetDate($this->eavvalue_value, -$offset)));
}
}
}
return parent::store($updateNulls);
}
开发者ID:joomlacorner,项目名称:citruscart,代码行数:20,代码来源:eavvalues.php
示例11: _buildQueryFields
protected function _buildQueryFields(&$query)
{
Citruscart::load('CitruscartHelperUser', 'helpers.user');
$date = JFactory::getDate()->toSql();
$filter_product = $this->getState('filter_product');
$user = CitruscartHelperBase::getInstance('user');
if (strlen($filter_product)) {
$default_group = $user->getUserGroup(JFactory::getUser()->id, (int) $filter_product);
} else {
$default_group = Citruscart::getInstance()->get('default_user_group', '1');
}
$fields = array();
$fields[] = " p_from.product_name as product_name_from ";
$fields[] = " p_from.product_sku as product_sku_from ";
$fields[] = " p_from.product_model as product_model_from ";
$fields[] = "\n (\n SELECT\n prices.product_price\n FROM\n #__citruscart_productprices AS prices\n WHERE\n prices.product_id = tbl.product_id_from\n AND prices.group_id = '{$default_group}'\n AND prices.product_price_startdate <= '{$date}'\n AND (prices.product_price_enddate >= '{$date}' OR prices.product_price_enddate = '0000-00-00 00:00:00' )\n ORDER BY prices.price_quantity_start ASC\n LIMIT 1\n )\n AS product_price_from ";
$fields[] = " p_to.product_name as product_name_to ";
$fields[] = " p_to.product_sku as product_sku_to ";
$fields[] = " p_to.product_model as product_model_to ";
$fields[] = "\n (\n SELECT\n prices.product_price\n FROM\n #__citruscart_productprices AS prices\n WHERE\n prices.product_id = tbl.product_id_to\n AND prices.group_id = '{$default_group}'\n AND prices.product_price_startdate <= '{$date}'\n AND (prices.product_price_enddate >= '{$date}' OR prices.product_price_enddate = '0000-00-00 00:00:00' )\n ORDER BY prices.price_quantity_start ASC\n LIMIT 1\n )\n AS product_price_to ";
$query->select($this->getState('select', 'tbl.*'));
$query->select($fields);
}
开发者ID:joomlacorner,项目名称:citruscart,代码行数:23,代码来源:productrelations.php
示例12:
echo $item->shipping_address_2 ? $item->shipping_address_2 . ", " : "";
echo $item->shipping_city . ", ";
echo $item->shipping_zone_name . " ";
echo $item->shipping_postal_code . " ";
echo $item->shipping_country_name;
}
?>
<?php
if (!empty($item->order_number)) {
echo "<br/><b>" . JText::_('COM_CITRUSCART_ORDER_NUMBER') . "</b>: " . $item->order_number;
}
?>
</td>
<td style="text-align: center;">
<label class="label label-warning"><?php
echo CitruscartHelperBase::currency($item->order_total, $item->currency);
?>
</label>
<?php
if (!empty($item->commissions)) {
?>
<br/>
<?php
JHTML::_('behavior.tooltip');
?>
<a href="index.php?option=com_amigos&view=commissions&filter_orderid=<?php
echo $item->order_id;
?>
" target="_blank">
<img src='<?php
echo JURI::root(true);
开发者ID:joomlacorner,项目名称:citruscart,代码行数:31,代码来源:default.php
示例13:
<div class='onDisplayProductAttributeOptions_wrapper'>
<?php
echo $this->onDisplayProductAttributeOptions;
?>
</div>
<?php
}
?>
<?php
echo JText::_('COM_CITRUSCART_QUANTITY');
?>
<input type="text" name="quantity" value="1" size="10" />
<br/>
<?php
echo JText::_('COM_CITRUSCART_BASE_PRICE');
?>
: <?php
echo CitruscartHelperBase::currency($row->price);
?>
<br/>
<input type="submit" name="add_to_cart" value="<?php
echo JText::_('COM_CITRUSCART_ADD_TO_ORDER');
?>
" class="btn btn-success" />
<input type="hidden" name="task" id="task" value="addtocart" />
<input type="hidden" name="product_id" value="<?php
echo $row->product_id;
?>
" />
开发者ID:joomlacorner,项目名称:citruscart,代码行数:31,代码来源:viewproduct_addtocart.php
示例14:
<td colspan="2">
<input style="float: right;" type="submit" class="btn btn-success" value="<?php
echo JText::_('COM_CITRUSCART_UPDATE_QUANTITIES');
?>
" name="update" />
</td>
</tr>
<tr>
<td colspan="4" style="font-weight: bold;">
<?php
echo JText::_('COM_CITRUSCART_SUBTOTAL');
?>
</td>
<td style="text-align: right;">
<span id="totalAmountDue"><?php
echo CitruscartHelperBase::currency($subtotal);
?>
</span>
</td>
</tr>
<tr>
<td colspan="5" style="white-space: nowrap;">
<b><?php
echo JText::_('COM_CITRUSCART_TAX_AND_SHIPPING_TOTALS');
?>
</b>
<br/>
<?php
echo JText::_('COM_CITRUSCART_CALCULATED_DURING_CHECKOUT_PROCESS');
?>
</td>
开发者ID:joomlacorner,项目名称:citruscart,代码行数:31,代码来源:default.php
示例15: Copyright
<?php
/*------------------------------------------------------------------------
# com_citruscart - citruscart
# ------------------------------------------------------------------------
# author Citruscart Team - Citruscart http://www.citruscart.com
# copyright Copyright (C) 2014 - 2019 Citruscart.com All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://citruscart.com
# Technical Support: Forum - http://citruscart.com/forum/index.html
-------------------------------------------------------------------------*/
defined('_JEXEC') or die('Restricted access');
/*Layout for displaying refreshed total amount.*/
JHTML::_('stylesheet', 'menu.css', 'media/citruscart/css/');
JHtml::_('script', 'media/citruscart/js/citruscart.js', false, false);
JHTML::_('script', 'joomla.javascript.js', 'includes/js/');
Citruscart::load('CitruscartGrid', 'library.grid');
$state = $this->state;
$order = $this->order;
$items = $this->orderitems;
echo CitruscartHelperBase::currency($items);
开发者ID:joomlacorner,项目名称:citruscart,代码行数:21,代码来源:total.php
示例16:
<?php
Citruscart::load('CitruscartHelperShipping', 'helpers.shipping');
?>
<span style="float: right;">[<?php
echo CitruscartUrl::popup("index.php?option=com_citruscart&controller=shippingmethods&task=setrates&id=" . $item->shipping_method_id . "&tmpl=component", "Set Rates");
?>
]</span>
<?php
if ($shipping_method_type = CitruscartHelperShipping::getType($item->shipping_method_type)) {
echo "<b>" . JText::_('COM_CITRUSCART_TYPE') . "</b>: " . $shipping_method_type->title;
}
if ($item->subtotal_minimum > '0') {
echo "<br/><b>" . JText::_('COM_CITRUSCART_MINIMUM_ORDER_REQUIRED') . "</b>: " . CitruscartHelperBase::currency($item->subtotal_minimum);
}
if ($item->subtotal_maximum > '-1') {
echo "<br/><b>" . JText::_('COM_CITRUSCART_SHIPPING_METHODS_SUBTOTAL_MAX') . "</b>: " . CitruscartHelperBase::currency($item->subtotal_maximum);
}
?>
</div>
</td>
<td style="text-align: center;">
<?php
echo $item->tax_class_name;
?>
</td>
<td style="text-align: center;">
<?php
echo CitruscartGrid::enable($item->shipping_method_enabled, $i, 'shipping_method_enabled.');
?>
</td>
</tr>
开发者ID:joomlacorner,项目名称:citruscart,代码行数:31,代码来源:default.php
示例17: checkPassword2
/**
* Checks that a password and password2 match
* return unknown_type
*/
function checkPassword2()
{
$input = JFactory::getApplication()->input;
Citruscart::load('CitruscartHelperBase', 'helpers._base');
$helper = CitruscartHelperBase::getInstance();
$response = array();
$response['msg'] = '';
$response['error'] = '';
// get elements from post
$elements = json_decode(preg_replace('/[\\n\\r]+/', '\\n', $input->getString('elements')));
// convert elements to array that can be binded
$values = CitruscartHelperBase::elementsToArray($elements);
$password = $values['password'];
$password2 = $values['password2'];
if (empty($password)) {
$response['msg'] = $helper->validationMessage("COM_CITRUSCART_PASSWORD_CANNOT_BE_EMPTY", 'fail');
$response['error'] = '1';
echo json_encode($response);
return;
}
if (empty($password2)) {
$response['msg'] = $helper->validationMessage("COM_CITRUSCART_PASSWORD_VERIFY_CANNOT_BE_EMPTY", 'fail');
$response['error'] = '1';
echo json_encode($response);
return;
}
$message = "";
if ($password != $password2) {
$message .= $helper->validationMessage('COM_CITRUSCART_PASSWORD_DO_NOT_MATCH', 'fail');
} else {
// no error
$message .= $helper->validationMessage('COM_CITRUSCART_PASSWORD_VALID', 'success');
}
$response['msg'] = $message;
$response['error'] = '1';
echo json_encode($response);
return;
}
开发者ID:joomlacorner,项目名称:citruscart,代码行数:42,代码来源:checkout.php
示例18: getAvatar
/**
*
* Get Avatar based on the installed community component
* @param int $id - userid
* @return object
*/
function getAvatar($id)
{
$avatar = '';
$found = false;
Citruscart::load('CitruscartHelperAmbra', 'helpers.ambra');
$helper_ambra = CitruscartHelperBase::getInstance('Ambra');
//check if ambra installed
if ($helper_ambra->isInstalled() && !$found) {
if (!class_exists('Ambra')) {
JLoader::register("Ambra", JPATH_ADMINISTRATOR . "/components/com_ambra/defines.php");
}
//Get Ambra Avatar
if ($image = Ambra::getClass("AmbraHelperUser", 'helpers.user')->getAvatar($id)) {
$link = JRoute::_(JURI::root() . 'index.php?option=com_ambra&view=users&id=' . $id, false);
$avatar .= "<a href='{$link}' target='_blank'>";
$avatar .= "<img src='{$image}' style='max-width:80px; border:1px solid #ccccce;' />";
$avatar .= "</a>";
}
$found = true;
}
//check if jomsocial installed
if (DSC::getApp()->isComponentInstalled('com_community') && !$found) {
//Get JomSocial Avatar
$database = JFactory::getDBO();
$query = "\r\n\t\t\tSELECT\r\n\t\t\t\t*\r\n\t\t\tFROM\r\n\t\t\t\t#__community_users\r\n\t\t\tWHERE\r\n\t\t\t\t`userid` = '" . $id . "'\r\n\t\t\t";
$database->setQuery($query);
$result = $database->loadObject();
if (isset($result->thumb)) {
$image = JURI::root() . $result->thumb;
}
$link = JRoute::_(JURI::root() . 'index.php?option=com_community&view=profile&userid=' . $id, false);
$avatar .= "<a href='{$link}' target='_blank'>";
$avatar .= "<img src='{$image}' style='max-width:80px; border:1px solid #ccccce;' />";
$avatar .= "</a>";
$found = true;
}
//check if community builder is installed
if (DSC::getApp()->isComponentInstalled('com_comprofiler') && !$found) {
//Get JomSocial Avatar
$database = JFactory::getDBO();
$query = "\r\n\t\t\tSELECT\r\n\t\t\t\t*\r\n\t\t\tFROM\r\n\t\t\t\t#__comprofiler\r\n\t\t\tWHERE\r\n\t\t\t\t`id` = '" . $id . "'\r\n\t\t\t";
$database->setQuery($query);
$result = $database->loadObject();
if (isset($result->avatar)) {
$image = JURI::root() . 'images/comprofiler/' . $result->avatar;
} else {
$image = JRoute::_(JURI::root() . 'components/com_comprofiler/plugin/templates/default/images/avatar/nophoto_n.png');
}
$link = JRoute::_(JURI::root() . 'index.php?option=com_comprofiler&userid=' . $id, false);
$avatar .= "<a href='{$link}' target='_blank'>";
$avatar .= "<img src='{$image}' style='max-width:80px; border:1px solid #ccccce;' />";
$avatar .= "</a>";
$found = true;
}
return $avatar;
}
开发者ID:joomlacorner,项目名称:citruscart,代码行数:62,代码来源:user.php
示例19: sprintf
?>
<?php
if ($this->defines->get('display_credits', '0') && (double) $this->userinfo->credits_total > (double) '0.00') {
?>
<fieldset id="opc-credit-form">
<div id="opc-credit-validation"></div>
<div id="credits_form">
<label for="apply_credit_amount"><?php
echo JText::_('COM_CITRUSCART_STORE_CREDIT');
?>
</label>
<div class="help-block"><?php
echo sprintf(JText::_('COM_CITRUSCART_YOU_HAVE_STORE_CREDIT'), CitruscartHelperBase::currency($this->userinfo->credits_total, $this->defines->get('default_currencyid', '1')));
?>
</div>
<div class="input-append" id="opc-credit-input">
<input class="span2" type="text" id="apply_credit_amount" name="apply_credit_amount" />
<button id="opc-credit-button" class="btn" type="button"><?php
echo JText::_("COM_CITRUSCART_APPLY_CREDIT_TO_ORDER");
?>
</button>
</div>
</div>
<div id='opc-credits'></div>
</fieldset>
<?php
开发者ID:joomlacorner,项目名称:citruscart,代码行数:31,代码来源:review.php
示例20: load
/**
* Loads a row from the database and binds the fields to the object properties
* If $load_eav is true, binds also the eav fields linked to this entity
*
* @access public
* @param mixed Optional primary key. If not specifed, the value of current key is used
* @param bool reset the object values?
* @param bool load the eav values for this object
*
* @return boolean True if successful
*/
function load($oid = null, $reset = true, $load_eav = true)
{
$eavs = array();
/* Get the application */
$app = JFactory::getApplication();
$editable_by = $app->isAdmin() ? 1 : 2;
if ($app->isAdmin()) {
$view = $app->input->get('view', '');
//$view = JRequest::get('view', '' );
if ($view == 'pos') {
// display all for POS
$editable_by = array(1, 2);
}
}
if (!is_array($oid)) {
// load by primary key if not array
$keyName = $this->getKeyName();
$oid = array($keyName => $oid);
}
if (empty($oid)) {
// if empty, use the value of the current key
$keyName = $this->getKeyName();
$oid = $this->{$keyName};
if (empty($oid)) {
// if still empty, fail
$this->setError(JText::_('COM_CITRUSCART_CANNOT_LOAD_WITH_EMPTY_KEY'));
return false;
}
}
// allow $oid to be an array of key=>values to use when loading
$oid = (array) $oid;
$this->_linked_table_key = isset($this->_linked_table_key) ? $this->_linked_table_key : (isset($oid[$this->_linked_table_key_name]) ? $oid[$this->_linked_table_key_name] : '');
if (!empty($reset)) {
$this->reset();
}
$db = $this->getDBO();
// initialize the query
$query = new DSCQuery();
$query->select('*');
$query->from($this->getTableName());
if ($load_eav) {
Citruscart::load("CitruscartHelperBase", 'helpers._base');
$eav_helper = CitruscartHelperBase::getInstance('Eav');
$k = $this->_tbl_key;
$id = $this->{$k};
// Get the custom fields for this entities
Citruscart::load('CitruscartHelperEav', 'helpers.eav');
$eavs = CitruscartHelperEav::getAttributes($this->get('_suffix'), $id, true, $editable_by);
// Is this a mirrored table (see decription at the beginning of this file)
if (strlen($this->_linked_table) && $this->_linked_table_key) {
// Copy the custom field value to this table
$mirrored_eavs = $eav_helper->getAttributes($this->_linked_table, $this->_linked_table_key, true, $editable_by);
$eavs = array_merge($eavs, $mirrored_eavs);
}
}
foreach ($oid as $key => $value) {
// Check that $key is field in table
if (!in_array($key, array_keys($this->getProperties()))) {
// Check if it is a eav field
if ($load_eav) {
// loop through until the key is found or the eav are finished
$found = false;
$i = 0;
while (!$found && $i < count($eavs)) {
// Does the key exists?
if ($key == $eavs[$i]->eavattribute_alias) {
$found = true;
} else {
$i++;
}
}
// Was the key found?
if (!$found) {
// IF not return an error
$this->setError(get_class($this) . ' does not have the field ' . $key);
return false;
}
// key was found -> add this EAV field
$value_tbl_name = 'value_' . $eavs[$i]->eavattribute_alias;
// for some reason MySQL makes spaces around '-' charachter
// (which is often charachter in aliases) that's why we replace it with '_'
$value_tbl_name = str_replace("-", "_", $value_tbl_name);
// Join the table based on the type of the value
$table_type = $eav_helper->getType($eavs[$i]->eavattribute_alias);
// Join the tables
$query->join('LEFT', '#__citruscart_eavvalues' . $table_type . ' AS ' . $value_tbl_name . ' ON ( ' . $value_tbl_name . '.eavattribute_id = ' . $eavs[$i]->eavattribute_id . ' AND ' . $value_tbl_name . '.eaventity_id = ' . $this->_tbl_key . ' )');
// Filter using '='
$query->where($value_tbl_name . ".eavvalue_value = '" . $value . "'");
// else let the store() method worry over this
//.........这里部分代码省略.........
开发者ID:joomlacorner,项目名称:citruscart,代码行数:101,代码来源:_baseeav.php
注:本文中的CitruscartHelperBase类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论