favorite feature enhancement

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9045 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2011-09-06 04:52:59 +00:00
parent 8ab1295893
commit cb0fafd5f3
3 changed files with 33 additions and 23 deletions

View file

@ -165,16 +165,19 @@
{
$favoriteSrl = $output->get('favoriteSrl');
$output = $this->_deleteFavorite($favoriteSrl);
$result = 'off';
}
// if not exists, insert favorite
else
{
$output = $this->_insertFavorite($siteSrl, $moduleName);
$result = 'on';
}
if (!$output->toBool()) return $output;
$this->add('result', $result);
$this->setRedirectUrl(Context::get('error_return_url'));
}

View file

@ -4,15 +4,16 @@
* @brief module 모듈의 관리자용 javascript
**/
/* 모듈 즐겨찾기 */
function doToggleFavoriteModule(module_name) {
var params = new Array();
params['module_name'] = module_name;
params['site_srl'] = '0';
exec_xml('admin','procAdminToggleFavorite',params, completeToggleFavoriteModule);
function doToggleFavoriteModule(obj, module_name) {
function on_complete(data){
console.log(data);
if (data.result == 'on')
jQuery(obj).removeClass('fvOff').addClass('fvOn').html(xe.lang.favorite_on);
else
jQuery(obj).removeClass('fvOn').addClass('fvOff').html(xe.lang.favorite_off);
}
function completeToggleFavoriteModule(ret_obj) {
location.reload();
jQuery.exec_json('admin.procAdminToggleFavorite', {'module_name': module_name, 'site_srl': 0}, on_complete);
}
/* 카테고리 관련 작업들 */

View file

@ -1,4 +1,10 @@
<!--%import("js/module_admin.js")-->
<script type="text/javascript">
xe.lang.favorite_on = '{$lang->favorite}({$lang->on})';
xe.lang.favorite_off = '{$lang->favorite}({$lang->off})';
</script>
<div class="content" id="content">
<h1 class="h1">Installed Module</h1>
<div class="table even easyList">
@ -8,7 +14,7 @@
</caption>
<thead>
<tr>
<th scope="col">즐겨찾기</th>
<th scope="col">{$lang->favorite}</th>
<th scope="col" class="title">{$lang->module_name}</th>
<th scope="col">{$lang->version}</th>
<th scope="col">{$lang->author}</th>
@ -21,9 +27,9 @@
<tr>
<td>
<!--@if(in_array($val->module,$favoriteModuleList))-->
<a href="#" class="fvOn" onClick="doToggleFavoriteModule('{$val->module}')">즐겨찾기(켜짐)</a>
<a href="#" class="fvOn" onclick="doToggleFavoriteModule(this, '{$val->module}'); return false;">{$lang->favorite}({$lang->on})</a>
<!--@else-->
<a href="#" class="fvOff" onClick="doToggleFavoriteModule('{$val->module}')">즐겨찾기(꺼짐)</a>
<a href="#" class="fvOff" onclick="doToggleFavoriteModule(this, '{$val->module}'); return false;">{$lang->favorite}({$lang->off})</a>
<!--@end-->
</td>
<td class="title">