当前位置: 首页>>代码示例>>PHP>>正文


PHP Credentials::getCredentialOptions方法代码示例

本文整理汇总了PHP中Credentials::getCredentialOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP Credentials::getCredentialOptions方法的具体用法?PHP Credentials::getCredentialOptions怎么用?PHP Credentials::getCredentialOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Credentials的用法示例。


在下文中一共展示了Credentials::getCredentialOptions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: paramRules

 public function paramRules()
 {
     if (Yii::app()->isInSession) {
         $credOptsDict = Credentials::getCredentialOptions(null, true);
         $credOpts = $credOptsDict['credentials'];
         $selectedOpt = $credOptsDict['selectedOption'];
         foreach ($credOpts as $key => $val) {
             if ($key == $selectedOpt) {
                 $credOpts = array($key => $val) + $credOpts;
                 // move to beginning of array
                 break;
             }
         }
     } else {
         $credOpts = array();
     }
     return array_merge(parent::paramRules(), array('title' => Yii::t('studio', $this->title), 'info' => Yii::t('studio', $this->info), 'options' => array(array('name' => 'from', 'label' => Yii::t('studio', 'Send As:'), 'type' => 'dropdown', 'options' => $credOpts))));
 }
开发者ID:dsyman2,项目名称:X2CRM,代码行数:18,代码来源:BaseX2FlowEmail.php

示例2: fieldOptions

 /**
  * Gets possible values for a field.
  *
  * Note, this is meant to be a stripped-down imitation of what is in
  * {@link X2Model} already. I know this is code duplication, but considering 
  *
  * Note, does not yet handle multiple choice (selecting more than one).
  * 
  * @param Fields $field
  */
 public function fieldOptions(Fields $field)
 {
     switch ($field->type) {
         case 'assignment':
             return X2Model::getAssignmentOptions(true, true, false);
         case 'credentials':
             $typeArr = explode(':', $field->linkType);
             $type = $typeArr[0];
             if (count($typeAlias) > 1) {
                 $uid = Credentials::$sysUseId[$typeAlias[1]];
             } else {
                 $uid = Yii::app()->getSuId();
             }
             if (count($typeArr > 0)) {
                 $uid = $typeArr[1];
             }
             $config = Credentials::getCredentialOptions($this->staticModel, $field->fieldName, $type, $uid);
             return $config['credentials'];
         case 'dropdown':
             // Dropdown options
             $dropdown = Dropdowns::model()->findByPk($field->linkType);
             if ($dropdown instanceof Dropdowns) {
                 return json_decode($dropdown->options, 1);
             }
             break;
         case 'optionalAssignment':
             $options = X2Model::getAssignmentOptions(true, true, false);
             unset($options['Anyone']);
             $options[''] = '';
             return $options;
         case 'rating':
             return range(Fields::RATING_MIN, Fields::RATING_MAX);
         case 'varchar':
             // Special kludge for actions priority dropdown mapping
             if ($field->modelName == 'Actions' && $field->fieldName == 'priority') {
                 return Actions::getPriorityLabels();
             }
             break;
         case 'visibility':
             $permissionsBehavior = Yii::app()->params->modelPermissions;
             return $permissionsBehavior::getVisibilityOptions();
     }
     return array();
 }
开发者ID:tymiles003,项目名称:X2CRM,代码行数:54,代码来源:Api2Controller.php


注:本文中的Credentials::getCredentialOptions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。