* Finish task #86268.
This commit is contained in:
@@ -528,4 +528,38 @@ class group extends control
|
||||
$tree .= '</ul></li>';
|
||||
return print($tree);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort priv packages.
|
||||
*
|
||||
* @param int $parentID
|
||||
* @param int $grade
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function sortPrivPackages($parentID = 0, $grade = 0)
|
||||
{
|
||||
$orders = $_POST['orders'];
|
||||
if(empty($orders)) return false;
|
||||
if($grade == '1')
|
||||
{
|
||||
$orders = str_replace('View,', ',', $orders);
|
||||
$orders = trim($orders, ',');
|
||||
$this->loadModel('setting')->setItem("system.priv.views", $orders);
|
||||
}
|
||||
if($grade == '2')
|
||||
{
|
||||
$orders = trim($orders, ',');
|
||||
$parentID = rtrim($parentID, 'View');
|
||||
$this->loadModel('setting')->setItem("system.priv.{$parentID}Modules", $orders);
|
||||
}
|
||||
if($grade == '3')
|
||||
{
|
||||
$orders = explode(',', $orders);
|
||||
foreach($orders as $index => $id)
|
||||
{
|
||||
if(!empty($id)) $this->dao->update(TABLE_PRIVPACKAGE)->set('order')->eq(($index + 1) * 5)->where('id')->eq($id)->exec();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user