本文整理汇总了PHP中JSFactory::getLang方法的典型用法代码示例。如果您正苦于以下问题:PHP JSFactory::getLang方法的具体用法?PHP JSFactory::getLang怎么用?PHP JSFactory::getLang使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSFactory
的用法示例。
在下文中一共展示了JSFactory::getLang方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAllList
function getAllList($display = 0)
{
$db = JFactory::getDBO();
$lang = JSFactory::getLang();
$query = "SELECT id, `" . $lang->get("name") . "` as name, field_id FROM `#__jshopping_products_extra_field_values` order by ordering";
extract(js_add_trigger(get_defined_vars(), "before"));
$db->setQuery($query);
if ($display == 0) {
return $db->loadObjectList();
} elseif ($display == 1) {
$rows = $db->loadObjectList();
$list = array();
foreach ($rows as $k => $row) {
$list[$row->id] = $row->name;
unset($rows[$k]);
}
return $list;
} else {
$rows = $db->loadObjectList();
$list = array();
foreach ($rows as $k => $row) {
$list[$row->field_id][$row->id] = $row->name;
unset($rows[$k]);
}
return $list;
}
}
示例2: getList
function getList($groupordering = 0, $order = null, $orderDir = null, $filter = array())
{
$db = JFactory::getDBO();
$lang = JSFactory::getLang();
$ordering = "F.ordering";
if ($order && $orderDir) {
$ordering = $order . " " . $orderDir;
}
if ($groupordering) {
$ordering = "G.ordering, " . $ordering;
}
$where = '';
$_where = array();
if ($filter['group']) {
$_where[] = " F.group = '" . $db->escape($filter['group']) . "' ";
}
if ($filter['text_search']) {
$text_search = $filter['text_search'];
$word = addcslashes($db->escape($text_search), "_%");
$_where[] = "(LOWER(F.`" . $lang->get('name') . "`) LIKE '%" . $word . "%' OR LOWER(F.`" . $lang->get('description') . "`) LIKE '%" . $word . "%' OR F.id LIKE '%" . $word . "%')";
}
if (count($_where) > 0) {
$where = " WHERE " . implode(" AND ", $_where);
}
$query = "SELECT F.id, F.`" . $lang->get("name") . "` as name, F.`" . $lang->get("description") . "` as description, F.allcats, F.type, F.cats, F.ordering, F.`group`, G.`" . $lang->get("name") . "` as groupname, multilist FROM `#__jshopping_products_extra_fields` as F left join `#__jshopping_products_extra_field_groups` as G on G.id=F.group " . $where . " order by " . $ordering;
$db->setQuery($query);
return $db->loadObjectList();
}
示例3: getCategory
public static function getCategory($catid, $order = 'id', $ordering = 'asc', $limit, $publish = 0)
{
$_db = JFactory::getDBO();
$lang = JSFactory::getLang();
$user = JFactory::getUser();
$add_where = $publish ? " AND category_publish = '1' " : "";
$groups = implode(',', $user->getAuthorisedViewLevels());
$add_where .= ' AND access IN (' . $groups . ')';
if ($order == "id") {
$orderby = "category_id";
}
if ($order == "name") {
$orderby = "`" . $lang->get('name') . "`";
}
if ($order == "ordering") {
$orderby = "ordering";
}
if (!$orderby) {
$orderby = "ordering";
}
if ($limit > 0) {
$_limit = " LIMIT 0 , " . $limit;
} else {
$_limit = "";
}
$query = "SELECT `" . $lang->get('name') . "` as name,`" . $lang->get('description') . "` as description,`" . $lang->get('short_description') . "` as short_description, category_id, category_publish, ordering, category_image FROM `#__jshopping_categories`\r\n WHERE category_id IN (" . $catid . ") " . $add_where . "\r\n ORDER BY " . $orderby . " " . $ordering . " " . $_limit;
$_db->setQuery($query);
$categories = $_db->loadObjectList();
foreach ($categories as $key => $value) {
$categories[$key]->link = SEFLink('index.php?option=com_jshopping&controller=category&task=view&category_id=' . $categories[$key]->category_id, 1);
}
return $categories;
}
示例4: getProducts
function getProducts($filters, $order = null, $orderby = null, $limitstart = 0, $limit = 0)
{
$jshopConfig = JSFactory::getConfig();
$lang = JSFactory::getLang();
$adv_query = "";
$adv_from = "";
$adv_result = $this->getBuildQueryListProductDefaultResult();
$this->getBuildQueryListProduct("vendor", "list", $filters, $adv_query, $adv_from, $adv_result);
if ($this->main) {
$query_vendor_id = "(prod.vendor_id = '" . $this->id . "' OR prod.vendor_id ='0')";
} else {
$query_vendor_id = "prod.vendor_id = '" . $this->id . "'";
}
$order_query = $this->getBuildQueryOrderListProduct($order, $orderby, $adv_from);
JPluginHelper::importPlugin('jshoppingproducts');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onBeforeQueryGetProductList', array("vendor", &$adv_result, &$adv_from, &$adv_query, &$order_query, &$filters));
$query = "SELECT {$adv_result} FROM `#__jshopping_products` AS prod\n LEFT JOIN `#__jshopping_products_to_categories` AS pr_cat USING (product_id)\n LEFT JOIN `#__jshopping_categories` AS cat ON pr_cat.category_id = cat.category_id \n {$adv_from}\n WHERE " . $query_vendor_id . " AND prod.product_publish = '1' AND cat.category_publish='1' " . $adv_query . "\n GROUP BY prod.product_id " . $order_query;
if ($limit) {
$this->_db->setQuery($query, $limitstart, $limit);
} else {
$this->_db->setQuery($query);
}
$products = $this->_db->loadObjectList();
$products = listProductUpdateData($products);
return $products;
}
示例5: getName
function getName($status_id)
{
$lang = JSFactory::getLang();
$query = "SELECT `" . $lang->get('name') . "` as name FROM `#__jshopping_order_status` WHERE status_id = '" . $this->_db->escape($status_id) . "'";
$this->_db->setQuery($query);
return $this->_db->loadResult();
}
示例6: getAllPaymentMethods
function getAllPaymentMethods($publish = 1, $shipping_id = 0)
{
$db = JFactory::getDBO();
$jshopConfig = JSFactory::getConfig();
$query_where = $publish ? "WHERE payment_publish = '1'" : "";
$lang = JSFactory::getLang();
$query = "SELECT payment_id, `" . $lang->get("name") . "` as name, `" . $lang->get("description") . "` as description , payment_code, payment_class, scriptname, payment_publish, payment_ordering, payment_params, payment_type, price, price_type, tax_id, image FROM `#__jshopping_payment_method` {$query_where} ORDER BY payment_ordering";
extract(js_add_trigger(get_defined_vars(), "query"));
$db->setQuery($query);
$rows = $db->loadObjectList();
if ($shipping_id && $jshopConfig->step_4_3) {
$sh = JSFactory::getTable('shippingMethod', 'jshop');
$sh->load($shipping_id);
$payments = $sh->getPayments();
if (count($payments) > 0) {
foreach ($rows as $k => $v) {
if (!in_array($v->payment_id, $payments)) {
unset($rows[$k]);
}
}
$rows = array_values($rows);
}
}
return $rows;
}
示例7: getAllCountries
/**
* get list country
*
* @param int $publish (0-all, 1-publish, 2-unpublish)
* @param int $limitstart
* @param int $limit
* @param int $orderConfig use order config
* @return array
*/
function getAllCountries($publish = 1, $limitstart = null, $limit = null, $orderConfig = 1, $order = null, $orderDir = null)
{
$db = JFactory::getDBO();
$jshopConfig = JSFactory::getConfig();
if ($publish == 0) {
$where = " ";
} else {
if ($publish == 1) {
$where = " WHERE country_publish = '1' ";
} else {
if ($publish == 2) {
$where = " WHERE country_publish = '0' ";
}
}
}
$ordering = "ordering";
if ($orderConfig && $jshopConfig->sorting_country_in_alphabet) {
$ordering = "name";
}
if ($order && $orderDir) {
$ordering = $order . " " . $orderDir;
}
$lang = JSFactory::getLang();
$query = "SELECT country_id, country_publish, ordering, country_code, country_code_2, `" . $lang->get("name") . "` as name FROM `#__jshopping_countries` " . $where . " ORDER BY " . $ordering;
$db->setQuery($query, $limitstart, $limit);
return $db->loadObjectList();
}
示例8: getCountries
function getCountries()
{
$lang = JSFactory::getLang();
$query = "SELECT sh_country.country_id, countries.`" . $lang->get('name') . "` as name\n FROM `#__jshopping_shipping_method_price_countries` AS sh_country\n INNER JOIN `#__jshopping_countries` AS countries ON countries.country_id = sh_country.country_id\n WHERE sh_country.sh_pr_method_id = '" . $this->_db->escape($this->sh_pr_method_id) . "'";
$this->_db->setQuery($query);
return $this->_db->loadObjectList();
}
示例9: fetchElement
function fetchElement()
{
$db = JFactory::getDBO();
require_once JPATH_SITE . "/components/com_jshopping/lib/factory.php";
$lang = JSFactory::getLang();
$query = "SELECT m.category_id AS id, `" . $lang->get('name') . "` AS title, `" . $lang->get('name') . "` AS name, m.category_parent_id AS parent_id, m.category_parent_id as parent\r\n FROM #__jshopping_categories AS m\r\n LEFT JOIN #__jshopping_products_to_categories AS f\r\n ON m.category_id = f.category_id\r\n WHERE m.category_publish = 1\r\n ORDER BY ordering";
$db->setQuery($query);
$menuItems = $db->loadObjectList();
$children = array();
if ($menuItems) {
foreach ($menuItems as $v) {
$pt = $v->parent_id;
$list = isset($children[$pt]) ? $children[$pt] : array();
array_push($list, $v);
$children[$pt] = $list;
}
}
jimport('joomla.html.html.menu');
$options = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0);
$this->_xml->addChild('option', 'Root')->addAttribute('value', 0);
$optgroup = $this->_xml->addChild('optgroup', '');
$optgroup->addAttribute('label', 'Categories');
if (count($options)) {
foreach ($options as $option) {
$optgroup->addChild('option', htmlspecialchars($option->treename))->addAttribute('value', $option->id);
}
}
$this->_value = $this->_form->get($this->_name, $this->_default);
$html = parent::fetchElement();
return $html;
}
示例10: getBuildQueryListProduct
function getBuildQueryListProduct($type, $restype, &$filters, &$adv_query, &$adv_from, &$adv_result)
{
$jshopConfig = JSFactory::getConfig();
$lang = JSFactory::getLang();
$user = JFactory::getUser();
$db = JFactory::getDBO();
$originaladvres = $adv_result;
$groups = implode(',', $user->getAuthorisedViewLevels());
if ($type == "category") {
$adv_query .= ' AND prod.access IN (' . $groups . ')';
} else {
$adv_query .= ' AND prod.access IN (' . $groups . ') AND cat.access IN (' . $groups . ')';
}
if ($jshopConfig->show_delivery_time) {
$adv_result .= ", prod.delivery_times_id";
}
if ($jshopConfig->admin_show_product_extra_field) {
$adv_result .= getQueryListProductsExtraFields();
}
if ($jshopConfig->product_list_show_vendor) {
$adv_result .= ", prod.vendor_id";
}
if ($jshopConfig->hide_product_not_avaible_stock) {
$adv_query .= " AND prod.product_quantity > 0";
}
if (isset($filters['categorys']) && $type != "category" && is_array($filters['categorys']) && count($filters['categorys'])) {
$adv_query .= " AND cat.category_id in (" . implode(",", $filters['categorys']) . ")";
}
if (isset($filters['manufacturers']) && $type != "manufacturer" && is_array($filters['manufacturers']) && count($filters['manufacturers'])) {
$adv_query .= " AND prod.product_manufacturer_id in (" . implode(",", $filters['manufacturers']) . ")";
}
if (isset($filters['labels']) && is_array($filters['labels']) && count($filters['labels'])) {
$adv_query .= " AND prod.label_id in (" . implode(",", $filters['labels']) . ")";
}
if (isset($filters['vendors']) && $type != "vendor" && is_array($filters['vendors']) && count($filters['vendors'])) {
$adv_query .= " AND prod.vendor_id in (" . implode(",", $filters['vendors']) . ")";
}
if (isset($filters['extra_fields']) && is_array($filters['extra_fields'])) {
foreach ($filters['extra_fields'] as $f_id => $vals) {
if (is_array($vals) && count($vals)) {
$tmp = array();
foreach ($vals as $val_id) {
$tmp[] = " find_in_set('" . $val_id . "', prod.`extra_field_" . $f_id . "`) ";
}
$_tmp_adv_query = implode(' OR ', $tmp);
$adv_query .= " AND (" . $_tmp_adv_query . ")";
} elseif (is_string($vals) && $vals != "") {
$adv_query .= " AND prod.`extra_field_" . $f_id . "`='" . $db->escape($vals) . "'";
}
}
}
$this->getBuildQueryListProductFilterPrice($filters, $adv_query, $adv_from);
if ($jshopConfig->product_list_show_qty_stock) {
$adv_result .= ", prod.unlimited";
}
if ($restype == "count") {
$adv_result = $originaladvres;
}
}
示例11: displayEdit
function displayEdit($tpl = null)
{
JToolBarHelper::title($temp = $this->edit ? _JSHOP_UNITS_MEASURE_EDIT . ' / ' . $this->units->{JSFactory::getLang()->get('name')} : _JSHOP_UNITS_MEASURE_NEW, 'generic.png');
JToolBarHelper::save();
JToolBarHelper::apply();
JToolBarHelper::cancel();
parent::display($tpl);
}
示例12: loadData
function loadData($alias)
{
$lang = JSFactory::getLang();
$db = JFactory::getDBO();
$query = "SELECT id, alias, `" . $lang->get('text') . "` as text FROM `#__jshopping_config_statictext` where alias='" . $db->escape($alias) . "'";
$db->setQuery($query);
return $db->loadObject();
}
示例13: getNameForId
public function getNameForId($id)
{
$db = JFactory::getDBO();
$lang = JSFactory::getLang();
$query = "SELECT `" . $lang->get("name") . "` as name FROM `" . $this->_tbl . "` WHERE `" . $this->_tbl_key . "` = '" . $db->escape($id) . "'";
$db->setQuery($query);
return $db->loadResult();
}
示例14: getList
function getList()
{
$db = JFactory::getDBO();
$lang = JSFactory::getLang();
$query = "SELECT id, `" . $lang->get("name") . "` as name, ordering FROM `#__jshopping_attr_groups` order by ordering";
$db->setQuery($query);
return $db->loadObjectList();
}
示例15: getList
function getList()
{
$lang = JSFactory::getLang();
$db = JFactory::getDBO();
$query = "SELECT id, alias FROM `#__jshopping_config_statictext` ORDER BY id";
$db->setQuery($query);
return $db->loadObjectList();
}