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'); $favoriteSrl = $output->get('favoriteSrl');
$output = $this->_deleteFavorite($favoriteSrl); $output = $this->_deleteFavorite($favoriteSrl);
$result = 'off';
} }
// if not exists, insert favorite // if not exists, insert favorite
else else
{ {
$output = $this->_insertFavorite($siteSrl, $moduleName); $output = $this->_insertFavorite($siteSrl, $moduleName);
$result = 'on';
} }
if (!$output->toBool()) return $output; if (!$output->toBool()) return $output;
$this->add('result', $result);
$this->setRedirectUrl(Context::get('error_return_url')); $this->setRedirectUrl(Context::get('error_return_url'));
} }

View file

@ -4,15 +4,16 @@
* @brief module 모듈의 관리자용 javascript * @brief module 모듈의 관리자용 javascript
**/ **/
/* 모듈 즐겨찾기 */ /* 모듈 즐겨찾기 */
function doToggleFavoriteModule(module_name) { function doToggleFavoriteModule(obj, module_name) {
var params = new Array(); function on_complete(data){
params['module_name'] = module_name; console.log(data);
params['site_srl'] = '0'; if (data.result == 'on')
exec_xml('admin','procAdminToggleFavorite',params, completeToggleFavoriteModule); 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) { jQuery.exec_json('admin.procAdminToggleFavorite', {'module_name': module_name, 'site_srl': 0}, on_complete);
location.reload();
} }
/* 카테고리 관련 작업들 */ /* 카테고리 관련 작업들 */

View file

@ -1,4 +1,10 @@
<!--%import("js/module_admin.js")--> <!--%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"> <div class="content" id="content">
<h1 class="h1">Installed Module</h1> <h1 class="h1">Installed Module</h1>
<div class="table even easyList"> <div class="table even easyList">
@ -8,7 +14,7 @@
</caption> </caption>
<thead> <thead>
<tr> <tr>
<th scope="col">즐겨찾기</th> <th scope="col">{$lang->favorite}</th>
<th scope="col" class="title">{$lang->module_name}</th> <th scope="col" class="title">{$lang->module_name}</th>
<th scope="col">{$lang->version}</th> <th scope="col">{$lang->version}</th>
<th scope="col">{$lang->author}</th> <th scope="col">{$lang->author}</th>
@ -21,9 +27,9 @@
<tr> <tr>
<td> <td>
<!--@if(in_array($val->module,$favoriteModuleList))--> <!--@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--> <!--@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--> <!--@end-->
</td> </td>
<td class="title"> <td class="title">