本文整理汇总了PHP中MUtil_Model_ModelAbstract::isMultiOrganization方法的典型用法代码示例。如果您正苦于以下问题:PHP MUtil_Model_ModelAbstract::isMultiOrganization方法的具体用法?PHP MUtil_Model_ModelAbstract::isMultiOrganization怎么用?PHP MUtil_Model_ModelAbstract::isMultiOrganization使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MUtil_Model_ModelAbstract
的用法示例。
在下文中一共展示了MUtil_Model_ModelAbstract::isMultiOrganization方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAutoSearchElements
/**
* Returns a text element for autosearch. Can be overruled.
*
* The form / html elements to search on. Elements can be grouped by inserting null's between them.
* That creates a distinct group of elements
*
* @param array $data The $form field values (can be usefull, but no need to set them)
* @return array Of \Zend_Form_Element's or static tekst to add to the html or null for group breaks.
*/
protected function getAutoSearchElements(array $data)
{
$elements = parent::getAutoSearchElements($data);
$user = $this->loader->getCurrentUser();
if ($user->hasPrivilege('pr.respondent.select-on-track')) {
$tracks = $this->searchData['__active_tracks'];
$masks['show_all'] = $this->_('(all)');
$masks['show_without_track'] = $this->_('(no track)');
if (count($tracks) > 1) {
$masks['show_with_track'] = $this->_('(with track)');
}
if (count($tracks) > 1) {
$elements[] = $this->_createSelectElement('gr2t_id_track', $masks + $tracks);
} else {
$element = $this->_createRadioElement('gr2t_id_track', $masks + $tracks);
$element->setSeparator(' ');
$elements[] = $element;
}
$lineBreak = true;
} else {
$lineBreak = false;
}
if ($user->hasPrivilege('pr.respondent.show-deleted')) {
$elements[] = $this->_createCheckboxElement('grc_success', $this->_('Show active'));
}
if ($this->model->isMultiOrganization()) {
$element = $this->_createSelectElement(\MUtil_Model::REQUEST_ID2, $user->getRespondentOrganizations(), $this->_('(all organizations)'));
if ($lineBreak) {
$element->setLabel($this->_('Organization'))->setAttrib('onchange', 'this.form.submit();');
$elements[] = \MUtil_Html::create('br');
}
$elements[] = $element;
}
return $elements;
}
示例2: getAutoSearchElements
/**
* Returns a text element for autosearch. Can be overruled.
*
* The form / html elements to search on. Elements can be grouped by inserting null's between them.
* That creates a distinct group of elements
*
* @param array $data The $form field values (can be usefull, but no need to set them)
* @return array Of \Zend_Form_Element's or static tekst to add to the html or null for group breaks.
*/
protected function getAutoSearchElements(array $data)
{
$elements = parent::getAutoSearchElements($data);
$user = $this->loader->getCurrentUser();
if ($user->hasPrivilege('pr.respondent.select-on-track')) {
$elements[] = $this->_createCheckboxElement('show_with_track', $this->_('Has track'));
$elements[] = $this->_createCheckboxElement('show_without_track', $this->_('No track'));
$lineBreak = true;
} else {
$lineBreak = false;
}
if ($user->hasPrivilege('pr.respondent.show-deleted')) {
$elements[] = $this->_createCheckboxElement('grc_success', $this->_('Show active'));
}
if ($this->model->isMultiOrganization()) {
$element = $this->_createSelectElement(\MUtil_Model::REQUEST_ID2, $user->getRespondentOrganizations(), $this->_('(all organizations)'));
if ($lineBreak) {
$element->setLabel($this->_('Organization'));
$elements[] = \MUtil_Html::create('br');
}
$elements[] = $element;
}
return $elements;
}