本文整理汇总了PHP中CFunctions::getOwners方法的典型用法代码示例。如果您正苦于以下问题:PHP CFunctions::getOwners方法的具体用法?PHP CFunctions::getOwners怎么用?PHP CFunctions::getOwners使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFunctions
的用法示例。
在下文中一共展示了CFunctions::getOwners方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadAllFor
/**
* Charge les listes d'un utilisateur
*
* @param int $user_id User ID
* @param int $function_id Function ID
*
* @return self[]
*/
static function loadAllFor($user_id, $function_id)
{
$user = CMediusers::get($user_id);
$function = new CFunctions();
$function->load($function_id);
// Accès aux listes de choix de la fonction et de l'établissement
$module = CModule::getActive("dPcompteRendu");
$is_admin = $module && $module->canAdmin();
$access_function = $is_admin || CAppUI::conf("compteRendu CListeChoix access_function");
$access_group = $is_admin || CAppUI::conf("compteRendu CListeChoix access_group");
$listes = array();
if ($user->_id && !$function_id) {
$listes["prat"] = array();
}
if ($access_function) {
$listes["func"] = array();
}
if ($access_group) {
$listes["etab"] = array();
}
if ($user->_id && !$function_id) {
foreach ($user->getOwners() as $type => $owner) {
if (isset($listes[$type])) {
$listes[$type] = $owner->loadBackRefs("listes_choix", "nom");
}
}
} else {
foreach ($function->getOwners() as $type => $owner) {
if (isset($listes[$type])) {
$listes[$type] = $owner->loadBackRefs("listes_choix", "nom");
}
}
}
return $listes;
}
示例2: CFunctions
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version SVN: $Id:\$
* @link http://www.mediboard.org
*/
CCanDo::checkRead();
$liste_id = CValue::getOrSession("liste_id");
$user_id = CValue::getOrSession("user_id");
$function_id = CValue::getOrSession("function_id");
if ($user_id) {
$user = CMediusers::get($user_id);
$owners = $user->getOwners();
} else {
$function = new CFunctions();
$function->load($function_id);
$owners = $function->getOwners();
$user_id = "";
}
$listes = CListeChoix::loadAllFor($user_id, $function_id);
// Modèles associés
foreach ($listes as $_listes) {
foreach ($_listes as $_liste) {
/** @var $_liste CListeChoix */
$_liste->loadRefModele();
}
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("liste_id", $liste_id);
$smarty->assign("owners", $owners);
$smarty->assign("listes", $listes);