mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
issue 2517, added a method for clean favorite.
git-svn-id: http://xe-core.googlecode.com/svn/branches/luminous@11463 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
57c915eae9
commit
a2658393fe
3 changed files with 59 additions and 0 deletions
|
|
@ -216,6 +216,54 @@
|
|||
return $this->setRedirectUrl(Context::get('error_return_url'), $output);
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleanning favorite
|
||||
* @return Object
|
||||
*/
|
||||
function cleanFavorite()
|
||||
{
|
||||
$oModel = getAdminModel('admin');
|
||||
$output = $oModel->getFavoriteList();
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
$favoriteList = $output->get('favoriteList');
|
||||
if(!$favoriteList)
|
||||
{
|
||||
return new Object();
|
||||
}
|
||||
|
||||
$deleteTargets = array();
|
||||
foreach($favoriteList as $favorite)
|
||||
{
|
||||
if($favorite->type == 'module')
|
||||
{
|
||||
$modulePath = './modules/' . $favorite->module;
|
||||
$modulePath = FileHandler::getRealPath($modulePath);
|
||||
if(!is_dir($modulePath))
|
||||
{
|
||||
$deleteTargets[] = $favorite->admin_favorite_srl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!count($deleteTargets))
|
||||
{
|
||||
return new Object();
|
||||
}
|
||||
|
||||
$args->admin_favorite_srls = $deleteTargets;
|
||||
$output = executeQuery('admin.deleteFavorites', $args);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* Enviroment gathering agreement
|
||||
* @return void
|
||||
|
|
|
|||
8
modules/admin/queries/deleteFavorites.xml
Normal file
8
modules/admin/queries/deleteFavorites.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<query id="deleteFavorite" action="delete">
|
||||
<tables>
|
||||
<table name="admin_favorite" />
|
||||
</tables>
|
||||
<conditions>
|
||||
<condition operation="in" column="admin_favorite_srl" var="admin_favorite_srls" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
@ -70,6 +70,9 @@
|
|||
$this->updateCategory($xmlDoc);
|
||||
$this->updatePackages($xmlDoc);
|
||||
$this->checkInstalled();
|
||||
|
||||
$oAdminController = &getAdminController('admin');
|
||||
$output = $oAdminController->cleanFavorite();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue