mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Add method User_Query::only_template
This commit is contained in:
@@ -88,6 +88,11 @@ class User_Query implements User_QueryInterface
|
||||
* @var boolean
|
||||
*/
|
||||
protected $include_templates = false;
|
||||
/**
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $only_templates = false;
|
||||
/**
|
||||
*
|
||||
* @var Array
|
||||
@@ -191,18 +196,22 @@ class User_Query implements User_QueryInterface
|
||||
|
||||
$sql .= ' AND usr_login NOT LIKE "(#deleted_%" ';
|
||||
|
||||
if ($this->include_invite)
|
||||
if (!$this->include_invite)
|
||||
{
|
||||
$sql .= ' AND usr.invite=0 ';
|
||||
}
|
||||
|
||||
if ($this->include_templates === false)
|
||||
if ($this->only_templates === true)
|
||||
{
|
||||
$sql .= ' AND model_of = ' . $session->get_usr_id();
|
||||
}
|
||||
elseif ($this->include_templates === false)
|
||||
{
|
||||
$sql .= ' AND model_of=0';
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql .= ' AND (model_of=0 OR model_of= ' . $session->get_usr_id() . ' ) ';
|
||||
$sql .= ' AND (model_of=0 OR model_of = ' . $session->get_usr_id() . ' ) ';
|
||||
}
|
||||
|
||||
$baslist = array();
|
||||
@@ -355,6 +364,17 @@ class User_Query implements User_QueryInterface
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param boolean $boolean
|
||||
* @return User_Query
|
||||
*/
|
||||
public function only_templates($boolean)
|
||||
{
|
||||
$this->only_templates = !!$boolean;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
|
Reference in New Issue
Block a user