本文整理汇总了PHP中Groups::getNames方法的典型用法代码示例。如果您正苦于以下问题:PHP Groups::getNames方法的具体用法?PHP Groups::getNames怎么用?PHP Groups::getNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Groups
的用法示例。
在下文中一共展示了Groups::getNames方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAssignmentOptions
/**
* Returns assignment selection options
* @param type $anyone
* @param type $showGroups
* @param type $showSeparator
* @return type
*/
public static function getAssignmentOptions($anyone = true, $showGroups = true, $showSeparator = true)
{
$users = User::getNames();
if ($anyone !== true) {
unset($users['Anyone']);
}
if ($showGroups === true) {
$groups = Groups::getNames();
if (count($groups) > 0) {
if ($showSeparator) {
$users = $users + array('' => '--------------------') + $groups;
} else {
$users = $users + $groups;
}
}
}
return $users;
}
示例2: array
// $cs->registerScript(__CLASS__, $this->defaultOptions?'jQuery.{$this->mode}picker.setDefaults('.CJavaScript::encode($this->defaultOptions).');':'');
// $cs->registerScript(__CLASS__.'#'.$id, $js);
$fieldTypes = array();
$fieldLinkTypes = array();
$fieldOptions = array();
foreach ($itemModel->getFields() as $field) {
$fieldTypes[$field->fieldName] = $field->type;
if (!empty($field->linkType)) {
$fieldLinkTypes[$field->fieldName] = $field->linkType;
}
switch ($field->type) {
case 'dropdown':
$fieldOptions[$field->fieldName] = Dropdowns::getItems($field->linkType);
break;
case 'assignment':
$fieldOptions[$field->fieldName] = User::getNames() + Groups::getNames();
break;
case 'link':
$fieldOptions[$field->fieldName] = Yii::app()->request->scriptUrl . X2Model::model($field->linkType)->autoCompleteSource;
break;
}
}
$attributeLabels = $model->itemAttributeLabels;
//hack tags in
$fieldTypes['tags'] = 'tags';
$fieldOptions['tags'] = Tags::getAllTags();
$attributeLabels['tags'] = Yii::t('contacts', 'Tags');
natcasesort($attributeLabels);
$comparisonList = array('=' => Yii::t('contacts', 'equals'), '>' => Yii::t('contacts', 'greater than'), '<' => Yii::t('contacts', 'less than'), '<>' => Yii::t('contacts', 'not equal to'), 'list' => Yii::t('contacts', 'in list'), 'notList' => Yii::t('contacts', 'not in list'), 'empty' => Yii::t('contacts', 'empty'), 'notEmpty' => Yii::t('contacts', 'not empty'), 'contains' => Yii::t('contacts', 'contains'), 'noContains' => Yii::t('contacts', 'does not contain'));
$criteriaAttr = array();
foreach ($criteriaModels as $criterion) {
示例3: array
</label>
<?php
echo $form->dropDownList($admin, 'srrId', User::getUserIds());
?>
</div>
<div id="group-list" style="<?php
echo !empty($admin->serviceDistribution) && $admin->serviceDistribution == "singleGroup" ? "" : "display:none;";
?>
">
<label><?php
echo Yii::t('admin', 'Selected Group');
?>
</label>
<?php
echo $form->dropDownList($admin, 'sgrrId', Groups::getNames());
?>
</div>
<?php
echo $form->labelEx($admin, 'serviceOnlineOnly');
echo $form->dropDownList($admin, 'serviceOnlineOnly', array('0' => Yii::t('app', 'No'), '1' => Yii::t('app', 'Yes')));
?>
<?php
echo CHtml::submitButton(Yii::t('app', 'Save'), array('class' => 'x2-button')) . "\n";
$this->endWidget();
?>
</div>
<div class="form">
<b><?php
示例4: actionGetGroups
public function actionGetGroups()
{
$checked = false;
if (isset($_POST['checked'])) {
// coming from a group checkbox?
$checked = json_decode($_POST['checked']);
} elseif (isset($_POST['group'])) {
$checked = true;
}
$id = null;
if (isset($_POST['field'])) {
$id = $_POST['field'];
}
$options = array();
if ($checked) {
// group checkbox checked, return list of groups
echo CHtml::listOptions($id, Groups::getNames(), $options);
} else {
// group checkbox unchecked, return list of user names
$users = User::getNames();
if (!in_array($id, array_keys($users))) {
$id = Yii::app()->user->getName();
}
echo CHtml::listOptions($id, $users, $options);
}
}
示例5: array
?>
<a onclick="x2.forms.submitForm('chart');" href="#" class="x2-button"><span><?php
echo Yii::t('app', 'Go');
?>
</span></a>
</div>
</div>
</div>
<div class="x2-chart-container-controls">
<div class="x2-chart-control">
<div class="row">
<?php
echo $form->label($model, 'assignedTo', array('label' => Yii::t('charts', 'Select deals assigned to') . ' '));
?>
<?php
echo $form->dropDownList($model, 'assignedTo', array_merge(array('0' => 'All'), Groups::getNames(), User::getNames()));
?>
<a onclick="x2.forms.submitForm('chart');" href="#" class="x2-button"><span><?php
echo Yii::t('app', 'Go');
?>
</span></a>
</div>
</div>
</div>
<p class="x2-chart-separator"/>
<div class="x2-chart-container-center-large">
<?php
$this->widget('X2BubbleChart', array('model' => $sqlView, 'options' => array('other-threshold' => 2, 'statistic' => 'none', 'orderby' => 'dealValue asc', 'slice' => array('part' => $slice), 'x-axis' => array('column' => "round((closeDate-unix_timestamp())/(24*3600))"), 'y-axis' => array('column' => 'round(dealValue)'), 'r-axis' => array('column' => 'confidence', 'label' => "concat('\$',format(dealValue,2))")), 'filters' => $filters, 'chartOptions' => array('title' => Yii::t('charts', 'Deals'), 'axes' => array('yaxis' => array('label' => Yii::t('charts', 'Value'), 'tickOptions' => array('formatString' => '$%d')), 'xaxis' => array('label' => Yii::t('charts', 'Days To Close'))))));
?>
</div>
<p class="x2-chart-separator"/>