mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 10:11:38 +09:00
Add DocumentController::updateDocumentExtraVars()
- 특정 확장변수의 값을 쉽게 업데이트할 수 있는 메소드 제공 - 확장변수 추가 또는 변경 메소드 호출시 var_idx 또는 eid 중 하나만 전달해도 되도록 개선
This commit is contained in:
parent
786dace639
commit
7dd9330b1e
2 changed files with 141 additions and 9 deletions
|
|
@ -450,6 +450,48 @@ class documentModel extends document
|
|||
return $GLOBALS['XE_EXTRA_VARS'][$document_srl];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get var_idx of extra variable from its eid
|
||||
*
|
||||
* @param int $module_srl
|
||||
* @param string $eid
|
||||
* @return int|false
|
||||
*/
|
||||
public static function getExtraVarIdxByEid($module_srl, $eid)
|
||||
{
|
||||
$keys = self::getExtraKeys($module_srl);
|
||||
$keys = array_filter($keys, function($item) use($eid) { return $item->eid == $eid; });
|
||||
if (count($keys))
|
||||
{
|
||||
return array_first($keys)->idx;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get eid of extra variable from its var_idx
|
||||
*
|
||||
* @param int $module_srl
|
||||
* @param int $idx
|
||||
* @return string|false
|
||||
*/
|
||||
public static function getExtraVarEidByIdx($module_srl, $var_idx)
|
||||
{
|
||||
$keys = self::getExtraKeys($module_srl);
|
||||
$keys = array_filter($keys, function($item) use($var_idx) { return $item->idx == $var_idx; });
|
||||
if (count($keys))
|
||||
{
|
||||
return array_first($keys)->eid;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show pop-up menu of the selected posts
|
||||
* Printing, scrap, recommendations and negative, reported the Add Features
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue