mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
add multilingual API
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8991 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
5d79f510ce
commit
b54f869704
4 changed files with 67 additions and 6 deletions
|
|
@ -28,6 +28,7 @@
|
||||||
<action name="getModuleAdminModuleList" type="model" standalone="true" />
|
<action name="getModuleAdminModuleList" type="model" standalone="true" />
|
||||||
<action name="getModuleAdminLangCode" type="model" standalone="true" />
|
<action name="getModuleAdminLangCode" type="model" standalone="true" />
|
||||||
<action name="getModuleAdminLangListByName" type="model" standalone="true" />
|
<action name="getModuleAdminLangListByName" type="model" standalone="true" />
|
||||||
|
<action name="getModuleAdminLangListByValue" type="model" standalone="true" />
|
||||||
<action name="getLangListByLangcodeForAutoComplete" type="model" standalone="true" />
|
<action name="getLangListByLangcodeForAutoComplete" type="model" standalone="true" />
|
||||||
|
|
||||||
<action name="procModuleAdminInsertCategory" type="controller" standalone="true" ruleset="insertCategory" />
|
<action name="procModuleAdminInsertCategory" type="controller" standalone="true" ruleset="insertCategory" />
|
||||||
|
|
|
||||||
|
|
@ -188,10 +188,12 @@
|
||||||
{
|
{
|
||||||
$args = Context::getRequestVars();
|
$args = Context::getRequestVars();
|
||||||
if(!$args->site_srl) $args->site_srl = 0;
|
if(!$args->site_srl) $args->site_srl = 0;
|
||||||
$args->langName = $args->lang_name;
|
|
||||||
$columnList = array('lang_code', 'value');
|
$columnList = array('lang_code', 'value');
|
||||||
|
|
||||||
$langList = array();
|
$langList = array();
|
||||||
|
|
||||||
|
$args->langName = preg_replace('/\$user_lang->/', '', $args->lang_name);
|
||||||
$output = executeQueryArray('module.getLangListByName', $args, $columnList);
|
$output = executeQueryArray('module.getLangListByName', $args, $columnList);
|
||||||
if($output->toBool()) $langList = $output->data;
|
if($output->toBool()) $langList = $output->data;
|
||||||
|
|
||||||
|
|
@ -199,6 +201,34 @@
|
||||||
$this->add('lang_name', $args->langName);
|
$this->add('lang_name', $args->langName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return lang list
|
||||||
|
**/
|
||||||
|
function getModuleAdminLangListByValue()
|
||||||
|
{
|
||||||
|
$args = Context::getRequestVars();
|
||||||
|
if(!$args->site_srl) $args->site_srl = 0;
|
||||||
|
|
||||||
|
|
||||||
|
$langList = array();
|
||||||
|
|
||||||
|
$args->value = $args->lang_name;
|
||||||
|
|
||||||
|
// search value
|
||||||
|
$output = executeQueryArray('module.getLangNameByValue', $args);
|
||||||
|
if ($output->toBool()){
|
||||||
|
unset($args->value);
|
||||||
|
|
||||||
|
$args->langName = $output->data[0]->name;
|
||||||
|
$columnList = array('lang_code', 'value');
|
||||||
|
$output = executeQueryArray('module.getLangListByName', $args, $columnList);
|
||||||
|
|
||||||
|
if($output->toBool()) $langList = $output->data;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->add('lang_list', $langList);
|
||||||
|
$this->add('lang_name', $args->langName);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* @brief Return current lang list
|
* @brief Return current lang list
|
||||||
**/
|
**/
|
||||||
|
|
|
||||||
|
|
@ -1391,12 +1391,27 @@
|
||||||
function getLangListByLangcodeForAutoComplete() {
|
function getLangListByLangcodeForAutoComplete() {
|
||||||
$keyword = Context::get('search_keyword');
|
$keyword = Context::get('search_keyword');
|
||||||
|
|
||||||
$list = array(
|
$requestVars = Context::getRequestVars();
|
||||||
array('name'=>'key1', 'value'=>'value1'),
|
|
||||||
array('name'=>'key2', 'value'=>'value2'),
|
|
||||||
array('name'=>'key3', 'value'=>'value3')
|
|
||||||
);
|
|
||||||
|
|
||||||
|
$args->site_srl = (int)$requestVars->site_srl;
|
||||||
|
$args->page = 1; // /< Page
|
||||||
|
$args->list_count = 100; // /< the number of posts to display on a single page
|
||||||
|
$args->page_count = 5; // /< the number of pages that appear in the page navigation
|
||||||
|
$args->sort_index = 'name';
|
||||||
|
$args->order_type = 'asc';
|
||||||
|
$args->search_keyword = Context::get('search_keyword'); // /< keyword to search*/
|
||||||
|
|
||||||
|
$output = executeQueryArray('module.getLangListByLangcode', $args);
|
||||||
|
|
||||||
|
$list = array();
|
||||||
|
|
||||||
|
if($output->toBool()){
|
||||||
|
foreach($output->data as $code_info){
|
||||||
|
unset($codeInfo);
|
||||||
|
$codeInfo = array('name'=>'$user_lang->'.$code_info->name, 'value'=>$code_info->value);
|
||||||
|
$list[] = $codeInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
$this->add('results', $list);
|
$this->add('results', $list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
15
modules/module/queries/getLangNameByValue.xml
Normal file
15
modules/module/queries/getLangNameByValue.xml
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
<query id="getLangNameByValue" action="select">
|
||||||
|
<tables>
|
||||||
|
<table name="lang" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="*" />
|
||||||
|
</columns>
|
||||||
|
<conditions>
|
||||||
|
<condition operation="equal" column="site_srl" var="site_srl" notnull="notnull" filter="number" />
|
||||||
|
<condition operation="like_prefix" column="value" var="value" pipe="and" />
|
||||||
|
</conditions>
|
||||||
|
<groups>
|
||||||
|
<group column="name" />
|
||||||
|
</groups>
|
||||||
|
</query>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue