本文整理汇总了PHP中Axis_Locale类的典型用法代码示例。如果您正苦于以下问题:PHP Axis_Locale类的具体用法?PHP Axis_Locale怎么用?PHP Axis_Locale使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Axis_Locale类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCategoriesByProductId
/**
* Retrieve the category list
* with category description for one product
*
* @param int $productId
* @param int $languageId
* @return array Where the keys are the cateogory id
*/
public function getCategoriesByProductId($productId, $languageId = null)
{
if (null === $languageId) {
$languageId = Axis_Locale::getLanguageId();
}
return $this->select('*')->joinLeft('catalog_category_description', 'ccd.category_id = cpc.category_id AND ccd.language_id = ' . $languageId, '*')->where('cpc.product_id = ?', $productId)->fetchAssoc();
}
示例2: _initSeoParams
private function _initSeoParams($keywords)
{
if (!sizeof($keywords)) {
return array();
}
$rowset = Axis::single('catalog/hurl')->select()->where('key_word IN (?)', $keywords)->where('site_id = ?', Axis::getSiteId())->fetchAssoc();
foreach ($rowset as $row) {
switch ($row['key_type']) {
case 'c':
$this->_params['cat']['value'] = $row['key_id'];
if (empty($this->_params['cat']['seo'])) {
$this->_params['cat']['seo'] = $row['key_word'];
} else {
$this->_params['cat']['seo'] .= '/' . $row['key_word'];
}
break;
case 'p':
$this->_params['product']['value'] = $row['key_id'];
$this->_params['product']['seo'] = $row['key_word'];
$this->getRequest()->setParam('product', $row['key_id']);
break;
case 'm':
$mDescription = Axis::single('catalog/product_manufacturer_description')->select(array('title', 'description'))->where('manufacturer_id = ?', $row['key_id'])->where('language_id = ?', Axis_Locale::getLanguageId())->fetchRow();
$this->_params['manufacturer'] = array('value' => $row['key_id'], 'seo' => $row['key_word'], 'title' => $mDescription->title, 'description' => $mDescription->description);
break;
default:
break;
}
}
}
示例3: addProductDescription
/**
* Adds product_name column to select
*
* @param integer $languageId [optional]
* @return Axis_Tag_Model_Customer_Select
*/
public function addProductDescription($languageId = null)
{
if (null === $languageId) {
$languageId = Axis_Locale::getLanguageId();
}
return $this->joinLeft('catalog_product_description', 'tp.product_id = cpd.product_id AND cpd.language_id = ' . $languageId, array('product_name' => 'name'));
}
示例4: getCustomValues
/**
*
* @param int $valueSetId
* @param int $languageId
* @return array
*/
public function getCustomValues($valueSetId, $languageId = null)
{
if (null === $languageId) {
$languageId = Axis_Locale::getLanguageId();
}
return $this->select('id')->join('account_customer_valueset_value_label', 'acvvl.valueset_value_id = acvv.id', 'label')->where('acvv.is_active = 1')->where('acvv.customer_valueset_id = ?', $valueSetId)->where('acvvl.language_id = ?', $languageId)->order('acvv.sort_order')->fetchPairs();
}
示例5: getCacheKey
public function getCacheKey()
{
if (null === $this->_cacheKey) {
$this->_cacheKey = md5('admin_navigation' . Axis::session()->roleId . Axis_Locale::getLocale()->toString());
}
return $this->_cacheKey;
}
示例6: _initCategory
protected function _initCategory($id)
{
$categoryRow = Axis::single('catalog/category')->find($id)->current();
if (!$categoryRow || $categoryRow->status != 'enabled') {
return false;
}
$parentItems = $categoryRow->cache()->getParentItems();
foreach ($parentItems as $_category) {
if ($_category['status'] != 'enabled') {
return false;
}
$_uri = $this->view->hurl(array('cat' => array('value' => $_category['id'], 'seo' => $_category['key_word'])));
$this->_helper->breadcrumbs(array('label' => $_category['name'], 'uri' => $_uri));
}
$categoryDescriptionRow = Axis::single('catalog/category_description')->find($id, Axis_Locale::getLanguageId())->current();
if (!$categoryDescriptionRow) {
return false;
} else {
$this->view->category = array_merge($categoryRow->toArray(), $categoryDescriptionRow->toArray());
$this->view->pageTitle = $categoryDescriptionRow->name;
$this->view->meta()->setDescription($categoryDescriptionRow->meta_description)->setTitle($categoryDescriptionRow->meta_title)->setKeywords($categoryDescriptionRow->meta_keyword);
}
Zend_Registry::set('catalog/current_category', $categoryRow);
return $this->view->category;
}
示例7: indexAction
public function indexAction()
{
$this->view->pageTitle = Axis::translate('account')->__('Manage Customers');
if ($this->_hasParam('customerId')) {
$this->view->customerId = $this->_getParam('customerId');
}
$this->view->userForm = array();
$this->view->valueSet = array();
$modelCustomerValueSetValue = Axis::model('account/Customer_ValueSet_Value');
$modelCustomerFields = Axis::model('account/customer_field');
$fieldGroups = Axis::single('account/Customer_FieldGroup')->getGroups(Axis_Locale::getLanguageId());
foreach ($fieldGroups as $fieldGroup) {
//getting all fields
$this->view->userForm[$fieldGroup['id']]['title'] = $fieldGroup['title'];
$this->view->userForm[$fieldGroup['id']]['is_active'] = $fieldGroup['is_active'];
$this->view->userForm[$fieldGroup['id']]['fields'] = $modelCustomerFields->getFieldsByGroup($fieldGroup['id']);
//getting only used valuesets
foreach ($this->view->userForm[$fieldGroup['id']]['fields'] as $fd) {
if (!isset($fd['customer_valueset_id'])) {
continue;
}
$this->view->valueSet[$fd['customer_valueset_id']]['values'] = $modelCustomerValueSetValue->getValues($fd['customer_valueset_id']);
}
}
$this->render();
}
示例8: __construct
/**
* Construct, create index
*
* @param string $indexPath[optional]
* @param string $encoding[optional]
* @throws Axis_Exception
*/
public function __construct(array $params)
{
$encoding = $this->_encoding;
$indexPath = array_shift($params);
if (count($params)) {
$encoding = array_shift($params);
}
if (null === $indexPath) {
$site = Axis::getSite()->id;
$locale = Axis::single('locale/language')->find(Axis_Locale::getLanguageId())->current()->locale;
$indexPath = Axis::config()->system->path . '/var/index/' . $site . '/' . $locale;
}
if (!is_readable($indexPath)) {
throw new Axis_Exception(Axis::translate('search')->__('Please, update search indexes, to enable search functionality'));
}
/*
$mySimilarity = new Axis_Similarity();
Zend_Search_Lucene_Search_Similarity::setDefault($mySimilarity);
*/
Zend_Search_Lucene_Search_QueryParser::setDefaultEncoding($encoding);
// add filter by words
$stopWords = array('a', 'an', 'at', 'the', 'and', 'or', 'is', 'am');
$stopWordsFilter = new Zend_Search_Lucene_Analysis_TokenFilter_StopWords($stopWords);
$analyzer = new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8Num_CaseInsensitive();
$analyzer->addFilter($stopWordsFilter);
Zend_Search_Lucene_Analysis_Analyzer::setDefault($analyzer);
$this->_index = Zend_Search_Lucene::open($indexPath);
$this->_encoding = $encoding;
}
示例9: _beforeRender
protected function _beforeRender()
{
$modelQuestion = Axis::single('poll/question');
if ($this->hasQuestionId()) {
$this->_questionId = $this->getQuestionId();
$this->setQuestionId(null);
} else {
$this->_questionId = $modelQuestion->getOneNotVotedQuestionIdByCookie();
}
if (!$this->_questionId) {
return false;
}
$question = $modelQuestion->getQuestionWithAnswers($this->_questionId, Axis_Locale::getLanguageId());
if (!$question) {
return false;
}
$results = array();
$totalVoteCount = 0;
$this->_showResult = (bool) $this->getShowResult();
$this->setShowResult(null);
if ($this->_showResult) {
$questionRow = Axis::single('poll/question')->find($this->_questionId)->current();
$results = $questionRow->getResults();
$totalVoteCount = $questionRow->getTotalVoteCount();
}
$this->setFromArray(array('question' => $question, 'answers' => $question['answers'], 'results' => $results, 'status' => $this->_showResult, 'total_count' => $totalVoteCount));
return true;
}
示例10: indexAction
public function indexAction()
{
$this->setCanonicalUrl($this->view->url(array(), 'cms', true));
$this->setTitle(Axis::translate('cms')->__('Pages'), null, false);
$categories = Axis::single('cms/category')->select(array('id', 'parent_id'))->addCategoryContentTable()->columns(array('ccc.link', 'ccc.title'))->addActiveFilter()->addSiteFilter(Axis::getSiteId())->addLanguageIdFilter(Axis_Locale::getLanguageId())->order('cc.parent_id')->where('ccc.link IS NOT NULL')->fetchAssoc();
$pages = Axis::single('cms/page')->select(array('id', 'name'))->join(array('cpca' => 'cms_page_category'), 'cp.id = cpca.cms_page_id', 'cms_category_id')->join('cms_page_content', 'cp.id = cpc.cms_page_id', array('link', 'title'))->where('cp.is_active = 1')->where('cpc.language_id = ?', Axis_Locale::getLanguageId())->where('cpca.cms_category_id IN (?)', array_keys($categories))->order('cpca.cms_category_id')->fetchAssoc();
$menu = new Zend_Navigation();
foreach ($categories as $_category) {
$title = empty($_category['title']) ? $_category['link'] : $_category['title'];
$page = new Zend_Navigation_Page_Mvc(array('category_id' => $_category['id'], 'label' => $title, 'title' => $title, 'route' => 'cms_category', 'params' => array('cat' => $_category['link']), 'class' => 'icon-folder'));
$_container = $menu->findBy('category_id', $_category['parent_id']);
if (null === $_container) {
$_container = $menu;
}
$_container->addPage($page);
}
foreach ($pages as $_page) {
$title = empty($_page['title']) ? $_page['link'] : $_page['title'];
$page = new Zend_Navigation_Page_Mvc(array('label' => $title, 'title' => $title, 'route' => 'cms_page', 'params' => array('page' => $_page['link']), 'class' => 'icon-page'));
$_container = $menu->findBy('category_id', $_page['cms_category_id']);
$_container->addPage($page);
}
$this->view->menu = $menu;
$this->render();
}
示例11: init
public function init()
{
$categories = Axis::single('catalog/category')->select('*')->addName(Axis_Locale::getLanguageId())->addKeyWord()->order('cc.lft')->addSiteFilter(Axis::getSiteId())->addDisabledFilter()->fetchAll();
if (!is_array($this->_activeCategories)) {
$this->_activeCategories = array();
if (Zend_Registry::isRegistered('catalog/current_category')) {
$this->_activeCategories = array_keys(Zend_Registry::get('catalog/current_category')->cache()->getParentItems());
}
}
$container = $_container = new Zend_Navigation();
$lvl = 0;
$view = $this->getView();
foreach ($categories as $_category) {
$uri = $view->hurl(array('cat' => array('value' => $_category['id'], 'seo' => $_category['key_word']), 'controller' => 'catalog', 'action' => 'view'), false, true);
$class = 'nav-' . str_replace('.', '-', $_category['key_word']);
$page = new Zend_Navigation_Page_Uri(array('label' => $_category['name'], 'title' => $_category['name'], 'uri' => $uri, 'order' => $_category['lft'], 'class' => $class, 'visible' => 'enabled' === $_category['status'] ? true : false, 'active' => in_array($_category['id'], $this->_activeCategories)));
$lvl = $lvl - $_category['lvl'] + 1;
for ($i = 0; $i < $lvl; $i++) {
$_container = $_container->getParent();
}
$lvl = $_category['lvl'];
$_container->addPage($page);
$_container = $page;
}
$this->setData('menu', $container);
return true;
}
示例12: indexAction
public function indexAction()
{
$this->setTitle(Axis::translate('poll')->__('Polls'));
$languageId = Axis_Locale::getLanguageId();
$questionIds = array();
if ($this->_hasParam('questionId')) {
$questionIds[] = array('id' => $this->_getParam('questionId'));
}
$modelVote = Axis::single('poll/vote');
$modelAnswer = Axis::single('poll/answer');
$questions = Axis::single('poll/question')->getQuestions($languageId, $questionIds);
$answers = array();
foreach ($modelAnswer->getAnswers($languageId) as $answer) {
$answers[$answer['question_id']][] = $answer;
}
$votes = $modelVote->getVoteCount();
$customerVotes = $modelVote->getVoteCount(Axis::getCustomerId());
$results = $modelVote->getResults();
$cookieVotedQuestionIds = $modelVote->getQuestionIdsFromCookie();
$showResult = (bool) $this->_getParam('showResult', false);
foreach ($questions as &$question) {
$question['answer'] = isset($answers[$question['id']]) ? $answers[$question['id']] : array();
$isVoted = $showResult || in_array($question['id'], $cookieVotedQuestionIds) || isset($customerVotes[$question['id']]) && 0 < $customerVotes[$question['id']];
$question['status'] = false;
if ($isVoted) {
$question['results'] = isset($results[$question['id']]) ? $results[$question['id']] : array();
$question['totalCount'] = $votes[$question['id']];
$question['status'] = true;
}
}
$this->view->questions = $questions;
$this->render('all');
}
示例13: addContent
/**
* Add all columns from cms_page_content table to select
*
* @param int $languageId [optional]
* @return Axis_Admin_Model_Cms_Page_Select
*/
public function addContent($languageId = null)
{
if (null === $languageId) {
$languageId = Axis_Locale::getLanguageId();
}
$this->joinLeft('cms_page_content', $this->getAdapter()->quoteInto('cp.id = cpc.cms_page_id AND cpc.language_id = ?', $languageId), '*');
return $this;
}
示例14: __construct
public function __construct($options = null)
{
$default = array('id' => 'form-contacts', 'action' => Zend_Controller_Front::getInstance()->getBaseUrl() . Axis_Locale::getLanguageUrl() . '/contacts');
if (is_array($options)) {
$default = array_merge($default, $options);
}
parent::__construct($default);
}
示例15: getPages
public function getPages($languageId = null)
{
if (null == $languageId) {
$languageId = Axis_Locale::getLanguageId();
}
/*get pages*/
return Axis::single('cms/page_content')->select(array('link', 'title'))->joinInner(array('cpca' => 'cms_page_category'), 'cpc.cms_page_id = cpca.cms_page_id')->joinInner('cms_page', 'cp.id = cpc.cms_page_id')->where('cpca.cms_category_id = ?', $this->id)->where('cpc.language_id = ?', $languageId)->where('cp.is_active = 1')->where('cpc.link IS NOT NULL')->fetchAll();
}